commit a986295e19ef72cfdf6284dbbc0d0f16c7a6207d
Author: Hadi Khazaee Asl
Date: Fri Apr 17 17:04:44 2026 +0330
Initial Commit ...
diff --git a/.browserslistrc b/.browserslistrc
new file mode 100644
index 0000000..4f9ac26
--- /dev/null
+++ b/.browserslistrc
@@ -0,0 +1,16 @@
+# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
+# For additional information regarding the format and rule options, please see:
+# https://github.com/browserslist/browserslist#queries
+
+# For the full list of supported browsers by the Angular framework, please see:
+# https://angular.io/guide/browser-support
+
+# You can see what browsers were selected by your queries by running:
+# npx browserslist
+
+last 1 Chrome version
+last 1 Firefox version
+last 2 Edge major versions
+last 2 Safari major versions
+last 2 iOS major versions
+Firefox ESR
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..59d9a3a
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,16 @@
+# Editor configuration, see https://editorconfig.org
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 2
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.ts]
+quote_type = single
+
+[*.md]
+max_line_length = off
+trim_trailing_whitespace = false
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..189dd74
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,54 @@
+# See http://help.github.com/ignore-files/ for more about ignoring files.
+
+# Compiled output
+/dist
+/tmp
+/out-tsc
+/bazel-out
+
+# Node
+/node_modules
+npm-debug.log
+yarn-error.log
+
+# IDEs and editors
+.idea/
+.project
+.classpath
+.c9/
+*.launch
+.settings/
+*.sublime-workspace
+
+# Visual Studio Code
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+.history/*
+
+# Miscellaneous
+/.angular/cache
+.sass-cache/
+/connect.lock
+/coverage
+/libpeerconnection.log
+testem.log
+/typings
+
+# System files
+.DS_Store
+Thumbs.db
+
+#
+src/app/views/temp
+
+#
+# Electron ...
+platforms/electron/dist
+platforms/electron/www
+platforms/electron/node_modules
+
+#
+package-lock.json
diff --git a/.hintrc b/.hintrc
new file mode 100644
index 0000000..255ad34
--- /dev/null
+++ b/.hintrc
@@ -0,0 +1,18 @@
+{
+ "extends": [
+ "development"
+ ],
+ "hints": {
+ "meta-viewport": "off",
+ "apple-touch-icons": "off",
+ "compat-api/html": "off",
+ "no-inline-styles": "off",
+ "axe/name-role-value": [
+ "default",
+ {
+ "link-name": "off"
+ }
+ ],
+ "disown-opener": "off"
+ }
+}
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..8df515b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,12 @@
+# xClient
+
+this is an [**XFramework**](https://x-framework.ir) based App.
+a client of xSaherElm Project.
+
+## Maintainer
+
+Hadi Khazaee asl
+
+[https://www.saherelm.ir](https://www.saherelm.ir)
+
+[hadi_khazaee_asl@yahoo.com](mailto:hadi_khazaee_asl@yahoo.com)
diff --git a/angular.json b/angular.json
new file mode 100644
index 0000000..e25b06a
--- /dev/null
+++ b/angular.json
@@ -0,0 +1,181 @@
+{
+ "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
+ "version": 1,
+ "cli": {
+ "packageManager": "npm",
+ "analytics": false,
+ "defaultCollection": "@ionic/angular-toolkit"
+ },
+ "newProjectRoot": "projects",
+ "projects": {
+ "xClient": {
+ "projectType": "application",
+ "schematics": {
+ "@schematics/angular:component": {
+ "inlineTemplate": true,
+ "inlineStyle": true,
+ "style": "scss",
+ "skipTests": true
+ },
+ "@schematics/angular:class": {
+ "skipTests": true
+ },
+ "@schematics/angular:directive": {
+ "skipTests": true
+ },
+ "@schematics/angular:guard": {
+ "skipTests": true
+ },
+ "@schematics/angular:interceptor": {
+ "skipTests": true
+ },
+ "@schematics/angular:pipe": {
+ "skipTests": true
+ },
+ "@schematics/angular:resolver": {
+ "skipTests": true
+ },
+ "@schematics/angular:service": {
+ "skipTests": true
+ },
+ "@schematics/angular:application": {
+ "strict": true
+ }
+ },
+ "root": "",
+ "sourceRoot": "src",
+ "prefix": "app",
+ "architect": {
+ "build": {
+ "builder": "@angular-builders/custom-webpack:browser",
+ "options": {
+ "outputPath": "dist/xClient",
+ "index": "src/index.html",
+ "main": "src/main.ts",
+ "polyfills": "src/polyfills.ts",
+ "tsConfig": "tsconfig.app.json",
+ "inlineStyleLanguage": "scss",
+ "assets": [
+ {
+ "glob": "**/*",
+ "input": "src/assets",
+ "output": "assets"
+ },
+ {
+ "glob": "**/*.svg",
+ "input": "node_modules/x-framework-components/assets/icon/svg",
+ "output": "./svg"
+ },
+ {
+ "glob": "**/*.svg",
+ "input": "node_modules/ionicons/dist/ionicons/svg",
+ "output": "./svg"
+ },
+ "src/favicon.ico",
+ "src/manifest.webmanifest"
+ ],
+ "styles": [
+ "src/theme/theme.scss"
+ ],
+ "scripts": [],
+ "allowedCommonJsDependencies": [
+ "lodash"
+ ],
+ "customWebpackConfig": {
+ "path": "./polyfill-webpack.config.js",
+ "replaceDuplicatePlugins": true
+ }
+ },
+ "configurations": {
+ "production": {
+ "budgets": [
+ {
+ "type": "initial",
+ "maximumWarning": "500kb",
+ "maximumError": "15mb"
+ },
+ {
+ "type": "anyComponentStyle",
+ "maximumWarning": "2kb",
+ "maximumError": "1mb"
+ }
+ ],
+ "fileReplacements": [
+ {
+ "replace": "src/environments/environment.ts",
+ "with": "src/environments/environment.prod.ts"
+ }
+ ],
+ "outputHashing": "all"
+ },
+ "development": {
+ "buildOptimizer": false,
+ "optimization": false,
+ "vendorChunk": true,
+ "extractLicenses": false,
+ "sourceMap": true,
+ "namedChunks": true
+ }
+ },
+ "defaultConfiguration": "development"
+ },
+ "serve": {
+ "builder": "@angular-builders/custom-webpack:dev-server",
+ "options": {
+ "browserTarget": "app:build",
+ "sslKey": "./ssl/xClient.key",
+ "sslCert": "./ssl/xClient.crt"
+ },
+ "configurations": {
+ "production": {
+ "browserTarget": "xClient:build:production"
+ },
+ "development": {
+ "browserTarget": "xClient:build:development"
+ }
+ },
+ "defaultConfiguration": "development"
+ },
+ "extract-i18n": {
+ "builder": "@angular-devkit/build-angular:extract-i18n",
+ "options": {
+ "browserTarget": "xClient:build"
+ }
+ },
+ "ionic-cordova-build": {
+ "builder": "@ionic/angular-toolkit:cordova-build",
+ "options": {
+ "browserTarget": "app:build"
+ },
+ "configurations": {
+ "production": {
+ "browserTarget": "app:build:production"
+ }
+ }
+ },
+ "ionic-cordova-serve": {
+ "builder": "@ionic/angular-toolkit:cordova-serve",
+ "options": {
+ "cordovaBuildTarget": "app:ionic-cordova-build",
+ "devServerTarget": "app:serve"
+ },
+ "configurations": {
+ "production": {
+ "cordovaBuildTarget": "app:ionic-cordova-build:production",
+ "devServerTarget": "app:serve:production"
+ }
+ }
+ }
+ }
+ }
+ },
+ "defaultProject": "xClient",
+ "schematics": {
+ "@ionic/angular-toolkit:component": {
+ "styleext": "scss"
+ },
+ "@ionic/angular-toolkit:page": {
+ "styleext": "scss"
+ }
+ }
+}
diff --git a/config.xml b/config.xml
new file mode 100644
index 0000000..3038adb
--- /dev/null
+++ b/config.xml
@@ -0,0 +1,148 @@
+
+
+ xSaherElm
+ an xFramework based Application
+ Hadi Khazaee Asl
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ionic.config.json b/ionic.config.json
new file mode 100644
index 0000000..a7d1c41
--- /dev/null
+++ b/ionic.config.json
@@ -0,0 +1,7 @@
+{
+ "name": "xSaherElm",
+ "integrations": {
+ "cordova": {}
+ },
+ "type": "angular"
+}
diff --git a/ngsw-config.json b/ngsw-config.json
new file mode 100644
index 0000000..607ab33
--- /dev/null
+++ b/ngsw-config.json
@@ -0,0 +1,30 @@
+{
+ "$schema": "./node_modules/@angular/service-worker/config/schema.json",
+ "index": "/index.html",
+ "assetGroups": [
+ {
+ "name": "app",
+ "installMode": "prefetch",
+ "resources": {
+ "files": [
+ "/favicon.ico",
+ "/index.html",
+ "/manifest.webmanifest",
+ "/*.css",
+ "/*.js"
+ ]
+ }
+ },
+ {
+ "name": "assets",
+ "installMode": "lazy",
+ "updateMode": "prefetch",
+ "resources": {
+ "files": [
+ "/assets/**",
+ "/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
+ ]
+ }
+ }
+ ]
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..cd5b063
--- /dev/null
+++ b/package.json
@@ -0,0 +1,159 @@
+{
+ "name": "xClient",
+ "version": "0.0.0",
+ "scripts": {
+ "|aaa1|=========|aaa1|": "",
+ "|aaa2| Regular |aaa2|": "",
+ "|aaa3|=========|aaa3|": "",
+ "ng": "ng",
+ "start": "npm run serveXFrameworkProject",
+ "watch": "ng build --watch --configuration development",
+ "|aaa1|==========|aaa1|": "",
+ "|aaa2| /Regular |aaa2|": "",
+ "|aaa3|==========|aaa3|": "",
+ "|aaa1|=====|aaa1|": "",
+ "|aaa2| Run |aaa2|": "",
+ "|aaa3|=====|aaa3|": "",
+ "onlyServe": "ng serve -o",
+ "onlyServeSSL": "ng serve --ssl -o",
+ "runAndroid": "ionic cordova run android",
+ "emulateIos": "ionic cordova emulate ios",
+ "emulateAndroid": "ionic cordova emulate android",
+ "runElectron": "cd platforms/electron && npm run --force runElectron",
+ "startElectron": "cd platforms/electron && npm run --force startElectron",
+ "runProdElectron": "cd platforms/electron && npm run --force runProdElectron",
+ "serveXFrameworkProject": "npm run --force prepareDependenciesFromRegistry && ng serve -o",
+ "serveInLabXFrameworkProject": "npm run --force prepareDependenciesFromRegistry && ionic serve -l",
+ "serveSSLXFrameworkProject": "npm run --force prepareDependenciesFromRegistry && ng serve -o --ssl",
+ "runXElectron": "npm run prepareDependenciesFromRegistry && cd platforms/electron && npm run --force runElectron",
+ "serveSSLWithKeysXFrameworkProjectWithoutOpen": "npm run --force prepareDependenciesFromRegistry && ng serve --ssl",
+ "serveProdXFrameworkProject": "npm run --force prepareDependenciesFromRegistry && ng serve -o --configuration production",
+ "serveSSLProdXFrameworkProject": "npm run --force prepareDependenciesFromRegistry && ng serve -o --ssl --configuration production",
+ "|aaa0|======|aaa1|": "",
+ "|aaa2| /Run |aaa2|": "",
+ "|aaa3|======|aaa1|": "",
+ "|aaa4|=======|aaa1|": "",
+ "|aaa2| Build |aaa2|": "",
+ "|aaa3|=======|aaa1|": "",
+ "build": "ng build --aot --base-href ./",
+ "buildProd": "ng build --configuration production --aot --base-href ./",
+ "buildElectronWin32": "cd platforms/electron && npm run --force buildElectronWin32",
+ "buildElectronWin64": "cd platforms/electron && npm run --force buildElectronWin64",
+ "buildElectronMac64": "cd platforms/electron && npm run --force buildElectronMac64",
+ "buildElectronLinux64": "cd platforms/electron && npm run --force buildElectronLinux64",
+ "|aaa0|========|aaa1|": "",
+ "|aaa2| /Build |aaa2|": "",
+ "|aaa3|========|aaa1|": "",
+ "|aaa0|=========|aaa1|": "",
+ "|aaa2| Prepare |aaa2|": "",
+ "|aaa3|=========|aaa1|": "",
+ "resourcesIos": "ionic cordova resources ios",
+ "requirementsIos": "ionic cordova requirements ios",
+ "resourcesAndroid": "ionic cordova resources android",
+ "requirementsAndroid": "ionic cordova requirements android",
+ "prepareElectron": "cd platforms/electron && npm run prepareElectron",
+ "prepareDependencies": "npm i --force -D ../Documents/pack/x-framework-core-0.0.1.tgz ../Documents/pack/x-framework-services-0.0.1.tgz ../Documents/pack/x-framework-components-0.0.1.tgz ../Documents/pack/x-framework-identity-sdk-0.0.1.tgz ../Documents/pack/x-framework-push-service-0.0.1.tgz ../Documents/pack/x-saherelm-api-sdk-0.0.1.tgz",
+ "prepareDependenciesByLink": "npm link x-framework-core x-framework-services x-framework-components x-framework-identity-sdk x-framework-push-service x-saherelm-api-sdk",
+ "prepareXDependenciesFromRegistry": "npm i --force -D --registry https://npm.saherelmhub.ir x-framework-core x-framework-services x-framework-components x-framework-identity-sdk x-framework-push-service",
+ "prepareDependenciesFromRegistry": "npm i --force -D --registry https://npm.saherelmhub.ir x-framework-core x-framework-services x-framework-components x-framework-identity-sdk x-framework-push-service x-saherelm-api-sdk",
+ "addAPISDKRegisteryDependency": "npm i --force -D --registry https://npm.saherelmhub.ir x-saherelm-api-sdk",
+ "addAPISDKLocalDependency": "npm i --force -D ../Documents/pack/x-saherelm-api-sdk-0.0.1.tgz",
+ "|aaa0|==========|aaa1|": "",
+ "|aaa2| /Prepare |aaa2|": "",
+ "|aaa3|==========|aaa1|": ""
+ },
+ "private": true,
+ "dependencies": {
+ "@angular/animations": "~12.0.4",
+ "@angular/common": "~12.0.4",
+ "@angular/compiler": "~12.0.4",
+ "@angular/core": "~12.0.4",
+ "@angular/forms": "~12.0.4",
+ "@angular/platform-browser": "~12.0.4",
+ "@angular/platform-browser-dynamic": "~12.0.4",
+ "@angular/router": "~12.0.4",
+ "@angular/service-worker": "~12.0.4",
+ "rxjs": "~6.6.0",
+ "tslib": "^2.1.0",
+ "zone.js": "~0.11.4"
+ },
+ "devDependencies": {
+ "@angular-builders/custom-webpack": "^12.1.1",
+ "@angular-devkit/build-angular": "~12.0.5",
+ "@angular/cdk": "^12.1.2",
+ "@angular/cli": "~12.0.4",
+ "@angular/compiler-cli": "~12.0.4",
+ "@angular/flex-layout": "^12.0.0-beta.34",
+ "@angular/material": "^12.1.2",
+ "@angular/material-moment-adapter": "^12.1.2",
+ "@compodoc/compodoc": "^1.1.14",
+ "@ionic/angular": "^5.6.12",
+ "@ionic/angular-toolkit": "^4.0.0",
+ "@ionic/lab": "3.2.10",
+ "@microsoft/signalr": "^6.0.5",
+ "@microsoft/signalr-protocol-msgpack": "^7.0.2",
+ "@types/crypto-js": "^4.0.2",
+ "@types/dom-to-image": "^2.6.3",
+ "@types/howler": "^2.2.3",
+ "@types/jasmine": "~3.6.0",
+ "@types/node": "^12.11.1",
+ "@types/uuid": "^8.3.1",
+ "ace-builds": "^1.11.2",
+ "angular-gridster2": "^12.1.0",
+ "bignumber.js": "^9.0.2",
+ "cordova-android": "^9.1.0",
+ "cordova-ios": "^6.2.0",
+ "cordova-plugin-device": "^2.0.2",
+ "cordova-plugin-ionic-keyboard": "^2.2.0",
+ "cordova-plugin-ionic-webview": "^4.2.1",
+ "cordova-plugin-splashscreen": "^5.0.2",
+ "cordova-plugin-statusbar": "^2.4.2",
+ "cordova-plugin-whitelist": "^1.3.3",
+ "cordova-res": "^0.15.3",
+ "crypto-js": "^4.0.0",
+ "dom-to-image": "^2.6.0",
+ "echarts": "^5.4.2",
+ "electron": "^21.0.1",
+ "howler": "^2.2.3",
+ "ionicons": "^5.5.2",
+ "jalali-moment": "^3.3.10",
+ "jasmine-core": "~3.7.0",
+ "karma": "~6.3.0",
+ "karma-chrome-launcher": "~3.1.0",
+ "karma-coverage": "~2.0.3",
+ "karma-jasmine": "~4.0.0",
+ "karma-jasmine-html-reporter": "^1.5.0",
+ "libphonenumber-js": "^1.9.22",
+ "md5-typescript": "^1.0.5",
+ "moment": "^2.29.1",
+ "native-run": "^1.4.0",
+ "ng-packagr": "^12.0.0",
+ "ngx-device-detector": "^2.1.1",
+ "ngx-markdown": "^12.0.1",
+ "node-polyfill-webpack-plugin": "^1.1.4",
+ "ol": "^6.6.1",
+ "shx": "^0.3.3",
+ "typescript": "~4.2.3",
+ "uuid": "^8.3.2",
+ "x-framework-components": "0.0.1",
+ "x-framework-core": "0.0.1",
+ "x-framework-identity-sdk": "0.0.1",
+ "x-framework-push-service": "0.0.1",
+ "x-framework-services": "0.0.1",
+ "x-saherelm-api-sdk": "file:../Documents/pack/x-saherelm-api-sdk-0.0.1.tgz"
+ },
+ "cordova": {
+ "plugins": {
+ "cordova-plugin-whitelist": {},
+ "cordova-plugin-statusbar": {},
+ "cordova-plugin-device": {},
+ "cordova-plugin-splashscreen": {},
+ "cordova-plugin-ionic-webview": {},
+ "cordova-plugin-ionic-keyboard": {}
+ },
+ "platforms": [
+ "android",
+ "ios"
+ ]
+ }
+}
diff --git a/platforms/electron/README.md b/platforms/electron/README.md
new file mode 100644
index 0000000..af3cfb5
--- /dev/null
+++ b/platforms/electron/README.md
@@ -0,0 +1,11 @@
+# xMabsut Client Application
+
+an application which provides Mabsut features on Platforms.
+
+## Maintainer
+
+Hadi Khazaee Asl
+
+[https://www.saherelm.ir](https://www.saherelm.ir)
+
+[hadi_khazaee_asl@yahoo.com](mailto:hadi_khazaee_asl@yahoo.com)
diff --git a/platforms/electron/app.electron.js b/platforms/electron/app.electron.js
new file mode 100644
index 0000000..a786358
--- /dev/null
+++ b/platforms/electron/app.electron.js
@@ -0,0 +1,460 @@
+//
+//#region Required Modules ...
+const url = require("url");
+const path = require("path");
+const { Subject } = require("rxjs");
+const uuid = require("./modules/tools/x-uuid.tools");
+const XLogger = require("./modules/tools/x-logger.tools");
+const windowManager = require('./modules/tools/x-window.tools');
+const { XElectronChannel, XElectronMessage } = require('./modules/services/x-electron.service');
+const { app, shell, Tray, ipcMain, BrowserWindow, Menu } = require("electron");
+//#endregion
+
+//
+//#region Prepare Required Config Data ...
+//
+// Set Environment ...
+process.env.NODE_ENV = 'production';
+
+//
+const isDevelopment = process.env.NODE_ENV !== "production" ? true : false; // app.isPackaged;
+const isMac = process.platform === "darwin" ? true : false;
+
+//
+// Show Logs ...
+const showLogs = false;
+
+//
+// Show Debug Window ...
+const showDebug = false;
+
+//
+// Force Window to show fullscreen ...
+const isFullscreen = false;
+
+//
+// Show Window on Startup ...
+const showWindowOnStartup = true;
+
+//
+const iconPath = path.join(__dirname, "www/assets/icon/favicon.png");
+const trayIconPath = path.join(__dirname, "www/assets/icon/icon-16x16.png");
+//#endregion
+
+//
+//#region Handle Logging ...
+if (showLogs) {
+ XLogger.enableLogging();
+} else {
+ XLogger.disableLogging();
+}
+
+//
+console.log('XLogger State: ', XLogger.isLoggingEnable());
+//#endregion
+
+//
+//#region Global Objects ...
+//
+let tray;
+let mainUrl;
+let mainWindow;
+let mainWindowID;
+
+//
+const appId = uuid.generateUuid('XFrameworkElectronApp');
+//#endregion
+
+//
+//#region Subscribers ...
+//
+const otherChannelsSubject = new Subject();
+const defaultChannelSubject = new Subject();
+const handShakeChannelSubject = new Subject();
+
+//
+// Register Handshake Handler ...
+handShakeChannelSubject
+ .asObservable()
+ .subscribe(message => {
+ //
+ XLogger.logWarn(
+ XLogger.XLogMessage(
+ XLogger.XLogTag.Warn,
+ `Handshake Channel`,
+ [message]
+ )
+ );
+ });
+
+//
+// Register Default Handler ...
+defaultChannelSubject
+ .asObservable()
+ .subscribe(message => {
+ //
+ XLogger.logWarn(
+ XLogger.XLogMessage(
+ XLogger.XLogTag.Warn,
+ `Default Channel`,
+ [message]
+ )
+ );
+ });
+
+//
+// Register Other Handler ...
+otherChannelsSubject
+ .asObservable()
+ .subscribe(async message => {
+ //
+ XLogger.logWarn(
+ XLogger.XLogMessage(
+ XLogger.XLogTag.Warn,
+ `Other Channel`,
+ [message]
+ )
+ );
+
+ //
+ // File Service ...
+ if (message && message.channel === XElectronChannel.FileService) {
+ await handleFileServiceAction(message);
+ }
+
+ //
+ // Projects Service ...
+ if (message && message.channel === XElectronChannel.ProjectsService) {
+ await handleProjectsServiceAction(message);
+ }
+ });
+//#endregion
+
+//
+//#region Creator Fuctions ...
+/**
+ * Creat SysTray Object for using in app ...
+ */
+function createTray() {
+ //
+ // Create Tray Instance ...
+ tray = new Tray(trayIconPath);
+ XLogger.logDebug(XLogger.XLogMessage(XLogger.XLogTag.Debug, 'Tray Created ...'));
+
+ //
+ // Attach Event Listener to Tray Click ...
+ tray.on("click", () => {
+ //
+ XLogger.logDebug(XLogger.XLogMessage(XLogger.XLogTag.Debug, 'Tray Clicked ...'));
+
+ //
+ toggleMainWindow();
+ });
+
+ //
+ // Attach Event Listener to Tray RightClick ...
+ tray.on("right-click", () => {
+ //
+ XLogger.logDebug(XLogger.XLogMessage(XLogger.XLogTag.Debug, 'Tray Right Clicked ...'));
+
+ //
+ const contextMenu = Menu.buildFromTemplate([
+ {
+ label: "quit",
+ click: () => {
+ //
+ app.isClosing = true;
+ app.quit();
+ },
+ },
+ ]);
+
+ //
+ tray.popUpContextMenu(contextMenu);
+ });
+}
+
+/**
+ * Create Main Window Instance ...
+ */
+function createWindow() {
+ //
+ // Create Main Window ...
+ mainWindow = new BrowserWindow({
+ icon: iconPath,
+ show: showWindowOnStartup,
+ width: isDevelopment ? 1200 : 800,
+ height: isDevelopment ? 800 : 600,
+ webPreferences: {
+ nodeIntegration: true,
+ contextIsolation: false
+ },
+ });
+
+ //
+ // Handle FullScreen state if Window shown on startup ...
+ if (isFullscreen && showWindowOnStartup) {
+ mainWindow.maximize();
+ mainWindow.setFullScreen(true);
+ }
+
+ //
+ // Generate Main Windows UUID ...
+ mainWindowID = uuid.generateUuid("XFrameworkElectronWindow");
+ mainWindow.name = mainWindowID;
+ XLogger.logDebug(XLogger.XLogMessage(XLogger.XLogTag.Debug, `Window ${mainWindowID} Created ...`));
+
+ //
+ // Fix new Window Open action ...
+ mainWindow.webContents.on("new-window", function (e, url) {
+ e.preventDefault();
+
+ //
+ XLogger.logDebug(XLogger.XLogMessage(XLogger.XLogTag.Debug, 'New Window Requested ...'));
+
+ //
+ shell.openExternal(url);
+ });
+
+ //
+ // Handle load Main Url on Navigate for handling Navigation on Angular Apps ...
+ mainWindow.webContents.on("will-navigate", function (e, url) {
+ e.preventDefault();
+
+ //
+ XLogger.logDebug(XLogger.XLogMessage(XLogger.XLogTag.Debug, 'Window Will Navigate Called ...'));
+
+ //
+ mainWindow.loadURL(mainUrl);
+ });
+
+ //
+ // Prepare Main Url ...
+ mainUrl = url.format({
+ pathname: path.join(__dirname, "/www/index.html"),
+ protocol: "file",
+ slashes: true,
+ });
+
+ //
+ // Load Content on Main Window ...
+ mainWindow.loadURL(mainUrl);
+
+ //
+ // Remove Browser Window Default menu ...
+ mainWindow.removeMenu();
+
+ //
+ // Open Dev Tools on Development environment ...
+ if (showDebug) {
+ //
+ mainWindow.webContents.openDevTools();
+ XLogger.logDebug(XLogger.XLogMessage(XLogger.XLogTag.Debug, 'Window Dev Tools Opened ...'));
+ }
+
+ //
+ // Handle Window Closed ...
+ mainWindow.on("closed", () => {
+ //
+ mainWindow = null;
+ windowManager.remove(mainWindowID);
+
+ //
+ XLogger.logDebug(XLogger.XLogMessage(XLogger.XLogTag.Debug, `Window ${mainWindowID} Closed ...`));
+ });
+
+ //
+ // Handle Window Close ...
+ mainWindow.on("close", (e) => {
+ //
+ if (!app.isClosing) {
+ //
+ e.preventDefault();
+
+ //
+ mainWindow.hide();
+
+ //
+ XLogger.logDebug(XLogger.XLogMessage(XLogger.XLogTag.Debug, `Window ${mainWindowID} Hided ...`));
+ }
+
+ //
+ return true;
+ });
+
+ //
+ // Send Handshake Message to Angular App for Notifing id of main window ...
+ mainWindow.webContents.on("did-finish-load", () => {
+ //
+ // Instancing new Message for Sending ...
+ const handshakeMsg = new XElectronMessage(
+ appId,
+ mainWindowID,
+ undefined,
+ undefined,
+ XElectronChannel.Handshake,
+ new Date().getTime()
+ );
+
+ //
+ // Sending Handshake Message to MainWindow ...
+ sendMessage(handshakeMsg);
+
+ //
+ XLogger.logDebug(XLogger.XLogMessage(XLogger.XLogTag.Debug, `sending Handshake to Window ${mainWindowID} ...`));
+ });
+
+ //
+ //#region IPC Handlers ...
+ //
+ // Register Event Handler for HandShake ...
+ ipcMain.on(XElectronChannel.Handshake, (event, message) => {
+ //
+ if (!message || !message.sender) {
+ return;
+ }
+
+ //
+ const windowID = message.sender;
+ windowManager.set(windowID, mainWindow);
+
+ //
+ handShakeChannelSubject.next(message);
+ });
+
+ //
+ // Register Event Handler for Message ...
+ ipcMain.on(XElectronChannel.Default, (event, message) => {
+ defaultChannelSubject.next(message);
+ });
+
+ //
+ const channels = Object.assign({}, XElectronChannel);
+ delete channels.Default;
+ delete channels.Handshake;
+
+ //
+ Object.keys(channels).forEach(channel => {
+ //
+ // Register Event Handler for Message on other Channel ...
+ ipcMain.on(channels[channel], (event, message) => {
+ otherChannelsSubject.next(message);
+ });
+ });
+ //#endregion
+}
+
+/**
+ * Toggle Show/Hide Main Window ...
+ */
+function toggleMainWindow() {
+ //
+ if (!mainWindow) {
+ return;
+ }
+
+ //
+ XLogger.logDebug(XLogger.XLogMessage(XLogger.XLogTag.Debug, `Toggle Window ...`));
+
+ //
+ if (mainWindow.isVisible()) {
+ mainWindow.hide();
+ } else {
+ //
+ if (isFullscreen) {
+ mainWindow.maximize();
+ mainWindow.setFullScreen(true);
+ }
+ mainWindow.show();
+ }
+}
+//#endregion
+
+//
+//#region Event Emitters ...
+/**
+ * attach event to call when it's ready, to app object ...
+ */
+app.whenReady().then(() => {
+ //
+ XLogger.logDebug(XLogger.XLogMessage(XLogger.XLogTag.Debug, `App Ready ...`));
+
+ //
+ createTray();
+ createWindow();
+});
+
+/**
+ * attach event to call when all application Windows closed, to app object ...
+ */
+app.on("window-all-closed", () => {
+ //
+ XLogger.logDebug(XLogger.XLogMessage(XLogger.XLogTag.Debug, `All Windows Closed ...`));
+
+ //
+ if (!isMac) {
+ app.quit();
+ }
+});
+
+/**
+ * attach event to call when application activated, to app object ...
+ */
+app.on("activate", () => {
+ //
+ XLogger.logDebug(XLogger.XLogMessage(XLogger.XLogTag.Debug, `App Activated ...`));
+
+ //
+ if (!mainWindow) {
+ createWindow();
+ }
+});
+//#endregion
+
+//
+//#region Window Comminucations ...
+/**
+ * send a message to specified window ...
+ *
+ * @param {XElectronMessageDto} message the message which required to send ...
+ */
+function sendMessage(message) {
+ //
+ if (!message) {
+ return;
+ }
+
+ //
+ if (!message.sender) {
+ message.sender = appId;
+ }
+
+ //
+ if (!message.reciever) {
+ message.reciever = mainWindowID;
+ }
+
+ //
+ let destWindow = undefined;
+ if (windowManager.count() === 0) {
+ destWindow = mainWindow;
+ } else {
+ destWindow = windowManager.get(message.reciever);
+ }
+
+ //
+ if (!destWindow) {
+ //
+ const errorMessage = 'Dest Window not found ...';
+ XLogger.logError(XLogger.XLogMessage(XLogger.XLogTag.Error, errorMessage))
+ throw errorMessage;
+ }
+
+ //
+ // Sending Message to Window ...
+ destWindow.webContents.send(
+ message.channel,
+ JSON.stringify(message)
+ );
+}
+//#endregion
diff --git a/platforms/electron/modules/models/.gitkeep b/platforms/electron/modules/models/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/platforms/electron/modules/models/x-base.descriptor.js b/platforms/electron/modules/models/x-base.descriptor.js
new file mode 100644
index 0000000..7dfdddd
--- /dev/null
+++ b/platforms/electron/modules/models/x-base.descriptor.js
@@ -0,0 +1,1157 @@
+//
+//#region Imports ...
+const XValueTools = require('../tools/x-value.tools');
+const XTypeDectorTools = require('../tools/x-type-detector.tools');
+//#endregion
+
+//
+//#region Constants ...
+/**
+ * base usefull Expression keys ...
+ */
+const ExpressionKeys = {
+ From: 'from',
+ Enum: 'enum',
+ Type: 'type',
+ Class: 'class',
+ Const: 'const',
+ Export: 'export',
+ Import: 'import',
+ Public: 'public',
+ Exports: 'exports',
+ Private: 'private',
+ Extends: 'extends',
+ Abstract: 'abstract',
+ Interface: 'interface',
+ Implements: 'implements',
+ IGNORED_KEY: '|$IGNORED_KEY$|',
+}
+
+/**
+ * all available content types for raw contents ...
+ */
+const ContentTypes = {
+ Array: 'array',
+ Object: 'object',
+ String: 'string',
+ Unknown: 'unknown',
+ NonString: 'non_string',
+ NonStringSelf: 'non_string_self',
+ NonStringHasClosure: 'non_string_has_closure',
+ NonStringHasProperty: 'non_string_has_property',
+}
+
+/**
+ * ng files decorator types ...
+ */
+const DecoratorTypes = {
+ Module: 'module',
+ Unknown: 'unknown',
+ Component: 'component',
+ Directive: 'directive',
+ Injectable: 'injectable'
+}
+
+/**
+ * all available decorator parts ...
+ */
+const DecoratorParts = {
+ Styles: 'styles',
+ Imports: 'imports',
+ Exports: 'exports',
+ Selector: 'selector',
+ Template: 'template',
+ Providers: 'providers',
+ StyleUrls: 'styleUrls',
+ Bootstrap: 'bootstrap',
+ ProvidedIn: 'providedIn',
+ TemplateUrl: 'templateUrl',
+ Declarations: 'declarations',
+ EntryComponents: 'entryComponents',
+ ChangeDetection: 'changeDetection',
+}
+
+const ModuleDecoratorValidParts = [
+ DecoratorParts.Imports,
+ DecoratorParts.Exports,
+ DecoratorParts.Bootstrap,
+ DecoratorParts.Providers,
+ DecoratorParts.Declarations,
+ DecoratorParts.EntryComponents,
+];
+
+const ComponentDecoratorValidParts = [
+ DecoratorParts.Selector,
+ DecoratorParts.Template,
+ DecoratorParts.TemplateUrl,
+ DecoratorParts.Styles,
+ DecoratorParts.StyleUrls,
+ DecoratorParts.ChangeDetection,
+];
+
+const DirectiveDecoratorValidParts = [
+ DecoratorParts.Selector
+];
+
+const InjectableDecoratorValidParts = [
+ DecoratorParts.ProvidedIn
+];
+
+/**
+ * all available types for decorator parts ...
+ */
+const DecoratorPartTypes = {
+ Array: 'array',
+ String: 'string'
+}
+//#endregion
+
+//
+//#region Content Type ...
+/**
+ * check a proposed type is valid content type or not ...
+ *
+ * @param {string} type the proposed type to check ...
+ * @returns
+ */
+function isValidContentType(type = '') {
+ //
+ // Validate Args ...
+ if (!XValueTools.isValidArg(type)) {
+ return false;
+ }
+
+ //
+ // Normalize Arg ...
+ type = type.trim();
+
+ //
+ let result = Object.values(ContentTypes).includes(type);
+ return result;
+}
+
+/**
+ * retrieve a content type ...
+ *
+ * @param {string} content a content which going to check ...
+ * @returns a member of ContentTypes const ...
+ */
+function getContentType(content = '') {
+ //
+ // Validate Args ...
+ if (!XValueTools.isValidArg(content)) {
+ return ContentTypes.Unknown;
+ }
+
+ //
+ if (XValueTools.isSurroundedObject(content)) {
+ return ContentTypes.Object;
+ } else if (XValueTools.isSurroundedArray(content)) {
+ return ContentTypes.Array;
+ } else if (XValueTools.isSurroundedString(content)) {
+ return ContentTypes.String;
+ } else if (
+ content.includes(':') ||
+ content.includes('=')
+ ) {
+ //
+ if (
+ content.includes('{') &&
+ content.includes('}')
+ ) {
+ return ContentTypes.NonStringHasClosure;
+ } else if (
+ content.includes('[') &&
+ content.includes(']')
+ ) {
+ return ContentTypes.NonStringHasClosure;
+ } else {
+ //
+ const colons = XValueTools.findAllIndexes(':', content);
+ if (
+ !XValueTools.hasChildArray(colons) ||
+ colons.length === 1
+ ) {
+ return ContentTypes.NonStringSelf
+ }
+
+ //
+ return ContentTypes.NonStringHasProperty;
+ }
+ } else {
+ return ContentTypes.NonString;
+ }
+}
+//#endregion
+
+//
+//#region Decorator ...
+/**
+ * determines a property name is valid in Decorator Object or not ...
+ *
+ * @param {string} part decorator object property name ...
+ * @returns is it valid or not ...
+ */
+function isValidDecoratorPart(part = DecoratorParts.Imports) {
+ //
+ // Validate Args ...
+ if (!XValueTools.isValidArg(part)) {
+ return false;
+ }
+
+ //
+ result = Object.values(DecoratorParts).includes(part);
+ return result;
+}
+
+/**
+ * determines a proposed value is valid decorator types or not ...
+ *
+ * @param {string} type a child of DecoratorTypes ...
+ * @returns proposed value is valid type or not ...
+ */
+function isValidDecoratorType(type = DecoratorTypes.Unknown) {
+ //
+ // Validate Args ...
+ if (
+ !XValueTools.isValidArg(type) ||
+ type === DecoratorTypes.Unknown
+ ) {
+ return false;
+ }
+
+ //
+ result = Object.values(DecoratorTypes).includes(type);
+ return result;
+}
+
+/**
+ * determines a part of decorator is valid for specified decorator type or not ...
+ *
+ * @param {string} part specified proposed part of DecoratorDescriptor ...
+ * @param {string} type specified proposed DecoratorType ...
+ * @returns part is valid for type or not ...
+ */
+function isValidDecoratorPartForType(
+ part = DecoratorParts.Imports,
+ type = DecoratorTypes.Unknown
+) {
+ //
+ // Validate Args ...
+ if (
+ !isValidDecoratorType(type) ||
+ !isValidDecoratorPart(part) ||
+ !XValueTools.isValidArg(part) ||
+ !XValueTools.isValidArg(type)
+ ) {
+ return false;
+ }
+
+ //
+ let result = false;
+ switch (type) {
+ //
+ case DecoratorTypes.Module:
+ result = ModuleDecoratorValidParts
+ .includes(part);
+ break;
+
+ //
+ case DecoratorTypes.Component:
+ result = ComponentDecoratorValidParts
+ .includes(part);
+ break;
+
+ //
+ case DecoratorTypes.Directive:
+ result = DirectiveDecoratorValidParts
+ .includes(part);
+ break;
+
+ //
+ case DecoratorTypes.Injectable:
+ result = InjectableDecoratorValidParts
+ .includes(part);
+ break;
+ }
+
+ //
+ return result;
+}
+
+/**
+ * retrieve decorator specific part type ...
+ *
+ * @param {string} part Decorator Object property name ...
+ * @returns decorator part type ...
+ */
+function getDecoratorPartType(part) {
+ //
+ // Validate Args ...
+ if (
+ !isValidDecoratorPart(part) &&
+ !XValueTools.isValidArg(part)
+ ) {
+ return undefined;
+ }
+
+ //
+ let result = '';
+
+ //
+ switch (part) {
+ //
+ // Array Parts ...
+ case DecoratorParts.Styles:
+ case DecoratorParts.Imports:
+ case DecoratorParts.Exports:
+ case DecoratorParts.Providers:
+ case DecoratorParts.StyleUrls:
+ case DecoratorParts.Bootstrap:
+ case DecoratorParts.Declarations:
+ case DecoratorParts.EntryComponents:
+ result = DecoratorPartTypes.Array;
+ break;
+
+ //
+ // String Parts ...
+ case DecoratorParts.Selector:
+ case DecoratorParts.Template:
+ case DecoratorParts.ProvidedIn:
+ case DecoratorParts.TemplateUrl:
+ case DecoratorParts.ChangeDetection:
+ result = DecoratorPartTypes.String;
+ break;
+ }
+
+ //
+ if (!XValueTools.isValidArg(result)) {
+ return undefined;
+ }
+
+ //
+ return result;
+}
+
+/**
+ * determines an specific part of decorator is in array type or not ...
+ *
+ * @param {string} part Decorator Object property name ...
+ * @returns
+ */
+function isDecoratorPartArray(part) {
+ //
+ // Validate Args ...
+ if (
+ !isValidDecoratorPart(part) ||
+ !XValueTools.isValidArg(part)
+ ) {
+ return false;
+ }
+
+ //
+ // Retrieve Decorator Part Type ...
+ const type = getDecoratorPartType(part);
+ if (!XValueTools.isValidArg(type)) {
+ return false;
+ }
+
+ //
+ const result = type === DecoratorPartTypes.Array;
+ return result;
+}
+
+/**
+ * determines an specific part of decorator is in string type or not ...
+ *
+ * @param {string} part Decorator Object property name ...
+ * @returns
+ */
+function isDecoratorPartString(part) {
+ //
+ // Validate Args ...
+ if (
+ !isValidDecoratorPart(part) ||
+ !XValueTools.isValidArg(part)
+ ) {
+ return false;
+ }
+
+ //
+ // Retrieve Decorator Part Type ...
+ const type = getDecoratorPartType(part);
+ if (!XValueTools.isValidArg(type)) {
+ return false;
+ }
+
+ //
+ const result = type === DecoratorPartTypes.String;
+ return result;
+}
+
+/**
+ * extract specified decorator part values from given content ...
+ *
+ * @param {string} part the part which reuire to extract from given text, which usually must be DecoratorParts value ...
+ * @param {string} content given content to tokenize ...
+ * @param {boolean} isArray determines the given token value is array or not ...
+ * @returns parsed token's value(s) ...
+ */
+function extractDecoratorPart(
+ part = '',
+ content = '',
+) {
+ //
+ // Validate Args ...
+ if (
+ !isValidDecoratorPart(part) ||
+ !XValueTools.isValidArg(part) ||
+ !XValueTools.isValidArg(content)
+ ) {
+ return undefined;
+ }
+
+ //
+ const partType = getDecoratorPartType(part);
+ const isArray = isDecoratorPartArray(part);
+
+ //
+ let listSeparator = ',';
+ let end = isArray ? ']' : '\'';
+ let start = isArray ? '[' : '\'';
+
+ //
+ // find token index ...
+ let partIndex = content.indexOf(part);
+ if (partIndex === -1) {
+ return undefined;
+ }
+
+ //
+ content = content.substring(partIndex);
+ partIndex = content.indexOf(part);
+ if (part === DecoratorParts.Template) {
+ //
+ const tIndex = content.indexOf(DecoratorParts.TemplateUrl);
+ if (partIndex === tIndex) {
+ return undefined;
+ }
+ }
+
+ //
+ // find start and end index ...
+ let startIndex = content.indexOf(start, partIndex) + 1;
+ let endIndex = content.indexOf(end, startIndex) - 1;
+
+ //
+ // Try to fix string interpolation ...
+ if (!isArray && (startIndex < 0 || endIndex < 0)) {
+ startIndex = content.indexOf('`', partIndex + part.length);
+ endIndex = content.indexOf('`', startIndex + 1);
+ }
+
+ //
+ // Try to fix Object ...
+ if (!isArray && (startIndex < 0 || endIndex < 0)) {
+ startIndex = part.length;
+ endIndex = content.indexOf('`', startIndex + 1) > 0 ?
+ content.indexOf('`', startIndex + 1) :
+ content.indexOf(',', startIndex + 1) > 0 ?
+ content.indexOf(',', startIndex + 1) :
+ content.indexOf('}', startIndex + 1) > 0 ?
+ content.indexOf('}', startIndex + 1) :
+ -1;
+ }
+
+ if (startIndex === -1 || endIndex === -1) {
+ return undefined;
+ }
+
+ //
+ // define regExps for clearing content ...
+ const regExp = new RegExp(
+ ' |\n|',
+ 'g'
+ );
+
+ //
+ // Extract required content and remove all non required contents from it ...
+ let resultContent = content
+ .substr(startIndex, (endIndex - startIndex) + 1);
+ if (isArray) {
+ resultContent = resultContent.replace(regExp, '').trim();
+ } else {
+ resultContent = resultContent
+ .replace(',', '')
+ .replace('}', '')
+ .replace(':', '').trim();
+ }
+ if (!XValueTools.isValidArg(resultContent)) {
+ return isArray ? [] : '';
+ }
+
+ //
+ // check content is a list or not ...
+ const isMultipleDeclaration = resultContent.includes(listSeparator);
+
+ //
+ // prepare result ...
+ const outOfClosedIndexes = XValueTools.findAllIndexesOutOfCloseds(listSeparator, resultContent);
+ const outOfClosedParts = XValueTools.sliceContent(outOfClosedIndexes, resultContent);
+ let result = isMultipleDeclaration ?
+ isArray ?
+ [...outOfClosedParts] :
+ resultContent :
+ isArray ?
+ [resultContent] :
+ resultContent;
+ result = isArray ?
+ result.filter(r => r.length > 0) :
+ result.trim();
+
+ //
+ return result;
+}
+//#endregion
+
+//
+//#region Parsers ...
+/**
+ * parse given content and extracts it's XKeyValueDescriptor childs ...
+ *
+ * @param {string} content a proposed content to parse ...
+ * @param {boolean} isInterface force parser to parse object content as an interface content, default is false ...
+ * @returns parsed collection of XKeyValueDescriptor object instance ...
+ */
+function parseContent(
+ content = '',
+ isInterface = false
+) {
+ //
+ // Validate Args ...
+ if (!XValueTools.isValidArg(content)) {
+ return undefined;
+ }
+
+ //
+ // Define Result Structure ...
+ let result = [{
+ key: '',
+ value: undefined,
+ type: ContentTypes.Unknown,
+ }];
+ result.pop();
+
+ //
+ const contentType = getContentType(content);
+ if (isValidContentType(contentType)) {
+ result.type = contentType;
+ }
+
+ //
+ switch (contentType) {
+ //
+ // parse array contents ...
+ case ContentTypes.Array:
+ result = parseProperties(
+ content,
+ isInterface
+ );
+ break;
+
+ //
+ //parse object content ...
+ case ContentTypes.Object:
+ result = parseProperties(
+ content,
+ isInterface
+ );
+ break;
+
+ //
+ // add content it self ...
+ case ContentTypes.String:
+ result.push({
+ type: contentType,
+ value: parseString(content),
+ key: ExpressionKeys.IGNORED_KEY,
+ });
+ break;
+
+ //
+ // add content it self without anything ...
+ case ContentTypes.NonString:
+ result.push({
+ value: content,
+ type: contentType,
+ key: ExpressionKeys.IGNORED_KEY,
+ });
+ break;
+
+ //
+ // parse just one property ...
+ case ContentTypes.NonStringSelf:
+ break;
+
+ //
+ // parse properties more than one ...
+ case ContentTypes.NonStringHasProperty:
+ break;
+
+ //
+ // parse key and values ...
+ case ContentTypes.NonStringHasClosure:
+ break;
+
+ //
+ case ContentTypes.Unknown:
+ default:
+ break;
+ }
+
+ //
+ return result;
+}
+
+/**
+ * parse properties of given content and extract it's values ...
+ *
+ * @param {string} content the content which going to parse ...
+ * @param {boolean} isInterface determines the props is for interface or not ...
+ * @returns parse props as a collection of key/value/type array ...
+ */
+function parseProperties(
+ content = '',
+ isInterface = false
+) {
+ //
+ let result = [{
+ key: '',
+ value: undefined,
+ type: ContentTypes.Unknown,
+ }];
+ result.pop();
+
+ //
+ // Validate Args ...
+ if (!XValueTools.isValidArg(content)) {
+ return result;
+ }
+
+ //
+ // Clear Surrounded Chars ...
+ if (XValueTools.isSurroundedArray(content)) {
+ content = XValueTools.clearArraySurround(content);
+ } else if (XValueTools.isSurroundedObject(content)) {
+ content = XValueTools.clearObjectSurround(content);
+ }
+
+ //
+ let individualColonIndexes = [];
+ if (!!isInterface) {
+ individualColonIndexes = XValueTools.findAllIndexesOutOfCloseds(';', content);
+ } else {
+ individualColonIndexes = XValueTools.findAllIndexesOutOfCloseds(',', content);
+ }
+
+ //
+ let parts = [];
+ if (XValueTools.hasChildArray(individualColonIndexes)) {
+ parts = XValueTools
+ .sliceContent(individualColonIndexes, content)
+ .filter(r => XValueTools.isValidArg(r));
+ } else {
+ parts.push(content);
+ }
+
+ //
+ for (const part of parts) {
+ //
+ const partType = getContentType(part);
+
+ //
+ const individualSemicolonIndexes = XValueTools
+ .findAllIndexesOutOfCloseds(
+ [':', '='],
+ part
+ );
+
+ //
+ if (!XValueTools.hasChildArray(individualSemicolonIndexes)) {
+ //
+ const parsedContent = parseContent(
+ part,
+ isInterface
+ ) || [];
+ if (partType === ContentTypes.Object) {
+ result.push({
+ type: partType,
+ value: parsedContent,
+ key: ExpressionKeys.IGNORED_KEY,
+ });
+ } else {
+ result.push(...parsedContent);
+ }
+ continue;
+ }
+
+ //
+ const sepIndex = individualSemicolonIndexes[0];
+ const keyVal = XValueTools.sliceContent([sepIndex], part);
+ if (
+ keyVal.length !== 2 ||
+ !XValueTools.hasChildArray(keyVal)
+ ) {
+ continue;
+ }
+
+ //
+ let parsedValue = parseContent(
+ keyVal[1],
+ isInterface
+ );
+ let type = parsedValue.type || getContentType(keyVal[1]);
+ if (
+ parsedValue.length === 1 &&
+ XValueTools.hasChildArray(parsedValue) &&
+ parsedValue[0].key === ExpressionKeys.IGNORED_KEY &&
+ !Object.values([ContentTypes.Array, ContentTypes.Object]).includes(parsedValue[0].type)
+ ) {
+ parsedValue = parsedValue[0].value;
+ }
+
+ //
+ result.push({
+ type,
+ key: keyVal[0],
+ value: parsedValue
+ });
+ }
+
+ //
+ return result;
+}
+
+/**
+ * parse a content as string ...
+ *
+ * @param {string} content the content which going to parsed ...
+ * @returns parsed string content ...
+ */
+function parseString(content = '') {
+ //
+ // Validate Args ...
+ if (
+ !XValueTools.isValidArg(content) ||
+ !XValueTools.isSurroundedString(content)
+ ) {
+ return '';
+ }
+
+ //
+ if (
+ content.startsWith('\'') &&
+ (
+ XValueTools.endsWidth('\'', content) ||
+ XValueTools.endsWidth('\',', content) ||
+ XValueTools.endsWidth('\';', content) ||
+ XValueTools.endsWidth('\'\n', content)
+ )
+ ) {
+ //
+ const removeFromLastLength = XValueTools.endsWidth('\'', content) ?
+ 1 :
+ XValueTools.endsWidth('\',', content) ||
+ XValueTools.endsWidth('\';', content) ||
+ XValueTools.endsWidth('\'\n', content) ?
+ 2 :
+ 0;
+
+ //
+ content = content.substring(1, content.length - removeFromLastLength);
+ content = XValueTools.surroundBy('\"', content);
+ } else if (
+ content.startsWith('`') &&
+ (
+ XValueTools.endsWidth('\`', content) ||
+ XValueTools.endsWidth('\`,', content) ||
+ XValueTools.endsWidth('\`;', content) ||
+ XValueTools.endsWidth('\`\n', content)
+ )
+ ) {
+ content = XValueTools.surroundBy('\"', content);
+ }
+
+ //
+ return content;
+}
+//#endregion
+
+//
+//#region Expressions ...
+function toExpression(content) {
+ //
+ let result = '';
+ const isKeyValueType = XValueTools.isKeyValueType(content);
+ if (!isKeyValueType) {
+ //
+ const isContentArray = XTypeDectorTools.isArray(content);
+ if (isContentArray) {
+ //
+ const contentResults = [''];
+ contentResults.pop();
+
+ //
+ for (const contentChild of content) {
+ //
+ const contentResult = toExpression(contentChild);
+ contentResults.push(contentResult);
+ }
+
+ //
+ result += '[\n' + contentResults.join(',\n') + '\n]';
+ } else {
+ result += content;
+ }
+ } else {
+ //
+ // Retrieve Type ...
+ const keyValType = content.type || ContentTypes.Unknown;
+
+ //
+ let contentResult = '';
+ switch (keyValType) {
+ //
+ // String ...
+ case ContentTypes.String:
+ //
+ let surroundSymbol = content.value.charAt(0);
+ contentResult = XValueTools.clearSurround(surroundSymbol, content.value);
+
+ //
+ surroundSymbol = contentResult.charAt(0) || '';
+ if (surroundSymbol !== '\'' && surroundSymbol !== '`') {
+ contentResult = XValueTools.surroundBy('\'', contentResult);
+ }
+ break;
+
+ //
+ // NonString ...
+ case ContentTypes.NonString:
+ contentResult = content.value;
+ break;
+
+ //
+ // Array ...
+ case ContentTypes.Array:
+ //
+ const arrayResult = [''];
+ arrayResult.pop();
+
+ //
+ if (XTypeDectorTools.isString(content.value)) {
+ //
+ const normalContentValue = XValueTools.toNormalArray(content.value);
+ content.value = [
+ ...normalContentValue
+ ]
+ }
+ for (const arrayChild of content.value) {
+ //
+ const arrayChildExp = toExpression(arrayChild);
+ arrayResult.push(arrayChildExp);
+ }
+
+ //
+ // TODO: create a way to handle array or objects childs for join ...
+ let arrayResultContent = '';
+ for (let i = 0; i < arrayResult.length; i++) {
+ //
+ const nextResult = arrayResult[i + 1];
+ arrayResultContent += arrayResult[i] + (
+ i < arrayResult.length - 1 ?
+ (XValueTools.isSurroundedArray(nextResult) ||
+ XValueTools.isSurroundedObject(nextResult)) ?
+ ',\n' :
+ ', ' :
+ ''
+ );
+ }
+
+ //
+ contentResult = '[\n' + arrayResultContent + '\n]';
+ break;
+
+ //
+ // Object ...
+ case ContentTypes.Object:
+ //
+ let objectResult = '{\n';
+
+ //
+ for (let i = 0; i < content.value.length; i++) {
+ //
+ const arrayChild = content.value[i];
+ const arrayChildExp = toExpression(arrayChild);
+ objectResult += (
+ arrayChild.key !== ExpressionKeys.IGNORED_KEY ?
+ arrayChild.key +
+ ': ' :
+ ''
+ ) +
+ arrayChildExp +
+ (
+ i === content.value.length - 1 ?
+ '' :
+ ',\n'
+ );
+ }
+
+ //
+ objectResult += '\n}';
+
+ //
+ contentResult = objectResult;
+ break;
+ }
+
+ //
+ result += contentResult;
+ }
+
+ //
+ return result;
+}
+//#endregion
+
+//
+//#region Extractors ...
+/**
+ * extract all occurance indexes of an identifier inside a content ...
+ *
+ * @param {string} identifier the value which going to search ...
+ * @param {string} content the content is going to searched for value ...
+ * @returns a collection of occurance indexes ...
+ */
+function extractIdentifierIndexes(
+ identifier = '',
+ content = '') {
+ //
+ // Prepare Result ...
+ let result = [0];
+ result.pop();
+
+ //
+ // Validate Args ...
+ if (
+ !XValueTools.isValidArg(content) ||
+ !XValueTools.isValidArg(identifier)
+ ) {
+ return result;
+ }
+
+ //
+ // Extract Identifiers ...
+ result = XValueTools.
+ findAllIndexes(
+ identifier,
+ content
+ );
+
+ //
+ return result;
+}
+
+/**
+ * check an index of an identifier inside a content is same as identifier or not ...
+ *
+ * @param {string} identifier the value which going to search ...
+ * @param {number} index the item proposed index on content ...
+ * @param {string} content the content is going to searched for value ...
+ * @returns is it match identifier or not ...
+ */
+function validateIdentifierInContent(
+ identifier = '',
+ index = -1,
+ content = ''
+) {
+ //
+ // Prepare Result ...
+ let result = false;
+
+ //
+ // Validate Args ...
+ if (
+ !XValueTools.isValidArg(content) ||
+ !XValueTools.isValidArg(identifier)
+ ) {
+ return false;
+ }
+
+ //
+ // Normalize Index ...
+ index = index < 0 ? 0 : index > content.length ? content.length : index;
+
+ //
+ //
+ // Check Type after befre content ...
+ let startIndex = index - 1;
+ let endIndex = index + identifier.length + 1;
+ const tIdentifier = content.substring(startIndex, endIndex).trim();
+ result = tIdentifier === identifier;
+
+ //
+ return result;
+}
+
+/**
+ * extract all occurance indexes of an identifier inside a content and Validate them ...
+ *
+ * @param {string} identifier the value which going to search ...
+ * @param {string} content the content is going to searched for value ...
+ * @returns a collection of occurance indexes ...
+ */
+function extractValidIdentifierIndexes(
+ identifier = '',
+ content = ''
+) {
+ //
+ // Prepare Result ...
+ let result = [0];
+ result.pop();
+
+ //
+ // Validate Args ...
+ if (
+ !XValueTools.isValidArg(content) ||
+ !XValueTools.isValidArg(identifier)
+ ) {
+ return result;
+ }
+
+ //
+ // Extract Identifier Indexes ...
+ result = extractIdentifierIndexes(
+ identifier,
+ content
+ );
+
+ //
+ // Filter result to get Valid Identifiers ...
+ result = result.filter(i => validateIdentifierInContent
+ (
+ identifier,
+ i,
+ content
+ )
+ );
+
+ //
+ return result;
+}
+
+/**
+ * determines a content expression starter is exported or not ...
+ *
+ * @param {number} index start index for checking export ...
+ * @param {string} content the content which reuired to check ...
+ * @returns is exported or not ...
+ */
+function checkIsExported(
+ index = 0,
+ content = ''
+) {
+ //
+ // Prepare Result ...
+ let result = false;
+
+ //
+ // Validate Args ...
+ if (!XValueTools.isValidArg(content)) {
+ return result;
+ }
+
+ //
+ // Normalize Index ...
+ index = index < 0 ? 0 : index > content.length ? content.length : index;
+
+ //
+ const startIndex = index - ExpressionKeys.Export.length - 1;
+ const endIndex = startIndex + ExpressionKeys.Export.length;
+ const identifier = content.substring(startIndex, endIndex).trim();
+ result = identifier === ExpressionKeys.Export;
+
+ //
+ return result;
+}
+//#endregion
+
+//
+//#region Content Cleaners ...
+/**
+ * clear all comments, regions symbols and non required signs from a content ...
+ *
+ * @param {string} content the content which used ...
+ * @returns cleared content ...
+ */
+function clearContent(content = '') {
+ //
+ // Validate Args ...
+ if (!XValueTools.isValidArg(content)) {
+ return '';
+ }
+
+ //
+ // Check Content contains Line Return or not ...
+ if (content.includes('\n')) {
+ content = content.split('\n')
+ .map(cc => cc.trim())
+ .filter(cc => XValueTools.isValidArg(cc) &&
+ !cc.startsWith('//') &&
+ !cc.startsWith('#'))
+ .join('\n');
+ }
+
+ //
+ return content;
+}
+//#endregion
+
+//
+// Module Exports ...
+module.exports = {
+ //
+ ContentTypes,
+ ExpressionKeys,
+ DecoratorTypes,
+ DecoratorParts,
+ DecoratorPartTypes,
+ ModuleDecoratorValidParts,
+ ComponentDecoratorValidParts,
+ DirectiveDecoratorValidParts,
+ InjectableDecoratorValidParts,
+
+ //
+ getContentType,
+ isValidContentType,
+
+ //
+ extractDecoratorPart,
+ isValidDecoratorPart,
+ isValidDecoratorType,
+ getDecoratorPartType,
+ isDecoratorPartArray,
+ isDecoratorPartString,
+ isValidDecoratorPartForType,
+
+ //
+ parseContent,
+ clearContent,
+ checkIsExported,
+ extractIdentifierIndexes,
+ validateIdentifierInContent,
+ extractValidIdentifierIndexes,
+
+ //
+ toExpression,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/models/x-class.descriptor.js b/platforms/electron/modules/models/x-class.descriptor.js
new file mode 100644
index 0000000..06e9c6c
--- /dev/null
+++ b/platforms/electron/modules/models/x-class.descriptor.js
@@ -0,0 +1,622 @@
+//
+//#region Imports ...
+const XFileTools = require('../tools/x-file.tools');
+const XValueTools = require('../tools/x-value.tools');
+const XBaseDescriptor = require('./x-base.descriptor');
+const XDecoratorDescriptor = require('./x-decorator.descriptor');
+//#endregion
+
+/**
+ * check an object instance is ClassDescriptor or not ...
+ *
+ * @param {any} object proposed object to check ...
+ * @returns
+ */
+function isDescriptor(object) {
+ //
+ if (!object) {
+ return false;
+ }
+
+ //
+ let result = false;
+ result =
+ object.hasOwnProperty('raw') &&
+ Array.isArray(object.extends) &&
+ object.hasOwnProperty('name') &&
+ Array.isArray(object.implements) &&
+ object.hasOwnProperty('extends') &&
+ object.hasOwnProperty('isPublic') &&
+ object.hasOwnProperty('decorator') &&
+ object.hasOwnProperty('implements') &&
+ object.hasOwnProperty('isExported') &&
+ object.hasOwnProperty('isExtended') &&
+ object.hasOwnProperty('isAbstract') &&
+ object.hasOwnProperty('hasDecorator') &&
+ object.hasOwnProperty('isImplemented');
+
+ //
+ return result;
+}
+
+/**
+ * retrieve base or filled ClassDescriptor object instance ...
+ *
+ * @param {any} value a value provider object ...
+ * @returns an instance of ClassDescriptor object ...
+ */
+function createDescriptor(value) {
+ //
+ const result = {
+ raw: '',
+ name: '',
+ extends: [],
+ implements: [],
+ isPublic: true,
+ isExported: false,
+ isExtended: false,
+ isAbstract: false,
+ hasDecorator: false,
+ isImplemented: false,
+ decorator: {
+ ...XDecoratorDescriptor.createDescriptor()
+ },
+ };
+
+ //
+ //#region Apply Props ...
+ if (value) {
+ //
+ //#region name ...
+ if (XValueTools.isValidArg(value.name)) {
+ result.name = value.name;
+ }
+ //#endregion
+
+ //
+ //#region extends ...
+ if (XValueTools.hasChildArray(value.extends)) {
+ result.extends = [...value.extends];
+ }
+ //#endregion
+
+ //
+ //#region implements ...
+ if (XValueTools.hasChildArray(value.implements)) {
+ result.implements = [...value.implements];
+ }
+ //#endregion
+
+ //
+ //#region raw ...
+ if (XValueTools.isValidArg(value.raw)) {
+ result.raw = value.raw;
+ }
+ //#endregion
+
+ //
+ //#region isPublic ...
+ if (!!value.isPublic) {
+ result.isPublic = true;
+ } else if (value.isPublic === false) {
+ result.isPublic = false;
+ }
+ //#endregion
+
+ //
+ //#region isExported ...
+ if (!!value.isExported) {
+ result.isExported = true;
+ }
+ //#endregion
+
+ //
+ //#region isExtended ...
+ if (!!value.isExtended) {
+ result.isExtended = true;
+ }
+ //#endregion
+
+ //
+ //#region isAbstract ...
+ if (!!value.isAbstract) {
+ result.isAbstract = true;
+ }
+ //#endregion
+
+ //
+ //#region hasDecorator ...
+ if (!!value.hasDecorator) {
+ result.hasDecorator = true;
+ }
+ //#endregion
+
+ //
+ //#region decorator ...
+ if (!!result.hasDecorator && value.decorator) {
+ result.decorator = {
+ ...XDecoratorDescriptor.createDescriptor(value.decorator)
+ };
+ } else {
+ result.decorator = undefined;
+ }
+ //#endregion
+
+ //
+ //#region isImplemented ...
+ if (!!value.isImplemented) {
+ result.isImplemented = true;
+ }
+ //#endregion
+ }
+ //#endregion
+
+ //
+ return result;
+}
+
+/**
+ * converts an instance of Descriptor to Expression ...
+ *
+ * @param descriptor an instance of ClassDescriptor ...
+ * @returns creator string ...
+ */
+function toExpression(
+ descriptor = createDescriptor(),
+ forceClearContent = false,
+) {
+ //
+ let result = '';
+
+ //
+ // Validate Arg ...
+ if (!isDescriptor(descriptor)) {
+ return result;
+ }
+
+ //
+ let classContent = '';
+ let classContentIndexers = XValueTools.findClosedContent('{', '}', descriptor.raw);
+ if (XValueTools.hasChildArray(classContentIndexers)) {
+ //
+ classContent = XValueTools
+ .clearObjectSurround(classContentIndexers[0].content);
+
+ //
+ if (!!forceClearContent) {
+ classContent = XBaseDescriptor.clearContent(classContent);
+ }
+ }
+
+ //
+ // Handle Class Decorator ...
+ if (
+ !!descriptor.hasDecorator &&
+ XValueTools.isValidArgs(descriptor.decorator.type) &&
+ XBaseDescriptor.isValidDecoratorType(descriptor.decorator.type)
+ ) {
+ //
+ result += XDecoratorDescriptor
+ .toExpression(descriptor.decorator) +
+ '\n';
+ }
+
+ //
+ // Handle Class ...
+ result +=
+ //
+ // Export ...
+ (
+ descriptor.isExported ?
+ XBaseDescriptor.ExpressionKeys.Export +
+ ' ' :
+ ''
+ ) +
+ //
+ // Public or Private ...
+ (
+ !descriptor.isPublic ?
+ XBaseDescriptor.ExpressionKeys.Private +
+ ' ' :
+ ''
+ ) +
+ //
+ // Abstract ...
+ (
+ descriptor.isAbstract ?
+ XBaseDescriptor.ExpressionKeys.Abstract +
+ ' ' :
+ ''
+ ) +
+ //
+ // Class Definition ...
+ XBaseDescriptor.ExpressionKeys.Class +
+ ' ' +
+ descriptor.name +
+ ' ' +
+ //
+ // Extends ...
+ (
+ descriptor.isExtended ?
+ XBaseDescriptor.ExpressionKeys.Extends +
+ ' ' +
+ descriptor.extends.join(', ')
+ + ' ' :
+ ''
+ ) +
+ //
+ // Implements ...
+ (
+ descriptor.isImplemented ?
+ XBaseDescriptor.ExpressionKeys.Implements +
+ ' ' +
+ descriptor.implements.join(', ') +
+ ' ' :
+ ''
+ ) +
+ //
+ // Open Class ...
+ '{\n' +
+ //
+ // Class Content ...
+ (
+ XValueTools.isValidArg(classContent) ?
+ classContent :
+ ''
+ ) +
+ //
+ // Close Class ...
+ '\n}';
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists ClassDescriptors ...
+ *
+ * @param {string} file a file path ...
+ * @returns a collection of ClassDescriptors ...
+ */
+async function extractDescriptors(file = '') {
+ //
+ if (!XFileTools.isFileExists(file)) {
+ return [];
+ }
+
+ //
+ const fileContent = await XFileTools.readFile(file);
+ if (!XValueTools.isValidArg(fileContent)) {
+ return [];
+ }
+
+ //
+ let result = [
+ createDescriptor()
+ ];
+ result.pop();
+
+ //
+ result = extractDescriptorsFromContent(fileContent);
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists ClassDescriptors ...
+ *
+ * @param {string} content a file content ...
+ * @returns a collection of ClassDescriptors ...
+ */
+function extractDescriptorsFromContent(content = '') {
+ //
+ // Prepare result ...
+ let result = [
+ createDescriptor()
+ ];
+ result.pop();
+
+ //
+ // Validate Args ...
+ if (
+ !XValueTools.isValidArg(content) ||
+ !content.includes(XBaseDescriptor.ExpressionKeys.Class)
+ ) {
+ return result;
+ }
+
+ //
+ // Extract all Key Indexes ...
+ const keyIndexes = XBaseDescriptor.
+ extractValidIdentifierIndexes(XBaseDescriptor.ExpressionKeys.Class, content);
+
+ //
+ // Validate Keys Exists on Content ...
+ if (!XValueTools.hasChildArray(keyIndexes)) {
+ return result;
+ }
+
+ //
+ // Loop through indexes ...
+ for (let index of keyIndexes) {
+ //
+ // create an empty instance of descriptor ...
+ let descriptor = {
+ ...createDescriptor()
+ }
+
+ //
+ let startIndex = index;
+ let endIndex = content.indexOf('{', startIndex);
+ let rawIndexContents = XValueTools.findClosedContent('{', '}', content, endIndex);
+ if (!XValueTools.hasChildArray(rawIndexContents)) {
+ continue;
+ }
+
+ //
+ let identifier = content.substring(
+ index + XBaseDescriptor.ExpressionKeys.Class.length,
+ endIndex
+ ).trim();
+
+ //
+ //#region HasExtends, Extends, HasImplements, Implements ...
+ //
+ const hasExtends = identifier.includes(XBaseDescriptor.ExpressionKeys.Extends);
+ const hasImplements = identifier.includes(XBaseDescriptor.ExpressionKeys.Implements);
+
+ //
+ descriptor.isExtended = hasExtends;
+ descriptor.isImplemented = hasImplements;
+
+ //
+ let extendsStartIndex = -1;
+ let implementsStartIndex = -1;
+
+ //
+ // Extends ...
+ if (!!hasExtends) {
+ //
+ extendsStartIndex = identifier
+ .indexOf(XBaseDescriptor.ExpressionKeys.Extends) +
+ XBaseDescriptor.ExpressionKeys.Extends.length;
+
+ //
+ let extendsIdentifier = identifier
+ .substring(extendsStartIndex)
+ .trim();
+ if (extendsIdentifier
+ .includes(XBaseDescriptor.ExpressionKeys.Implements)) {
+ //
+ let extendsEndIndex = extendsIdentifier
+ .indexOf(XBaseDescriptor.ExpressionKeys.Implements);
+ extendsIdentifier = extendsIdentifier
+ .substring(0, extendsEndIndex)
+ .trim();
+ }
+
+ //
+ // Continue if it's not Valid ...
+ if (!XValueTools.isValidArg(extendsIdentifier)) {
+ continue;
+ }
+
+ //
+ // Check if extends is Array or not ...
+ if (extendsIdentifier.includes(',')) {
+ descriptor.extends.push(
+ ...extendsIdentifier
+ .split(',')
+ .map(e => e.trim())
+ .filter(e => XValueTools.isValidArg(e))
+ )
+ } else {
+ descriptor.extends.push(extendsIdentifier);
+ }
+ }
+
+ //
+ // Implements ...
+ if (!!hasImplements) {
+ //
+ implementsStartIndex = identifier
+ .indexOf(XBaseDescriptor.ExpressionKeys.Implements) +
+ XBaseDescriptor.ExpressionKeys.Implements.length;
+
+ //
+ let implementsIdentifier = identifier
+ .substring(implementsStartIndex)
+ .trim();
+ if (implementsIdentifier
+ .includes(XBaseDescriptor.ExpressionKeys.Extends)) {
+ //
+ let implementsEndIndex = implementsIdentifier
+ .indexOf(XBaseDescriptor.ExpressionKeys.Extends);
+ implementsIdentifier = implementsIdentifier
+ .substring(0, implementsEndIndex)
+ .trim();
+ }
+
+ //
+ // Continue if it's not Valid ...
+ if (!XValueTools.isValidArg(implementsIdentifier)) {
+ continue;
+ }
+
+ //
+ // Check if extends is Array or not ...
+ if (implementsIdentifier.includes(',')) {
+ descriptor.implements.push(
+ ...implementsIdentifier
+ .split(',')
+ .map(i => i.trim())
+ .filter(i => XValueTools.isValidArg(i))
+ )
+ } else {
+ descriptor.implements.push(implementsIdentifier);
+ }
+ }
+ //#endregion
+
+ //
+ //#region Class Name ...
+ let nameEndIndex = Math.min(
+ ...[
+ extendsStartIndex,
+ implementsStartIndex,
+ identifier.length
+ ]
+ .filter(i => i >= 0)
+ );
+ identifier = identifier
+ .substring(0, nameEndIndex)
+ .replace(XBaseDescriptor.ExpressionKeys.Extends, '')
+ .replace(XBaseDescriptor.ExpressionKeys.Implements, '')
+ .trim();
+
+ //
+ // Continue if class name is not valid ...
+ if (!XValueTools.isValidArg(identifier)) {
+ continue;
+ }
+
+ //
+ // Set Descriptor name ...
+ descriptor.name = identifier;
+ //#endregion
+
+ //
+ //#region Exported, Public, Abstract ...
+ //
+ const lengthForComeBack =
+ XBaseDescriptor.ExpressionKeys.Export.length +
+ XBaseDescriptor.ExpressionKeys.Public.length +
+ XBaseDescriptor.ExpressionKeys.Private.length +
+ XBaseDescriptor.ExpressionKeys.Abstract.length;
+
+ //
+ startIndex = index - lengthForComeBack;
+ endIndex = index;
+ identifier = content
+ .substring(startIndex, endIndex)
+ .trim();
+
+ //
+ // Exported ...
+ descriptor.isExported = identifier.includes(XBaseDescriptor.ExpressionKeys.Export);
+
+ //
+ // Public ...
+ descriptor.isPublic = identifier.includes(XBaseDescriptor.ExpressionKeys.Public) ||
+ !identifier.includes(XBaseDescriptor.ExpressionKeys.Private);
+
+ //
+ // Abstract ...
+ descriptor.isAbstract = identifier.includes(XBaseDescriptor.ExpressionKeys.Abstract);
+ //#endregion
+
+ //
+ //#region Raw ...
+ let classStartIndex = Math.max(
+ ...[
+ content.indexOf(XBaseDescriptor.ExpressionKeys.Export, startIndex),
+ content.indexOf(XBaseDescriptor.ExpressionKeys.Public, startIndex),
+ content.indexOf(XBaseDescriptor.ExpressionKeys.Private, startIndex),
+ content.indexOf(XBaseDescriptor.ExpressionKeys.Abstract, startIndex),
+ ]
+ .filter(i => i >= 0 && i <= rawIndexContents[0].start)
+ );
+ let classEndIndex = rawIndexContents[0].end + 1;
+ descriptor.raw = content.substring(classStartIndex, classEndIndex);
+ //#endregion
+
+ //
+ //#region Decorator ...
+ //
+ const forExtractDecoratorContentEndIndex = content.indexOf(descriptor.raw);
+ let forExtractDecoratorContent = content.substring(0, forExtractDecoratorContentEndIndex);
+
+ //
+ let decoratorIndexes = XValueTools
+ .findAllIndexes('@(.*)\\({', forExtractDecoratorContent)
+ .map(index => {
+ return {
+ startIndex: index,
+ decoratorContentIndexer: XValueTools
+ .findClosedContent('({', '})', forExtractDecoratorContent, index)[0]
+ }
+ });
+ let decoratorIndex = decoratorIndexes
+ .find(i => i.decoratorContentIndexer.end + 1 === classStartIndex - 1);
+ if (
+ !decoratorIndex &&
+ decoratorIndexes.length === 1 &&
+ XValueTools.hasChildArray(decoratorIndexes)
+ ) {
+ //
+ decoratorIndex = {
+ //
+ ...decoratorIndexes[0],
+
+ //
+ decoratorContentIndexer: {
+ //
+ ...decoratorIndexes[0]
+ .decoratorContentIndexer,
+
+ //
+ end: classStartIndex - 1,
+
+ //
+ content: content.substring(
+ decoratorIndexes[0]
+ .decoratorContentIndexer
+ .start,
+ classStartIndex - 1
+ ),
+ }
+ };
+ }
+
+ //
+ if (decoratorIndex) {
+ //
+ identifier = forExtractDecoratorContent
+ .substring(
+ decoratorIndex.startIndex,
+ decoratorIndex.decoratorContentIndexer.end + 1
+ );
+
+ //
+ const decorator = XDecoratorDescriptor.extractDescriptorFromContent(identifier);
+ if (!decorator) {
+ continue;
+ }
+
+ //
+ descriptor.hasDecorator = true;
+ descriptor.decorator = {
+ ...decorator
+ };
+ }
+ //#endregion
+
+ //
+ result.push(descriptor);
+ }
+
+ //
+ return result;
+}
+
+//
+// Module Exports ...
+module.exports = {
+ //
+ isDescriptor,
+ toExpression,
+ createDescriptor,
+ extractDescriptors,
+ extractDescriptorsFromContent,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/models/x-const.descriptor.js b/platforms/electron/modules/models/x-const.descriptor.js
new file mode 100644
index 0000000..ae0c3c3
--- /dev/null
+++ b/platforms/electron/modules/models/x-const.descriptor.js
@@ -0,0 +1,354 @@
+//
+//#region Imports ...
+const XFileTools = require('../tools/x-file.tools');
+const XValueTools = require('../tools/x-value.tools');
+const XBaseDescriptor = require('./x-base.descriptor');
+const XContentDescriptor = require('./x-content.descriptor');
+//#endregion
+
+/**
+ * check an object instance is ConstDescriptor or not ...
+ *
+ * @param {any} object proposed object to check ...
+ * @returns
+ */
+function isDescriptor(object) {
+ //
+ if (!object) {
+ return false;
+ }
+
+ //
+ let result = false;
+ result =
+ object.hasOwnProperty('raw') &&
+ object.hasOwnProperty('name') &&
+ object.hasOwnProperty('content') &&
+ object.hasOwnProperty('isExported');
+
+ //
+ return result;
+}
+
+/**
+ * retrieve base or filled ConstDescriptor object instance ...
+ *
+ * @param {any} value a value provider object ...
+ * @returns an instance of ConstDescriptor object ...
+ */
+function createDescriptor(value) {
+ //
+ let result = {
+ raw: '',
+ name: '',
+ type: '',
+ content: {
+ ...XContentDescriptor.createDescriptor()
+ },
+ isExported: false,
+ };
+
+ //
+ //#region Apply Value ...
+ if (value) {
+ //
+ //#region raw ...
+ if (XValueTools.isValidArg(value.raw)) {
+ result.raw = value.raw;
+ }
+ //#endregion
+
+ //
+ //#region name ...
+ if (XValueTools.isValidArg(value.name)) {
+ result.name = value.name;
+ }
+ //#endregion
+
+ //
+ //#region type ...
+ if (XValueTools.isValidArg(value.type)) {
+ result.type = value.type;
+ }
+ //#endregion
+
+ //
+ //#region content ...
+ if (
+ value.content &&
+ XContentDescriptor.isDescriptor(value.content)
+ ) {
+ result.content = { ...value.content };
+ }
+ //#endregion
+
+ //
+ //#region isExported ...
+ if (!!value.isExported) {
+ result.isExported = value.isExported;
+ }
+ //#endregion
+ }
+ //#endregion
+
+ //
+ return result;
+}
+
+/**
+ * converts an instance of Descriptor to Expression ...
+ *
+ * @param descriptor an instance of ConstDescriptor ...
+ * @returns creator string ...
+ */
+function toExpression(descriptor = createDescriptor()) {
+ //
+ let result = '';
+
+ //
+ // Validate Arg ...
+ if (!isDescriptor(descriptor)) {
+ return result;
+ }
+
+ //
+ result += (
+ !!descriptor.isExported ?
+ XBaseDescriptor.ExpressionKeys.Export + ' ' :
+ ''
+ ) +
+ XBaseDescriptor.ExpressionKeys.Const +
+ ' ' +
+ descriptor.name +
+ (
+ XValueTools.isValidArg(descriptor.type) ?
+ ': ' +
+ descriptor.type :
+ ''
+ ) +
+ ' = ';
+
+ //
+ let contentExpression = XContentDescriptor.toExpression(descriptor.content, ':');
+ if (XValueTools.isValidArg(contentExpression)) {
+ result += contentExpression;
+ }
+
+ //
+ result += ';';
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists ConstDescriptors ...
+ *
+ * @param {string} file a file path ...
+ * @returns a collection of ConstDescriptors ...
+ */
+async function extractDescriptors(file = '') {
+ //
+ if (!XFileTools.isFileExists(file)) {
+ return [];
+ }
+
+ //
+ const fileContent = await XFileTools.readFile(file);
+ if (!XValueTools.isValidArg(fileContent)) {
+ return [];
+ }
+
+ //
+ let result = [
+ createDescriptor()
+ ];
+ result.pop();
+
+ //
+ result = extractDescriptorsFromContent(fileContent);
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists ConstDescriptors ...
+ *
+ * @param {string} content a file content ...
+ * @returns a collection of ConstDescriptors ...
+ */
+function extractDescriptorsFromContent(content = '') {
+ //
+ // Prepare result ...
+ let result = [
+ createDescriptor()
+ ];
+ result.pop();
+
+ //
+ // Validate Args ...
+ if (
+ !XValueTools.isValidArg(content) ||
+ !content.includes(XBaseDescriptor.ExpressionKeys.Const)
+ ) {
+ return result;
+ }
+
+ //
+ // Extract all Key Indexes ...
+ const keyIndexes = XBaseDescriptor.
+ extractValidIdentifierIndexes(XBaseDescriptor.ExpressionKeys.Const, content);
+
+ //
+ // Validate Keys Exists on Content ...
+ if (!XValueTools.hasChildArray(keyIndexes)) {
+ return result;
+ }
+
+ //
+ // Loop through indexes ...
+ for (let index of keyIndexes) {
+ //
+ let startIndex = index - 1;
+ let endIndex = index + XBaseDescriptor.ExpressionKeys.Const.length + 1;
+
+ //
+ // create an empty instance of descriptor ...
+ let descriptor = {
+ ...createDescriptor()
+ }
+
+ //
+ //#region Name and Type extractor ...
+ const nameEndIndex = content.indexOf('=', index);
+ identifier = content
+ .substring(index + XBaseDescriptor.ExpressionKeys.Const.length, nameEndIndex)
+ .trim();
+ if (XValueTools.isValidArg(identifier)) {
+ //
+ // Check to Extract Type ...
+ if (identifier.includes(':')) {
+ //
+ startIndex = 0;
+ endIndex = identifier.indexOf(':', startIndex);
+
+ //
+ descriptor.name = identifier
+ .substring(startIndex, endIndex)
+ .trim();
+
+ //
+ // Type extraction ...
+ startIndex = endIndex + 1;
+ descriptor.type = identifier
+ .substring(startIndex)
+ .trim();
+ } else {
+ descriptor.name = identifier;
+ }
+ }
+ //#endregion
+
+ //
+ //#region Extract isExported ...
+ const isExported = XBaseDescriptor.checkIsExported(index, content);
+ descriptor.isExported = isExported;
+ if (isExported) {
+ startIndex = index - XBaseDescriptor.ExpressionKeys.Export.length - 1;
+ } else {
+ startIndex = index;
+ }
+ //#endregion
+
+ //
+ //#region Extract raw content ...
+ identifier = content.substring(startIndex);
+ startIndex = 0;
+ endIndex = XValueTools.findNearestIndex(
+ [
+ ';',
+ '{',
+ '[',
+ '\n'
+ ],
+ identifier,
+ 0 // nameEndIndex - startIndex
+ );
+ const nearestChar = identifier.charAt(endIndex);
+ if (nearestChar === '{') {
+ //
+ const closedItemsIndexes = XValueTools.findClosedContent('{', '}', identifier, endIndex);
+ if (!XValueTools.hasChildArray(closedItemsIndexes)) {
+ continue;
+ }
+
+ //
+ endIndex = closedItemsIndexes[0].end;
+ } else if (nearestChar === '[') {
+ //
+ const closedItemsIndexes = XValueTools.findClosedContent('[', ']', identifier, endIndex);
+ if (!XValueTools.hasChildArray(closedItemsIndexes)) {
+ continue;
+ }
+
+ //
+ endIndex = closedItemsIndexes[0].end;
+ }
+
+ //
+ identifier = identifier
+ .substring(startIndex, endIndex + 1)
+ .trim();
+ if (XValueTools.isValidArg(identifier)) {
+ descriptor.raw = identifier;
+ }
+ //#endregion
+
+ //
+ //#region Parse Content ...
+ startIndex = identifier.indexOf('=', 0);
+ let contentContainer = identifier
+ .substring(startIndex + 1)
+ .trim()
+
+ //
+ // Clear Content ...
+ contentContainer = XBaseDescriptor
+ .clearContent(contentContainer);
+
+ //
+ const contentType = XBaseDescriptor.getContentType(contentContainer);
+ const parsedContents = XBaseDescriptor.parseContent(contentContainer) || [];
+ const contentDescriptor = XContentDescriptor.createDescriptor();
+
+ //
+ contentDescriptor.type = contentType;
+ contentDescriptor.childs = [
+ ...parsedContents
+ ];
+
+ //
+ descriptor.content = {
+ ...contentDescriptor
+ };
+ //#endregion
+
+ //
+ result.push(descriptor);
+ }
+
+ //
+ return result;
+}
+
+//
+// Module Exports ...
+module.exports = {
+ //
+ isDescriptor,
+ toExpression,
+ createDescriptor,
+ extractDescriptors,
+ extractDescriptorsFromContent,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/models/x-content.descriptor.js b/platforms/electron/modules/models/x-content.descriptor.js
new file mode 100644
index 0000000..cc63554
--- /dev/null
+++ b/platforms/electron/modules/models/x-content.descriptor.js
@@ -0,0 +1,154 @@
+//
+//#region Imports ...
+const XValueTools = require('../tools/x-value.tools');
+const XBaseDescriptor = require('./x-base.descriptor');
+const XKeyValueDescriptor = require('./x-key-value.descriptor');
+//#endregion
+
+/**
+ * check an object is valid ContentDescriptor object ...
+ *
+ * @param {any} object proposed object to check ...
+ * @returns
+ */
+function isDescriptor(object) {
+ //
+ let result = false;
+ result = object &&
+ object.hasOwnProperty('type') &&
+ object.hasOwnProperty('childs') &&
+ Array.isArray(object.childs) &&
+ (
+ object.childs.length > 0 ?
+ object.childs.every(ch => XKeyValueDescriptor.isDescriptor(ch)) :
+ true
+ );
+
+ //
+ return result;
+}
+
+/**
+ * converts an instance of Descriptor to Expression ...
+ *
+ * @param descriptor an instance of ContentDescriptor ...
+ * @param {string} assignSymbol property assign symbol ...
+ * @returns creator string ...
+ */
+function toExpression(
+ descriptor = createDescriptor(),
+ assignSymbol = ':',
+ separator = ','
+) {
+ //
+ let result = '';
+
+ //
+ // Validate Arg ...
+ if (!isDescriptor(descriptor)) {
+ return result;
+ }
+
+ //
+ // Normalize Property Assign Symbol ...
+ assignSymbol = !XValueTools.isValidArg(assignSymbol) ?
+ ':' :
+ assignSymbol;
+
+ //
+ const isArrayType = descriptor.type === XBaseDescriptor.ContentTypes.Array;
+ const isObjectType = descriptor.type === XBaseDescriptor.ContentTypes.Object;
+
+ //
+ result += (
+ isObjectType ? '{\n' :
+ isArrayType ? '[\n' :
+ ''
+ );
+
+ //
+ for (let i = 0; i < descriptor.childs.length; i++) {
+ //
+ const keyVal = descriptor.childs[i];
+ const keyValExpression = XKeyValueDescriptor.toExpression(keyVal, assignSymbol);
+
+ //
+ if (separator === ';') {
+ //
+ result += keyValExpression + (
+ i === descriptor.childs.length - 1 ?
+ separator :
+ `${separator}\n`
+ );
+ } else {
+ //
+ result += keyValExpression + (
+ i === descriptor.childs.length - 1 ?
+ '' :
+ `${separator}\n`
+ );
+ }
+ }
+
+ //
+ result += (
+ isObjectType ? '\n}' :
+ isArrayType ? '\n]' :
+ ''
+ );
+
+ //
+ return result;
+}
+
+/**
+ * retrieve base or filled ContentDescriptor object instance ...
+ *
+ * @param {any} value value provider object instance ...
+ * @returns an instance of ContentDescriptor ...
+ */
+function createDescriptor(value) {
+ //
+ let result = {
+ type: XBaseDescriptor.ContentTypes.Unknown,
+ childs: [
+ XKeyValueDescriptor.createDescriptor()
+ ]
+ };
+ result.childs.pop();
+
+ //
+ //#region Apply Value ...
+ if (value) {
+ //
+ //#region type ...
+ if (XBaseDescriptor.isValidContentType(value.type)) {
+ result.type = value.type;
+ }
+ //#endregion
+
+ //
+ //#region childs ...
+ if (
+ XValueTools.hasChildArray(value.childs) &&
+ value.childs.every(ch => XKeyValueDescriptor.isDescriptor(ch))
+ ) {
+ result.childs = [
+ ...value.childs
+ ];
+ }
+ //#endregion
+ }
+ //#endregion
+
+ //
+ return result;
+}
+
+//
+// Module Exports ...
+module.exports = {
+ isDescriptor,
+ toExpression,
+ createDescriptor,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/models/x-decorator.descriptor.js b/platforms/electron/modules/models/x-decorator.descriptor.js
new file mode 100644
index 0000000..e58016c
--- /dev/null
+++ b/platforms/electron/modules/models/x-decorator.descriptor.js
@@ -0,0 +1,1237 @@
+//
+//#region Imports ...
+const XFileTools = require('../tools/x-file.tools');
+const XValueTools = require('../tools/x-value.tools');
+const XBaseDescriptor = require('./x-base.descriptor');
+const XTypeDetectorTools = require('../tools/x-type-detector.tools');
+//#endregion
+
+/**
+ * determines a proposed value is a descriptor or not ...
+ *
+ * @param {any} descriptor the proposed value to check ...
+ * @returns value is a valid descriptor or not ...
+ */
+function isDescriptor(descriptor) {
+ //
+ // Prepare Result ...
+ let result = false;
+
+ //
+ //#region Validate Args ...
+ if (!descriptor) {
+ return result;
+ }
+
+ //
+ const descriptorType = descriptor.type;
+ if (
+ !XValueTools.isValidArg(descriptorType) ||
+ !XBaseDescriptor.isValidDecoratorType(descriptorType)
+ ) {
+ return result;
+ }
+
+ //
+ const descriptorKeys = Object
+ .keys(descriptor)
+ .filter(k => k !== 'raw' && k !== 'type');
+ if (!XValueTools.hasChildArray(descriptorKeys)) {
+ return result;
+ }
+ //#endregion
+
+ //
+ result = descriptorKeys.every(k => XBaseDescriptor
+ .isValidDecoratorPartForType(k, descriptorType));
+
+ //
+ return result;
+}
+
+/**
+ * retrieve base or filled DecoratorDescriptor object instance ...
+ *
+ * @param {any} value a value provider object ...
+ * @returns an instance of DecoratorDescriptor object ...
+ */
+function createDescriptor(value, forceFullProperty = false) {
+ //
+ // Define base Model ...
+ let result = {
+ raw: '',
+ type: '',
+ styles: [],
+ imports: [],
+ exports: [],
+ selector: '',
+ template: '',
+ providers: [],
+ styleUrls: [],
+ bootstrap: [],
+ providedIn: '',
+ templateUrl: '',
+ declarations: [],
+ entryComponents: [],
+ changeDetection: '',
+ };
+
+ //
+ //#region Apply Value ...
+ if (value) {
+ //
+ // Prepare Input Values ...
+ Object.keys(value).forEach(part => {
+ //
+ let partValue = value[part];
+
+ //
+ // Check Part is Valid for Decorator ...
+ if (XBaseDescriptor.isValidDecoratorPart(part)) {
+ //
+ // Retrieve Part Type ...
+ const type = XBaseDescriptor.getDecoratorPartType(part);
+ if (XValueTools.isValidArg(type)) {
+ //
+ switch (type) {
+ //
+ // Array ...
+ case XBaseDescriptor.DecoratorPartTypes.Array:
+ //
+ // Normalize Arrray ...
+ partValue = XValueTools.toNormalArray(partValue);
+
+ //
+ // Add Specific Signs if not have ...
+ // TODO: Complete sorroundation if reqired ...
+ // partValue = partValue.map(pv => {
+ // //
+ // });
+ break;
+
+ //
+ // String ...
+ case XBaseDescriptor.DecoratorPartTypes.String:
+ //
+ // Add Specific Signs if not have ...
+ // TODO: Complete sorroundation if reqired ...
+ break;
+ }
+
+ //
+ value[part] = partValue;
+ }
+ }
+ });
+
+ //
+ //#region raw ...
+ if (XValueTools.isValidArg(value.raw)) {
+ result.raw = value.raw;
+ }
+ //#endregion
+
+ //
+ //#region type ...
+ if (XValueTools.isValidArg(value.type)) {
+ result.type = value.type;
+ }
+ //#endregion
+
+ //
+ //#region styles ...
+ if (XValueTools.hasChildArray(value.styles)) {
+ result.styles = value.styles;
+ } else if (!forceFullProperty) {
+ result.styles = undefined;
+ }
+ //#endregion
+
+ //
+ //#region imports ...
+ if (XValueTools.hasChildArray(value.imports)) {
+ result.imports = value.imports;
+ } else if (!forceFullProperty) {
+ result.imports = undefined;
+ }
+ //#endregion
+
+ //
+ //#region exports ...
+ if (XValueTools.hasChildArray(value.exports)) {
+ result.exports = value.exports;
+ } else if (!forceFullProperty) {
+ result.exports = undefined;
+ }
+ //#endregion
+
+ //
+ //#region selector ...
+ if (XValueTools.isValidArg(value.selector)) {
+ result.selector = value.selector;
+ } else if (!forceFullProperty) {
+ result.selector = undefined;
+ }
+ //#endregion
+
+ //
+ //#region template ...
+ if (XValueTools.isValidArg(value.template)) {
+ result.template = value.template;
+ } else if (!forceFullProperty) {
+ result.template = undefined;
+ }
+ //#endregion
+
+ //
+ //#region providers ...
+ if (XValueTools.hasChildArray(value.providers)) {
+ result.providers = value.providers;
+ } else if (!forceFullProperty) {
+ result.providers = undefined;
+ }
+ //#endregion
+
+ //
+ //#region styleUrls ...
+ if (XValueTools.hasChildArray(value.styleUrls)) {
+ result.styleUrls = value.styleUrls;
+ } else if (!forceFullProperty) {
+ result.styleUrls = undefined;
+ }
+ //#endregion
+
+ //
+ //#region bootstrap ...
+ if (XValueTools.hasChildArray(value.bootstrap)) {
+ result.bootstrap = value.bootstrap;
+ } else if (!forceFullProperty) {
+ result.bootstrap = undefined;
+ }
+ //#endregion
+
+ //
+ //#region providedIn ...
+ if (XValueTools.isValidArg(value.providedIn)) {
+ result.providedIn = value.providedIn;
+ } else if (!forceFullProperty) {
+ result.providedIn = undefined;
+ }
+ //#endregion
+
+ //
+ //#region templateUrl ...
+ if (XValueTools.isValidArg(value.templateUrl)) {
+ result.templateUrl = value.templateUrl;
+ } else if (!forceFullProperty) {
+ result.templateUrl = undefined;
+ }
+ //#endregion
+
+ //
+ //#region declarations ...
+ if (XValueTools.hasChildArray(value.declarations)) {
+ result.declarations = value.declarations;
+ } else if (!forceFullProperty) {
+ result.declarations = undefined;
+ }
+ //#endregion
+
+ //
+ //#region entryComponents ...
+ if (XValueTools.hasChildArray(value.entryComponents)) {
+ result.entryComponents = value.entryComponents;
+ } else if (!forceFullProperty) {
+ result.entryComponents = undefined;
+ }
+ //#endregion
+
+ //
+ //#region changeDetection ...
+ if (XValueTools.isValidArg(value.changeDetection)) {
+ result.changeDetection = value.changeDetection;
+ } else if (!forceFullProperty) {
+ result.changeDetection = undefined;
+ }
+ //#endregion
+ }
+ //#endregion
+
+ //
+ //#region Apply Selection Parts based on Module Type ...
+ if (
+ XValueTools.isValidArg(result.type) &&
+ Object.values(XBaseDescriptor.DecoratorTypes).includes(result.type)
+ ) {
+ //
+ const raw = result.raw;
+ const type = result.type;
+
+ //
+ switch (result.type) {
+ //
+ // Unknown ...
+ case XBaseDescriptor.DecoratorTypes.Unknown:
+ result = undefined;
+ break;
+
+ //
+ // Module ...
+ case XBaseDescriptor.DecoratorTypes.Module:
+ //
+ let validModuleDecorator = {};
+ Object.values(XBaseDescriptor.ModuleDecoratorValidParts).forEach(p => {
+ validModuleDecorator[p] = result[p];
+ });
+
+ //
+ result = {
+ ...validModuleDecorator
+ }
+ break;
+
+ //
+ // Directive ...
+ case XBaseDescriptor.DecoratorTypes.Directive:
+ //
+ let validDirectiveDecorator = {};
+ Object.values(XBaseDescriptor.DirectiveDecoratorValidParts).forEach(p => {
+ validDirectiveDecorator[p] = result[p];
+ });
+
+ //
+ result = {
+ ...validDirectiveDecorator
+ }
+ break;
+
+ //
+ // Component ...
+ case XBaseDescriptor.DecoratorTypes.Component:
+ //
+ let validComponentDecorator = {};
+ Object.values(XBaseDescriptor.ComponentDecoratorValidParts).forEach(p => {
+ validComponentDecorator[p] = result[p];
+ });
+
+ //
+ result = {
+ ...validComponentDecorator
+ }
+ break;
+
+ //
+ // Injectable ...
+ case XBaseDescriptor.DecoratorTypes.Injectable:
+ //
+ let validInjectableDecorator = {};
+ Object.values(XBaseDescriptor.InjectableDecoratorValidParts).forEach(p => {
+ validInjectableDecorator[p] = result[p];
+ });
+
+ //
+ result = {
+ ...validInjectableDecorator
+ }
+ break;
+ }
+
+ //
+ result.raw = raw;
+ result.type = type;
+ }
+ //#endregion
+
+ //
+ //#region remove all undefined keys ...
+ if (value && !forceFullProperty) {
+ //
+ Object.keys(result).forEach(key => {
+ if (!result[key]) {
+ delete result[key];
+ }
+ });
+ }
+ //#endregion
+
+ //
+ return result;
+}
+
+/**
+ * converts an instance of Descriptor to Expression ...
+ *
+ * @param descriptor an instance of DecoratorDescriptor ...
+ * @returns creator string ...
+ */
+function toExpression(descriptor = createDescriptor()) {
+ //
+ let result = '';
+
+ //
+ // Validate Arg ...
+ if (
+ !XBaseDescriptor.isValidDecoratorType(descriptor.type) ||
+ !Object.keys(descriptor).filter(k => k !== 'raw' && k !== 'type').every(key => XBaseDescriptor.isValidDecoratorPartForType(key, descriptor.type))
+ ) {
+ return result;
+ }
+
+ //
+ let decoTypeParam = Object.keys(XBaseDescriptor.DecoratorTypes).find(key => XBaseDescriptor.DecoratorTypes[key] === descriptor.type);
+ if (!XValueTools.isValidArg(decoTypeParam)) {
+ return '';
+ }
+
+ //
+ // Change module to NG Module ...
+ if (decoTypeParam.toLowerCase() === XBaseDescriptor.DecoratorTypes.Module) {
+ decoTypeParam = 'NgModule';
+ }
+
+ //
+ result += '@' + decoTypeParam + '({';
+
+ //
+ // selector ...
+ if (XValueTools.isValidArg(descriptor.selector)) {
+ descriptor.selector = XValueTools.surroundBy('\'', descriptor.selector);
+ }
+
+ //
+ // template ...
+ if (XValueTools.isValidArg(descriptor.template)) {
+ descriptor.template = XValueTools.surroundBy('`', descriptor.template);
+ }
+
+ //
+ // providedIn
+ if (XValueTools.isValidArg(descriptor.providedIn)) {
+ descriptor.providedIn = XValueTools.surroundBy('\'', descriptor.providedIn);
+ }
+
+ //
+ // templateUrl
+ if (XValueTools.isValidArg(descriptor.templateUrl)) {
+ descriptor.templateUrl = XValueTools.surroundBy('\'', descriptor.templateUrl);
+ }
+
+ //
+ const decType = descriptor.type;
+ const decParts = Object.keys(descriptor).filter(k => k !== 'type' && k !== 'raw');
+
+ //
+ // Loop Through Parts and make them to Expression ...
+ for (const part of decParts) {
+ //
+ const partValue = descriptor[part];
+
+ //
+ result += '\n' + part + ': ';
+ if (XTypeDetectorTools.isArray(partValue)) {
+ result += '[ ' + partValue.join(', ') + ' ]';
+ } else {
+ result += partValue;
+ }
+
+ //
+ result += ',';
+ }
+
+ //
+ result += '\n})';
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists DecoratorDescriptors ...
+ *
+ * @param {string} file a file path ...
+ * @returns a collection of DecoratorDescriptors ...
+ */
+async function extractDescriptor(file = '') {
+ //
+ if (!XFileTools.isFileExists(file)) {
+ return [];
+ }
+
+ //
+ const fileContent = await XFileTools.readFile(file);
+ if (!XValueTools.isValidArg(fileContent)) {
+ return [];
+ }
+
+ //
+ let result = [
+ createDescriptor()
+ ];
+ result.pop();
+
+ //
+ result = extractDescriptorFromContent(fileContent);
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists DecoratorDescriptors ...
+ *
+ * @param {string} content a file content ...
+ * @returns a collection of DecoratorDescriptors ...
+ */
+function extractDescriptorFromContent(content = '') {
+ //
+ // Prepare Result ...
+ let result = {
+ ...createDescriptor()
+ }
+
+ //
+ // Validate Args ...
+ if (!XValueTools.isValidArg(content)) {
+ return undefined;
+ }
+
+ //
+ // Check Content must Contains Decorator ...
+ const hasDec = hasDecoratorFromContent(content);
+ if (!hasDec) {
+ return undefined;
+ }
+
+ //
+ // Retrieve Exists Decorator type ...
+ const decType = getDecoratorTypeFromContent(content);
+
+ //
+ // Raw Content of descriptor ...
+ let raw = extractDecoratorContentByContent(
+ content,
+ false
+ );
+ result.raw = raw;
+ result.type = decType;
+
+ //
+ let decoratorContent = extractDecoratorContentByContent(content);
+ if (!XValueTools.isValidArg(decoratorContent)) {
+ return undefined;
+ }
+
+ //
+ switch (decType) {
+ //
+ case XBaseDescriptor.DecoratorTypes.Module:
+ //
+ XBaseDescriptor.ModuleDecoratorValidParts.forEach(key => {
+ //
+ result[key] = XBaseDescriptor.extractDecoratorPart(key, decoratorContent);
+
+ //
+ if (!result[key]) {
+ delete result[key];
+ }
+ });
+ break;
+
+ //
+ case XBaseDescriptor.DecoratorTypes.Component:
+ //
+ XBaseDescriptor.ComponentDecoratorValidParts.forEach(key => {
+ //
+ result[key] = XBaseDescriptor.extractDecoratorPart(key, decoratorContent);
+
+ //
+ if (!result[key]) {
+ delete result[key];
+ }
+ });
+ break;
+
+ //
+ case XBaseDescriptor.DecoratorTypes.Directive:
+ //
+ XBaseDescriptor.DirectiveDecoratorValidParts.forEach(key => {
+ //
+ result[key] = XBaseDescriptor.extractDecoratorPart(key, decoratorContent);
+
+ //
+ if (!result[key]) {
+ delete result[key];
+ }
+ });
+ break;
+
+ //
+ case XBaseDescriptor.DecoratorTypes.Injectable:
+ //
+ XBaseDescriptor.InjectableDecoratorValidParts.forEach(key => {
+ //
+ result[key] = XBaseDescriptor.extractDecoratorPart(key, decoratorContent);
+
+ //
+ if (!result[key]) {
+ delete result[key];
+ }
+ });
+ break;
+
+ //
+ default:
+ result = undefined;
+ break;
+ }
+
+ //
+ // Cleanup Unused Keys ...
+ if (result && XValueTools.hasChildArray(Object.keys(result))) {
+ //
+ Object.keys(result).forEach(key => {
+ //
+ const isArray = XTypeDetectorTools.isArray(result[key]);
+
+ //
+ if (
+ (!isArray && !XValueTools.isValidArg(result[key])) ||
+ (isArray && !XValueTools.hasChildArray(result[key]))
+ ) {
+ delete result[key];
+ }
+ });
+ }
+
+ //
+ return result;
+}
+
+//
+//#region Custom Actions ...
+//
+//#region hasDescriptor ...
+/**
+ * determines a file has decorator or not
+ *
+ * @param {string} file file path ...
+ * @returns {Promise} has decorator or not ...
+ */
+async function hasDecorator(file) {
+ //
+ let result = false;
+
+ //
+ // read file content ..
+ const content = await XFile.readFile(file);
+ result = hasDecoratorFromContent(content);
+
+ //
+ return result;
+}
+
+/**
+ * determines a file content has decorator or not
+ *
+ * @param {string} content file content ...
+ * @returns {boolean} has decorator or not ...
+ */
+function hasDecoratorFromContent(content) {
+ //
+ let result = false;
+
+ //
+ // Validate Args ...
+ if (!XValueTools.isValidArg(content)) {
+ return false;
+ }
+
+ //
+ // read file content ..
+ result = content &&
+ content.length > 1 &&
+ content.includes('@') &&
+ content.includes('({') &&
+ content.includes('})');
+
+ //
+ return result;
+}
+//#endregion
+
+//
+//#region decoratorContent ...
+/**
+ * extract decorator content of specified file ...
+ *
+ * @param {string} file a file path ...
+ * @param {boolean} removeExtras remove all extra chars like comments and whitespaces ...
+ * @returns the content of decorator object ...
+ */
+async function extractDecoratorContent(
+ file,
+ removeExtras = true
+) {
+ //
+ let result = '';
+
+ //
+ // Validate Args ...
+ if (!XFile.isFileExists(file)) {
+ return undefined;
+ }
+
+ //
+ const content = await XFile.readFile(file);
+ result = extractDecoratorContentByContent(content, removeExtras);
+ if (!XValueTools.isValidArg(result)) {
+ return undefined;
+ }
+
+ //
+ return result;
+}
+
+/**
+ * extract decorator content of specified file content ...
+ *
+ * @param {string} content a file content ...
+ * @param {boolean} removeExtras remove all extra chars like comments and whitespaces ...
+ * @returns the content of decorator object ...
+ */
+function extractDecoratorContentByContent(
+ content,
+ removeExtras = true
+) {
+ //
+ let result = '';
+
+ //
+ // check content has decorator or not ...
+ const hasDec = hasDecoratorFromContent(content);
+ if (!hasDec) {
+ return undefined;
+ }
+
+ //
+ // find decorator start and ends indexes ...
+ const sIndex = content.indexOf('({');
+ const lIndex = content.lastIndexOf('})');
+ if (sIndex === -1 || lIndex === -1) {
+ return undefined;
+ }
+
+ //
+ // retrieve decorator content ...
+ result = content
+ .substr(sIndex + 1, (lIndex - sIndex));
+
+ //
+ // remove extra contents from decorator ...
+ if (!!removeExtras) {
+ result = result.split('\n')
+ .filter(line =>
+ !line
+ .trim()
+ .startsWith('//') && line.length > 0)
+ .join('\n');
+ }
+ if (!XValueTools.isValidArg(result)) {
+ return undefined;
+ }
+
+ //
+ // return result ...
+ return result;
+}
+//#endregion
+
+//
+//#region types ...
+/**
+ * determines specific file's decorator type ...
+ *
+ * @param {string} file a file path ...
+ * @returns {Promise} one of DecoratorType object values ...
+ */
+async function getDecoratorType(file) {
+ //
+ let result = XBaseDescriptor.DecoratorTypes.Unknown;
+
+ //
+ const hasDec = await hasDecorator(file);
+ if (!hasDec) {
+ return result;
+ }
+
+ //
+ const content = await XFileTools.readFile(file);
+ result = getDecoratorTypeFromContent(content);
+
+ //
+ return result;
+}
+
+/**
+ * determines specific content's decorator type ...
+ *
+ * @param {string} content a file content ...
+ * @returns {string} one of DecoratorType object values ...
+ */
+function getDecoratorTypeFromContent(content) {
+ //
+ let result = XBaseDescriptor.DecoratorTypes.Unknown;
+
+ //
+ const hasDec = hasDecoratorFromContent(content);
+ if (!hasDec) {
+ return result;
+ }
+
+ //
+ let eIndex = content.indexOf('({');
+
+ //
+ content = content.substr(0, eIndex + 2);
+ eIndex = content.indexOf('({');
+ let sIndex = content.indexOf('@');
+ while (eIndex - sIndex > 20) {
+ sIndex = content.indexOf('@', sIndex + 1);
+ }
+
+ //
+ const typeContent = (content.substr(sIndex + 1, (eIndex - sIndex) - 1)).toLowerCase();
+ if (!typeContent || typeContent.length === 0) {
+ return result;
+ }
+
+ //
+ result = typeContent.includes(XBaseDescriptor.DecoratorTypes.Module) ?
+ XBaseDescriptor.DecoratorTypes.Module :
+ typeContent.includes(XBaseDescriptor.DecoratorTypes.Component) ?
+ XBaseDescriptor.DecoratorTypes.Component :
+ typeContent.includes(XBaseDescriptor.DecoratorTypes.Directive) ?
+ XBaseDescriptor.DecoratorTypes.Directive :
+ typeContent.includes(XBaseDescriptor.DecoratorTypes.Injectable) ?
+ XBaseDescriptor.DecoratorTypes.Injectable :
+ XBaseDescriptor.DecoratorTypes.Unknown;
+
+ //
+ return result;
+}
+
+/**
+ * determines decorator type of an specific file ...
+ *
+ * @param {string} decType determines a type DecoratorTypes ...
+ * @param {string} file destination file to check ...
+ * @returns
+ */
+async function isDecoratorOf(
+ decType,
+ file
+) {
+ //
+ let result = false;
+
+ //
+ // Validate Args ...
+ const availableDecTypes = Object.values(DecoratorTypes);
+ if (
+ !XValueTools.isValidArg(file) ||
+ !XValueTools.isValidArg(decType) ||
+ !availableDecTypes.includes(decType)
+ ) {
+ return false;
+ }
+
+ //
+ // reading file content ...
+ const content = await XFile.readFile(file);
+ if (!XValueTools.isValidArg(content)) {
+ return false;
+ }
+
+ //
+ result = isDecoratorOfFromContent(decType, content);
+ return result;
+}
+
+/**
+ * determines decorator type of a content ...
+ *
+ * @param {string} decType determines a type DecoratorTypes ...
+ * @param {string} content file content to check ...
+ * @returns
+ */
+function isDecoratorOfFromContent(
+ decType,
+ content
+) {
+ //
+ let result = false;
+
+ //
+ // Validate Args ...
+ const availableDecTypes = Object.values(DecoratorTypes);
+ if (
+ !XValueTools.isValidArg(content) ||
+ !XValueTools.isValidArg(decType) ||
+ !availableDecTypes.includes(decType)
+ ) {
+ return false;
+ }
+
+ //
+ const hasDec = hasDecoratorFromContent(content);
+ if (!hasDec) {
+ return false;
+ }
+
+ //
+ const contentDecType = getDecoratorTypeFromContent(content);
+ if (!XValueTools.isValidArg(contentDecType)) {
+ return result;
+ }
+
+ //
+ result = contentDecType === decType;
+ return result;
+}
+
+/**
+ * determine a file is module or not ...
+ *
+ * @param {string} file a file path ...
+ * @returns
+ */
+async function isModule(file) {
+ //
+ const result = await isDecoratorOf(
+ XBaseDescriptor.DecoratorTypes.Module,
+ file
+ );
+
+ //
+ return result;
+}
+
+/**
+ * determine a content is module or not ...
+ *
+ * @param {string} content a file content ...
+ * @returns
+ */
+function isModuleFromContent(content) {
+ //
+ const result = isDecoratorOfFromContent(
+ XBaseDescriptor.DecoratorTypes.Module,
+ content
+ );
+
+ //
+ return result;
+}
+
+/**
+ * determine a file is directive or not ...
+ *
+ * @param {string} file a file path ...
+ * @returns
+ */
+async function isDirective(file) {
+ //
+ const result = await isDecoratorOf(
+ XBaseDescriptor.DecoratorTypes.Directive,
+ file
+ );
+
+ //
+ return result;
+}
+
+/**
+ * determine a content is directive or not ...
+ *
+ * @param {string} content a file content ...
+ * @returns
+ */
+function isDirectiveFromContent(content) {
+ //
+ const result = isDecoratorOfFromContent(
+ XBaseDescriptor.DecoratorTypes.Directive,
+ content
+ );
+
+ //
+ return result;
+}
+
+/**
+ * determine a file is component or not ...
+ *
+ * @param {string} file a file path ...
+ * @returns
+ */
+async function isComponent(file) {
+ //
+ const result = await isDecoratorOf(
+ XBaseDescriptor.DecoratorTypes.Component,
+ file
+ );
+
+ //
+ return result;
+}
+
+/**
+ * determine a content is component or not ...
+ *
+ * @param {string} content a file content ...
+ * @returns
+ */
+function isComponentFromContent(content) {
+ //
+ const result = isDecoratorOfFromContent(
+ XBaseDescriptor.DecoratorTypes.Component,
+ content
+ );
+
+ //
+ return result;
+}
+
+/**
+ * determine a file is injectable or not ...
+ *
+ * @param {string} file a file path ...
+ * @returns
+ */
+async function isInjectable(file) {
+ //
+ const result = await isDecoratorOf(
+ XBaseDescriptor.DecoratorTypes.Injectable,
+ file
+ );
+
+ //
+ return result;
+}
+
+/**
+ * determine a content is injectable or not ...
+ *
+ * @param {string} content a file content ...
+ * @returns
+ */
+function isInjectableFromContent(content) {
+ //
+ const result = isDecoratorOfFromContent(
+ XBaseDescriptor.DecoratorTypes.Injectable,
+ content
+ );
+
+ //
+ return result;
+}
+//#endregion
+
+/**
+ * retrieve required args and update a descriptor based on provided values ...
+ *
+ * @param {any} descriptor an instance of XDecoratorDescriptor object which is source ...
+ * @param {any} updateBy an instance of XDecoratorDescriptor object which used to update source ...
+ * @param {string|string[]} parts selected parts of XDecoratorDescriptor to update manually ...
+ * @param {string|string[]} objects selected objects which inserted into specified parts ...
+ * @returns update source descriptor ...
+ */
+function update(
+ descriptor,
+ updateBy,
+ parts,
+ objects
+) {
+ //
+ // Prepare Result ...
+ let result = createDescriptor(descriptor);
+
+ //
+ //#region Validate Args ...
+ //
+ // Validate descriptor ...
+ if (
+ !descriptor ||
+ !isDescriptor(descriptor)
+ ) {
+ return result;
+ }
+
+ //
+ // Validate Types ...
+ const decType = descriptor.type;
+ if (
+ !XBaseDescriptor.isValidDecoratorType(decType) ||
+ (
+ updateBy &&
+ isDescriptor(updateBy) &&
+ (
+ descriptor.type !== updateBy.type ||
+ !XBaseDescriptor.isValidDecoratorType(updateBy.type)
+ )
+ )
+ ) {
+ return result;
+ }
+ //#endregion
+
+ //
+ //#region Handle UpdateBy ...
+ if (
+ updateBy &&
+ isDescriptor(updateBy)
+ ) {
+ //
+ const descriptorKeys = Object
+ .keys(descriptor)
+ .filter(k => k !== 'raw' && k !== 'type');
+
+ //
+ const updateByKeys = Object
+ .keys(updateBy)
+ .filter(k => k !== 'raw' && k !== 'type');
+
+ //
+ const usedKeysForUpdate = [
+ //
+ // required keys is UpdateBy ...
+ ...updateByKeys,
+ ...descriptorKeys
+ .filter(k => !updateByKeys.includes(k))
+ ];
+
+ //
+ for (const key of usedKeysForUpdate) {
+ //
+ // determines key type ...
+ const isArray = XBaseDescriptor
+ .isDecoratorPartArray(key);
+
+ //
+ // Update key valeu ...
+ result[key] = !isArray ?
+ updateByKeys.includes(key) ?
+ updateBy[key] :
+ descriptor[key] :
+ [
+ ...(
+ XValueTools.hasChildArray(updateBy[key]) ?
+ updateBy[key] :
+ []
+ ),
+ ...(
+ XValueTools
+ .hasChildArray(
+ descriptor[key]) ?
+ descriptor[key] :
+ []
+ )
+ .filter(v => !(
+ XValueTools.hasChildArray(updateBy[key]) ?
+ updateBy[key] :
+ []
+ )
+ .includes(v))
+ ];
+ }
+ }
+ //#endregion
+
+ //
+ //#region Handle Objects and Parts ...
+ if (parts && objects) {
+ //
+ // Normalize Parts ...
+ const normalParts = XValueTools
+ .toNormalArray(parts)
+ .map(r => r.trim())
+ .filter(r =>
+ XValueTools.isValidArg(r) &&
+ XBaseDescriptor.isValidDecoratorPart(r) &&
+ XBaseDescriptor.isValidDecoratorPartForType(r, decType));
+
+ //
+ // Normalize Objects ...
+ const normalObjects = XValueTools
+ .toNormalArray(objects)
+ .map(r => XTypeDetectorTools.isString(r) ?
+ r.trim() :
+ r)
+ .filter(r => XValueTools.isValidArg(r));
+
+ //
+ if (
+ XValueTools.hasChildArray(normalParts) &&
+ XValueTools.hasChildArray(normalObjects)
+ ) {
+ //
+ for (const object of normalObjects) {
+ for (const part of normalParts) {
+ //
+ const isArrayPartType = XBaseDescriptor
+ .isDecoratorPartArray(part);
+ if (!isArrayPartType) {
+ result[part] = object;
+ } else {
+ //
+ result[part] = [
+ ...result[part]
+ .filter(r => r !== object),
+ object
+ ];
+ }
+ }
+ }
+ }
+ }
+ //#endregion
+
+ //
+ return result;
+}
+//#endregion
+
+//
+// Module Exports ...
+module.exports = {
+ //
+ isDescriptor,
+ toExpression,
+ createDescriptor,
+ extractDescriptor,
+ extractDescriptorFromContent,
+
+ //
+ hasDecorator,
+ hasDecoratorFromContent,
+
+ //
+ extractDecoratorContent,
+ extractDecoratorContentByContent,
+
+ //
+ isModule,
+ isDirective,
+ isComponent,
+ isInjectable,
+ isDecoratorOf,
+ getDecoratorType,
+ isModuleFromContent,
+ isDirectiveFromContent,
+ isComponentFromContent,
+ isInjectableFromContent,
+ isDecoratorOfFromContent,
+ getDecoratorTypeFromContent,
+
+ //
+ update,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/models/x-enum.descriptor.js b/platforms/electron/modules/models/x-enum.descriptor.js
new file mode 100644
index 0000000..3a68233
--- /dev/null
+++ b/platforms/electron/modules/models/x-enum.descriptor.js
@@ -0,0 +1,307 @@
+//
+//#region Imports ...
+const XFileTools = require('../tools/x-file.tools');
+const XValueTools = require('../tools/x-value.tools');
+const XBaseDescriptor = require('./x-base.descriptor');
+const XContentDescriptor = require('./x-content.descriptor');
+//#endregion
+
+/**
+ * check an object instance is EnumDescriptor or not ...
+ *
+ * @param {any} object proposed object to check ...
+ * @returns
+ */
+function isDescriptor(object) {
+ //
+ if (!object) {
+ return false;
+ }
+
+ //
+ let result = false;
+ result =
+ object.hasOwnProperty('raw') &&
+ object.hasOwnProperty('name') &&
+ object.hasOwnProperty('content') &&
+ object.hasOwnProperty('isExported');
+
+ //
+ return result;
+}
+
+/**
+ * retrieve base or filled EnumDescriptor object instance ...
+ *
+ * @param {any} value a value provider object ...
+ * @returns an instance of EnumDescriptor object ...
+ */
+function createDescriptor(value) {
+ //
+ let result = {
+ raw: '',
+ name: '',
+ content: {
+ ...XContentDescriptor.createDescriptor()
+ },
+ isExported: false,
+ }
+
+ //
+ //#region Apply Value ...
+ if (value) {
+ //
+ //#region raw ...
+ if (XValueTools.isValidArg(value.raw)) {
+ result.raw = value.raw;
+ }
+ //#endregion
+
+ //
+ //#region name ...
+ if (XValueTools.isValidArg(value.name)) {
+ result.name = value.name;
+ }
+ //#endregion
+
+ //
+ //#region content ...
+ if (
+ value.content &&
+ XContentDescriptor.isDescriptor(value.content)
+ ) {
+ result.content = {
+ ...value.content
+ };
+ }
+ //#endregion
+
+ //
+ //#region isExported ...
+ if (!!value.isExported) {
+ result.isExported = value.isExported;
+ }
+ //#endregion
+ }
+ //#endregion
+
+ //
+ return result;
+}
+
+/**
+ * converts an instance of Descriptor to Expression ...
+ *
+ * @param descriptor an instance of EnumDescriptor ...
+ * @returns creator string ...
+ */
+function toExpression(descriptor = createDescriptor()) {
+ //
+ let result = '';
+
+ //
+ // Validate Arg ...
+ if (!isDescriptor(descriptor)) {
+ return result;
+ }
+
+ //
+ result += (
+ !!descriptor.isExported ?
+ XBaseDescriptor.ExpressionKeys.Export + ' ' :
+ ''
+ ) +
+ XBaseDescriptor.ExpressionKeys.Enum +
+ ' ' +
+ descriptor.name +
+ ' ' +
+ '{';
+
+ //
+ let contentExpression = XContentDescriptor.toExpression(descriptor.content, ' =');
+ if (XValueTools.isValidArg(contentExpression)) {
+ //
+ if (XValueTools.isSurroundedArray(contentExpression)) {
+ contentExpression = XValueTools.clearArraySurround(contentExpression);
+ } else if (XValueTools.isSurroundedObject(contentExpression)) {
+ contentExpression = XValueTools.clearObjectSurround(contentExpression);
+ }
+
+ //
+ if (XValueTools.isValidArg(contentExpression)) {
+ result += contentExpression;
+ }
+ }
+
+ //
+ result += '}';
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists EnumDescriptors ...
+ *
+ * @param {string} file a file path ...
+ * @returns a collection of EnumDescriptor ...
+ */
+async function extractDescriptors(file = '') {
+ //
+ if (!XFileTools.isFileExists(file)) {
+ return [];
+ }
+
+ //
+ const fileContent = await XFileTools.readFile(file);
+ if (!XValueTools.isValidArg(fileContent)) {
+ return [];
+ }
+
+ //
+ let result = [
+ createDescriptor()
+ ];
+ result.pop();
+
+ //
+ result = extractDescriptorsFromContent(fileContent);
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists EnumDescriptors ...
+ *
+ * @param {string} content a file content ...
+ * @returns a collection of EnumDescriptor ...
+ */
+function extractDescriptorsFromContent(content = '') {
+ //
+ // Prepare Result ...
+ let result = [
+ createDescriptor()
+ ];
+ result.pop();
+
+ //
+ // Validate Args ...
+ if (
+ !XValueTools.isValidArg(content) ||
+ !content.includes(XBaseDescriptor.ExpressionKeys.Enum)
+ ) {
+ return result;
+ }
+
+ //
+ // Extract all key Indexes ...
+ const keyIndexes = XBaseDescriptor.
+ extractValidIdentifierIndexes(XBaseDescriptor.ExpressionKeys.Enum, content);
+
+ //
+ // Validate them ...
+ if (!XValueTools.hasChildArray(keyIndexes)) {
+ return result;
+ }
+
+ //
+ // Loop through indexes ...
+ for (const index of keyIndexes) {
+ //
+ let startIndex = index - 1;
+ let endIndex = index + XBaseDescriptor.ExpressionKeys.Enum.length + 1;
+
+ //
+ // create an empty instance of descriptor ...
+ let descriptor = {
+ ...createDescriptor()
+ }
+
+ //
+ //#region Name extractor ...
+ const nameEndIndex = content.indexOf('{', index);
+ identifier = content
+ .substring(index + XBaseDescriptor.ExpressionKeys.Enum.length, nameEndIndex)
+ .trim();
+ if (XValueTools.isValidArg(identifier)) {
+ descriptor.name = identifier;
+ }
+ //#endregion
+
+ //
+ //#region Extract isExported ...
+ const isExported = XBaseDescriptor.checkIsExported(index, content);
+ descriptor.isExported = isExported;
+ if (isExported) {
+ startIndex = index - XBaseDescriptor.ExpressionKeys.Export.length - 1;
+ }
+ //#endregion
+
+ //
+ //#region Extract raw content ...
+ identifier = content.substring(startIndex);
+ let closedContenstIndexes = XValueTools.findClosedContent('{', '}', identifier);
+ if (!XValueTools.hasChildArray(closedContenstIndexes)) {
+ continue;
+ }
+
+ //
+ startIndex = 0;
+ endIndex = closedContenstIndexes[0].end;
+ if (endIndex < 0) {
+ continue;
+ }
+
+ //
+ const raw = identifier.substring(startIndex, endIndex + 1);
+ if (!XValueTools.isValidArg(raw)) {
+ continue;
+ }
+
+ //
+ descriptor.raw = raw;
+ //#endregion
+
+ //
+ //#region Parse Enum Content ...
+ startIndex = closedContenstIndexes[0].start;
+ endIndex = closedContenstIndexes[0].end + 1;
+ let contentContainer = identifier.substring(startIndex, endIndex);
+ contentContainer = XBaseDescriptor.clearContent(contentContainer);
+
+ //
+ const contentType = XBaseDescriptor.getContentType(contentContainer);
+ const parsedContents = XBaseDescriptor.parseContent(contentContainer);
+ const contentDescriptor = XContentDescriptor.createDescriptor();
+
+ //
+ contentDescriptor.type = contentType;
+ contentDescriptor.childs = [
+ ...parsedContents
+ ];
+
+ //
+ descriptor.content = {
+ ...contentDescriptor
+ };
+ //#endregion
+
+ //
+ result.push(descriptor);
+ }
+
+ //
+ return result;
+}
+
+//
+// Moduile Exports ...
+module.exports = {
+ //
+ isDescriptor,
+ toExpression,
+ createDescriptor,
+ extractDescriptors,
+ extractDescriptorsFromContent,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/models/x-export.descriptor.js b/platforms/electron/modules/models/x-export.descriptor.js
new file mode 100644
index 0000000..8b3d9ad
--- /dev/null
+++ b/platforms/electron/modules/models/x-export.descriptor.js
@@ -0,0 +1,480 @@
+//
+//#region Imports ...
+const XFileTools = require('../tools/x-file.tools');
+const XValueTools = require('../tools/x-value.tools');
+const XBaseDescriptor = require('./x-base.descriptor');
+//#endregion
+
+/**
+ * check an object instance is ExportDescriptor or not ...
+ *
+ * @param {any} object proposed object to check ...
+ * @returns
+ */
+function isDescriptor(object) {
+ //
+ if (!object) {
+ return false;
+ }
+
+ //
+ let result = false;
+ result = Array.isArray(object.objects) &&
+ object.hasOwnProperty('raw') &&
+ object.hasOwnProperty('type') &&
+ object.hasOwnProperty('module') &&
+ object.hasOwnProperty('objects');
+
+ //
+ return result;
+}
+
+/**
+ * retrieve base or filled ExportDescriptor object instance ...
+ *
+ * @param {any} value a value provider object ...
+ * @returns an instance of ExportDescriptor object ...
+ */
+function createDescriptor(value) {
+ //
+ let result = {
+ raw: '',
+ type: '',
+ module: '',
+ objects: ['']
+ }
+ result.objects.pop();
+
+ //
+ //#region Apply Value ...
+ if (value) {
+ //
+ //#region raw ...
+ if (XValueTools.isValidArg(value.raw)) {
+ result.raw = value.raw;
+ }
+ //#endregion
+
+ //
+ //#region type ...
+ if (
+ XValueTools.isValidArg(value.type) ||
+ XBaseDescriptor.isValidContentType(value.type)
+ ) {
+ result.type = value.type;
+ }
+ //#endregion
+
+ //
+ //#region module ..
+ if (XValueTools.isValidArg(value.module)) {
+ result.module = value.module;
+ }
+ //#endregion
+
+ //
+ //#region objects ...
+ if (XValueTools.hasChildArray(value.objects)) {
+ result.objects = [
+ ...value.objects
+ ];
+ }
+ //#endregion
+ }
+ //#endregion
+
+ //
+ return result;
+}
+
+/**
+ * converts an instance of Descriptor to Expression ...
+ *
+ * @param descriptor an instance of ExportDescriptor ...
+ * @returns creator string ...
+ */
+function toExpression(descriptor = createDescriptor()) {
+ //
+ let result = '';
+
+ //
+ // Validate Arg ...
+ if (!isDescriptor(descriptor)) {
+ return result;
+ }
+
+ //
+ result += XBaseDescriptor.ExpressionKeys.Export +
+ ' ';
+
+ //
+ //#region objects ...
+ //
+ if (descriptor.type === XBaseDescriptor.ContentTypes.Object) {
+ //
+ let objectsIdentifier = descriptor.objects.join(', ');
+ objectsIdentifier = `{ ${objectsIdentifier} }`;
+
+ //
+ result += objectsIdentifier;
+ } else {
+ result += descriptor.objects[0];
+ }
+
+ //
+ result += ' ';
+ //#endregion
+
+ //
+ //#region module ...
+ result += XBaseDescriptor.ExpressionKeys.From +
+ ' ' +
+ XValueTools.surroundBy('\'', descriptor.module);
+ //#endregion
+
+ //
+ result += ';'
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists ExportDescriptor ...
+ *
+ * @param {string} file a file path ...
+ * @returns a collection of ExportDescriptor ...
+ */
+async function extractDescriptors(file = '') {
+ //
+ if (!XFileTools.isFileExists(file)) {
+ return [];
+ }
+
+ //
+ const fileContent = await XFileTools.readFile(file);
+ if (!XValueTools.isValidArg(fileContent)) {
+ return [];
+ }
+
+ //
+ let result = [
+ createDescriptor()
+ ];
+ result.pop();
+
+ //
+ result = extractDescriptorsFromContent(fileContent);
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists ExportDescriptor ...
+ *
+ * @param {string} content a file content ...
+ * @returns a collection of ExportDescriptor ...
+ */
+function extractDescriptorsFromContent(content = '') {
+ //
+ // Prepare Result ...
+ let result = [
+ createDescriptor()
+ ];
+ result.pop();
+
+ //
+ // Validate Args ...
+ if (
+ !XValueTools.isValidArg(content) ||
+ !content.includes(XBaseDescriptor.ExpressionKeys.Export)
+ ) {
+ return result;
+ }
+
+ //
+ // Extract all key Indexes ...
+ const keyIndexes = XBaseDescriptor.
+ extractValidIdentifierIndexes(XBaseDescriptor.ExpressionKeys.Export, content)
+ .filter(i => {
+ //
+ // Exports ...
+ let startIndex = i;
+ let key = XBaseDescriptor.ExpressionKeys.Exports;
+ let endIndex = startIndex + key.length;
+ let subStr = content.substring(startIndex, endIndex);
+ if (subStr === key) {
+ return false;
+ }
+
+ //
+ // Const ...
+ startIndex = i + XBaseDescriptor.ExpressionKeys.Export.length + 1;
+ key = XBaseDescriptor.ExpressionKeys.Const;
+ endIndex = startIndex + key.length;
+ subStr = content.substring(startIndex, endIndex);
+ if (subStr === key) {
+ return false;
+ }
+
+ //
+ // Enum ...
+ key = XBaseDescriptor.ExpressionKeys.Enum;
+ endIndex = startIndex + key.length;
+ subStr = content.substring(startIndex, endIndex);
+ if (subStr === key) {
+ return false;
+ }
+
+ //
+ // Type ...
+ key = XBaseDescriptor.ExpressionKeys.Type;
+ endIndex = startIndex + key.length;
+ subStr = content.substring(startIndex, endIndex);
+ if (subStr === key) {
+ return false;
+ }
+
+ //
+ // Class ...
+ key = XBaseDescriptor.ExpressionKeys.Class;
+ endIndex = startIndex + key.length;
+ subStr = content.substring(startIndex, endIndex);
+ if (subStr === key) {
+ return false;
+ }
+
+ //
+ // Interface ...
+ key = XBaseDescriptor.ExpressionKeys.Interface;
+ endIndex = startIndex + key.length;
+ subStr = content.substring(startIndex, endIndex);
+ if (subStr === key) {
+ return false;
+ }
+
+ //
+ return true;
+ });
+
+ //
+ // Validate them ...
+ if (!XValueTools.hasChildArray(keyIndexes)) {
+ return result;
+ }
+
+ //
+ // Loop through indexes ...
+ for (const index of keyIndexes) {
+ //
+ // create an empty instance of descriptor ...
+ let descriptor = {
+ ...createDescriptor()
+ }
+
+ //
+ let startIndex = index;
+ let endIndex = XValueTools.findNearestIndex(
+ [
+ ';',
+ '\n'
+ ],
+ content,
+ startIndex
+ );
+ const nearestChar = content.charAt(endIndex);
+ if (nearestChar === ';') {
+ endIndex++;
+ }
+
+ //
+ let identifier = content
+ .substring(startIndex, endIndex)
+ .trim();
+
+ //
+ // Check Identifier must includes FROM ...
+ if (!identifier.includes(XBaseDescriptor.ExpressionKeys.From)) {
+ continue;
+ }
+
+ //
+ //#region raw ...
+ const raw = identifier;
+ descriptor.raw = raw;
+ //#endregion
+
+ //
+ const fromIndex = identifier.indexOf(XBaseDescriptor.ExpressionKeys.From);
+
+ //
+ //#region extracts Objects ...
+ startIndex = XBaseDescriptor.ExpressionKeys.Import.length;
+ endIndex = fromIndex;
+ identifier = identifier
+ .substring(startIndex, endIndex)
+ .trim();
+
+ //
+ // Clear Unused Content ...
+ identifier = XBaseDescriptor.clearContent(identifier);
+
+ //
+ // Clear Also \n ...
+ identifier = XValueTools.clearContent('\n', identifier);
+
+ //
+ if (XValueTools.isSurroundedObject(identifier)) {
+ //
+ // Clear Object Surround ...
+ identifier = XValueTools.clearObjectSurround(identifier);
+
+ //
+ // Extract Imported Objects ...
+ let importedObjects = identifier
+ .split(',')
+ .map(o => o.trim())
+ .filter(o => XValueTools.isValidArg(o));
+
+ //
+ descriptor.type = XBaseDescriptor.ContentTypes.Object;
+ descriptor.objects = [
+ ...importedObjects
+ ];
+ } else {
+ //
+ descriptor.type = XBaseDescriptor.ContentTypes.String;
+ descriptor.objects.push(identifier)
+ }
+ //#endregion
+
+ //
+ //#region Module ...
+ startIndex = fromIndex + XBaseDescriptor.ExpressionKeys.From.length;
+ identifier = raw
+ .substring(startIndex)
+ .trim();
+ identifier = XValueTools.findClosedStrings(identifier)[0].content;
+ if (XValueTools.isSurroundedString(identifier)) {
+ //
+ const surroundSymbol = identifier.charAt(0);
+ identifier = XValueTools.clearSurround(surroundSymbol, identifier);
+ }
+
+ //
+ descriptor.module = identifier;
+ //#endregion
+
+ //
+ result.push(descriptor);
+ }
+
+ //
+ return result;
+}
+
+//
+//#region Custom Actions ...
+function update(
+ descriptors,
+ addOrUpdates
+) {
+ //
+ // Prepare Result ...
+ let result = [createDescriptor()];
+ result.pop();
+
+ //
+ //#region Validate Args ...
+ //
+ // Validate Descriptors ...
+ if (XValueTools.hasChildArray(descriptors)) {
+ //
+ // Validate All Objects is Descriptor ...
+ const isAllIsImport = descriptors.every(d => isDescriptor(d));
+ if (!isAllIsImport) {
+ return result;
+ }
+
+ //
+ result = [
+ ...descriptors
+ ];
+ }
+
+ //
+ // Validate addOrUpdates ...
+ if (XValueTools.hasChildArray(addOrUpdates)) {
+ //
+ // Validate All Objects is Descriptor ...
+ const isAllIsImport = addOrUpdates.every(d => isDescriptor(d));
+ if (!isAllIsImport) {
+ return result;
+ }
+ } else {
+ return result;
+ }
+ //#endregion
+
+ //
+ for (const desc of addOrUpdates) {
+ //
+ // Find same Module if exists ...
+ //
+ let descriptor = createDescriptor(desc);
+
+ //
+ let existsModuleIndex = result.findIndex(d => descriptor.module === d.module);
+ if (existsModuleIndex >= 0) {
+ //
+ descriptor = result[existsModuleIndex];
+ let mustAddObjects = desc.objects.filter(o => o.includes('*') ||
+ !descriptor.objects.includes(o));
+ if (XValueTools.hasChildArray(mustAddObjects)) {
+ descriptor.objects = [
+ ...descriptor.objects,
+ ...mustAddObjects
+ ];
+ }
+
+ //
+ result[existsModuleIndex] = {
+ ...descriptor
+ };
+ } else {
+ //
+ let mustAddObjects = descriptor.objects.filter(o => o.includes('*') ||
+ result
+ .map(d => d.objects)
+ .every(objects => !objects.includes(o))
+ );
+
+ //
+ descriptor.objects = [
+ ...mustAddObjects
+ ];
+
+ //
+ result.push(descriptor);
+ }
+ }
+
+ //
+ return result;
+}
+//#endregion
+
+//
+// Moduile Exports ...
+module.exports = {
+ //
+ isDescriptor,
+ toExpression,
+ createDescriptor,
+ extractDescriptors,
+ extractDescriptorsFromContent,
+
+ //
+ update,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/models/x-file.descriptor.js b/platforms/electron/modules/models/x-file.descriptor.js
new file mode 100644
index 0000000..f893d45
--- /dev/null
+++ b/platforms/electron/modules/models/x-file.descriptor.js
@@ -0,0 +1,353 @@
+//
+//#region Imports ...
+const XFileTools = require('../tools/x-file.tools');
+const XValueTools = require('../tools/x-value.tools');
+const XBaseDescriptor = require('./x-base.descriptor');
+const XEnumDescriptor = require('./x-enum.descriptor');
+const XTypeDescriptor = require('./x-type.descriptor');
+const XClassDescriptor = require('./x-class.descriptor');
+const XConstDescriptor = require('./x-const.descriptor');
+const XImportDescriptor = require('./x-import.descriptor');
+const XExportDescriptor = require('./x-export.descriptor');
+const XInterfaceDescriptor = require('./x-interface.descriptor');
+//#endregion
+
+/**
+ * check an object instance is XFileDescriptor or not ...
+ *
+ * @param {any} object proposed object to check ...
+ * @returns
+ */
+function isDescriptor(object) {
+ //
+ if (!object) {
+ return false;
+ }
+
+ //
+ let result = false;
+ result =
+ Array.isArray(object.types) &&
+ object.hasOwnProperty('types') &&
+ //
+ Array.isArray(object.enums) &&
+ object.hasOwnProperty('enums') &&
+ //
+ Array.isArray(object.consts) &&
+ object.hasOwnProperty('consts') &&
+ //
+ Array.isArray(object.classes) &&
+ object.hasOwnProperty('classes') &&
+ //
+ Array.isArray(object.imports) &&
+ object.hasOwnProperty('imports') &&
+ //
+ Array.isArray(object.exports) &&
+ object.hasOwnProperty('exports') &&
+ //
+ Array.isArray(object.interfaces) &&
+ object.hasOwnProperty('interfaces');
+
+ //
+ return result;
+}
+
+/**
+ * retrieve base or filled XFileDescriptor object instance ...
+ *
+ * @param {any} value a value provider object ...
+ * @returns an instance of XFileDescriptor object ...
+ */
+function createDescriptor(value) {
+ //
+ let result = {
+ types: [XTypeDescriptor.createDescriptor()],
+ enums: [XEnumDescriptor.createDescriptor()],
+ consts: [XConstDescriptor.createDescriptor()],
+ classes: [XClassDescriptor.createDescriptor()],
+ imports: [XImportDescriptor.createDescriptor()],
+ exports: [XExportDescriptor.createDescriptor()],
+ interfaces: [XInterfaceDescriptor.createDescriptor()],
+ };
+
+ //
+ result.types.pop();
+ result.enums.pop();
+ result.consts.pop();
+ result.classes.pop();
+ result.imports.pop();
+ result.exports.pop();
+ result.interfaces.pop();
+
+ //
+ //#region Apply Value ...
+ if (value) {
+ //
+ //#region types ...
+ if (XValueTools.hasChildArray(value.types)) {
+ result.types = [
+ ...value.types
+ ];
+ }
+ //#endregion
+
+ //
+ //#region enums ...
+ if (XValueTools.hasChildArray(value.enums)) {
+ result.enums = [
+ ...value.enums
+ ];
+ }
+ //#endregion
+
+ //
+ //#region consts ...
+ if (XValueTools.hasChildArray(value.consts)) {
+ result.consts = [
+ ...value.consts
+ ];
+ }
+ //#endregion
+
+ //
+ //#region classes ...
+ if (XValueTools.hasChildArray(value.classes)) {
+ result.classes = [
+ ...value.classes
+ ];
+ }
+ //#endregion
+
+ //
+ //#region imports ...
+ if (XValueTools.hasChildArray(value.imports)) {
+ result.imports = [
+ ...value.imports
+ ];
+ }
+ //#endregion
+
+ //
+ //#region exports ...
+ if (XValueTools.hasChildArray(value.exports)) {
+ result.exports = [
+ ...value.exports
+ ];
+ }
+ //#endregion
+
+ //
+ //#region interfaces ...
+ if (XValueTools.hasChildArray(value.interfaces)) {
+ result.interfaces = [
+ ...value.interfaces
+ ];
+ }
+ //#endregion
+ }
+ //#endregion
+
+ //
+ return result;
+}
+
+/**
+ * converts an instance of Descriptor to Expression ...
+ *
+ * @param descriptor an instance of XFileDescriptor ...
+ * @returns creator string ...
+ */
+function toExpression(descriptor = createDescriptor()) {
+ //
+ let result = '';
+
+ //
+ // Validate Arg ...
+ if (!isDescriptor(descriptor)) {
+ return result;
+ }
+
+ //
+ //#region Imports ...
+ if (XValueTools.hasChildArray(descriptor.imports)) {
+ //
+ const expression = descriptor.imports
+ .map(d => XImportDescriptor
+ .toExpression(d)
+ ).join('\n');
+
+ //
+ result += expression + '\n\n';
+ }
+ //#endregion
+
+ //
+ //#region Enums ...
+ if (XValueTools.hasChildArray(descriptor.enums)) {
+ //
+ const expression = descriptor.enums
+ .map(d => XEnumDescriptor
+ .toExpression(d)
+ ).join('\n');
+
+ //
+ result += expression + '\n\n';
+ }
+ //#endregion
+
+ //
+ //#region Types ...
+ if (XValueTools.hasChildArray(descriptor.types)) {
+ //
+ const expression = descriptor.types
+ .map(d => XTypeDescriptor
+ .toExpression(d)
+ ).join('\n');
+
+ //
+ result += expression + '\n\n';
+ }
+ //#endregion
+
+ //
+ //#region Interfaces ...
+ if (XValueTools.hasChildArray(descriptor.interfaces)) {
+ //
+ const expression = descriptor.interfaces
+ .map(d => XInterfaceDescriptor
+ .toExpression(d)
+ ).join('\n');
+
+ //
+ result += expression + '\n\n';
+ }
+ //#endregion
+
+ //
+ //#region Consts ...
+ if (XValueTools.hasChildArray(descriptor.consts)) {
+ //
+ const expression = descriptor.consts
+ .map(d => XConstDescriptor
+ .toExpression(d)
+ ).join('\n');
+
+ //
+ result += expression + '\n\n';
+ }
+ //#endregion
+
+ //
+ //#region Classes ...
+ if (XValueTools.hasChildArray(descriptor.classes)) {
+ //
+ const expression = descriptor.classes
+ .map(d => XClassDescriptor
+ .toExpression(d)
+ ).join('\n');
+
+ //
+ result += expression + '\n\n';
+ }
+ //#endregion
+
+ //
+ //#region Exports ...
+ if (XValueTools.hasChildArray(descriptor.exports)) {
+ //
+ const expression = descriptor.exports
+ .map(d => XExportDescriptor
+ .toExpression(d)
+ ).join('\n');
+
+ //
+ result += expression + '\n\n';
+ }
+ //#endregion
+
+ //
+ if (XValueTools.endsWidth('\n', result)) {
+ result = result.substring(0, result.length - 1);
+ }
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists XFileDescriptors ...
+ *
+ * @param {string} file a file path ...
+ * @returns a collection of XFileDescriptors ...
+ */
+async function extractDescriptor(file = '') {
+ //
+ let result = createDescriptor();
+
+ //
+ if (!XFileTools.isFileExists(file)) {
+ return undefined;
+ }
+
+ //
+ const fileContent = await XFileTools.readFile(file);
+ if (!XValueTools.isValidArg(fileContent)) {
+ return undefined;
+ }
+
+ //
+ result = extractDescriptorFromContent(fileContent);
+ return result;
+}
+
+/**
+ * extract all exists XFileDescriptors ...
+ *
+ * @param {string} content a file content ...
+ * @returns a collection of XFileDescriptors ...
+ */
+function extractDescriptorFromContent(content = '') {
+ //
+ // Prepare result ...
+ let result = createDescriptor();
+
+ //
+ // Validate Args ...
+ if (!XValueTools.isValidArg(content)) {
+ return undefined;
+ }
+
+ //
+ const types = XTypeDescriptor.extractDescriptorsFromContent(content);
+ const enums = XEnumDescriptor.extractDescriptorsFromContent(content);
+ const consts = XConstDescriptor.extractDescriptorsFromContent(content);
+ const classes = XClassDescriptor.extractDescriptorsFromContent(content);
+ const exports = XExportDescriptor.extractDescriptorsFromContent(content);
+ const imports = XImportDescriptor.extractDescriptorsFromContent(content);
+ const interfaces = XInterfaceDescriptor.extractDescriptorsFromContent(content);
+
+ //
+ result = {
+ types,
+ enums,
+ consts,
+ imports,
+ exports,
+ classes,
+ interfaces,
+ };
+
+ //
+ return result;
+}
+
+//
+// Module Exports ...
+module.exports = {
+ //
+ isDescriptor,
+ toExpression,
+ createDescriptor,
+ extractDescriptor,
+ extractDescriptorFromContent,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/models/x-import.descriptor.js b/platforms/electron/modules/models/x-import.descriptor.js
new file mode 100644
index 0000000..d4c575d
--- /dev/null
+++ b/platforms/electron/modules/models/x-import.descriptor.js
@@ -0,0 +1,423 @@
+//
+//#region Imports ...
+const XFileTools = require('../tools/x-file.tools');
+const XValueTools = require('../tools/x-value.tools');
+const XBaseDescriptor = require('./x-base.descriptor');
+//#endregion
+
+/**
+ * check an object instance is ImportDescriptor or not ...
+ *
+ * @param {any} object proposed object to check ...
+ * @returns
+ */
+function isDescriptor(object) {
+ //
+ if (!object) {
+ return false;
+ }
+
+ //
+ let result = false;
+ result = Array.isArray(object.objects) &&
+ object.hasOwnProperty('raw') &&
+ object.hasOwnProperty('type') &&
+ object.hasOwnProperty('module') &&
+ object.hasOwnProperty('objects');
+
+ //
+ return result;
+}
+
+/**
+ * retrieve base or filled ImportDescriptor object instance ...
+ *
+ * @param {any} value a value provider object ...
+ * @returns an instance of ImportDescriptor object ...
+ */
+function createDescriptor(value) {
+ //
+ let result = {
+ raw: '',
+ type: '',
+ module: '',
+ objects: ['']
+ }
+ result.objects.pop();
+
+ //
+ //#region Apply Value ...
+ if (value) {
+ //
+ //#region raw ...
+ if (XValueTools.isValidArg(value.raw)) {
+ result.raw = value.raw;
+ }
+ //#endregion
+
+ //
+ //#region type ...
+ if (
+ XValueTools.isValidArg(value.type) ||
+ XBaseDescriptor.isValidContentType(value.type)
+ ) {
+ result.type = value.type;
+ }
+ //#endregion
+
+ //
+ //#region module ..
+ if (XValueTools.isValidArg(value.module)) {
+ result.module = value.module;
+ }
+ //#endregion
+
+ //
+ //#region objects ...
+ if (XValueTools.hasChildArray(value.objects)) {
+ result.objects = [
+ ...value.objects
+ ];
+ }
+ //#endregion
+ }
+ //#endregion
+
+ //
+ return result;
+}
+
+/**
+ * converts an instance of Descriptor to Expression ...
+ *
+ * @param descriptor an instance of ImportDescriptor ...
+ * @returns creator string ...
+ */
+function toExpression(descriptor = createDescriptor()) {
+ //
+ let result = '';
+
+ //
+ // Validate Arg ...
+ if (!isDescriptor(descriptor)) {
+ return result;
+ }
+
+ //
+ result += XBaseDescriptor.ExpressionKeys.Import +
+ ' ';
+
+ //
+ //#region objects ...
+ //
+ if (descriptor.type === XBaseDescriptor.ContentTypes.Object) {
+ //
+ let objectsIdentifier = descriptor.objects.join(', ');
+ objectsIdentifier = `{ ${objectsIdentifier} }`;
+
+ //
+ result += objectsIdentifier;
+ } else {
+ result += descriptor.objects[0];
+ }
+
+ //
+ result += ' ';
+ //#endregion
+
+ //
+ //#region module ...
+ result += XBaseDescriptor.ExpressionKeys.From +
+ ' ' +
+ XValueTools.surroundBy('\'', descriptor.module);
+ //#endregion
+
+ //
+ result += ';'
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists ImportDescriptor ...
+ *
+ * @param {string} file a file path ...
+ * @returns a collection of ImportDescriptor ...
+ */
+async function extractDescriptors(file = '') {
+ //
+ if (!XFileTools.isFileExists(file)) {
+ return [];
+ }
+
+ //
+ const fileContent = await XFileTools.readFile(file);
+ if (!XValueTools.isValidArg(fileContent)) {
+ return [];
+ }
+
+ //
+ let result = [
+ createDescriptor()
+ ];
+ result.pop();
+
+ //
+ result = extractDescriptorsFromContent(fileContent);
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists ImportDescriptor ...
+ *
+ * @param {string} content a file content ...
+ * @returns a collection of ImportDescriptor ...
+ */
+function extractDescriptorsFromContent(content = '') {
+ //
+ // Prepare Result ...
+ let result = [
+ createDescriptor()
+ ];
+ result.pop();
+
+ //
+ // Validate Args ...
+ if (
+ !XValueTools.isValidArg(content) ||
+ !content.includes(XBaseDescriptor.ExpressionKeys.Import)
+ ) {
+ return result;
+ }
+
+ //
+ // Extract all key Indexes ...
+ const keyIndexes = XBaseDescriptor.
+ extractValidIdentifierIndexes(XBaseDescriptor.ExpressionKeys.Import, content);
+
+ //
+ // Validate them ...
+ if (!XValueTools.hasChildArray(keyIndexes)) {
+ return result;
+ }
+
+ //
+ // Loop through indexes ...
+ for (const index of keyIndexes) {
+ //
+ // create an empty instance of descriptor ...
+ let descriptor = {
+ ...createDescriptor()
+ }
+
+ //
+ let startIndex = index;
+ let endIndex = XValueTools.findNearestIndex(
+ [
+ ';',
+ '\n'
+ ],
+ content,
+ startIndex
+ );
+ const nearestChar = content.charAt(endIndex);
+ if (nearestChar === ';') {
+ endIndex++;
+ }
+
+ //
+ let identifier = content
+ .substring(startIndex, endIndex)
+ .trim();
+
+ //
+ // Check Identifier must includes FROM ...
+ if (!identifier.includes(XBaseDescriptor.ExpressionKeys.From)) {
+ continue;
+ }
+
+ //
+ //#region raw ...
+ const raw = identifier;
+ descriptor.raw = raw;
+ //#endregion
+
+ //
+ const fromIndex = identifier.indexOf(XBaseDescriptor.ExpressionKeys.From);
+
+ //
+ //#region extracts Objects ...
+ startIndex = XBaseDescriptor.ExpressionKeys.Import.length;
+ endIndex = fromIndex;
+ identifier = identifier
+ .substring(startIndex, endIndex)
+ .trim();
+
+ //
+ // Clear Unused Content ...
+ identifier = XBaseDescriptor.clearContent(identifier);
+
+ //
+ // Clear Also \n ...
+ identifier = XValueTools.clearContent('\n', identifier);
+
+ //
+ if (XValueTools.isSurroundedObject(identifier)) {
+ //
+ // Type ...
+ descriptor.type = XBaseDescriptor.ContentTypes.Object;
+
+ //
+ // Clear Object Surround ...
+ identifier = XValueTools.clearObjectSurround(identifier);
+
+ //
+ // Extract Imported Objects ...
+ let importedObjects = identifier
+ .split(',')
+ .map(o => o.trim())
+ .filter(o => XValueTools.isValidArg(o));
+
+ //
+ descriptor.objects = [
+ ...importedObjects
+ ];
+ } else {
+ //
+ descriptor.type = XBaseDescriptor.ContentTypes.String;
+ descriptor.objects.push(identifier)
+ }
+ //#endregion
+
+ //
+ //#region Module ...
+ startIndex = fromIndex + XBaseDescriptor.ExpressionKeys.From.length;
+ identifier = raw
+ .substring(startIndex)
+ .trim();
+ identifier = XValueTools.findClosedStrings(identifier)[0].content;
+ if (XValueTools.isSurroundedString(identifier)) {
+ //
+ const surroundSymbol = identifier.charAt(0);
+ identifier = XValueTools.clearSurround(surroundSymbol, identifier);
+ }
+
+ //
+ descriptor.module = identifier;
+ //#endregion
+
+ //
+ result.push(descriptor);
+ }
+
+ //
+ return result;
+}
+
+//
+//#region Custom Actions ...
+function update(
+ descriptors,
+ addOrUpdates
+) {
+ //
+ // Prepare Result ...
+ let result = [createDescriptor()];
+ result.pop();
+
+ //
+ //#region Validate Args ...
+ //
+ // Validate Descriptors ...
+ if (XValueTools.hasChildArray(descriptors)) {
+ //
+ // Validate All Objects is Descriptor ...
+ const isAllIsImport = descriptors.every(d => isDescriptor(d));
+ if (!isAllIsImport) {
+ return result;
+ }
+
+ //
+ result = [
+ ...descriptors
+ ];
+ }
+
+ //
+ // Validate addOrUpdates ...
+ if (XValueTools.hasChildArray(addOrUpdates)) {
+ //
+ // Validate All Objects is Descriptor ...
+ const isAllIsImport = addOrUpdates.every(d => isDescriptor(d));
+ if (!isAllIsImport) {
+ return result;
+ }
+ } else {
+ return result;
+ }
+ //#endregion
+
+ //
+ for (const desc of addOrUpdates) {
+ //
+ // Find same Module if exists ...
+ //
+ let descriptor = createDescriptor(desc);
+
+ //
+ let existsModuleIndex = result.findIndex(d => descriptor.module === d.module);
+ if (existsModuleIndex >= 0) {
+ //
+ descriptor = result[existsModuleIndex];
+ let mustAddObjects = desc.objects.filter(o => o.includes('*') ||
+ !descriptor.objects.includes(o));
+ if (XValueTools.hasChildArray(mustAddObjects)) {
+ descriptor.objects = [
+ ...descriptor.objects,
+ ...mustAddObjects
+ ];
+ }
+
+ //
+ result[existsModuleIndex] = {
+ ...descriptor
+ };
+ } else {
+ //
+ let mustAddObjects = descriptor.objects
+ .filter(o => o.includes('*') ||
+ result
+ .map(d => d.objects)
+ .every(objects => !objects.includes(o))
+ );
+
+ //
+ descriptor.objects = [
+ ...mustAddObjects
+ ];
+
+ //
+ result.push(descriptor);
+ }
+ }
+
+ //
+ return result;
+}
+//#endregion
+
+//
+// Moduile Exports ...
+module.exports = {
+ //
+ isDescriptor,
+ toExpression,
+ createDescriptor,
+ extractDescriptors,
+ extractDescriptorsFromContent,
+ //
+ update,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/models/x-interface.descriptor.js b/platforms/electron/modules/models/x-interface.descriptor.js
new file mode 100644
index 0000000..12d2058
--- /dev/null
+++ b/platforms/electron/modules/models/x-interface.descriptor.js
@@ -0,0 +1,380 @@
+//
+//#region Imports ...
+const XFileTools = require('../tools/x-file.tools');
+const XValueTools = require('../tools/x-value.tools');
+const XBaseDescriptor = require('./x-base.descriptor');
+const XContentDescriptor = require('./x-content.descriptor');
+//#endregion
+
+/**
+ * check an object instance is InterfaceDescriptor or not ...
+ *
+ * @param {any} object proposed object to check ...
+ * @returns
+ */
+function isDescriptor(object) {
+ //
+ if (!object) {
+ return false;
+ }
+
+ //
+ let result = false;
+ result =
+ object.hasOwnProperty('raw') &&
+ object.hasOwnProperty('name') &&
+ Array.isArray(object.extends) &&
+ object.hasOwnProperty('extends') &&
+ object.hasOwnProperty('isExtended') &&
+ object.hasOwnProperty('isExported');
+
+ //
+ return result;
+}
+
+/**
+ * retrieve base or filled InterfaceDescriptor object instance ...
+ *
+ * @param {any} value a value provider object ...
+ * @returns an instance of InterfaceDescriptor object ...
+ */
+function createDescriptor(value) {
+ //
+ let result = {
+ raw: '',
+ name: '',
+ extends: [''],
+ isExtended: false,
+ isExported: false,
+ properties: {
+ ...XContentDescriptor.createDescriptor()
+ },
+ };
+ result.extends.pop();
+
+ //
+ //#region Apply Value ...
+ if (value) {
+ //
+ //#region raw ...
+ if (XValueTools.isValidArg(value.raw)) {
+ result.raw = value.raw;
+ }
+ //#endregion
+
+ //
+ //#region name ...
+ if (XValueTools.isValidArg(value.name)) {
+ result.name = value.name;
+ }
+ //#endregion
+
+ //
+ //#region isExported ...
+ if (!!value.isExported) {
+ result.isExported = value.isExported;
+ }
+ //#endregion
+
+ //
+ //#region isExtended ...
+ if (!!value.isExtended) {
+ result.isExtended = value.isExtended;
+ }
+ //#endregion
+
+ //
+ //#region extends ...
+ if (XValueTools.hasChildArray(value.extends)) {
+ result.extends = [
+ ...value.extends
+ ];
+ }
+ //#endregion
+
+ //
+ //#region properties ...
+ if (
+ value.properties &&
+ XContentDescriptor.isDescriptor(value.properties)
+ ) {
+ result.properties = {
+ ...value.properties
+ };
+ }
+ //#endregion
+ }
+ //#endregion
+
+ //
+ return result;
+}
+
+/**
+ * converts an instance of Descriptor to Expression ...
+ *
+ * @param descriptor an instance of InterfaceDescriptor ...
+ * @returns creator string ...
+ */
+function toExpression(descriptor = createDescriptor()) {
+ //
+ let result = '';
+
+ //
+ // Validate Arg ...
+ if (!isDescriptor(descriptor)) {
+ return result;
+ }
+
+ //
+ result += (
+ !!descriptor.isExported ?
+ XBaseDescriptor.ExpressionKeys.Export + ' ' :
+ ''
+ ) +
+ XBaseDescriptor.ExpressionKeys.Interface +
+ ' ' +
+ descriptor.name +
+ ' ' +
+ (
+ !!descriptor.isExtended &&
+ XValueTools.hasChildArray(descriptor.extends) ?
+ XBaseDescriptor.ExpressionKeys.Extends +
+ ' ' +
+ descriptor.extends.join(', ') +
+ ' ' :
+ ''
+ );
+
+ //
+ let contentExpression = XContentDescriptor.toExpression(descriptor.properties, ':', ';');
+ if (XValueTools.isValidArg(contentExpression)) {
+ result += contentExpression;
+ }
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists InterfaceDescriptors ...
+ *
+ * @param {string} file a file path ...
+ * @returns a collection of InterfaceDescriptors ...
+ */
+async function extractDescriptors(file = '') {
+ //
+ if (!XFileTools.isFileExists(file)) {
+ return [];
+ }
+
+ //
+ const fileContent = await XFileTools.readFile(file);
+ if (!XValueTools.isValidArg(fileContent)) {
+ return [];
+ }
+
+ //
+ let result = [
+ createDescriptor()
+ ];
+ result.pop();
+
+ //
+ result = extractDescriptorsFromContent(fileContent);
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists InterfaceDescriptors ...
+ *
+ * @param {string} content a file content ...
+ * @returns a collection of InterfaceDescriptors ...
+ */
+function extractDescriptorsFromContent(content = '') {
+ //
+ // Prepare result ...
+ let result = [
+ createDescriptor()
+ ];
+ result.pop();
+
+ //
+ // Validate Args ...
+ if (
+ !XValueTools.isValidArg(content) ||
+ !content.includes(XBaseDescriptor.ExpressionKeys.Interface)
+ ) {
+ return result;
+ }
+
+ //
+ // Extract all Key Indexes ...
+ const keyIndexes = XBaseDescriptor.
+ extractValidIdentifierIndexes(XBaseDescriptor.ExpressionKeys.Interface, content);
+
+ //
+ // Validate Keys Exists on Content ...
+ if (!XValueTools.hasChildArray(keyIndexes)) {
+ return result;
+ }
+
+ //
+ // Loop through indexes ...
+ for (let index of keyIndexes) {
+ //
+ let startIndex = index - 1;
+ let endIndex = index + XBaseDescriptor.ExpressionKeys.Interface.length + 1;
+
+ //
+ // create an empty instance of descriptor ...
+ let descriptor = {
+ ...createDescriptor()
+ }
+
+ //
+ //#region Extract isExported ...
+ const isExported = XBaseDescriptor.checkIsExported(index, content);
+ descriptor.isExported = isExported;
+ if (isExported) {
+ startIndex = index - XBaseDescriptor.ExpressionKeys.Export.length - 1;
+ } else {
+ startIndex = index;
+ }
+ //#endregion
+
+ //
+ // Closed Item ...
+ let closedContents = XValueTools.findClosedContent('{', '}', content, index);
+ if (!XValueTools.hasChildArray(closedContents)) {
+ continue;
+ }
+
+ //
+ let interfaceContentIndexer = closedContents[0];
+ endIndex = interfaceContentIndexer.start - 1;
+
+ //
+ identifier = content
+ .substring(startIndex, endIndex)
+ .trim();
+
+ //
+ //#region extract Name, Extends ...
+ let name = '';
+ let nameCandidate = identifier
+ .replace(XBaseDescriptor.ExpressionKeys.Export, '')
+ .replace(XBaseDescriptor.ExpressionKeys.Interface, '')
+ .trim();
+ let extendsIdentifiers = nameCandidate;
+ if (nameCandidate.includes(XBaseDescriptor.ExpressionKeys.Extends)) {
+ //
+ // Name ...
+ let nameEndIndex = nameCandidate.indexOf(XBaseDescriptor.ExpressionKeys.Extends);
+ nameCandidate = nameCandidate
+ .substring(0, nameEndIndex)
+ .trim();
+
+ //
+ //isExtended ...
+ descriptor.isExtended = true;
+ extendsIdentifiers = extendsIdentifiers
+ .substring(nameEndIndex + XBaseDescriptor.ExpressionKeys.Extends.length)
+ .trim();
+
+ //
+ if (
+ !XValueTools.isValidArg(nameCandidate) ||
+ !XValueTools.isValidArg(extendsIdentifiers)
+ ) {
+ continue;
+ }
+
+ //
+ // Extends ...
+ descriptor.extends = [
+ ...extendsIdentifiers
+ .split(',')
+ .map(e => e.trim())
+ .filter(e => XValueTools.isValidArg(e))
+ ];
+
+ //
+ name = nameCandidate;
+ } else {
+ name = nameCandidate;
+ }
+
+ //
+ if (!XValueTools.isValidArg(name)) {
+ continue;
+ }
+
+ //
+ descriptor.name = name;
+ //#endregion
+
+ //
+ //#region extract Content ...
+ let contentContainer = interfaceContentIndexer.content;
+
+ //
+ // Clear Content ...
+ contentContainer = XBaseDescriptor
+ .clearContent(contentContainer);
+
+ //
+ const contentType = XBaseDescriptor.getContentType(contentContainer);
+ const parsedContents = XBaseDescriptor.parseContent(
+ contentContainer,
+ true
+ );
+ const contentDescriptor = XContentDescriptor.createDescriptor();
+
+ //
+ contentDescriptor.type = contentType;
+ contentDescriptor.childs = [
+ ...parsedContents
+ ];
+
+ //
+ descriptor.properties = {
+ ...contentDescriptor
+ }
+ //#endregion
+
+ //
+ //#region Extract raw content ...
+ //
+ endIndex = interfaceContentIndexer.end + 1;
+ identifier = content
+ .substring(startIndex, endIndex)
+ .trim();
+ if (!XValueTools.isValidArg(identifier)) {
+ continue;
+ }
+
+ //
+ descriptor.raw = identifier;
+ //#endregion
+
+ //
+ result.push(descriptor);
+ }
+
+ //
+ return result;
+}
+
+//
+// Module Exports ...
+module.exports = {
+ //
+ isDescriptor,
+ toExpression,
+ createDescriptor,
+ extractDescriptors,
+ extractDescriptorsFromContent,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/models/x-key-value.descriptor.js b/platforms/electron/modules/models/x-key-value.descriptor.js
new file mode 100644
index 0000000..2e20ca8
--- /dev/null
+++ b/platforms/electron/modules/models/x-key-value.descriptor.js
@@ -0,0 +1,118 @@
+//
+//#region Imports ...
+const XValueTools = require('../tools/x-value.tools');
+const XBaseDescriptor = require('./x-base.descriptor');
+//#endregion
+
+/**
+ * check an object is valid key/value object ...
+ * @param {any} object proposed object to check ...
+ * @returns
+ */
+function isDescriptor(object) {
+ //
+ let result = false;
+ result = object &&
+ object.hasOwnProperty('key') &&
+ object.hasOwnProperty('type') &&
+ object.hasOwnProperty('value');
+
+ //
+ return result;
+}
+
+/**
+ * retrieve base or filled KeyValueProvider object instance ...
+ *
+ * @param {any} value value provider object instance ...
+ * @returns an instance of KeyValueDescriptor ...
+ */
+function createDescriptor(value) {
+ //
+ const result = {
+ key: '',
+ value: undefined,
+ type: XBaseDescriptor.ContentTypes.Unknown,
+ };
+
+ //
+ //#region Apply Value ...
+ if (value) {
+ //
+ //#region key ...
+ if (XValueTools.isValidArg(value.key)) {
+ result.key = value.key;
+ }
+ //#endregion
+
+ //
+ //#region type ...
+ if (
+ XValueTools.isValidArg(value.type) &&
+ XBaseDescriptor.isValidContentType(value.type)
+ ) {
+ result.type = value.type;
+ }
+ //#endregion
+
+ //
+ //#region value ...
+ if (value.value) {
+ result.value = value.value;
+ }
+ //#endregion
+ }
+ //#endregion
+
+ //
+ return result;
+}
+
+/**
+ * converts an instance of Descriptor to Expression ...
+ *
+ * @param descriptor an instance of KeyValueDescriptor ...
+ * @param {string} assignSymbol property assign symbol ...
+ * @returns creator string ...
+ */
+function toExpression(
+ descriptor = createDescriptor(),
+ assignSymbol = ''
+) {
+ //
+ let result = '';
+
+ //
+ // Validate Args ...
+ if (!isDescriptor(descriptor)) {
+ return result;
+ }
+
+ //
+ // Normalize Assign Symbol ...
+ assignSymbol = !XValueTools.isValidArg(assignSymbol) ?
+ '' :
+ assignSymbol;
+
+ //
+ // Handle Key ...
+ if (descriptor.key !== XBaseDescriptor.ExpressionKeys.IGNORED_KEY) {
+ result += descriptor.key + assignSymbol + ' ';
+ }
+
+ //
+ // Handle Value ...
+ const valueExpression = XBaseDescriptor.toExpression(descriptor);
+ result += valueExpression;
+
+ //
+ return result;
+}
+
+//
+// Module Exports ...
+module.exports = {
+ isDescriptor,
+ toExpression,
+ createDescriptor,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/models/x-localization.descriptor.js b/platforms/electron/modules/models/x-localization.descriptor.js
new file mode 100644
index 0000000..8f7f4db
--- /dev/null
+++ b/platforms/electron/modules/models/x-localization.descriptor.js
@@ -0,0 +1,527 @@
+//
+//#region Imports ...
+const XFileTools = require('../tools/x-file.tools');
+const XValueTools = require('../tools/x-value.tools');
+const XBaseDescriptor = require('./x-base.descriptor');
+const XConstDescriptor = require('./x-const.descriptor');
+const XContentDescriptor = require('./x-content.descriptor');
+//#endregion
+
+//
+//#region Constants ...
+/**
+ * all possible usage of localeResources ...
+ */
+const LocalizationResourceIdentifiers = {
+ ResourceIDs: 'ResourceIDs.',
+ XResourceIDs: 'XResourceIDs.',
+ XAppResourceIDs: 'AppResourceIDs.',
+ ThisResourceIDs: 'this.ResourceIDs.',
+ ThisAppResourceIDs: 'this.AppResourceIDs.',
+};
+//#endregion
+
+//
+//#region ResourceIDsDescriptor ...
+/**
+ * check an object instance is ResourceIDsDescriptor or not ...
+ *
+ * @param {any} object proposed object to check ...
+ * @returns
+ */
+function isResourceIDsDescriptor(object) {
+ //
+ if (!object) {
+ return false;
+ }
+
+ //
+ let result = false;
+ result =
+ object.hasOwnProperty('resourceIds') &&
+ object.hasOwnProperty('appResourceIds') &&
+ Array.isArray(object.resourceIds) &&
+ Array.isArray(object.appResourceIds);
+
+ //
+ return result;
+}
+
+/**
+ * retrieve base or filled ResourceIDsDescriptor object instance ...
+ *
+ * @param {any} value a value provider object ...
+ * @returns an instance of ResourceIDsDescriptor object ...
+ */
+function createResourceIDsDescriptor(value) {
+ //
+ let result = {
+ resourceIds: [''],
+ appResourceIds: ['']
+ }
+ result.resourceIds.pop();
+ result.appResourceIds.pop();
+
+ //
+ //#region Apply Value ...
+ if (value) {
+ //
+ //#region ResourceIDs ...
+ if (XValueTools.hasChildArray(value.resourceIds)) {
+ result.resourceIds = [
+ ...value.resourceIds
+ ];
+ }
+ //#endregion
+
+ //
+ //#region appResourceIds ...
+ if (XValueTools.hasChildArray(value.appResourceIds)) {
+ result.appResourceIds = [
+ ...value.appResourceIds
+ ];
+ }
+ //#endregion
+ }
+ //#endregion
+
+ //
+ return result;
+}
+
+/**
+ * extract exists used ResourceIds form files ...
+ *
+ * @param {string|string[]} files a file(s) path ...
+ * @returns an instance of ResourceIDsDescriptor ...
+ */
+async function extractResourceIDsDescriptor(files) {
+ //
+ // Prepare Result ...
+ let result = createResourceIDsDescriptor();
+
+ //
+ // Normalize Files ...
+ const normalFiles = XValueTools.toNormalArray(files);
+
+ //
+ // Validate Args ...
+ if (
+ !XValueTools.hasChildArray(normalFiles) ||
+ !normalFiles.every(file => XFileTools.isFileExists(file))
+ ) {
+ return result;
+ }
+
+ //
+ const readFileContentTasks = normalFiles.map(file => XFileTools.readFile(file));
+ const fileContents = await Promise.all(readFileContentTasks);
+ if (!XValueTools.hasChildArray(fileContents)) {
+ return result;
+ }
+
+ //
+ result = extractResourceIDsDescriptorFromContent(fileContents);
+
+ //
+ return result;
+}
+
+/**
+ * extract exists ResourceIDsDescriptor from file contents ...
+ *
+ * @param {string|string[]} contents a file(s) content(s) ...
+ * @returns an instance of ResourceIDsDescriptor ...
+ */
+function extractResourceIDsDescriptorFromContent(contents) {
+ //
+ // Prepare Result ...
+ let result = createResourceIDsDescriptor();
+
+ //
+ // Validate Args ...
+ if (!contents) {
+ return result;
+ }
+
+ //
+ // Normalize Contents ...
+ const normalContents = XValueTools
+ .toNormalArray(contents)
+ .map(c => c.trim())
+ .filter(c => XValueTools.isValidArg(c));
+ if (!XValueTools.hasChildArray(normalContents)) {
+ return result;
+ }
+
+ //
+ // Loop through all normal contents and extract result ...
+ for (const content of normalContents) {
+ //
+ // Find all indexes in File for eachType ...
+ const indexes = XValueTools.findAllIndexes(
+ Object.values(LocalizationResourceIdentifiers),
+ content
+ );
+ if (!XValueTools.hasChildArray(indexes)) {
+ continue;
+ }
+
+ //
+ // Try to Parse Content by indexes ...
+ for (const idx of indexes) {
+ //
+ let identifierToken = content.substring(idx, idx + LocalizationResourceIdentifiers.ThisAppResourceIDs.length);
+ if (identifierToken.includes(LocalizationResourceIdentifiers.ThisAppResourceIDs)) {
+ identifierToken = identifierToken.includes(LocalizationResourceIdentifiers.ThisAppResourceIDs);
+ } else if (identifierToken.includes(LocalizationResourceIdentifiers.ThisResourceIDs)) {
+ identifierToken = LocalizationResourceIdentifiers.ThisResourceIDs;
+ } else if (identifierToken.includes(LocalizationResourceIdentifiers.XAppResourceIDs)) {
+ identifierToken = LocalizationResourceIdentifiers.XAppResourceIDs;
+ } else if (identifierToken.includes(LocalizationResourceIdentifiers.XResourceIDs)) {
+ identifierToken = LocalizationResourceIdentifiers.XResourceIDs;
+ } else if (identifierToken.includes(LocalizationResourceIdentifiers.ResourceIDs)) {
+ identifierToken = LocalizationResourceIdentifiers.ResourceIDs;
+ } else {
+ identifierToken = undefined;
+ }
+
+ //
+ if (!XValueTools.isValidArg(identifierToken)) {
+ continue;
+ }
+
+ //
+ let endIndex = XValueTools.findNearestIndex(
+ [
+ ';',
+ '\"',
+ ',',
+ ' ',
+ ')',
+ '\n'
+ ],
+ content,
+ idx,
+ true
+ );
+
+ //
+ const identifier = content
+ .substring(idx, endIndex)
+ .replace(identifierToken, '');
+ if (XValueTools.isValidArg(identifier)) {
+ //
+ switch (identifierToken) {
+ //
+ // ResourceIDs ...
+ case LocalizationResourceIdentifiers.ResourceIDs:
+ case LocalizationResourceIdentifiers.XResourceIDs:
+ case LocalizationResourceIdentifiers.ThisResourceIDs:
+ if (!result.resourceIds.includes(identifier)) {
+ result.resourceIds.push(identifier);
+ }
+ break;
+
+ //
+ // AppResourceIDs ...
+ case LocalizationResourceIdentifiers.XAppResourceIDs:
+ case LocalizationResourceIdentifiers.ThisAppResourceIDs:
+ if (!result.appResourceIds.includes(identifier)) {
+ result.appResourceIds.push(identifier);
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ //
+ return result;
+}
+//#endregion
+
+//
+//#region LocaleResourceItemDescriptor ...
+function isLocaleResourceItemDescriptor(value) {
+ //
+ let result = false;
+
+ //
+ result = value &&
+ value.hasOwnProperty('id') &&
+ value.hasOwnProperty('value');
+
+ //
+ return result;
+}
+
+function createLocaleResourceItemDescriptor(value) {
+ //
+ let result = {
+ id: '',
+ value: ''
+ };
+
+ //
+ //#region Apply Value ...
+ if (value) {
+ //
+ //#region id ...
+ if (XValueTools.isValidArg(value.id)) {
+ result.id = value.id;
+ }
+ //#endregion
+
+ //
+ //#region value ...
+ if (XValueTools.isValidArg(value.value)) {
+ result.value = value.value;
+ }
+ //#endregion
+ }
+ //#endregion
+
+ //
+ return result;
+}
+//#endregion
+
+//
+//#region LocalizationDescriptor ...
+function isLocalizationDescriptor(value) {
+ //
+ let result = false;
+
+ //
+ result = value &&
+ value.hasOwnProperty('name') &&
+ value.hasOwnProperty('locale') &&
+ value.hasOwnProperty('language') &&
+ value.hasOwnProperty('direction') &&
+ value.hasOwnProperty('resources') &&
+ Array.isArray(value.resources) &&
+ (XValueTools.hasChildArray(value.resources) ?
+ value.resources.every(r => isLocaleResourceItemDescriptor(r)) : true);
+
+ //
+ return result;
+}
+
+function createLocalizationDescriptor(value) {
+ //
+ let result = {
+ name: '',
+ locale: '',
+ language: '',
+ direction: '',
+ resources: [
+ createLocaleResourceItemDescriptor()
+ ]
+ };
+ result.resources.pop();
+
+ //
+ //#region Apply Value ...
+ if (value) {
+ //
+ //#region name ...
+ if (XValueTools.isValidArg(value.name)) {
+ result.name = value.name;
+ }
+ //#endregion
+
+ //
+ //#region locale ...
+ if (XValueTools.isValidArg(value.locale)) {
+ result.locale = value.locale;
+ }
+ //#endregion
+
+ //
+ //#region language ...
+ if (XValueTools.isValidArg(value.language)) {
+ result.language = value.language;
+ }
+ //#endregion
+
+ //
+ //#region direction ...
+ if (XValueTools.isValidArg(value.direction)) {
+ result.direction = value.direction;
+ }
+ //#endregion
+
+ //
+ //#region resources ...
+ if (
+ XValueTools.hasChildArray(value.resources) &&
+ value.resources.every(r => isLocaleResourceItemDescriptor(r))
+ ) {
+ result.resources = [
+ ...value.resources
+ ];
+ }
+ //#endregion
+ }
+ //#endregion
+
+ //
+ return result;
+}
+
+function extractLocalizationDescriptors(
+ constDescriptor = XConstDescriptor.createDescriptor()
+) {
+ //
+ let result = [
+ createLocalizationDescriptor()
+ ];
+ result.pop();
+
+ //
+ // Validate Args ...
+ if (
+ !constDescriptor ||
+ !XConstDescriptor.isDescriptor(constDescriptor) ||
+ !XValueTools.hasChildArray(constDescriptor.content.childs)
+ ) {
+ return result;
+ }
+
+ //
+ // extract childs of content ...
+ for (const child of constDescriptor.content.childs) {
+ //
+ const localizationDescriptor = createLocalizationDescriptor();
+ for (const value of child.value) {
+ //
+ if (value.key !== 'resources') {
+ localizationDescriptor[value.key] = XValueTools.toStringExpression(value.value);
+ } else {
+ localizationDescriptor[value.key] = value.value.map(v => {
+ //
+ const id = XValueTools
+ .toStringExpression(
+ v.value.find(
+ vv => vv.key === 'id')?.value
+ );
+
+ //
+ const value = XValueTools
+ .toStringExpression(
+ v.value.find(
+ vv => vv.key === 'value')?.value
+ );
+
+ //
+ const result = createLocaleResourceItemDescriptor({
+ id,
+ value,
+ });
+
+ //
+ return result;
+ });
+ }
+ }
+
+ //
+ result.push(localizationDescriptor);
+ }
+
+ //
+ return result;
+}
+//#endregion
+
+//
+//#region ResourceIDUsedCase ...
+/**
+ * create an empty/filled LocaleResourceIDUsedCaseDescriptor object instance ...
+ *
+ * @param {any} value value provider for filling ...
+ * @returns an instance of Specific Descriptor ...
+ */
+function createLocaleResourceIDUsedCaseDescriptor(value) {
+ //
+ // Prepare Result ...
+ let result = {
+ resourceID: '',
+ usedCases: [
+ ''
+ ],
+ };
+ result.usedCases.pop();
+
+ //
+ //#region Apply Value ...
+ if (value) {
+ //
+ //#region resourceID ...
+ if (XValueTools.isValidArg(value.resourceID)) {
+ result.resourceID = value.resourceID;
+ }
+ //#endregion
+
+ //
+ //#region usedCases ...
+ if (XValueTools.hasChildArray(value.usedCases)) {
+ result.usedCases = [
+ ...value.usedCases
+ ];
+ }
+ //#endregion
+ }
+ //#endregion
+
+ //
+ return result;
+}
+
+/**
+ * check an object is LocaleResourceIDUsedCaseDescriptor instance or not ...
+ *
+ * @param {any} value proposed object to check ...
+ * @returns
+ */
+function isLocaleResourceIDUsedCaseDescriptor(value) {
+ //
+ let result = false;
+
+ //
+ result = value &&
+ value.hasOwnProperty('resourceID') &&
+ value.hasOwnProperty('usedCases') &&
+ Array.isArray(value.usedCases);
+
+ //
+ return result;
+}
+//#endregion
+
+//
+// Moduile Exports ...
+module.exports = {
+ //
+ LocalizationResourceIdentifiers,
+
+ //
+ isResourceIDsDescriptor,
+ createResourceIDsDescriptor,
+ extractResourceIDsDescriptor,
+ extractResourceIDsDescriptorFromContent,
+
+ //
+ isLocaleResourceItemDescriptor,
+ createLocaleResourceItemDescriptor,
+
+ //
+ isLocalizationDescriptor,
+ createLocalizationDescriptor,
+ extractLocalizationDescriptors,
+
+ //
+ isLocaleResourceIDUsedCaseDescriptor,
+ createLocaleResourceIDUsedCaseDescriptor,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/models/x-type.descriptor.js b/platforms/electron/modules/models/x-type.descriptor.js
new file mode 100644
index 0000000..5c14ed5
--- /dev/null
+++ b/platforms/electron/modules/models/x-type.descriptor.js
@@ -0,0 +1,279 @@
+//
+//#region Imports ...
+const XFileTools = require('../tools/x-file.tools');
+const XValueTools = require('../tools/x-value.tools');
+const XBaseDescriptor = require('./x-base.descriptor');
+//#endregion
+
+/**
+ * check an object instance is typeDescriptor or not ...
+ *
+ * @param {any} object proposed object to check ...
+ * @returns
+ */
+function isDescriptor(object) {
+ //
+ if (!object) {
+ return false;
+ }
+
+ //
+ let result = false;
+ result =
+ object.hasOwnProperty('raw') &&
+ object.hasOwnProperty('name') &&
+ object.hasOwnProperty('content') &&
+ object.hasOwnProperty('isExported');
+
+ //
+ return result;
+}
+
+/**
+ * retrieve base or filled TypeDescriptor object instance ...
+ *
+ * @param {any} value a value provider object ...
+ * @returns an instance of TypeDescriptor object ...
+ */
+function createDescriptor(value) {
+ //
+ let result = {
+ raw: '',
+ name: '',
+ content: '',
+ isExported: false,
+ };
+
+ //
+ //#region Apply Value ...
+ if (value) {
+ //
+ //#region raw ...
+ if (XValueTools.isValidArg(value.raw)) {
+ result.raw = value.raw;
+ }
+ //#endregion
+
+ //
+ //#region name ...
+ if (XValueTools.isValidArg(value.name)) {
+ result.name = value.name;
+ }
+ //#endregion
+
+ //
+ //#region content ...
+ if (XValueTools.isValidArg(value.content)) {
+ result.content = value.content;
+ }
+ //#endregion
+
+ //
+ //#region isExported ...
+ if (!!value.isExported) {
+ result.isExported = true;
+ }
+ //#endregion
+ }
+ //#endregion
+
+ //
+ return result;
+}
+
+/**
+ * converts an instance of Descriptor to Expression ...
+ *
+ * @param descriptor an instance of TypeDescriptor ...
+ * @returns creator string ...
+ */
+function toExpression(descriptor = createDescriptor()) {
+ //
+ let result = '';
+
+ //
+ // Validate Arg ...
+ if (!isDescriptor(descriptor)) {
+ return result;
+ }
+
+ //
+ result += (
+ !!descriptor.isExported ?
+ XBaseDescriptor.ExpressionKeys.Export + ' ' :
+ ''
+ ) +
+ XBaseDescriptor.ExpressionKeys.Type +
+ ' ' +
+ descriptor.name +
+ ' = ' +
+ descriptor.content
+ + ';';
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists TypeDescriptors ...
+ *
+ * @param {string} file a file path ...
+ * @returns a collection of TypeDescriptor ...
+ */
+async function extractDescriptors(file = '') {
+ //
+ if (!XFileTools.isFileExists(file)) {
+ return [];
+ }
+
+ //
+ const fileContent = await XFileTools.readFile(file);
+ if (!XValueTools.isValidArg(fileContent)) {
+ return [];
+ }
+
+ //
+ let result = [
+ createDescriptor()
+ ];
+ result.pop();
+
+ //
+ result = extractDescriptorsFromContent(fileContent);
+
+ //
+ return result;
+}
+
+/**
+ * extract all exists TypeDescriptors ...
+ *
+ * @param {string} content a file content ...
+ * @returns a collection of TypeDescriptor ...
+ */
+function extractDescriptorsFromContent(content = '') {
+ //
+ // Prepare Result ...
+ let result = [
+ createDescriptor()
+ ];
+ result.pop();
+
+ //
+ // Validate Args ...
+ if (
+ !XValueTools.isValidArg(content) ||
+ !content.includes(XBaseDescriptor.ExpressionKeys.Type)
+ ) {
+ return result;
+ }
+
+ //
+ // Extract all key Indexes ...
+ const keyIndexes = XBaseDescriptor.
+ extractValidIdentifierIndexes(XBaseDescriptor.ExpressionKeys.Type, content);
+
+ //
+ // Validate them ...
+ if (!XValueTools.hasChildArray(keyIndexes)) {
+ return result;
+ }
+
+ //
+ // Loop through indexes ...
+ for (const index of keyIndexes) {
+ //
+ // Check Type after befre content ...
+ let startIndex = index - 1;
+ let endIndex = index + XBaseDescriptor.ExpressionKeys.Type.length + 1;
+
+ //
+ // create an empty instance of descriptor ...
+ let descriptor = {
+ ...createDescriptor()
+ }
+
+ //
+ //#region Name extractor ...
+ const nameEndIndex = content.indexOf('=', index);
+ identifier = content
+ .substring(index + XBaseDescriptor.ExpressionKeys.Type.length, nameEndIndex)
+ .trim();
+ if (XValueTools.isValidArg(identifier)) {
+ descriptor.name = identifier;
+ }
+ //#endregion
+
+ //
+ //#region Extract isExported ...
+ const isExported = XBaseDescriptor.checkIsExported(index, content);
+ descriptor.isExported = isExported;
+ if (isExported) {
+ startIndex = index - XBaseDescriptor.ExpressionKeys.Export.length - 1;
+ }
+ //#endregion
+
+ //
+ //#region Extract raw content ...
+ identifier = content.substring(startIndex);
+ startIndex = 0;
+ endIndex = XValueTools.findNearestIndex(
+ [
+ ';',
+ '{',
+ '\n'
+ ]
+ , identifier
+ );
+ const nearestChar = identifier.charAt(endIndex);
+ if (nearestChar === '{') {
+ //
+ const closedItemsIndexes = XValueTools.findClosedContentIndexes('{', '}', identifier, endIndex);
+ if (!XValueTools.hasChildArray(closedItemsIndexes)) {
+ continue;
+ }
+
+ //
+ endIndex = closedItemsIndexes[0].end;
+
+ }
+
+ //
+ identifier = identifier
+ .substring(startIndex, endIndex)
+ .trim();
+ if (XValueTools.isValidArg(identifier)) {
+ descriptor.raw = identifier;
+ }
+ //#endregion
+
+ //
+ //#region Parse Content ...
+ startIndex = identifier.indexOf('=', 0);
+ identifier = identifier
+ .substring(startIndex + 1)
+ .trim();
+ identifier = XBaseDescriptor.clearContent(identifier);
+ if (XValueTools.isValidArg(identifier)) {
+ descriptor.content = identifier;
+ }
+ //#endregion
+
+ //
+ result.push(descriptor);
+ }
+
+ //
+ return result;
+}
+
+//
+// Module Exports ...
+module.exports = {
+ //
+ isDescriptor,
+ toExpression,
+ createDescriptor,
+ extractDescriptors,
+ extractDescriptorsFromContent,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/services/x-electron.service.js b/platforms/electron/modules/services/x-electron.service.js
new file mode 100644
index 0000000..f770b50
--- /dev/null
+++ b/platforms/electron/modules/services/x-electron.service.js
@@ -0,0 +1,48 @@
+
+'use strict';
+
+//
+const XElectronChannel = {
+ Default: 'xMessage',
+ Handshake: 'xHandshake',
+ FileService: 'xFileService',
+ ProjectsService: 'xProjectsService',
+}
+
+//
+// Module Exports ...
+module.exports = {
+ //
+ XElectronChannel: XElectronChannel,
+
+ //
+ XElectronMessage: class XElectronMessage {
+ //
+ constructor(
+ sender = '',
+ reciever = '',
+ message = '',
+ payload = undefined,
+ channel = undefined,
+ timestamp = undefined,
+ ) {
+ //
+ if (!timestamp) {
+ timestamp = Date.now();
+ }
+
+ //
+ if (!channel) {
+ channel = XElectronChannel.Default;
+ }
+
+ //
+ this.sender = sender;
+ this.reciever = reciever;
+ this.payload = payload;
+ this.message = message;
+ this.timestamp = timestamp;
+ this.channel = channel;
+ }
+ }
+}
diff --git a/platforms/electron/modules/tools/x-file.tools.js b/platforms/electron/modules/tools/x-file.tools.js
new file mode 100644
index 0000000..8e1a872
--- /dev/null
+++ b/platforms/electron/modules/tools/x-file.tools.js
@@ -0,0 +1,617 @@
+const fs = require('fs');
+const os = require('os');
+const Path = require('path');
+const XValueTools = require('./x-value.tools');
+
+/**
+ * required folder names ...
+ */
+const FolderNames = {
+ Documents: 'Documents',
+}
+
+/**
+ * current os path separators ...
+ */
+const PathSeparator = Path.sep;
+
+/**
+ * current directory ...
+ */
+const CurrentDir = __dirname;
+
+//
+//#region Global ...
+/**
+ * retrieve a path status ...
+ *
+ * @param {string} path a path value to check ...
+ * @returns an stat object ...
+ */
+function getStatus(path = '') {
+ //
+ if (!XValueTools.isValidArg(path)) {
+ return undefined;
+ }
+
+ //
+ return fs.statSync(path);
+}
+
+/**
+ * retrieve user's Document path ...
+ *
+ * @returns a path ...
+ */
+function getDocumentsPath() {
+ return Path.join(os.homedir(), FolderNames.Documents);
+}
+
+/**
+ * retrieve user's Document contents ...
+ *
+ * @returns resources contents as string array ...
+ */
+function getDocumentsContents() {
+ return getDirectoryContents(getDocumentsPath());
+}
+//#endregion
+
+//
+//#region Path ...
+/**
+ * retrieve the base name of specific address path ...
+ *
+ * @param {string} path address of file or folder ...
+ * @returns string ...
+ */
+function basename(path = '') {
+ //
+ if (!XValueTools.isValidArg(path)) {
+ return '';
+ }
+
+ //
+ const result = Path.basename(path);
+ return result;
+}
+
+/**
+ * join several path segments together ...
+ *
+ * @param {...string} path path params ...
+ * @returns a joined paths ...
+ */
+function joinPath(...path) {
+ return Path.join(...path);
+}
+//#endregion
+
+//
+//#region File ...
+/**
+ * determines a path destination is a file or not ...
+ *
+ * @param {string} path a path value to check ...
+ * @returns a boolean value ...
+ */
+function isFileExists(path = '') {
+ //
+ if (!XValueTools.isValidArg(path)) {
+ return false;
+ }
+
+ //
+ try {
+ const stat = getStatus(path);
+ if (!stat) {
+ return false;
+ }
+
+ //
+ return stat.isFile();
+ } catch {
+ return false;
+ }
+}
+
+/**
+ * remove a file ...
+ *
+ * @param {string} path a file path ...
+ * @returns {Promise} action done or not ...
+ */
+function removeFile(path = '') {
+ return new Promise((resolve) => {
+ //
+ if (!isFileExists(path)) {
+ resolve(false);
+ }
+
+ //
+ fs.unlink(path, (err) => {
+ //
+ if (err) {
+ resolve(false);
+ return;
+ }
+
+ //
+ resolve(true);
+ });
+ });
+}
+
+/**
+ * copy a file to destination path ...
+ *
+ * @param {string} source source file path ...
+ * @param {string} dest dest folder path ...
+ * @returns {Promise} action done or not ...
+ */
+function copyFile(
+ source = '',
+ dest = ''
+) {
+ return new Promise((resolve) => {
+ //
+ if (
+ !isFileExists(source) ||
+ !isDirectoryExists(dest)
+ ) {
+ resolve(false);
+ return;
+ }
+
+ //
+ const destFilePath = Path.join(dest, Path.basename(source));
+ fs.copyFile(source, destFilePath, (err) => {
+ //
+ if (err) {
+ resolve(false);
+ return;
+ }
+
+ //
+ resolve(true);
+ });
+ });
+}
+
+/**
+ * reading specified file content ...
+ *
+ * @param {string} path a file path ...
+ * @returns {Promise} file content ...
+ */
+function readFile(path = '') {
+ return new Promise((resolve) => {
+ //
+ if (!isFileExists(path)) {
+ resolve('');
+ return;
+ }
+
+ //
+ fs.readFile(path, 'utf8', (err, content) => {
+ //
+ if (err) {
+ resolve(undefined);
+ return;
+ }
+
+ //
+ resolve(content);
+ });
+ });
+}
+
+/**
+ * write content to a file ...
+ *
+ * @param {string} path a file path ...
+ * @param {string} content the content which going to write to the file ...
+ * @param {bool} overwrite determines file overwrite if exists ...
+ * @returns {Promise} action done or not ...
+ */
+function writeFile(
+ path = '',
+ content = '',
+ overwrite = true
+) {
+ return new Promise((resolve) => {
+ //
+ if (isFileExists(path) && !overwrite) {
+ //
+ resolve(false);
+ return;
+ }
+
+ //
+ // Normalize Content ...
+ content = XValueTools.isValidArg(content) ?
+ content :
+ '';
+
+ //
+ fs.writeFile(path, content, (err) => {
+ //
+ if (err) {
+ //
+ resolve(false);
+ return;
+ }
+
+ //
+ resolve(true);
+ });
+ });
+}
+
+/**
+ * create a file ...
+ *
+ * @param {string} path file path ...
+ * @param {string} fileName file name ...
+ * @returns {Promise} action done or not ...
+ */
+function createFile(
+ path = '',
+ fileName = ''
+) {
+ return new Promise((resolve) => {
+ //
+ const filePath = Path.join(path, fileName);
+ if (
+ isFileExists(filePath) ||
+ !XValueTools.isValidArg(path) ||
+ !XValueTools.isValidArg(fileName)
+ ) {
+ //
+ resolve(false);
+ return;
+ }
+
+ //
+ fs.writeFile(filePath, '', (err) => {
+ //
+ if (err) {
+ //
+ resolve(false);
+ return;
+ }
+
+ //
+ resolve(true);
+ });
+ });
+}
+
+/**
+ * remove a file name extension ...
+ *
+ * @param {string} name
+ * @returns {string} name without extension ...
+ */
+function removeFileExtension(name = '') {
+ return name.substring(0, name.lastIndexOf('.')) || name;
+}
+//#endregion
+
+//
+//#region Directory ...
+/**
+ * create a directory ...
+ *
+ * @param {string} path destination path including dir name ...
+ * @param {boolean} recursive create directories recursively ...
+ * @returns action done or not ...
+ */
+function createDirectory(
+ path = '',
+ recursive = true
+) {
+ //
+ let result = false;
+
+ //
+ if (
+ isDirectoryExists(path) ||
+ !XValueTools.isValidArg(path)
+ ) {
+ return false;
+ }
+
+ //
+ try {
+ //
+ fs.mkdirSync(path, { recursive: recursive });
+ result = true;
+ return result;
+ } catch {
+ return false;
+ }
+}
+
+/**
+ * remove a directory ...
+ *
+ * @param {string} path destination path including dir name ...
+ * @param {boolean} recursive removes directories recursively ...
+ * @returns {Promise} action done or not ...
+ */
+function removeDirectory(
+ path = '',
+ recursive = false
+) {
+ return new Promise((resolve) => {
+ //
+ if (!isDirectoryExists(path)) {
+ resolve(false);
+ return;
+ }
+
+ //
+ fs.rm(path, {
+ recursive
+ }, (err) => {
+ //
+ if (err) {
+ resolve(false);
+ return;
+ }
+
+ //
+ resolve(true);
+ });
+ });
+}
+
+/**
+ * determines a path destination is a directory or not ...
+ *
+ * @param {string} path a folder path ...
+ * @returns represent destnation path is Directory or not ...
+ */
+function isDirectoryExists(path = '') {
+ //
+ if (!XValueTools.isValidArg(path)) {
+ return false;
+ }
+
+ //
+ try {
+ //
+ const isExists = fs.existsSync(path);
+ if (!isExists) {
+ return false;
+ }
+
+ //
+ const stat = getStatus(path);
+ if (!stat) {
+ return false;
+ }
+
+ //
+ const result = stat.isDirectory();
+ return result;
+ } catch {
+ return false;
+ }
+}
+
+/**
+ * retrieve a directory content ...
+ *
+ * @param {string} path a folder path ...
+ * @returns {Promise} a collection of folder files ...
+ */
+function getDirectoryContents(path = '') {
+ return new Promise((resolve) => {
+ //
+ if (!isDirectoryExists(path)) {
+ resolve([]);
+ return;
+ }
+
+ //
+ fs.readdir(path, (err, content) => {
+ //
+ if (err) {
+ resolve([]);
+ return;
+ }
+
+ //
+ resolve(content);
+ });
+ });
+}
+
+/**
+ * retrieve a directory files ...
+ *
+ * @param {string} path a folder path ...
+ * @returns {Promise} a collection of folder files ...
+ */
+function getDirectoryFiles(
+ path = '',
+ containsHiddenFiles = false
+) {
+ return new Promise((resolve) => {
+ //
+ if (!isDirectoryExists(path)) {
+ resolve([]);
+ return;
+ }
+
+ //
+ fs.readdir(path, (err, content) => {
+ //
+ if (err) {
+ resolve([]);
+ return;
+ }
+
+ //
+ if (!containsHiddenFiles) {
+ content = content.filter(c => !c.startsWith('.'))
+ }
+
+ //
+ const result = [];
+ content
+ .forEach(c => {
+ //
+ const cPath = Path.join(path, c);
+ if (isFileExists(cPath)) {
+ result.push(c);
+ }
+ });
+
+ //
+ resolve(result);
+ });
+ });
+}
+
+/**
+ * retrieve a directory folders ...
+ *
+ * @param {string} path a folder path ...
+ * @returns {Promise} a collection of folder names ...
+ */
+function getDirectoryFolders(path = '') {
+ return new Promise((resolve) => {
+ //
+ if (!isDirectoryExists(path)) {
+ resolve([]);
+ return;
+ }
+
+ //
+ fs.readdir(path, (err, content) => {
+ //
+ if (err) {
+ resolve([]);
+ return;
+ }
+
+ //
+ const result = [];
+ content.forEach(c => {
+ //
+ const cPath = Path.join(path, c);
+ if (isDirectoryExists(cPath)) {
+ result.push(c);
+ }
+ });
+
+ //
+ resolve(result);
+ });
+ });
+}
+
+/**
+ * copy a folder with all of it's content to dest ...
+ *
+ * @param {string} source source folder path ...
+ * @param {string} dest dest folder path ...
+ * @returns {Promise} action done or not ...
+ */
+async function copyFolder(
+ source = '',
+ dest = ''
+) {
+ //
+ if (
+ !isDirectoryExists(source) ||
+ !XValueTools.isValidArg(dest) ||
+ !XValueTools.isValidArg(source)
+ ) {
+ return false;
+ }
+
+ //
+ const folderName = Path.basename(source);
+ const destPath = Path.join(dest, folderName);
+
+ //
+ // Create Dest Path folder if not exists ...
+ if (!isDirectoryExists(destPath)) {
+ //
+ let result = createDirectory(destPath, true);
+ if (!result) {
+ return false;
+ }
+ }
+
+ //
+ // Files ...
+ const files = await getDirectoryFiles(source);
+ if (files && files.constructor === Array && files.length > 0) {
+ //
+ const filesPromises = files.map(file => copyFile(Path.join(source, file), destPath));
+ const filesResult = (await Promise.all(filesPromises)).every(r => !!r);
+ if (!filesResult) {
+ return false;
+ }
+ }
+
+ //
+ // Folders ...
+ const folders = await getDirectoryFolders(source);
+ if (folders && folders.constructor === Array && folders.length > 0) {
+ //
+ const folderPromises = folders.map(folder => copyFolder(Path.join(source, folder), destPath));
+ const filesResult = (await Promise.all(folderPromises)).every(r => !!r);
+ if (!filesResult) {
+ return false;
+ }
+ }
+
+ //
+ return true;
+}
+//#endregion
+
+//
+// Module Exports ...
+module.exports = {
+ //
+ CurrentDir,
+ FolderNames,
+ PathSeparator,
+
+ //
+ getStatus,
+ getDocumentsPath,
+ getDocumentsContents,
+
+ //
+ basename,
+ joinPath,
+
+ //
+ copyFile,
+ readFile,
+ writeFile,
+ createFile,
+ removeFile,
+ isFileExists,
+ removeFileExtension,
+
+ //
+ copyFolder,
+ createDirectory,
+ removeDirectory,
+ createDirectory,
+ removeDirectory,
+ isDirectoryExists,
+ isDirectoryExists,
+ getDirectoryFiles,
+ getDirectoryFolders,
+ getDirectoryContents,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/tools/x-logger.tools.js b/platforms/electron/modules/tools/x-logger.tools.js
new file mode 100644
index 0000000..a9f2a5a
--- /dev/null
+++ b/platforms/electron/modules/tools/x-logger.tools.js
@@ -0,0 +1,187 @@
+
+const baseLogTag = 'XFrameworkElectronApp';
+let enableLogging = true;
+
+/**
+ * Log Tags ...
+ */
+const XLogTag = {
+ Debug: 'debug',
+ Info: 'info',
+ Warn: 'warn',
+ Error: 'error'
+};
+
+/**
+ * retrieve an instance of XLogMessage ...
+ *
+ * @param {string} tag tag of logging ...
+ * @param {string} message content of log message ...
+ * @param {array of any} args args of content which required to logging ...
+ * @param {number} timestamp logging time ...
+ *
+ * @returns an instance of log message object ...
+ */
+function XLogMessage(tag, message, args, timestamp) {
+ //
+ if (!tag) {
+ throw 'Tag not provided ...';
+ }
+
+ //
+ if (!message) {
+ throw 'Message not provided ...';
+ }
+
+ //
+ if (!args) {
+ args = [];
+ }
+
+ //
+ if (!timestamp) {
+ timestamp = new Date().getTime();
+ }
+
+ //
+ return {
+ tag,
+ message,
+ args,
+ timestamp,
+ };
+}
+
+/**
+ * log data ...
+ *
+ * @param {XLogMessage} message
+ */
+function log(message) {
+ //
+ if (!message || !message.tag || !message.message || !enableLogging) {
+ return;
+ }
+
+ //
+ message.timestamp = new Date().getTime();
+
+ //
+ switch (message.tag) {
+ //
+ case XLogTag.Debug:
+ logDebug(message);
+ break;
+ //
+ case XLogTag.Info:
+ logInfo(message);
+ break;
+ //
+ case XLogTag.Warn:
+ logWarn(message);
+ break;
+ //
+ case XLogTag.Error:
+ logError(message);
+ break;
+
+ //
+ default:
+ break;
+ }
+}
+
+/**
+ * Log Debug ...
+ *
+ * @param {XLogMessage} message
+ */
+function logDebug(message) {
+ //
+ if (!message || !message.message || !enableLogging || message.tag !== XLogTag.Debug) {
+ return;
+ }
+
+ //
+ message.timestamp = new Date().getTime();
+
+ //
+ console.debug(`${baseLogTag}:${message.tag} => ${message.message}`, ...message.args);
+}
+
+/**
+ * Log Info ...
+ *
+ * @param {XLogMessage} message
+ */
+function logInfo(message) {
+ //
+ if (!message || !message.message || !enableLogging || message.tag !== XLogTag.Info) {
+ return;
+ }
+
+ //
+ message.timestamp = new Date().getTime();
+
+ //
+ console.info(`${baseLogTag}:${message.tag} => ${message.message}`, ...message.args);
+}
+
+/**
+ * Log Warn ...
+ *
+ * @param {XLogMessage} message
+ */
+function logWarn(message) {
+ //
+ if (!message || !message.message || !enableLogging || message.tag !== XLogTag.Warn) {
+ return;
+ }
+
+ //
+ message.timestamp = new Date().getTime();
+
+ //
+ console.warn(`${baseLogTag}:${message.tag} => ${message.message}`, ...message.args);
+}
+
+/**
+ * Log Error ...
+ *
+ * @param {XLogMessage} message
+ */
+function logError(message) {
+ //
+ if (!message || !message.message || !enableLogging || message.tag !== XLogTag.Error) {
+ return;
+ }
+
+ //
+ message.timestamp = new Date().getTime();
+
+ //
+ console.error(`${baseLogTag}:${message.tag} => ${message.message}`, ...message.args);
+}
+
+//
+// Module Eports ...
+module.exports = {
+ //
+ enableLogging: () => {
+ enableLogging = true;
+ },
+ disableLogging: () => {
+ enableLogging = false;
+ },
+ isLoggingEnable: () => {
+ return enableLogging;
+ },
+ //
+ XLogTag: XLogTag,
+ XLogMessage: XLogMessage,
+ log: log,
+ logDebug: logDebug,
+ logInfo: logInfo,
+ logWarn: logWarn,
+ logError: logError,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/tools/x-shell.tools.js b/platforms/electron/modules/tools/x-shell.tools.js
new file mode 100644
index 0000000..1441faf
--- /dev/null
+++ b/platforms/electron/modules/tools/x-shell.tools.js
@@ -0,0 +1,203 @@
+//
+//#region Imports ...
+const os = require('os');
+const process = require('process');
+const { exec } = require("child_process");
+const XFileTools = require('../tools/x-file.tools');
+//#endregion
+
+//
+//#region Constants ...
+//
+const OS = {
+ Aix: 'aix',
+ Darwin: 'darwin',
+ FreeBSD: 'freebsd',
+ Linux: 'linux',
+ OpenBSD: 'openbsd',
+ SnOS: 'sunos',
+ Windows: 'win32'
+}
+
+//
+const isWindows = process.platform === OS.Windows;
+//#endregion
+
+//
+//#region Actions ...
+//
+//#region Pure shell commands ...
+/**
+ * execute a command using NodeJS on shell ...
+ *
+ * @param {string} cmd command to execute ...
+ * @param {string} cwd working directory ...
+ *
+ * @returns Promise instance ...
+ */
+function execute(cmd, cwd) {
+ return new Promise((resolve, reject) => {
+ //
+ if (!cmd || cmd.toString().length === 0 || (cwd && !XFileTools.isDirectoryExists(cwd))) {
+ reject('invalid args ...');
+ return;
+ }
+
+ //
+ exec(cmd, { cwd }, (err, result, stdError) => {
+ //
+ if (err) {
+ reject(err);
+ return;
+ }
+
+ //
+ if (stdError) {
+ //
+ // reject(stdError);
+ // return;
+ }
+
+ //
+ resolve(result);
+ });
+ });
+};
+
+/**
+ * determines a command exists on host or not ...
+ *
+ * @param {string} name specific command name ...
+ *
+ * @returns boolean Promise ...
+ */
+function checkCommandExists(name) {
+ return new Promise(resolve => {
+ //
+ if (!name) {
+ resolve(false);
+ return;
+ }
+
+ //
+ const cmd = isWindows ? `${name} >nul 2>&1` : `type ${name} >/dev/null 2>&1`;
+ execute(cmd).then(result => {
+ resolve(true);
+ })
+ .catch(err => {
+ resolve(false);
+ });
+ });
+}
+//#endregion
+
+//
+//#region required commands state ...
+/**
+ * check al required commands exists or not ...
+ *
+ * @returns
+ */
+async function isRequiredCommandsExists() {
+ //
+ let result = false;
+
+ //
+ // const isTarExists = await isTarCommandExists();
+ // const isCatExists = await isCatCommandExists();
+ // const isGrepExists = await isGrepCommandExists();
+ // const isSedExists = await isSedCommandExists();
+ // const isNpmExists = await isNpmCommandExists();
+ const isNgExists = await isNgCommandExists();
+ const isIonicExists = await isIonicCommandExists();
+ const isCordovaExists = await isCordovaCommandExists();
+
+ //
+ result = isNgExists &&
+ isIonicExists &&
+ isCordovaExists;
+
+ //
+ return result;
+}
+
+/**
+ * retrieve required commands state object ...
+ *
+ * @returns
+ */
+async function getRequiredCommandsStates() {
+ //
+ const result = {};
+
+ //
+ // const isTarExists = await isTarCommandExists();
+ // const isCatExists = await isCatCommandExists();
+ // const isGrepExists = await isGrepCommandExists();
+ // const isSedExists = await isSedCommandExists();
+ // const isNpmExists = await isNpmCommandExists();
+ const isNgExists = await isNgCommandExists();
+ const isIonicExists = await isIonicCommandExists();
+ const isCordovaExists = await isCordovaCommandExists();
+
+ //
+ result['ng'] = isNgExists;
+ result['ionic'] = isIonicExists;
+ result['cordova'] = isCordovaExists;
+
+ //
+ return result;
+}
+//#endregion
+
+//
+//#region Commonly used Command Checkers ...
+/**
+ * determines ng command exists or not ...
+ *
+ * @returns
+ */
+function isNgCommandExists() {
+ return checkCommandExists('ng');
+}
+
+/**
+ * determines ionic command exists or not ...
+ *
+ * @returns
+ */
+function isIonicCommandExists() {
+ return checkCommandExists('ionic');
+}
+
+/**
+ * determines cordova command exists or not ...
+ *
+ * @returns
+ */
+function isCordovaCommandExists() {
+ return checkCommandExists('cordova');
+}
+//#endregion
+//#endregion
+
+//
+// Module Exports ...
+module.exports = {
+ //
+ execute,
+ checkCommandExists,
+ isRequiredCommandsExists,
+ getRequiredCommandsStates,
+
+ //
+ // isFxCommandExists,
+ // isTarCommandExists,
+ // isCatCommandExists,
+ // isSedCommandExists,
+ // isNpmCommandExists,
+ // isGrepCommandExists,
+ isNgCommandExists,
+ isIonicCommandExists,
+ isCordovaCommandExists,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/tools/x-type-detector.tools.js b/platforms/electron/modules/tools/x-type-detector.tools.js
new file mode 100644
index 0000000..a050754
--- /dev/null
+++ b/platforms/electron/modules/tools/x-type-detector.tools.js
@@ -0,0 +1,252 @@
+/**
+ * all supported data types ...
+ */
+const DataTypes = {
+ Null: 'null',
+ Date: 'date',
+ Array: 'array',
+ Object: 'object',
+ String: 'string',
+ Number: 'number',
+ Unknown: 'unknown',
+ Boolean: 'boolean',
+ Function: 'function',
+ Undefined: 'undefined',
+};
+
+/**
+ * detect type of a content ...
+ *
+ * @param {any} value the content which going to check ...
+ * @returns
+ */
+function getType(value) {
+ //
+ const type = typeof value;
+
+ //
+ let result = DataTypes.Unknown;
+ let dateIdentifier = '[object Date]';
+ let constructor = value && value.constructor ?
+ value.constructor.toString() :
+ '';
+
+ //
+ switch (type) {
+ //
+ case 'undefined':
+ result = DataTypes.Undefined;
+ break;
+
+ //
+ case 'boolean':
+ result = DataTypes.Boolean;
+ break;
+
+ //
+ case 'string':
+ result = DataTypes.String;
+ break;
+
+ //
+ case 'number':
+ result = DataTypes.Number;
+ break;
+
+ //
+ case 'function':
+ result = DataTypes.Function;
+ break;
+
+ //
+ case 'object':
+ //
+ // Null ...
+ if (value === null) {
+ result = DataTypes.Null;
+ } else
+ //
+ // Array ...
+ if (Array.isArray(value)) {
+ result = DataTypes.Array;
+ } else
+ //
+ // Data ...
+ if (
+ value instanceof Date ||
+ isFunction(value.getMonth) ||
+ constructor.includes(dateIdentifier) ||
+ Object.prototype.toString.call(value) === dateIdentifier
+ ) {
+ result = DataTypes.Date;
+ } else
+ //
+ // Object ...
+ {
+ result = DataTypes.Object;
+ }
+ break;
+
+ //
+ default:
+ result = DataTypes.Unknown;
+ break;
+ }
+
+ //
+ return result;
+}
+
+/**
+ * retrieve an object constructor ...
+ *
+ * @param {any} value the content which going to check ...
+ * @returns
+ */
+function getConstructor(value) {
+ //
+ const result = value && value.constructor ?
+ value.constructor.toString() :
+ '';
+
+ //
+ return result;
+}
+
+/**
+ * retrieve an object prototype ...
+ *
+ * @param {any} value the content which going to check ...
+ * @returns
+ */
+function getPrototype(value) {
+ //
+ const result = value ?
+ Object.prototype.toString.call(value) :
+ '';
+
+ //
+ return result;
+}
+
+/**
+ * check an object is null or not ...
+ *
+ * @param {any} value the content which going to check ...
+ * @returns
+ */
+function isNull(value) {
+ return getType(value) === DataTypes.Null;
+}
+
+/**
+ * check an object is undefined or not ...
+ *
+ * @param {any} value the content which going to check ...
+ * @returns
+ */
+function isUndefined(value) {
+ return getType(value) === DataTypes.Undefined;
+}
+
+/**
+ * check an object is null or undefined or not ...
+ *
+ * @param {any} value the content which going to check ...
+ * @returns
+ */
+function isNullOrUndefined(value) {
+ return isNull(value) || isUndefined(value);
+}
+
+/**
+ * check an object is a date or not ...
+ *
+ * @param {any} value the content which going to check ...
+ * @returns
+ */
+function isDate(value) {
+ return getType(value) === DataTypes.Date;
+}
+
+/**
+ * check an object is number or not ...
+ *
+ * @param {any} value the content which going to check ...
+ * @returns
+ */
+function isNumber(value) {
+ return getType(value) === DataTypes.Number;
+}
+
+/**
+ * check an object is string or not ...
+ *
+ * @param {any} value the content which going to check ...
+ * @returns
+ */
+function isString(value) {
+ return getType(value) === DataTypes.String;
+}
+
+/**
+ * check an object is boolean or not ...
+ *
+ * @param {any} value the content which going to check ...
+ * @returns
+ */
+function isBoolean(value) {
+ return getType(value) === DataTypes.Boolean;
+}
+
+/**
+ * check an object is an Array or not ...
+ *
+ * @param {any} value the content which going to check ...
+ * @returns
+ */
+function isArray(value) {
+ return getType(value) === DataTypes.Array;
+}
+
+/**
+ * check an object is and Object or not ...
+ *
+ * @param {any} value the content which going to check ...
+ * @returns
+ */
+function isObject(value) {
+ return getType(value) === DataTypes.Object;
+}
+
+/**
+ * check an object is a Function or not ...
+ *
+ * @param {any} value the content which going to check ...
+ * @returns
+ */
+function isFunction(value) {
+ return getType(value) === DataTypes.Function;
+}
+
+//
+// Module Exports ...
+module.exports = {
+ //
+ DataTypes,
+
+ //
+ getType,
+ getConstructor,
+ getPrototype,
+ isNull,
+ isUndefined,
+ isNullOrUndefined,
+ isDate,
+ isNumber,
+ isString,
+ isBoolean,
+ isArray,
+ isObject,
+ isFunction,
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/tools/x-uuid.tools.js b/platforms/electron/modules/tools/x-uuid.tools.js
new file mode 100644
index 0000000..49fc647
--- /dev/null
+++ b/platforms/electron/modules/tools/x-uuid.tools.js
@@ -0,0 +1,37 @@
+//
+//#region Imports ...
+const uuid = require("uuid");
+//#endregion
+
+//
+//#region Constants ...
+const DEFAULT_NAMESPACE = "SaherElm IT Center";
+//#endregion
+
+/**
+ * generate a uniqu identifier ...
+ *
+ * @param {string} prefix the prefix of generated uuid ...
+ * @param {string} content the additional content which added to generated uuid ...
+ * @param {string} nameSpace the proposed name space for generating uuid ...
+ * @returns a unique universal uuid ...
+ */
+function generateUuid(
+ prefix,
+ content,
+ nameSpace = DEFAULT_NAMESPACE
+) {
+ //
+ const uId = content ? uuid.v5(content, nameSpace) : uuid.v4();
+ const result = prefix ? `${prefix}_${uId}` : uId;
+
+ //
+ return result;
+}
+
+//
+// Module Exports ...
+module.exports = {
+ DEFAULT_NAMESPACE,
+ generateUuid,
+};
diff --git a/platforms/electron/modules/tools/x-value.tools.js b/platforms/electron/modules/tools/x-value.tools.js
new file mode 100644
index 0000000..4756012
--- /dev/null
+++ b/platforms/electron/modules/tools/x-value.tools.js
@@ -0,0 +1,1397 @@
+const XTypeTools = require('./x-type-detector.tools');
+
+/**
+* validate a value as an argument ...
+*
+* @param {string} value the value which going to validate ...
+* @returns
+*/
+function isValidArg(value) {
+ //
+ let result = false;
+
+ //
+ result = value &&
+ value.length > 0;
+
+ //
+ return result;
+}
+
+/**
+ * validate a collection of valuea as an arguments ...
+ *
+ * @param {string|string[]} values the value collection which going to checked ...
+ * @returns
+ */
+function isValidArgs(values) {
+ //
+ // Normalize Values ...
+ const normalValues = toNormalArray(values);
+ if (!hasChildArray(normalValues)) {
+ return false;
+ }
+
+ //
+ let result = normalValues.every(nv => isValidArg(nv));
+ return result;
+}
+
+/**
+ * converts content to an array object ...
+ *
+ * @param {string|string[]} content the content which required to normalized ...
+ * @returns {string[]} array object ...
+ */
+function toNormalArray(content = '') {
+ //
+ // Validate Args ...
+ if (!isValidArg(content)) {
+ return [];
+ }
+
+ //
+ const result = Array.isArray(content) ?
+ [...content] :
+ content.includes(',') &&
+ content !== ',' ?
+ [...content.split(',')] :
+ [content];
+
+ //
+ return result;
+}
+
+/**
+ * determines value is array and has atleast one child ...
+ *
+ * @param {any} value the value which going to checked ...
+ * @returns {boolean} result of checking ...
+ */
+function hasChildArray(value) {
+ //
+ let result = false;
+ result = value &&
+ Array.isArray(value) &&
+ value.length > 0;
+
+ //
+ return result;
+}
+
+/**
+ * check an string is ends with specified symbol ...
+ *
+ * @param {string} symbol specified search symbol ...
+ * @param {string} value specified search content ...
+ * @param {boolean} ignoreCase specified search case sensitive or not ...
+ * @returns
+ */
+function endsWidth(
+ symbol = '',
+ value = '',
+ ignoreCase = true
+) {
+ //
+ if (!isValidArg(value)) {
+ return false;
+ }
+
+ //
+ if (!isValidArg(symbol)) {
+ return true;
+ }
+
+ //
+ // TODO: uncomment it if necessary ...
+ // symbol = symbol.trim();
+
+ //
+ let result = false;
+ const subtractedContent = value.substring(value.length - symbol.length);
+ result = !!ignoreCase ?
+ subtractedContent
+ .toLowerCase() === symbol
+ .toLowerCase() :
+ subtractedContent === symbol;
+
+ //
+ return result;
+}
+
+/**
+ * surround specified content by provided symbol ...
+ *
+ * @param {string} symbol surround string ...
+ * @param {string} content used content to surrounded by symbol ...
+ * @returns surrounded content ...
+ */
+function surroundBy(
+ symbol = '',
+ content = ''
+) {
+ //
+ // Validate Args ...
+ if (!isValidArg(content)) {
+ content = '';
+ }
+
+ //
+ if (!isValidArg(symbol)) {
+ symbol = '';
+ }
+
+ //
+ if (isSurrounded(symbol, content)) {
+ return content;
+ }
+
+ //
+ const result = `${symbol}${content}${symbol}`;
+ return result;
+}
+
+/**
+ * convert a parsed sign to clear string ...
+ *
+ * @param {string} value a parsed content ...
+ * @returns clear parsed signs ...
+ */
+function toStringExpression(value) {
+ //
+ let result = '';
+ result = value;
+
+ //
+ if (
+ !value ||
+ !isValidArg(value) ||
+ !isSurroundedString(value)
+ ) {
+ return result;
+ }
+
+ //
+ const startSymbol = value.charAt(0);
+ const endSymbol = value.charAt(value.length - 1);
+
+ //
+ if (startSymbol !== endSymbol) {
+ return result;
+ }
+
+ //
+ if (
+ startSymbol === "\"" ||
+ startSymbol === "\'"
+ ) {
+ result = clearSurround(startSymbol, value);
+ }
+
+ //
+ return result;
+}
+
+
+
+/**
+ * find and cleare proposed candidates from specified content ...
+ *
+ * @param {string|string[]} candidates the proposed string(s) whic going to cleared from content ...
+ * @param {string} content the destination content which used to find and replace candidates on it ...
+ * @returns cleared content ...
+ */
+function clearContent(
+ candidates,
+ content
+) {
+ //
+ // Validate Args ...
+ if (
+ !candidates ||
+ !isValidArg(content)
+ ) {
+ return '';
+ }
+
+ //
+ // Normalize candidates ...
+ const normalCandidates = toNormalArray(candidates)
+ .filter(c => isValidArg(c));
+ if (!hasChildArray(normalCandidates)) {
+ return content;
+ }
+
+ //
+ // define regexp for content ...
+ const regExpExpression = normalCandidates.join('|');
+ const regExp = new RegExp(
+ regExpExpression,
+ 'gi'
+ );
+
+ //
+ let result = '';
+ result = content.replace(regExp, '');
+
+ //
+ return result;
+}
+
+/**
+ * clear surrounded symbol from content ...
+ *
+ * @param {string} symbol specified search symbol ...
+ * @param {string} content specified content to clear ...
+ * @returns
+ */
+function clearSurround(
+ symbol = '',
+ content = ''
+) {
+ //
+ // Validate Args ...
+ if (
+ !isValidArg(content) ||
+ (isValidArg(symbol) &&
+ symbol.length >= content.length - 1)
+ ) {
+ return '';
+ }
+
+ //
+ // Validate Surround ...
+ if (!isSurrounded(symbol, content)) {
+ return content;
+ }
+
+ //
+ if (!isValidArg(symbol)) {
+ return content;
+ }
+
+ //
+ let result = content.substring(symbol.length, content.length - symbol.length);
+ return result;
+}
+
+/**
+ * clear object sign ...
+ *
+ * @param {string} content
+ * @returns cleared content ...
+ */
+function clearObjectSurround(content = '') {
+ //
+ // Validate Args ...
+ if (
+ !isValidArg(content) ||
+ !isSurroundedObject(content)
+ ) {
+ return content;
+ }
+
+ //
+ const endIndex = content.length - (
+ endsWidth('}', content) ?
+ 1 :
+ endsWidth('},', content) ||
+ endsWidth('};', content) ||
+ endsWidth('}\n', content) ?
+ 2 :
+ 0
+ );
+
+ //
+ const result = content.substring(1, endIndex);
+ return result;
+}
+
+/**
+ * clear array sign ...
+ *
+ * @param {string} content
+ * @returns cleared content ...
+ */
+function clearArraySurround(content = '') {
+ //
+ // Validate Args ...
+ if (
+ !isValidArg(content) ||
+ !isSurroundedArray(content)
+ ) {
+ return content;
+ }
+
+ //
+ const endIndex = content.length - (
+ endsWidth(']', content) ?
+ 1 :
+ endsWidth('],', content) ||
+ endsWidth('];', content) ||
+ endsWidth(']\n', content) ?
+ 2 :
+ 0
+ );
+
+ //
+ const result = content.substring(1, endIndex);
+ return result;
+}
+
+/**
+ * slice a content to individual parts ...
+ *
+ * @param {number|number[]} indexes which indexes used to slice ...
+ * @param {strng} content the content which going to sliced ...
+ * @returns sliced parts of content ...
+ */
+function sliceContent(indexes, content) {
+ //
+ // Validate Args ...
+ if (
+ !isValidArg(indexes) ||
+ !isValidArg(content)
+ ) {
+ return [];
+ }
+
+ //
+ // Normalize indexes ...
+ const normalIndexes = toNormalArray(indexes)
+ .filter(index => index > -1 && index < content.length);
+ if (!hasChildArray(normalIndexes)) {
+ return [];
+ }
+
+ //
+ let result = [''];
+ result.pop();
+
+ //
+ let lastIndex = 0;
+ for (const index of normalIndexes) {
+ //
+ const part = content.substring(lastIndex, index);
+ if (isValidArg(part)) {
+ result.push(part.trim());
+ }
+
+ //
+ lastIndex = index + 1;
+ }
+
+ //
+ // check remained parts ...
+ if (lastIndex < content.length) {
+ //
+ const part = content.substring(lastIndex);
+ if (isValidArg(part)) {
+ result.push(part.trim());
+ }
+ }
+
+ //
+ return result;
+}
+
+
+
+/**
+ * check an string is starts and ends with specified symbol ...
+ *
+ * @param {string} symbol specified search symbol ...
+ * @param {string} content specified search content ...
+ * @param {boolean} ignoreCase specified search case sensitive or not ...
+ * @returns
+ */
+function isSurrounded(
+ symbol = '',
+ content = '',
+ ignoreCase = true
+) {
+ //
+ // Validate Args ...
+ if (!isValidArg(content)) {
+ return false;
+ }
+
+ //
+ if (!isValidArg(symbol)) {
+ return true;
+ }
+
+ //
+ symbol = symbol.trim();
+
+ //
+ let result = false;
+ result = (!!ignoreCase ?
+ content
+ .toLowerCase()
+ .startsWith(symbol.toLowerCase()) :
+ content.startsWith(symbol)
+ ) &&
+ endsWidth(symbol, content, ignoreCase);
+
+ //
+ return result;
+}
+
+/**
+ * determines a content is an string surrounded value or not ...
+ *
+ * @param {string} content a content which going to check ...
+ * @returns
+ */
+function isSurroundedString(content = '') {
+ //
+ // Validate Args ...
+ if (!isValidArg(content)) {
+ return false;
+ }
+
+ //
+ let result = false;
+ result = (
+ content.startsWith('\'') &&
+ (
+ endsWidth('\'', content) ||
+ endsWidth('\',', content) ||
+ endsWidth('\';', content) ||
+ endsWidth('\'\n', content)
+ ) ||
+ content.startsWith('\"') &&
+ (
+ endsWidth('\"', content) ||
+ endsWidth('\",', content) ||
+ endsWidth('\";', content) ||
+ endsWidth('\"\n', content)
+ ) ||
+ content.startsWith('`') &&
+ (
+ endsWidth('\`', content) ||
+ endsWidth('\`,', content) ||
+ endsWidth('\`;', content) ||
+ endsWidth('\`\n', content)
+ )
+ );
+ return result;
+}
+
+/**
+ * check a content is an array content or not ...
+ *
+ * @param {string} content
+ * @returns
+ */
+function isSurroundedArray(content = '') {
+ //
+ // Validate Args ...
+ if (!isValidArg(content)) {
+ return false;
+ }
+
+ //
+ let result = false;
+ result = content.startsWith('[') &&
+ (
+ endsWidth(']', content) ||
+ endsWidth('],', content) ||
+ endsWidth('];', content) ||
+ endsWidth(']\n', content)
+ );
+ return result;
+}
+
+/**
+ * check a content is an object content or not ...
+ *
+ * @param {string} content
+ * @returns
+ */
+function isSurroundedObject(content = '') {
+ //
+ // Validate Args ...
+ if (!isValidArg(content)) {
+ return false;
+ }
+
+ //
+ let result = false;
+ result = content.startsWith('{') &&
+ (
+ endsWidth('}', content) ||
+ endsWidth('},', content) ||
+ endsWidth('};', content) ||
+ endsWidth('}\n', content)
+ );
+ return result;
+}
+
+/**
+ * check an index model is contains inside anothers or not ...
+ *
+ * @param {{ start: number, end: number}} source the source index model to check ...
+ * @param {...{ start: number, end: number}} dest the collection of index models which going to check ...
+ * @returns
+ */
+function isIndexInside(source, ...dest) {
+ //
+ let result = false;
+
+ //
+ // Validate Args ...
+ if (!source || !dest) {
+ return result;
+ }
+
+ //
+ // Check idx is standard ...
+ if (
+ !source ||
+ !source.end ||
+ !source.start ||
+ source.start > source.end
+ ) {
+ return false;
+ }
+
+ //
+ // Check types of destinations ...
+ for (let index of dest) {
+ //
+ // Check idx is standard ...
+ if (
+ !index ||
+ !index.end ||
+ !index.start ||
+ index.start > index.end
+ ) {
+ return false;
+ }
+ }
+
+ //
+ if (dest.includes(source)) {
+ dest = dest.filter(d => d !== source);
+ }
+
+ //
+ const insideContentIndex = dest.find(dIndex => {
+ //
+ const result = source.start >= dIndex.start &&
+ source.start <= dIndex.end &&
+ source.end >= dIndex.start &&
+ source.end <= dIndex.end;
+ return result;
+ });
+
+ //
+ result = insideContentIndex;
+ return result;
+}
+
+/**
+ * check a number exists in
+ * @param {number} idx the number which going to check ...
+ * @param {{ start: number, end: number}} index the index model
+ * @returns
+ */
+function isInsideIndex(idx = -1, index) {
+ //
+ let result = false;
+
+ //
+ // Validate Args ...
+ if (
+ !index ||
+ !index.hasOwnProperty('end') ||
+ !index.hasOwnProperty('start')
+ ) {
+ return result;
+ }
+
+ //
+ result = idx > index.start && idx < index.end;
+ return result;
+}
+
+/**
+ * determines an object is key/value and type ...
+ *
+ * @param {any} content the object which we are going to check ...
+ * @returns
+ */
+function isKeyValueType(content) {
+ //
+ const result = content &&
+ content.hasOwnProperty('key') &&
+ content.hasOwnProperty('type') &&
+ content.hasOwnProperty('value');
+
+ //
+ return result;
+}
+
+
+
+/**
+ * find all indexes of token(s) in content ...
+ *
+ * @param {string|string[]} tokens the tokens which require to search ...
+ * @param {string} content the content which using to search ...
+ * @returns {number[]} all occured indexes ...
+ */
+function findAllIndexes(
+ tokens,
+ content
+) {
+ //
+ // Validate Args ...
+ if (
+ !isValidArg(tokens) ||
+ !isValidArg(content)
+ ) {
+ return [];
+ }
+
+ //
+ // normalize tokens ...
+ const normalTokens = toNormalArray(tokens);
+ if (!hasChildArray(normalTokens)) {
+ return [];
+ }
+
+ //
+ // Parse contents ...
+ let match;
+ const result = [];
+ const regExp = new RegExp(
+ normalTokens.join('|'),
+ 'g'
+ );
+ while ((match = regExp.exec(content)) !== null) {
+ result.push(match.index);
+ }
+ if (!hasChildArray(result)) {
+ return [];
+ }
+
+ //
+ return result;
+}
+
+/**
+ * find nearest symbol in a content from specified index ...
+ *
+ * @param {string|string[]} candidates specifies which symbols to find ...
+ * @param {string} content te content for seasrch ...
+ * @param {number} startFromIndex the index of start position ...
+ * @returns
+ */
+function findNearest(
+ candidates,
+ content = '',
+ startFromIndex = 0
+) {
+ //
+ // Validate Args ...
+ if (
+ !isValidArg(content) ||
+ !isValidArg(candidates) ||
+ !isValidArg(content.trim())
+ ) {
+ return '';
+ }
+
+ //
+ // Normalize Content ...
+ content = content.trim();
+
+ //
+ // Normalize Starts From ...
+ startFromIndex = startFromIndex < 0 || startFromIndex > content.length - 1 ? 0 : startFromIndex;
+
+ //
+ // Normalize Symbols ...
+ const normalCandidates = toNormalArray(candidates);
+ if (!hasChildArray(normalCandidates)) {
+ return '';
+ }
+
+ //
+ let nearestIndex = findNearestIndex(
+ normalCandidates,
+ content,
+ startFromIndex
+ );
+ if (nearestIndex < 0) {
+ return '';
+ }
+
+ //
+ let result = content.substring(
+ nearestIndex,
+ nearestIndex + Math.max(...normalCandidates.map(nc => nc.length))
+ ).trim();
+ return result;
+}
+
+/**
+ * search candidates in content and find nearest one and return it ...
+ *
+ * @param {string|string[]} candidates which candidates required to check ...
+ * @param {string} content the content which required to search candidates ...
+ * @param {number} startFromIndex the proposed index to start searching content from on ...
+ * @returns
+ */
+function findNearestIndex(
+ candidates = [''],
+ content = '',
+ startFromIndex = 0,
+ ignoreClosedItems = false
+) {
+ //
+ // Validate Args ...
+ if (
+ !isValidArg(content) ||
+ !isValidArg(candidates)
+ ) {
+ return -1;
+ }
+
+ //
+ // Mormalize startFromIndex value ...
+ startFromIndex = startFromIndex < 0 ?
+ 0 :
+ startFromIndex > content.length - 1 ?
+ content.length - 1 :
+ startFromIndex;
+
+ //
+ // Normalize candidates ...
+ let normalCandidates = toNormalArray(candidates);
+
+ //
+ if (!!ignoreClosedItems) {
+ normalCandidates = normalCandidates
+ .map(c => content.indexOf(
+ c,
+ startFromIndex
+ )
+ ).map(c => +c)
+ .filter(c => +c > -1);
+ } else {
+ normalCandidates = findAllIndexesOutOfCloseds(normalCandidates, content)
+ .filter(c => c >= startFromIndex);
+ }
+ if (!hasChildArray(normalCandidates)) {
+ return -1;
+ }
+
+ //
+ let result = -1;
+ result = Math.min(...normalCandidates);
+
+ //
+ return result;
+}
+
+/**
+ * find close index of specific sign in destination content ...
+ *
+ * @param {string} openSymbol open of area sign ...
+ * @param {string} closeSymbol close of area sign ...
+ * @param {string} content the destination content for parsing ...
+ * @param {number} startsFrom an start index of content for start parsing ...
+ * @returns
+ */
+function findCloseIndex(
+ openSymbol = '',
+ closeSymbol = '',
+ content = '',
+ startsFrom = -1
+) {
+ //
+ // Validate Args ...
+ if (
+ startsFrom < 0 ||
+ !isValidArg(content) ||
+ !isValidArg(openSymbol) ||
+ !isValidArg(closeSymbol) ||
+ openSymbol === closeSymbol ||
+ !content.includes(openSymbol) ||
+ !content.includes(closeSymbol) ||
+ startsFrom > content.length - 1
+ ) {
+ return -1;
+ }
+
+ //
+ let result = -1;
+
+ //
+ let index = startsFrom;
+ const openSignStack = [];
+ while (index < content.length) {
+ //
+ const openCandidate = content.substring(index, index + openSymbol.length);
+ const closeCandidate = content.substring(index, index + closeSymbol.length);
+
+ //
+ if (openCandidate === openSymbol) {
+ openSignStack.push(index);
+ } else if (closeCandidate === closeSymbol) {
+ //
+ if (openSignStack.length > 0) {
+ openSignStack.pop();
+ }
+
+ //
+ if (openSignStack.length === 0) {
+ result = index;
+ break;
+ }
+ }
+
+ //
+ index++;
+ }
+
+ //
+ return result;
+}
+
+/**
+ * find closed contents of specific sign in destination content ...
+ *
+ * @param {string} openSymbol open of area sign ...
+ * @param {string} closeSymbol close of area sign ...
+ * @param {string} content the destination content for parsing ...
+ * @param {number} startsFrom an start index of content for start parsing ...
+ * @returns
+ */
+function findClosedContent(
+ openSymbol = '',
+ closeSymbol = '',
+ content = '',
+ startsFrom = 0,
+) {
+ //
+ let result = [{
+ start: -1,
+ end: -1,
+ content: ''
+ }];
+ result.pop();
+
+ //
+ // Validate Args ...
+ if (
+ !isValidArg(content) ||
+ !isValidArg(openSymbol) ||
+ !isValidArg(closeSymbol) ||
+ !content.includes(openSymbol) ||
+ !content.includes(closeSymbol) ||
+ openSymbol.length >= content.length ||
+ closeSymbol.length >= content.length
+ ) {
+ return result;
+ }
+
+ //
+ // Normalize Start From ...
+ startsFrom = startsFrom < 0 || startsFrom >= content.length ? 0 : startsFrom;
+
+ //
+ let canContinue = true;
+ while (!!canContinue) {
+ //
+ let openSymbolIndex = content.indexOf(openSymbol, startsFrom);
+ if (openSymbolIndex < 0) {
+ //
+ canContinue = false;
+ continue;
+ }
+
+ //
+ let closeSymbolIndex = findCloseIndex(
+ openSymbol,
+ closeSymbol,
+ content,
+ openSymbolIndex
+ );
+ if (closeSymbolIndex < 0) {
+ //
+ canContinue = false;
+ continue;
+ }
+ if (content.charAt(closeSymbolIndex) !== closeSymbol) {
+ closeSymbolIndex++;
+ }
+
+ //
+ // Prevent ${} string interpolations ...
+ if (
+ openSymbol === '{' &&
+ openSymbolIndex - 1 >= 0
+ ) {
+ //
+ const prevChar = content.charAt(openSymbolIndex - 1);
+ if (prevChar === '$') {
+ continue;
+ }
+ }
+
+ //
+ const item = content
+ .substring(openSymbolIndex, closeSymbolIndex + 1)
+ .trim();
+ startsFrom = closeSymbolIndex + 1;
+ result.push({
+ start: openSymbolIndex,
+ end: closeSymbolIndex,
+ content: item
+ });
+ }
+
+ //
+ if (!hasChildArray(result)) {
+ return result;
+ }
+
+ //
+ return result;
+}
+
+/**
+ * extract a collection of closed contents exists in a content ...
+ *
+ * @param symbols a collection of open and close contents ...
+ * @param {string} content a content for searching inside it ...
+ * @returns a collection of closed content ...
+ */
+function findClosedContents(
+ symbols = [
+ {
+ openSymbol: '',
+ closeSymbol: ''
+ }
+ ],
+ content = ''
+) {
+ //
+ let result = [{
+ start: -1,
+ end: -1,
+ content: ''
+ }];
+ result.pop();
+
+ //
+ if (
+ !isValidArg(content) ||
+ !hasChildArray(symbols)
+ ) {
+ return [];
+ }
+
+ //
+ symbols.forEach(symbol => {
+ //
+ const closedContent = findClosedContent(
+ symbol.openSymbol,
+ symbol.closeSymbol,
+ content
+ );
+
+ //
+ if (hasChildArray(closedContent)) {
+ result.push(
+ ...closedContent
+ );
+ }
+ });
+
+ //
+ return result;
+}
+
+/**
+ * find all string content closed items ...
+ *
+ * @param {string} content a content which going to search ...
+ * @returns a collection of index descriptors ...
+ */
+function findClosedStrings(content = '') {
+ //
+ // Validate Args ...
+ if (!isValidArg(content)) {
+ return [];
+ }
+
+ //
+ // there are 3 types of strings ...
+ // ' " and `
+
+ //
+ const token1 = '\'';
+ const token1Stack = [0];
+ token1Stack.pop();
+
+ //
+ const token2 = '"';
+ const token2Stack = [0];
+ token2Stack.pop();
+
+ //
+ const token3 = '`';
+ const token3Stack = [0];
+ token3Stack.pop();
+
+ //
+ const result = [
+ {
+ start: -1,
+ end: -1,
+ content: ''
+ }
+ ];
+ result.pop();
+
+ //
+ for (let i = 0; i < content.length; i++) {
+ //
+ const currentChart = content.charAt(i);
+
+ //
+ //#region Token 1 ...
+ if (currentChart === token1) {
+ //
+ if (!hasChildArray(token1Stack)) {
+ token1Stack.push(i);
+ } else {
+ //
+ const start = token1Stack.pop();
+ const end = i + 1;
+ const pContent = content.substring(start, end);
+ result.push({
+ start,
+ end,
+ content: pContent
+ });
+ }
+ }
+ //#endregion
+
+ //
+ //#region Token 2 ...
+ if (currentChart === token2) {
+ //
+ if (!hasChildArray(token2Stack)) {
+ token2Stack.push(i);
+ } else {
+ //
+ const start = token2Stack.pop();
+ const end = i + 1;
+ const pContent = content.substring(start, end);
+ result.push({
+ start,
+ end,
+ content: pContent
+ });
+ }
+ }
+ //#endregion
+
+ //
+ //#region Token 3 ...
+ if (currentChart === token3) {
+ //
+ if (!hasChildArray(token3Stack)) {
+ token3Stack.push(i);
+ } else {
+ //
+ const start = token3Stack.pop();
+ const end = i + 1;
+ const pContent = content.substring(start, end);
+ result.push({
+ start,
+ end,
+ content: pContent
+ });
+ }
+ }
+ //#endregion
+ }
+
+ //
+ return result;
+}
+
+/**
+ * find container indexes from within indexes ...
+ *
+ * @param {...{start: number, end: number}} index the collection of indexes to find beiggers inside ...
+ * @returns
+ */
+function findContainerIndexes(...index) {
+ //
+ let result = [
+ {
+ start: -1,
+ end: -1,
+ content: ''
+ }
+ ];
+ result.pop();
+
+ //
+ let concatedIndexes = [];
+ for (let idx of index) {
+ //
+ // Index Childs ...
+ for (let iix of idx) {
+ //
+ // Check idx is standard ...
+ if (
+ !iix ||
+ !iix.end ||
+ !iix.start ||
+ iix.start > iix.end
+ ) {
+ continue;
+ }
+
+ //
+ // Check index inside another index ...
+ concatedIndexes.push(iix);
+ }
+ }
+
+ //
+ if (!hasChildArray(concatedIndexes)) {
+ return result;
+ }
+
+ //
+ for (let ccIdx of concatedIndexes) {
+ //
+ const isInside = isIndexInside(ccIdx, ...concatedIndexes);
+ if (isInside) {
+ continue;
+ }
+
+ //
+ if (hasChildArray(result)) {
+ //
+ const isInsideResult = isIndexInside(ccIdx, ...result);
+ if (isInsideResult) {
+ continue;
+ }
+ }
+
+ //
+ result.push(ccIdx);
+ }
+
+ //
+ return result;
+}
+
+/**
+ * find all tokens indexes inside a content which they are not inside closed items ...
+ *
+ * @param {string|string[]} tokens the tokens which require to search ...
+ * @param {string} content the content which using to search ...
+ * @returns
+ */
+function findAllIndexesOutOfCloseds1(
+ tokens,
+ content,
+) {
+ //
+ // Validate Args ...
+ if (!isValidArg(content)) {
+ return [];
+ }
+
+ //
+ // Extract token Indexes ...
+ const tokensIndexes = findAllIndexes(tokens, content);
+ if (!hasChildArray(tokensIndexes)) {
+ return [];
+ }
+
+ //
+ // Extract Closed Objects Indexes ...
+ const closedArrays = findClosedContent('[', ']', content);
+ const closedObjects = findClosedContent('{', '}', content);
+ const closedStrings = findClosedStrings(content);
+ if (
+ !hasChildArray(closedObjects) &&
+ !hasChildArray(closedArrays) &&
+ !hasChildArray(closedStrings)
+ ) {
+ return tokensIndexes;
+ }
+
+ //
+ // find bigger sloded ...
+ let containerClosedItems = findContainerIndexes(
+ closedArrays,
+ closedObjects,
+ closedStrings
+ ).filter(i => !isSurroundedString(i.content));
+
+ //
+ let result = [-1];
+ result.pop();
+
+ //
+ for (let tIdx of tokensIndexes) {
+ //
+ let canAdd = true;
+ for (let ccIndex of containerClosedItems) {
+ //
+ canAdd = isInsideIndex(tIdx, ccIndex);
+ if (canAdd) {
+ break;
+ }
+ }
+
+ //
+ if (!canAdd) {
+ result.push(tIdx);
+ }
+ }
+
+ //
+ return result;
+}
+
+/**
+ * find all tokens indexes inside a content which they are not inside closed items ...
+ *
+ * @param {string|string[]} tokens the tokens which require to search ...
+ * @param {string} content the content which using to search ...
+ * @returns
+ */
+function findAllIndexesOutOfCloseds(
+ tokens,
+ content,
+) {
+ //
+ // Define Result ...
+ let result = [-1];
+ result.pop();
+
+ //
+ // Validate Args ...
+ if (!isValidArg(content)) {
+ return [];
+ }
+
+ //
+ // Normalize Tokens ...
+ const normalizeTokens = toNormalArray(tokens);
+ if (!hasChildArray(normalizeTokens)) {
+ return result;
+ }
+
+ //
+ // Extract Closed Objects Indexes ...
+ let openSymbols = [
+ '{',
+ '[',
+ '\'',
+ '"',
+ '`'
+ ];
+ let closeSymbols = [
+ '}',
+ ']',
+ '\'',
+ '"',
+ '`'
+ ];
+ let openStack = [];
+ let lastOpenSymbol = '';
+ let lastClosedIndex = -1;
+ for (let i = 0; i < content.length; i++) {
+ //
+ const prevChar = content.charAt(i - 1) || '';
+ const char = content.charAt(i);
+ const nextChar = content.charAt(i + 1) || '';
+
+ //
+ const isToken = normalizeTokens.includes(char);
+ const isOpenSymbol = openSymbols.includes(char);
+ const isCloseSymbol = closeSymbols.includes(char);
+
+ //
+ if (isOpenSymbol && lastOpenSymbol !== char) {
+ openStack.push(i);
+ lastOpenSymbol = char === '\'' || char === '"' || char === '`' ? char : lastOpenSymbol;
+ } else if (isCloseSymbol) {
+ //
+ lastOpenSymbol = char === '\'' || char === '"' || char === '`' ? '' : lastOpenSymbol;
+ let lastPop = openStack.pop();
+ if (openStack.length === 0) {
+ lastClosedIndex = lastPop;
+ }
+ } else if (isToken) {
+ if (
+ i > lastClosedIndex &&
+ openStack.length === 0
+ ) {
+ result.push(i);
+ }
+ }
+ }
+
+ //
+ return result;
+}
+
+//
+// Module Exports ...
+module.exports = {
+ //
+ endsWidth,
+ surroundBy,
+ isValidArg,
+ isValidArgs,
+ toNormalArray,
+ hasChildArray,
+ toStringExpression,
+
+ //
+ sliceContent,
+ clearContent,
+ clearSurround,
+ clearArraySurround,
+ clearObjectSurround,
+
+ //
+ isSurrounded,
+ isIndexInside,
+ isInsideIndex,
+ isKeyValueType,
+ isSurroundedArray,
+ isSurroundedString,
+ isSurroundedObject,
+
+ //
+ findNearest,
+ findAllIndexes,
+ findCloseIndex,
+ findNearestIndex,
+ findClosedContent,
+ findClosedStrings,
+ findClosedContents,
+ findAllIndexesOutOfCloseds,
+
+ //
+}
\ No newline at end of file
diff --git a/platforms/electron/modules/tools/x-window.tools.js b/platforms/electron/modules/tools/x-window.tools.js
new file mode 100644
index 0000000..5cf4f35
--- /dev/null
+++ b/platforms/electron/modules/tools/x-window.tools.js
@@ -0,0 +1,125 @@
+/**
+ * main storage object ...
+ */
+const windows = {};
+
+/**
+ * retrieve all exists window id's ...
+ *
+ * @returns an array of strings which represents window id's ...
+ */
+function keys() {
+ return Object.keys(windows);
+}
+
+/**
+ * retrieve all available windows ...
+ *
+ * @returns an array of strings which represent BrowserWindow Objects ...
+ */
+function values() {
+ return Object.values(windows);
+}
+
+/**
+ * retrieve count of available windows ...
+ *
+ * @returns number
+ */
+function count() {
+ return Object.keys(windows).length;
+}
+
+/**
+ * check a BrowserWindow id exists or not ...
+ *
+ * @param {string} key window id ...
+ * @returns a boolean value which represent window exists or not ...
+ */
+function has(key) {
+ //
+ if (!key) {
+ return false;
+ }
+
+ //
+ return keys()
+ .includes(key);
+}
+
+/**
+ * retrieve a window by providing it's id ...
+ *
+ * @param {string} key window id ...
+ * @returns an instance of Browserwindow instance ...
+ */
+function get(key) {
+ //
+ if (!has(key)) {
+ return undefined;
+ }
+
+ //
+ return windows[key];
+}
+
+/**
+ * set a window by it's id ...
+ *
+ * @param {string} key window id ...
+ * @param {BrowserWindow} value specified window instance ...
+ * @returns a boolean value ...
+ */
+function set(key, value) {
+ //
+ try {
+ windows[key] = value;
+ return true;
+ } catch {
+ return false;
+ }
+}
+
+/**
+ * remove a key/value from windows ...
+ *
+ * @param {string} key window id ...
+ * @returns a boolean value ...
+ */
+function remove(key) {
+ //
+ if (!has(key)) {
+ return false;
+ }
+
+ //
+ try {
+ //
+ delete windows[key];
+ return true;
+ } catch {
+ return false;
+ }
+}
+
+/**
+ * clear all registered objects ...
+ */
+function clear() {
+ windows = {};
+}
+
+module.exports = {
+ //
+ windows: windows,
+
+ //
+ has: has,
+ get: get,
+ set: set,
+ keys: keys,
+ count: count,
+ clear: clear,
+ values: values,
+ remove: remove,
+}
\ No newline at end of file
diff --git a/platforms/electron/package.json b/platforms/electron/package.json
new file mode 100644
index 0000000..08fd452
--- /dev/null
+++ b/platforms/electron/package.json
@@ -0,0 +1,37 @@
+{
+ "name": "x-mabsut-client",
+ "version": "1.0.0",
+ "description": "Mabsut CLient application",
+ "homepage": "https://mabsut.ir",
+ "author": {
+ "name": "Hadi Khazaee Asl",
+ "email": "hadi_khazaee_asl@yahoo.com",
+ "url": "https://saherelm.ir"
+ },
+ "keywords": [
+ "x-mabsut",
+ "x-framework",
+ "saherelm"
+ ],
+ "scripts": {
+ "true": "",
+ "startElectron": "electron .",
+ "rmWWW": "shx --silent rm -rf ./www",
+ "prepareElectron": "npm run rmWWW && shx --silent cp -r ../../dist/xClient ./www",
+ "runElectron": "npm run rmWWW && cd .. && cd .. && npm run build && cd platforms/electron && npm run prepareElectron && npm run startElectron",
+ "runProdElectron": "cd .. && cd .. && npm run buildProd && cd platforms/electron && npm run prepareElectron && npm run startElectron",
+ "buildElectronWin32": "cd .. && cd .. && npm run buildProd && cd platforms/electron && npm run prepareElectron && electron-packager . --platform=win32 --arch=ia32 --icon=www/assets/icon/favicon.ico --overwrite --prune=true --out=dist",
+ "buildElectronWin64": "cd .. && cd .. && npm run buildProd && cd platforms/electron && npm run prepareElectron && electron-packager . --platform=win32 --arch=x64 --icon=www/assets/icon/favicon.ico --overwrite --prune=true --out=dist",
+ "buildElectronMac64": "cd .. && cd .. && npm run buildProd && cd platforms/electron && npm run prepareElectron && electron-packager . --platform=darwin --arch=x64 --icon=www/assets/icon/favicon.icns --overwrite --prune=true --out=dist",
+ "buildElectronLinux64": "cd .. && cd .. && npm run buildProd && cd platforms/electron && npm run prepareElectron && electron-packager . --platform=linux --arch=x64 --icon=www/assets/icon/favicon.png --overwrite --prune=true --out=dist"
+ },
+ "devDependencies": {
+ "electron-packager": "^15.3.0",
+ "uuid": "^8.3.2",
+ "shx": "^0.3.3"
+ },
+ "dependencies": {
+ "electron": "^13.1.7"
+ },
+ "main": "app.electron.js"
+}
diff --git a/plugins/android.json b/plugins/android.json
new file mode 100644
index 0000000..d09375b
--- /dev/null
+++ b/plugins/android.json
@@ -0,0 +1,31 @@
+{
+ "prepare_queue": {
+ "installed": [],
+ "uninstalled": []
+ },
+ "config_munge": {
+ "files": {}
+ },
+ "installed_plugins": {
+ "cordova-plugin-device": {
+ "PACKAGE_NAME": "ir.saherelm.xFramework.xFramework"
+ },
+ "cordova-plugin-ionic-keyboard": {
+ "PACKAGE_NAME": "ir.saherelm.xFramework.xFramework"
+ },
+ "cordova-plugin-ionic-webview": {
+ "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+",
+ "PACKAGE_NAME": "ir.saherelm.xFramework.xFramework"
+ },
+ "cordova-plugin-splashscreen": {
+ "PACKAGE_NAME": "ir.saherelm.xFramework.xFramework"
+ },
+ "cordova-plugin-statusbar": {
+ "PACKAGE_NAME": "ir.saherelm.xFramework.xFramework"
+ },
+ "cordova-plugin-whitelist": {
+ "PACKAGE_NAME": "ir.saherelm.xFramework.xFramework"
+ }
+ },
+ "dependent_plugins": {}
+}
diff --git a/plugins/cordova-plugin-device/.appveyor.yml b/plugins/cordova-plugin-device/.appveyor.yml
new file mode 100644
index 0000000..a7b2426
--- /dev/null
+++ b/plugins/cordova-plugin-device/.appveyor.yml
@@ -0,0 +1,28 @@
+# appveyor file
+# http://www.appveyor.com/docs/appveyor-yml
+
+max_jobs: 1
+
+shallow_clone: true
+
+init:
+ - git config --global core.autocrlf true
+
+image:
+ - Visual Studio 2017
+
+environment:
+ nodejs_version: "4"
+ matrix:
+ - PLATFORM: windows-10-store
+ JUST_BUILD: --justBuild
+install:
+ - npm cache clean -f
+ - node --version
+ - npm install -g cordova-paramedic@https://github.com/apache/cordova-paramedic.git
+ - npm install -g cordova
+
+build: off
+
+test_script:
+ - cordova-paramedic --config pr\%PLATFORM% --plugin . %JUST_BUILD%
diff --git a/plugins/cordova-plugin-device/.eslintrc.yml b/plugins/cordova-plugin-device/.eslintrc.yml
new file mode 100644
index 0000000..0cccb8c
--- /dev/null
+++ b/plugins/cordova-plugin-device/.eslintrc.yml
@@ -0,0 +1,10 @@
+root: true
+extends: semistandard
+rules:
+ indent:
+ - error
+ - 4
+ camelcase: off
+ padded-blocks: off
+ operator-linebreak: off
+ no-throw-literal: off
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device/.github/PULL_REQUEST_TEMPLATE.md b/plugins/cordova-plugin-device/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..91582f4
--- /dev/null
+++ b/plugins/cordova-plugin-device/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,22 @@
+
+
+### Platforms affected
+
+
+### What does this PR do?
+
+
+### What testing has been done on this change?
+
+
+### Checklist
+- [ ] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
+- [ ] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
+- [ ] Added automated test coverage as appropriate for this change.
diff --git a/plugins/cordova-plugin-device/.npmignore b/plugins/cordova-plugin-device/.npmignore
new file mode 100644
index 0000000..6964ea0
--- /dev/null
+++ b/plugins/cordova-plugin-device/.npmignore
@@ -0,0 +1,23 @@
+#If ignorance is bliss, then somebody knock the smile off my face
+
+*.csproj.user
+*.suo
+*.cache
+Thumbs.db
+*.DS_Store
+
+*.bak
+*.cache
+*.log
+*.swp
+*.user
+
+node_modules
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device/.travis.yml b/plugins/cordova-plugin-device/.travis.yml
new file mode 100644
index 0000000..ae0b308
--- /dev/null
+++ b/plugins/cordova-plugin-device/.travis.yml
@@ -0,0 +1,87 @@
+sudo: false
+addons:
+ jwt:
+ secure: egTo2EERSKVWdBoP+6ewd/JIyyly2XTT1xOVj27v2L148c453uRNPjXwiGRYu7vTw5rkGK+H54n4FG3rUOuEVNX9NDNC5TlkhTfmecXNzjyOIuV7xD0qg5s6Q3IXg8kAp9+JXWbVVR6hoPzmAAnTT4rcoh6cPg4Tf327W2sRGkw=
+env:
+ global:
+ - SAUCE_USERNAME=snay
+ - TRAVIS_NODE_VERSION="4.2"
+matrix:
+ include:
+ - env: PLATFORM=browser-chrome
+ os: linux
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=browser-firefox
+ os: linux
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=browser-safari
+ os: linux
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=browser-edge
+ os: linux
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=ios-9.3
+ os: osx
+ osx_image: xcode7.3
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=ios-10.0
+ os: osx
+ osx_image: xcode7.3
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=android-4.4
+ os: linux
+ language: android
+ jdk: oraclejdk8
+ android:
+ components:
+ - tools
+ - build-tools-26.0.2
+ - env: PLATFORM=android-5.1
+ os: linux
+ language: android
+ jdk: oraclejdk8
+ android:
+ components:
+ - tools
+ - build-tools-26.0.2
+ - env: PLATFORM=android-6.0
+ os: linux
+ language: android
+ jdk: oraclejdk8
+ android:
+ components:
+ - tools
+ - build-tools-26.0.2
+ - env: PLATFORM=android-7.0
+ os: linux
+ language: android
+ jdk: oraclejdk8
+ android:
+ components:
+ - tools
+ - build-tools-26.0.2
+before_install:
+- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm
+ && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm
+ install $TRAVIS_NODE_VERSION
+- node --version
+- if [[ "$PLATFORM" =~ android ]]; then gradle --version; fi
+- if [[ "$PLATFORM" =~ ios ]]; then npm install -g ios-deploy; fi
+- if [[ "$PLATFORM" =~ android ]]; then echo y | android update sdk -u --filter android-22,android-23,android-24,android-25,android-26;
+ fi
+- git clone https://github.com/apache/cordova-paramedic /tmp/paramedic && pushd /tmp/paramedic
+ && npm install && popd
+- npm install -g cordova
+install:
+- npm install
+script:
+- npm test
+- node /tmp/paramedic/main.js --config pr/$PLATFORM --plugin $(pwd) --shouldUseSauce
+ --buildName travis-plugin-device-$TRAVIS_JOB_NUMBER
+
diff --git a/plugins/cordova-plugin-device/CONTRIBUTING.md b/plugins/cordova-plugin-device/CONTRIBUTING.md
new file mode 100644
index 0000000..4c8e6a5
--- /dev/null
+++ b/plugins/cordova-plugin-device/CONTRIBUTING.md
@@ -0,0 +1,37 @@
+
+
+# Contributing to Apache Cordova
+
+Anyone can contribute to Cordova. And we need your contributions.
+
+There are multiple ways to contribute: report bugs, improve the docs, and
+contribute code.
+
+For instructions on this, start with the
+[contribution overview](http://cordova.apache.org/contribute/).
+
+The details are explained there, but the important items are:
+ - Sign and submit an Apache ICLA (Contributor License Agreement).
+ - Have a Jira issue open that corresponds to your contribution.
+ - Run the tests so your patch doesn't break existing functionality.
+
+We look forward to your contributions!
diff --git a/plugins/cordova-plugin-device/LICENSE b/plugins/cordova-plugin-device/LICENSE
new file mode 100644
index 0000000..7a4a3ea
--- /dev/null
+++ b/plugins/cordova-plugin-device/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device/NOTICE b/plugins/cordova-plugin-device/NOTICE
new file mode 100644
index 0000000..8ec56a5
--- /dev/null
+++ b/plugins/cordova-plugin-device/NOTICE
@@ -0,0 +1,5 @@
+Apache Cordova
+Copyright 2012 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
diff --git a/plugins/cordova-plugin-device/README.md b/plugins/cordova-plugin-device/README.md
new file mode 100644
index 0000000..048f028
--- /dev/null
+++ b/plugins/cordova-plugin-device/README.md
@@ -0,0 +1,267 @@
+---
+title: Device
+description: Get device information.
+---
+
+
+|AppVeyor|Travis CI|
+|:-:|:-:|
+|[](https://ci.appveyor.com/project/ApacheSoftwareFoundation/cordova-plugin-device)|[](https://travis-ci.org/apache/cordova-plugin-device)|
+
+# cordova-plugin-device
+
+This plugin defines a global `device` object, which describes the device's hardware and software.
+Although the object is in the global scope, it is not available until after the `deviceready` event.
+
+```js
+document.addEventListener("deviceready", onDeviceReady, false);
+function onDeviceReady() {
+ console.log(device.cordova);
+}
+```
+
+Report issues with this plugin on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Device%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC)
+
+
+## Installation
+
+ cordova plugin add cordova-plugin-device
+
+## Properties
+
+- device.cordova
+- device.model
+- device.platform
+- device.uuid
+- device.version
+- device.manufacturer
+- device.isVirtual
+- device.serial
+
+## device.cordova
+
+Get the version of Cordova running on the device.
+
+### Supported Platforms
+
+- Android
+- Browser
+- iOS
+- Windows
+- OSX
+
+## device.model
+
+The `device.model` returns the name of the device's model or
+product. The value is set by the device manufacturer and may be
+different across versions of the same product.
+
+### Supported Platforms
+
+- Android
+- Browser
+- iOS
+- Windows
+- OSX
+
+### Quick Example
+
+```js
+// Android: Nexus One returns "Passion" (Nexus One code name)
+// Motorola Droid returns "voles"
+// BlackBerry: Torch 9800 returns "9800"
+// Browser: Google Chrome returns "Chrome"
+// Safari returns "Safari"
+// iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. See http://theiphonewiki.com/wiki/index.php?title=Models
+// OSX: returns "x86_64"
+//
+var model = device.model;
+```
+
+### Android Quirks
+
+- Gets the [product name](http://developer.android.com/reference/android/os/Build.html#PRODUCT) instead of the [model name](http://developer.android.com/reference/android/os/Build.html#MODEL), which is often the production code name. For example, the Nexus One returns `Passion`, and Motorola Droid returns `voles`.
+
+## device.platform
+
+Get the device's operating system name.
+
+```js
+var string = device.platform;
+```
+### Supported Platforms
+
+- Android
+- Browser
+- iOS
+- Windows
+- OSX
+
+### Quick Example
+
+```js
+// Depending on the device, a few examples are:
+// - "Android"
+// - "BlackBerry 10"
+// - "browser"
+// - "iOS"
+// - "WinCE"
+// - "Tizen"
+// - "Mac OS X"
+var devicePlatform = device.platform;
+```
+
+## device.uuid
+
+Get the device's Universally Unique Identifier ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)).
+
+```js
+var string = device.uuid;
+```
+
+### Description
+
+The details of how a UUID is generated are determined by the device manufacturer and are specific to the device's platform or model.
+
+### Supported Platforms
+
+- Android
+- iOS
+- Windows
+- OSX
+
+### Quick Example
+
+```js
+// Android: Returns a random 64-bit integer (as a string, again!)
+// The integer is generated on the device's first boot
+//
+// BlackBerry: Returns the PIN number of the device
+// This is a nine-digit unique integer (as a string, though!)
+//
+// iPhone: (Paraphrased from the UIDevice Class documentation)
+// Returns the [UIDevice identifierForVendor] UUID which is unique and the same for all apps installed by the same vendor. However the UUID can be different if the user deletes all apps from the vendor and then reinstalls it.
+// Windows Phone 7 : Returns a hash of device+current user,
+// if the user is not defined, a guid is generated and will persist until the app is uninstalled
+// Tizen: returns the device IMEI (International Mobile Equipment Identity or IMEI is a number
+// unique to every GSM and UMTS mobile phone.
+var deviceID = device.uuid;
+```
+
+### iOS Quirk
+
+The `uuid` on iOS uses the identifierForVendor property. It is unique to the device across the same vendor, but will be different for different vendors and will change if all apps from the vendor are deleted and then reinstalled.
+Refer [here](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/#//apple_ref/occ/instp/UIDevice/identifierForVendor) for details.
+The UUID will be the same if app is restored from a backup or iCloud as it is saved in preferences. Users using older versions of this plugin will still receive the same previous UUID generated by another means as it will be retrieved from preferences.
+
+### OSX Quirk
+
+The `uuid` on OSX is generated automatically if it does not exist yet and is stored in the `standardUserDefaults` in the `CDVUUID` property.
+
+## device.version
+
+Get the operating system version.
+
+ var string = device.version;
+
+### Supported Platforms
+
+- Android 2.1+
+- Browser
+- iOS
+- Windows
+- OSX
+
+### Quick Example
+
+```js
+// Android: Froyo OS would return "2.2"
+// Eclair OS would return "2.1", "2.0.1", or "2.0"
+// Version can also return update level "2.1-update1"
+//
+// BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+//
+// Browser: Returns version number for the browser
+//
+// iPhone: iOS 3.2 returns "3.2"
+//
+// Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+// Windows 8: return the current OS version, ex on Windows 8.1 returns 6.3.9600.16384
+// Tizen: returns "TIZEN_20120425_2"
+// OSX: El Capitan would return "10.11.2"
+//
+var deviceVersion = device.version;
+```
+
+## device.manufacturer
+
+Get the device's manufacturer.
+
+ var string = device.manufacturer;
+
+### Supported Platforms
+
+- Android
+- iOS
+- Windows
+
+### Quick Example
+
+```js
+// Android: Motorola XT1032 would return "motorola"
+// BlackBerry: returns "BlackBerry"
+// iPhone: returns "Apple"
+//
+var deviceManufacturer = device.manufacturer;
+```
+
+## device.isVirtual
+
+whether the device is running on a simulator.
+
+```js
+var isSim = device.isVirtual;
+```
+
+### Supported Platforms
+
+- Android 2.1+
+- Browser
+- iOS
+- Windows
+- OSX
+
+### OSX and Browser Quirk
+
+The `isVirtual` property on OS X and Browser always returns false.
+
+## device.serial
+
+Get the device hardware serial number ([SERIAL](http://developer.android.com/reference/android/os/Build.html#SERIAL)).
+
+```js
+var string = device.serial;
+```
+
+### Supported Platforms
+
+- Android
+- OSX
+
diff --git a/plugins/cordova-plugin-device/RELEASENOTES.md b/plugins/cordova-plugin-device/RELEASENOTES.md
new file mode 100644
index 0000000..12d4008
--- /dev/null
+++ b/plugins/cordova-plugin-device/RELEASENOTES.md
@@ -0,0 +1,181 @@
+
+# Release Notes
+
+### 2.0.2 (Apr 12, 2018)
+* [CB-13893](https://issues.apache.org/jira/browse/CB-13893) **iOS** delete `libz.tbd` from device plugin
+
+### 2.0.1 (Dec 27, 2017)
+* [CB-13702](https://issues.apache.org/jira/browse/CB-13702) Fix to allow 2.0.0 version install
+
+### 2.0.0 (Dec 15, 2017)
+* [CB-13670](https://issues.apache.org/jira/browse/CB-13670) Remove deprecated platforms
+
+### 1.1.7 (Nov 06, 2017)
+* [CB-13472](https://issues.apache.org/jira/browse/CB-13472) (CI) Fixed Travis **Android** builds again
+* [CB-12895](https://issues.apache.org/jira/browse/CB-12895) setup `eslint` and removed `jshint`
+* [CB-13113](https://issues.apache.org/jira/browse/CB-13113) (browser) `device.isVirtual` is always false
+* [CB-13028](https://issues.apache.org/jira/browse/CB-13028) (CI) **Browser** builds on Travis and AppVeyor
+* [CB-13000](https://issues.apache.org/jira/browse/CB-13000) (CI) Speed up **Android** builds
+* [CB-12847](https://issues.apache.org/jira/browse/CB-12847) added `bugs` entry to `package.json`.
+
+### 1.1.6 (Apr 27, 2017)
+* [CB-12622](https://issues.apache.org/jira/browse/CB-12622) Added **Android 6.0** build badge to `README`
+* [CB-12685](https://issues.apache.org/jira/browse/CB-12685) added `package.json` to tests folder
+* [CB-12105](https://issues.apache.org/jira/browse/CB-12105) (browser) Properly detect Edge
+
+### 1.1.5 (Feb 28, 2017)
+* [CB-12353](https://issues.apache.org/jira/browse/CB-12353) Corrected merges usage in `plugin.xml`
+* [CB-12369](https://issues.apache.org/jira/browse/CB-12369) Add plugin typings from `DefinitelyTyped`
+* [CB-12363](https://issues.apache.org/jira/browse/CB-12363) Added build badges for **iOS 9.3** and **iOS 10.0**
+* [CB-12230](https://issues.apache.org/jira/browse/CB-12230) Removed **Windows 8.1** build badges
+
+### 1.1.4 (Dec 07, 2016)
+* [CB-12224](https://issues.apache.org/jira/browse/CB-12224) Updated version and RELEASENOTES.md for release 1.1.4
+* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…"
+* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version.
+
+### 1.1.3 (Sep 08, 2016)
+* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies
+* Add badges for paramedic builds on Jenkins
+* Add pull request template.
+* Readme: Add fenced code blocks with langauage hints
+* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to `README.md`
+
+### 1.1.2 (Apr 15, 2016)
+* Use passed device, follow create policy forf `CFUUIDCreate`
+* [CB-10631](https://issues.apache.org/jira/browse/CB-10631) Fix for `device.uuid` in **iOS 5.1.1**
+* Updating the comment to exclude URL
+* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add `JSHint` for plugins
+* Refactored `deviceInfo` on **iOS** for better readability.
+
+### 1.1.1 (Jan 15, 2016)
+* [CB-10238](https://issues.apache.org/jira/browse/CB-10238) **OSX** Move `device-plugin` out from `cordovalib` to the plugin repository
+* [CB-9923](https://issues.apache.org/jira/browse/CB-9923) Update `device.platform` documentation for **Browser** platform
+
+### 1.1.0 (Nov 18, 2015)
+* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
+* Add `isVirtual` for **Windows Phone 8.x**
+* Added basic **Android** support for hardware serial number
+* [CB-9865](https://issues.apache.org/jira/browse/CB-9865) Better simulator detection for **iOS**
+* Fixing contribute link.
+* Added **WP8** implementation
+* update to use `TARGET_OS_SIMULATOR` as `TARGET_IPHONE_SIMULATOR` is deprecated.
+* update code to use 'isVirtual'
+* create test to verify existence and type of new property 'isVirtual'
+* add `isSimulator` for **iOS** & **Android** device
+* Updated documentation to mention backwards compatibility
+* Updated **README** to reflect new behaviour and quirks on **iOS**
+* Check user defaults first to maintain backwards compatibility
+* Changed `UUID` to use `[UIDevice identifierForVendor]`
+
+### 1.0.1 (Jun 17, 2015)
+* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-device documentation translation: cordova-plugin-device
+* Attempts to corrent npm markdown issue
+
+### 1.0.0 (Apr 15, 2015)
+* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
+* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
+* Use TRAVIS_BUILD_DIR, install paramedic by npm
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
+* remove defunct windows8 version
+* add travis badge
+* Add cross-plugin ios paramedic test running for TravisCI
+* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
+
+### 0.3.0 (Feb 04, 2015)
+* Added device.manufacturer property for Android, iOS, Blackberry, WP8
+* Support for Windows Phone 8 ANID2 ANID is only supported up to Windows Phone 7.5
+* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) Use a local copy of uniqueAppInstanceIdentifier rather than CordovaLib's version
+* browser: Fixed a bug that caused an "cannot call method of undefined" error if the browser's user agent wasn't recognized
+
+### 0.2.13 (Dec 02, 2014)
+* Changing `device.platform` to always report the platform as "browser".
+* [CB-5892](https://issues.apache.org/jira/browse/CB-5892) - Remove deprecated `window.Settings`
+* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-device documentation translation: cordova-plugin-device
+* [CB-7571](https://issues.apache.org/jira/browse/CB-7571) Bump version of nested plugin to match parent plugin
+
+### 0.2.12 (Sep 17, 2014)
+* [CB-7471](https://issues.apache.org/jira/browse/CB-7471) cordova-plugin-device documentation translation
+* [CB-7552](https://issues.apache.org/jira/browse/CB-7552) device.name docs have not been removed
+* [fxos] Fix cordova version
+* added status box and documentation to manual tests
+* [fxos] Fix cordova version
+* added status box and documentation to manual tests
+* Added plugin support for the browser
+* [CB-7262](https://issues.apache.org/jira/browse/CB-7262) Adds support for universal windows apps.
+
+### 0.2.11 (Aug 06, 2014)
+* [FFOS] update DeviceProxy.js
+* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
+* Use Windows system calls to get better info
+
+### 0.2.10 (Jun 05, 2014)
+* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Spanish and French Translations added. Github close #12
+* Changing 1.5 to 2.0
+* added firefoxos version - conversion
+* added firefoxos version
+* [CB-6800](https://issues.apache.org/jira/browse/CB-6800) Add license
+* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
+
+### 0.2.9 (Apr 17, 2014)
+* [CB-5105](https://issues.apache.org/jira/browse/CB-5105): [Android, windows8, WP, BlackBerry10] Removed dead code for device.version
+* [CB-6422](https://issues.apache.org/jira/browse/CB-6422): [windows8] use cordova/exec/proxy
+* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
+* Add NOTICE file
+
+### 0.2.8 (Feb 05, 2014)
+* Tizen support added
+
+### 0.2.7 (Jan 07, 2014)
+* [CB-5737](https://issues.apache.org/jira/browse/CB-5737) Fix exception on close caused by left over telephony code from [CB-5504](https://issues.apache.org/jira/browse/CB-5504)
+
+### 0.2.6 (Jan 02, 2014)
+* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Device plugin
+* [CB-5504](https://issues.apache.org/jira/browse/CB-5504) Moving Telephony Logic out of Device
+
+### 0.2.5 (Dec 4, 2013)
+* [CB-5316](https://issues.apache.org/jira/browse/CB-5316) Spell Cordova as a brand unless it's a command or script
+* [ubuntu] use cordova/exec/proxy
+* add ubuntu platform
+* Modify Device.platform logic to use amazon-fireos as the platform for Amazon Devices
+* 1. Added amazon-fireos platform. 2. Change to use cordova-amazon-fireos as the platform if user agent contains 'cordova-amazon-fireos'
+
+### 0.2.4 (Oct 28, 2013)
+* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): added repo + issue tag in plugin.xml for device plugin
+* [CB-5085](https://issues.apache.org/jira/browse/CB-5085) device.cordova returning wrong value
+* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
+
+### 0.2.3 (Sept 25, 2013)
+* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version
+* [windows8] commandProxy has moved
+* [BlackBerry10] removed uneeded permission tags in plugin.xml
+* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.device to org.apache.cordova.device
+* Rename CHANGELOG.md -> RELEASENOTES.md
+* updated to use commandProxy for ffos
+* add firefoxos support
+* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch.
+
+### 0.2.1 (Sept 5, 2013)
+* removed extraneous print statement
+* [CB-4432](https://issues.apache.org/jira/browse/CB-4432) copyright notice change
diff --git a/plugins/cordova-plugin-device/doc/de/README.md b/plugins/cordova-plugin-device/doc/de/README.md
new file mode 100644
index 0000000..81f89e9
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/de/README.md
@@ -0,0 +1,203 @@
+
+
+# cordova-plugin-device
+
+[](https://travis-ci.org/apache/cordova-plugin-device)
+
+Dieses Plugin definiert eine globale `device` -Objekt, das des Geräts Hard- und Software beschreibt. Das Objekt im globalen Gültigkeitsbereich ist es zwar nicht verfügbar bis nach dem `deviceready` Ereignis.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## Installation
+
+ cordova plugin add cordova-plugin-device
+
+
+## Eigenschaften
+
+ * device.cordova
+ * device.model
+ * device.platform
+ * device.uuid
+ * device.version
+
+## device.cordova
+
+Rufen Sie die Version von Cordova, die auf dem Gerät ausgeführt.
+
+### Unterstützte Plattformen
+
+ * Amazon Fire OS
+ * Android
+ * BlackBerry 10
+ * Browser
+ * Firefox OS
+ * iOS
+ * Tizen
+ * Windows Phone 7 und 8
+ * Windows 8
+
+## device.model
+
+Die `device.model` gibt den Namen der Modell- oder des Geräts zurück. Der Wert wird vom Gerätehersteller festgelegt und kann zwischen den Versionen des gleichen Produkts unterschiedlich sein.
+
+### Unterstützte Plattformen
+
+ * Android
+ * BlackBerry 10
+ * Browser
+ * iOS
+ * Tizen
+ * Windows Phone 7 und 8
+ * Windows 8
+
+### Kurzes Beispiel
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Finden Sie unter http://theiphonewiki.com/wiki/index.php?title=Models / / Var-Modell = device.model;
+
+
+### Android Eigenarten
+
+ * Ruft den [Produktname](http://developer.android.com/reference/android/os/Build.html#PRODUCT) anstelle des [Modellnamens](http://developer.android.com/reference/android/os/Build.html#MODEL), das ist oft der Codename für die Produktion. Beispielsweise das Nexus One gibt `Passion` , und Motorola Droid gibt`voles`.
+
+### Tizen Macken
+
+ * Gibt z. B. das Gerätemodell von dem Kreditor zugeordnet,`TIZEN`
+
+### Windows Phone 7 und 8 Eigenarten
+
+ * Gibt das vom Hersteller angegebenen Gerätemodell zurück. Beispielsweise gibt der Samsung-Fokus`SGH-i917`.
+
+## device.platform
+
+Name des Betriebssystems des Geräts zu erhalten.
+
+ var string = device.platform;
+
+
+### Unterstützte Plattformen
+
+ * Android
+ * BlackBerry 10
+ * Browser4
+ * Firefox OS
+ * iOS
+ * Tizen
+ * Windows Phone 7 und 8
+ * Windows 8
+
+### Kurzes Beispiel
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Windows Phone 7 Macken
+
+Windows Phone 7 Geräte melden die Plattform als`WinCE`.
+
+### Windows Phone 8 Macken
+
+Windows Phone 8 Geräte melden die Plattform als`Win32NT`.
+
+## device.uuid
+
+Des Geräts Universally Unique Identifier ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier) zu erhalten).
+
+ var string = device.uuid;
+
+
+### Beschreibung
+
+Die Details wie eine UUID generiert wird werden vom Gerätehersteller und beziehen sich auf die Plattform oder das Modell des Geräts.
+
+### Unterstützte Plattformen
+
+ * Android
+ * BlackBerry 10
+ * iOS
+ * Tizen
+ * Windows Phone 7 und 8
+ * Windows 8
+
+### Kurzes Beispiel
+
+ / / Android: wird eine zufällige 64-Bit-Ganzzahl (als Zeichenfolge, wieder!) / / die ganze Zahl wird beim ersten Start des Geräts erzeugt / / / / BlackBerry: gibt die PIN-Nummer des Gerätes / / Dies ist eine neunstellige eindeutige Ganzzahl (als String, obwohl!) / / / / iPhone: (paraphrasiert aus der Dokumentation zur UIDevice-Klasse) / / liefert eine Reihe von Hash-Werte, die aus mehreren Hardware erstellt identifiziert.
+ / / Es ist gewährleistet, dass für jedes Gerät eindeutig sein und kann nicht gebunden werden / / an den Benutzer weitergeleitet.
+ / / Windows Phone 7: gibt einen Hash des Gerät + aktueller Benutzer, / / wenn der Benutzer nicht definiert ist, eine Guid generiert und wird weiter bestehen, bis die app deinstalliert wird / / Tizen: gibt das Gerät IMEI (International Mobile Equipment Identity oder IMEI ist eine Zahl / / einzigartig für jedes GSM- und UMTS-Handy.
+ var deviceID = device.uuid;
+
+
+### iOS Quirk
+
+Die `uuid` auf iOS ist nicht eindeutig zu einem Gerät, aber für jede Anwendung, für jede Installation variiert. Es ändert sich, wenn Sie löschen und neu die app installieren, und möglicherweise auch beim iOS zu aktualisieren, oder auch ein Upgrade möglich die app pro Version (scheinbaren in iOS 5.1). Die `uuid` ist kein zuverlässiger Wert.
+
+### Windows Phone 7 und 8 Eigenarten
+
+Die `uuid` für Windows Phone 7 die Berechtigung erfordert `ID_CAP_IDENTITY_DEVICE` . Microsoft wird diese Eigenschaft wahrscheinlich bald abzuschaffen. Wenn die Funktion nicht verfügbar ist, generiert die Anwendung eine persistente Guid, die für die Dauer der Installation der Anwendung auf dem Gerät gewährleistet ist.
+
+## device.version
+
+Version des Betriebssystems zu erhalten.
+
+ var string = device.version;
+
+
+### Unterstützte Plattformen
+
+ * Android 2.1 +
+ * BlackBerry 10
+ * Browser
+ * iOS
+ * Tizen
+ * Windows Phone 7 und 8
+ * Windows 8
+
+### Kurzes Beispiel
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+ // Tizen: returns "TIZEN_20120425_2"
+ var deviceVersion = device.version;
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device/doc/de/index.md b/plugins/cordova-plugin-device/doc/de/index.md
new file mode 100644
index 0000000..e3a537e
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/de/index.md
@@ -0,0 +1,206 @@
+
+
+# cordova-plugin-device
+
+Dieses Plugin definiert eine globale `device` -Objekt, das des Geräts Hard- und Software beschreibt. Das Objekt im globalen Gültigkeitsbereich ist es zwar nicht verfügbar bis nach dem `deviceready` Ereignis.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## Installation
+
+ cordova plugin add cordova-plugin-device
+
+
+## Eigenschaften
+
+* device.cordova
+* device.model
+* device.platform
+* device.uuid
+* device.version
+
+## device.cordova
+
+Rufen Sie die Version von Cordova, die auf dem Gerät ausgeführt.
+
+### Unterstützte Plattformen
+
+* Amazon Fire OS
+* Android
+* BlackBerry 10
+* Browser
+* Firefox OS
+* iOS
+* Tizen
+* Windows Phone 7 und 8
+* Windows 8
+
+## device.model
+
+Die `device.model` gibt den Namen der Modell- oder des Geräts zurück. Der Wert wird vom Gerätehersteller festgelegt und kann zwischen den Versionen des gleichen Produkts unterschiedlich sein.
+
+### Unterstützte Plattformen
+
+* Android
+* BlackBerry 10
+* Browser
+* iOS
+* Tizen
+* Windows Phone 7 und 8
+* Windows 8
+
+### Kurzes Beispiel
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Finden Sie unter http://theiphonewiki.com/wiki/index.php?title=Models / / Var-Modell = device.model;
+
+
+### Android Eigenarten
+
+* Ruft den [Produktname][1] anstelle des [Modellnamens][2], das ist oft der Codename für die Produktion. Beispielsweise das Nexus One gibt `Passion` , und Motorola Droid gibt`voles`.
+
+ [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT
+ [2]: http://developer.android.com/reference/android/os/Build.html#MODEL
+
+### Tizen Macken
+
+* Gibt z. B. das Gerätemodell von dem Kreditor zugeordnet,`TIZEN`
+
+### Windows Phone 7 und 8 Eigenarten
+
+* Gibt das vom Hersteller angegebenen Gerätemodell zurück. Beispielsweise gibt der Samsung-Fokus`SGH-i917`.
+
+## device.platform
+
+Name des Betriebssystems des Geräts zu erhalten.
+
+ var string = device.platform;
+
+
+### Unterstützte Plattformen
+
+* Android
+* BlackBerry 10
+* Browser4
+* Firefox OS
+* iOS
+* Tizen
+* Windows Phone 7 und 8
+* Windows 8
+
+### Kurzes Beispiel
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Windows Phone 7 Macken
+
+Windows Phone 7 Geräte melden die Plattform als`WinCE`.
+
+### Windows Phone 8 Macken
+
+Windows Phone 8 Geräte melden die Plattform als`Win32NT`.
+
+## device.uuid
+
+Des Geräts Universally Unique Identifier ([UUID][3] zu erhalten).
+
+ [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier
+
+ var string = device.uuid;
+
+
+### Beschreibung
+
+Die Details wie eine UUID generiert wird werden vom Gerätehersteller und beziehen sich auf die Plattform oder das Modell des Geräts.
+
+### Unterstützte Plattformen
+
+* Android
+* BlackBerry 10
+* iOS
+* Tizen
+* Windows Phone 7 und 8
+* Windows 8
+
+### Kurzes Beispiel
+
+ / / Android: wird eine zufällige 64-Bit-Ganzzahl (als Zeichenfolge, wieder!) / / die ganze Zahl wird beim ersten Start des Geräts erzeugt / / / / BlackBerry: gibt die PIN-Nummer des Gerätes / / Dies ist eine neunstellige eindeutige Ganzzahl (als String, obwohl!) / / / / iPhone: (paraphrasiert aus der Dokumentation zur UIDevice-Klasse) / / liefert eine Reihe von Hash-Werte, die aus mehreren Hardware erstellt identifiziert.
+ / / Es ist gewährleistet, dass für jedes Gerät eindeutig sein und kann nicht gebunden werden / / an den Benutzer weitergeleitet.
+ / / Windows Phone 7: gibt einen Hash des Gerät + aktueller Benutzer, / / wenn der Benutzer nicht definiert ist, eine Guid generiert und wird weiter bestehen, bis die app deinstalliert wird / / Tizen: gibt das Gerät IMEI (International Mobile Equipment Identity oder IMEI ist eine Zahl / / einzigartig für jedes GSM- und UMTS-Handy.
+ var deviceID = device.uuid;
+
+
+### iOS Quirk
+
+Die `uuid` auf iOS ist nicht eindeutig zu einem Gerät, aber für jede Anwendung, für jede Installation variiert. Es ändert sich, wenn Sie löschen und neu die app installieren, und möglicherweise auch beim iOS zu aktualisieren, oder auch ein Upgrade möglich die app pro Version (scheinbaren in iOS 5.1). Die `uuid` ist kein zuverlässiger Wert.
+
+### Windows Phone 7 und 8 Eigenarten
+
+Die `uuid` für Windows Phone 7 die Berechtigung erfordert `ID_CAP_IDENTITY_DEVICE` . Microsoft wird diese Eigenschaft wahrscheinlich bald abzuschaffen. Wenn die Funktion nicht verfügbar ist, generiert die Anwendung eine persistente Guid, die für die Dauer der Installation der Anwendung auf dem Gerät gewährleistet ist.
+
+## device.version
+
+Version des Betriebssystems zu erhalten.
+
+ var string = device.version;
+
+
+### Unterstützte Plattformen
+
+* Android 2.1 +
+* BlackBerry 10
+* Browser
+* iOS
+* Tizen
+* Windows Phone 7 und 8
+* Windows 8
+
+### Kurzes Beispiel
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+ // Tizen: returns "TIZEN_20120425_2"
+ var deviceVersion = device.version;
diff --git a/plugins/cordova-plugin-device/doc/es/README.md b/plugins/cordova-plugin-device/doc/es/README.md
new file mode 100644
index 0000000..a27abfb
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/es/README.md
@@ -0,0 +1,216 @@
+
+
+# cordova-plugin-device
+
+[](https://travis-ci.org/apache/cordova-plugin-device)
+
+Este plugin define un global `device` objeto que describe del dispositivo hardware y software. Aunque el objeto está en el ámbito global, no está disponible hasta después de la `deviceready` evento.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## Instalación
+
+ cordova plugin add cordova-plugin-device
+
+
+## Propiedades
+
+ * device.cordova
+ * device.model
+ * device.platform
+ * device.uuid
+ * device.version
+
+## device.cordova
+
+Obtener la versión de Cordova que se ejecuta en el dispositivo.
+
+### Plataformas soportadas
+
+ * Amazon fire OS
+ * Android
+ * BlackBerry 10
+ * Explorador
+ * Firefox OS
+ * iOS
+ * Tizen
+ * Windows Phone 7 y 8
+ * Windows 8
+
+## device.model
+
+El `device.model` devuelve el nombre de modelo del dispositivo o producto. El valor es fijado por el fabricante del dispositivo y puede ser diferente a través de versiones del mismo producto.
+
+### Plataformas soportadas
+
+ * Android
+ * BlackBerry 10
+ * Explorador
+ * iOS
+ * Tizen
+ * Windows Phone 7 y 8
+ * Windows 8
+
+### Ejemplo rápido
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. See http://theiphonewiki.com/wiki/index.php?title=Models
+ //
+ var model = device.model;
+
+
+### Rarezas Android
+
+ * Obtiene el [nombre del producto](http://developer.android.com/reference/android/os/Build.html#PRODUCT) en lugar del [nombre de la modelo](http://developer.android.com/reference/android/os/Build.html#MODEL), que es a menudo el nombre de código de producción. Por ejemplo, el Nexus One devuelve `Passion` y Motorola Droid devuelve `voles`.
+
+### Rarezas Tizen
+
+ * Devuelve que el modelo de dispositivo asignado por el proveedor, por ejemplo, `TIZEN`
+
+### Windows Phone 7 y 8 rarezas
+
+ * Devuelve el modelo de dispositivo especificado por el fabricante. Por ejemplo, el Samsung Focus devuelve `SGH-i917`.
+
+## device.platform
+
+Obtener el nombre del sistema operativo del dispositivo.
+
+ var string = device.platform;
+
+
+### Plataformas soportadas
+
+ * Android
+ * BlackBerry 10
+ * Browser4
+ * Firefox OS
+ * iOS
+ * Tizen
+ * Windows Phone 7 y 8
+ * Windows 8
+
+### Ejemplo rápido
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Windows Phone 7 rarezas
+
+Dispositivos Windows Phone 7 informe de la plataforma como `WinCE`.
+
+### Windows Phone 8 rarezas
+
+Dispositivos Windows Phone 8 Informe la plataforma como `Win32NT`.
+
+## device.uuid
+
+Obtener identificador universalmente única del dispositivo ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)).
+
+ var string = device.uuid;
+
+
+### Descripción
+
+Los detalles de cómo se genera un UUID son determinados por el fabricante del dispositivo y son específicos a la plataforma del dispositivo o modelo.
+
+### Plataformas soportadas
+
+ * Android
+ * BlackBerry 10
+ * iOS
+ * Tizen
+ * Windows Phone 7 y 8
+ * Windows 8
+
+### Ejemplo rápido
+
+ // Android: Returns a random 64-bit integer (as a string, again!)
+ // The integer is generated on the device's first boot
+ //
+ // BlackBerry: Returns the PIN number of the device
+ // This is a nine-digit unique integer (as a string, though!)
+ //
+ // iPhone: (Paraphrased from the UIDevice Class documentation)
+ // Returns a string of hash values created from multiple hardware identifies.
+ // It is guaranteed to be unique for every device and can't be tied
+ // to the user account.
+ // Windows Phone 7 : Returns a hash of device+current user,
+ // if the user is not defined, a guid is generated and will persist until the app is uninstalled
+ // Tizen: returns the device IMEI (International Mobile Equipment Identity or IMEI is a number
+ // unique to every GSM and UMTS mobile phone.
+ var deviceID = device.uuid;
+
+
+### Rarezas de iOS
+
+El `uuid` en iOS no es exclusiva de un dispositivo, pero varía para cada aplicación, para cada instalación. Cambia si puedes borrar y volver a instalar la aplicación, y posiblemente también cuándo actualizar iOS, o incluso mejorar la aplicación por la versión (evidente en iOS 5.1). El `uuid` no es un valor confiable.
+
+### Windows Phone 7 y 8 rarezas
+
+El `uuid` para Windows Phone 7 requiere el permiso `ID_CAP_IDENTITY_DEVICE`. Microsoft pronto probablemente desaprueban esta propiedad. Si la capacidad no está disponible, la aplicación genera un guid persistente que se mantiene durante la duración de la instalación de la aplicación en el dispositivo.
+
+## device.version
+
+Obtener la versión del sistema operativo.
+
+ var string = device.version;
+
+
+### Plataformas soportadas
+
+ * Android 2.1 +
+ * BlackBerry 10
+ * Explorador
+ * iOS
+ * Tizen
+ * Windows Phone 7 y 8
+ * Windows 8
+
+### Ejemplo rápido
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+ // Tizen: returns "TIZEN_20120425_2"
+ var deviceVersion = device.version;
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device/doc/es/index.md b/plugins/cordova-plugin-device/doc/es/index.md
new file mode 100644
index 0000000..f4a5897
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/es/index.md
@@ -0,0 +1,220 @@
+
+
+# cordova-plugin-device
+
+Este plugin define un global `device` objeto que describe del dispositivo hardware y software. Aunque el objeto está en el ámbito global, no está disponible hasta después de la `deviceready` evento.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## Instalación
+
+ cordova plugin add cordova-plugin-device
+
+
+## Propiedades
+
+* device.cordova
+* device.model
+* device.platform
+* device.uuid
+* device.version
+
+## device.cordova
+
+Obtener la versión de Cordova que se ejecuta en el dispositivo.
+
+### Plataformas soportadas
+
+* Amazon fire OS
+* Android
+* BlackBerry 10
+* Explorador
+* Firefox OS
+* iOS
+* Tizen
+* Windows Phone 7 y 8
+* Windows 8
+
+## device.model
+
+El `device.model` devuelve el nombre de modelo del dispositivo o producto. El valor es fijado por el fabricante del dispositivo y puede ser diferente a través de versiones del mismo producto.
+
+### Plataformas soportadas
+
+* Android
+* BlackBerry 10
+* Explorador
+* iOS
+* Tizen
+* Windows Phone 7 y 8
+* Windows 8
+
+### Ejemplo rápido
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. See http://theiphonewiki.com/wiki/index.php?title=Models
+ //
+ var model = device.model;
+
+
+### Rarezas Android
+
+* Obtiene el [nombre del producto][1] en lugar del [nombre de la modelo][2], que es a menudo el nombre de código de producción. Por ejemplo, el Nexus One devuelve `Passion` y Motorola Droid devuelve `voles`.
+
+ [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT
+ [2]: http://developer.android.com/reference/android/os/Build.html#MODEL
+
+### Rarezas Tizen
+
+* Devuelve que el modelo de dispositivo asignado por el proveedor, por ejemplo, `TIZEN`
+
+### Windows Phone 7 y 8 rarezas
+
+* Devuelve el modelo de dispositivo especificado por el fabricante. Por ejemplo, el Samsung Focus devuelve `SGH-i917`.
+
+## device.platform
+
+Obtener el nombre del sistema operativo del dispositivo.
+
+ var string = device.platform;
+
+
+### Plataformas soportadas
+
+* Android
+* BlackBerry 10
+* Browser4
+* Firefox OS
+* iOS
+* Tizen
+* Windows Phone 7 y 8
+* Windows 8
+
+### Ejemplo rápido
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Windows Phone 7 rarezas
+
+Dispositivos Windows Phone 7 informe de la plataforma como `WinCE`.
+
+### Windows Phone 8 rarezas
+
+Dispositivos Windows Phone 8 Informe la plataforma como `Win32NT`.
+
+## device.uuid
+
+Obtener identificador universalmente única del dispositivo ([UUID][3]).
+
+ [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier
+
+ var string = device.uuid;
+
+
+### Descripción
+
+Los detalles de cómo se genera un UUID son determinados por el fabricante del dispositivo y son específicos a la plataforma del dispositivo o modelo.
+
+### Plataformas soportadas
+
+* Android
+* BlackBerry 10
+* iOS
+* Tizen
+* Windows Phone 7 y 8
+* Windows 8
+
+### Ejemplo rápido
+
+ // Android: devuelve un entero de 64 bits al azar (como una cadena, otra vez!)
+ // el entero es generado en el primer arranque del dispositivo
+ //
+ // BlackBerry: devuelve el número PIN del dispositivo
+ // este es un entero único de nueve dígitos (como una cadena, aunque!)
+ //
+ // iPhone: (parafraseado de la documentación de la clase UIDevice)
+ // devuelve una cadena de valores hash creado a partir
+ // de múltiples hardware identifica.
+ / / Está garantizado para ser único para cada dispositivo y no puede ser atado / / a la cuenta de usuario.
+ // Windows Phone 7: devuelve un hash de dispositivo + usuario actual,
+ // si el usuario no está definido, un guid generado y persistirá hasta que se desinstala la aplicación
+ //
+ // Tizen: devuelve el dispositivo IMEI (identidad de equipo móvil internacional o IMEI es un número
+ // único para cada teléfono móvil GSM y UMTS.
+ var deviceID = device.uuid;
+
+
+### iOS chanfle
+
+El `uuid` en iOS no es exclusiva de un dispositivo, pero varía para cada aplicación, para cada instalación. Cambia si puedes borrar y volver a instalar la aplicación, y posiblemente también cuándo actualizar iOS, o incluso mejorar la aplicación por la versión (evidente en iOS 5.1). El `uuid` no es un valor confiable.
+
+### Windows Phone 7 y 8 rarezas
+
+El `uuid` para Windows Phone 7 requiere el permiso `ID_CAP_IDENTITY_DEVICE`. Microsoft pronto probablemente desaprueban esta propiedad. Si la capacidad no está disponible, la aplicación genera un guid persistente que se mantiene durante la duración de la instalación de la aplicación en el dispositivo.
+
+## device.version
+
+Obtener la versión del sistema operativo.
+
+ var string = device.version;
+
+
+### Plataformas soportadas
+
+* Android 2.1 +
+* BlackBerry 10
+* Explorador
+* iOS
+* Tizen
+* Windows Phone 7 y 8
+* Windows 8
+
+### Ejemplo rápido
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. el Mango se vuelve 7.10.7720
+ // Tizen: devuelve "TIZEN_20120425_2"
+ var deviceVersion = device.version;
diff --git a/plugins/cordova-plugin-device/doc/fr/README.md b/plugins/cordova-plugin-device/doc/fr/README.md
new file mode 100644
index 0000000..4101fd9
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/fr/README.md
@@ -0,0 +1,215 @@
+
+
+# cordova-plugin-device
+
+[](https://travis-ci.org/apache/cordova-plugin-device)
+
+Ce plugin définit un global `device` objet qui décrit le matériel et les logiciels de l'appareil. Bien que l'objet est dans la portée globale, il n'est pas disponible jusqu'après la `deviceready` événement.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## Installation
+
+ cordova plugin add cordova-plugin-device
+
+
+## Propriétés
+
+ * device.cordova
+ * device.model
+ * device.platform
+ * device.uuid
+ * device.version
+
+## device.cordova
+
+Retourne la version de Cordova en cours d'exécution sur l'appareil.
+
+### Plates-formes supportées
+
+ * Amazon Fire OS
+ * Android
+ * BlackBerry 10
+ * Navigateur
+ * Firefox OS
+ * iOS
+ * Paciarelli
+ * Windows Phone 7 et 8
+ * Windows 8
+
+## device.model
+
+L'objet `device.model` retourne le nom du modèle de l'appareil/produit. Cette valeur est définie par le fabricant du périphérique et peut varier entre les différentes versions d'un même produit.
+
+### Plates-formes supportées
+
+ * Android
+ * BlackBerry 10
+ * Navigateur
+ * iOS
+ * Paciarelli
+ * Windows Phone 7 et 8
+ * Windows 8
+
+### Exemple court
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Voir http://theiphonewiki.com/wiki/index.php?title=Models
+ //
+ var model = device.model;
+
+
+### Quirks Android
+
+ * Retourne le [nom du produit](http://developer.android.com/reference/android/os/Build.html#PRODUCT) au lieu du [nom du modèle](http://developer.android.com/reference/android/os/Build.html#MODEL), ce qui équivaut souvent au nom de code de production. Par exemple, `Passion` pour le Nexus One et `voles` pour le Motorola Droid.
+
+### Bizarreries de paciarelli
+
+ * Retourne le modèle du dispositif, assigné par le vendeur, par exemple `TIZEN`
+
+### Notes au sujet de Windows Phone 7 et 8
+
+ * Retourne le modèle de l'appareil spécifié par le fabricant. Par exemple `SGH-i917` pour le Samsung Focus.
+
+## device.platform
+
+Obtenir le nom de système d'exploitation de l'appareil.
+
+ var string = device.platform;
+
+
+### Plates-formes supportées
+
+ * Android
+ * BlackBerry 10
+ * Browser4
+ * Firefox OS
+ * iOS
+ * Paciarelli
+ * Windows Phone 7 et 8
+ * Windows 8
+
+### Exemple court
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Windows Phone 7 Quirks
+
+Appareils Windows Phone 7 rapport de la plate-forme comme`WinCE`.
+
+### Notes au sujet de Windows Phone 8
+
+Appareils Windows Phone 8 rapport de la plate-forme comme`Win32NT`.
+
+## device.uuid
+
+Obtenir Universally Unique Identifier de l'appareil ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)).
+
+ var string = device.uuid;
+
+
+### Description
+
+Les détails de comment un UUID généré sont déterminées par le fabricant du périphérique et sont spécifiques à la plate-forme ou le modèle de l'appareil.
+
+### Plates-formes supportées
+
+ * Android
+ * BlackBerry 10
+ * iOS
+ * Paciarelli
+ * Windows Phone 7 et 8
+ * Windows 8
+
+### Exemple court
+
+ // Android : retourne un nombre entier 64-bit aléatoire (sous la forme d'une chaîne de caractères, encore !)
+ // Ce nombre entier est généré lors du premier démarrage de l'appareil
+ //
+ // BlackBerry : retourne le numéro PIN de l'appareil
+ // Il s'agit d'un nombre entier unique à neuf chiffres (sous la forme d'une chaîne de caractères cependant !)
+ //
+ // iPhone : (copié depuis la documentation de la classe UIDevice)
+ // Retourne une chaîne de caractères générée à partir de plusieurs caractéristiques matérielles.
+ / / Il est garanti pour être unique pour chaque appareil et ne peut pas être lié / / pour le compte d'utilisateur.
+ // Windows Phone 7 : retourne un hashage généré à partir de appareil+utilisateur actuel,
+ // si aucun utilisateur n'est défini, un guid est généré persistera jusqu'à ce que l'application soit désinstallée
+ // Tizen : retourne le numéro IMEI (International Mobile Equipment Identity) de l'appareil, ce numéro est
+ // unique pour chaque téléphone GSM et UMTS.
+ var deviceID = device.uuid;
+
+
+### Spécificités iOS
+
+Le `uuid` sur iOS n'est pas propre à un périphérique, mais varie pour chaque application, pour chaque installation. Elle change si vous supprimez, puis réinstallez l'application, et éventuellement aussi quand vous mettre à jour d'iOS, ou même mettre à jour le soft par version (apparent dans iOS 5.1). Le `uuid` n'est pas une valeur fiable.
+
+### Notes au sujet de Windows Phone 7 et 8
+
+Le `uuid` pour Windows Phone 7 requiert l'autorisation `ID_CAP_IDENTITY_DEVICE` . Microsoft va probablement bientôt obsolète de cette propriété. Si la capacité n'est pas disponible, l'application génère un guid persistant qui est maintenu pendant toute la durée de l'installation de l'application sur le périphérique.
+
+## device.version
+
+Téléchargez la version de système d'exploitation.
+
+ var string = device.version;
+
+
+### Plates-formes supportées
+
+ * Android 2.1+
+ * BlackBerry 10
+ * Navigateur
+ * iOS
+ * Paciarelli
+ * Windows Phone 7 et 8
+ * Windows 8
+
+### Exemple court
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+ // Tizen: returns "TIZEN_20120425_2"
+ var deviceVersion = device.version;
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device/doc/fr/index.md b/plugins/cordova-plugin-device/doc/fr/index.md
new file mode 100644
index 0000000..163e498
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/fr/index.md
@@ -0,0 +1,218 @@
+
+
+# cordova-plugin-device
+
+Ce plugin définit un global `device` objet qui décrit le matériel et les logiciels de l'appareil. Bien que l'objet est dans la portée globale, il n'est pas disponible jusqu'après la `deviceready` événement.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## Installation
+
+ cordova plugin add cordova-plugin-device
+
+
+## Propriétés
+
+* device.cordova
+* device.model
+* device.platform
+* device.uuid
+* device.version
+
+## device.cordova
+
+Retourne la version de Cordova en cours d'exécution sur l'appareil.
+
+### Plates-formes prises en charge
+
+* Amazon Fire OS
+* Android
+* BlackBerry 10
+* Navigateur
+* Firefox OS
+* iOS
+* Paciarelli
+* Windows Phone 7 et 8
+* Windows 8
+
+## device.model
+
+L'objet `device.model` retourne le nom du modèle de l'appareil/produit. Cette valeur est définie par le fabricant du périphérique et peut varier entre les différentes versions d'un même produit.
+
+### Plates-formes prises en charge
+
+* Android
+* BlackBerry 10
+* Navigateur
+* iOS
+* Paciarelli
+* Windows Phone 7 et 8
+* Windows 8
+
+### Petit exemple
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Voir http://theiphonewiki.com/wiki/index.php?title=Models
+ //
+ var model = device.model;
+
+
+### Quirks Android
+
+* Retourne le [nom du produit][1] au lieu du [nom du modèle][2], ce qui équivaut souvent au nom de code de production. Par exemple, `Passion` pour le Nexus One et `voles` pour le Motorola Droid.
+
+ [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT
+ [2]: http://developer.android.com/reference/android/os/Build.html#MODEL
+
+### Bizarreries de paciarelli
+
+* Retourne le modèle du dispositif, assigné par le vendeur, par exemple `TIZEN`
+
+### Windows Phone 7 et 8 Quirks
+
+* Retourne le modèle de l'appareil spécifié par le fabricant. Par exemple `SGH-i917` pour le Samsung Focus.
+
+## device.platform
+
+Obtenir le nom de système d'exploitation de l'appareil.
+
+ var string = device.platform;
+
+
+### Plates-formes prises en charge
+
+* Android
+* BlackBerry 10
+* Browser4
+* Firefox OS
+* iOS
+* Paciarelli
+* Windows Phone 7 et 8
+* Windows 8
+
+### Petit exemple
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Windows Phone 7 Quirks
+
+Appareils Windows Phone 7 rapport de la plate-forme comme`WinCE`.
+
+### Notes au sujet de Windows Phone 8
+
+Appareils Windows Phone 8 rapport de la plate-forme comme`Win32NT`.
+
+## device.uuid
+
+Obtenir Universally Unique Identifier de l'appareil ([UUID][3]).
+
+ [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier
+
+ var string = device.uuid;
+
+
+### Description
+
+Les détails de comment un UUID généré sont déterminées par le fabricant du périphérique et sont spécifiques à la plate-forme ou le modèle de l'appareil.
+
+### Plates-formes prises en charge
+
+* Android
+* BlackBerry 10
+* iOS
+* Paciarelli
+* Windows Phone 7 et 8
+* Windows 8
+
+### Petit exemple
+
+ // Android : retourne un nombre entier 64-bit aléatoire (sous la forme d'une chaîne de caractères, encore !)
+ // Ce nombre entier est généré lors du premier démarrage de l'appareil
+ //
+ // BlackBerry : retourne le numéro PIN de l'appareil
+ // Il s'agit d'un nombre entier unique à neuf chiffres (sous la forme d'une chaîne de caractères cependant !)
+ //
+ // iPhone : (copié depuis la documentation de la classe UIDevice)
+ // Retourne une chaîne de caractères générée à partir de plusieurs caractéristiques matérielles.
+ / / Il est garanti pour être unique pour chaque appareil et ne peut pas être lié / / pour le compte d'utilisateur.
+ // Windows Phone 7 : retourne un hashage généré à partir de appareil+utilisateur actuel,
+ // si aucun utilisateur n'est défini, un guid est généré persistera jusqu'à ce que l'application soit désinstallée
+ // Tizen : retourne le numéro IMEI (International Mobile Equipment Identity) de l'appareil, ce numéro est
+ // unique pour chaque téléphone GSM et UMTS.
+ var deviceID = device.uuid;
+
+
+### Spécificités iOS
+
+Le `uuid` sur iOS n'est pas propre à un périphérique, mais varie pour chaque application, pour chaque installation. Elle change si vous supprimez, puis réinstallez l'application, et éventuellement aussi quand vous mettre à jour d'iOS, ou même mettre à jour le soft par version (apparent dans iOS 5.1). Le `uuid` n'est pas une valeur fiable.
+
+### Windows Phone 7 et 8 Quirks
+
+Le `uuid` pour Windows Phone 7 requiert l'autorisation `ID_CAP_IDENTITY_DEVICE` . Microsoft va probablement bientôt obsolète de cette propriété. Si la capacité n'est pas disponible, l'application génère un guid persistant qui est maintenu pendant toute la durée de l'installation de l'application sur le périphérique.
+
+## device.version
+
+Téléchargez la version de système d'exploitation.
+
+ var string = device.version;
+
+
+### Plates-formes prises en charge
+
+* Android 2.1+
+* BlackBerry 10
+* Navigateur
+* iOS
+* Paciarelli
+* Windows Phone 7 et 8
+* Windows 8
+
+### Petit exemple
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+ // Tizen: returns "TIZEN_20120425_2"
+ var deviceVersion = device.version;
diff --git a/plugins/cordova-plugin-device/doc/it/README.md b/plugins/cordova-plugin-device/doc/it/README.md
new file mode 100644
index 0000000..7974962
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/it/README.md
@@ -0,0 +1,203 @@
+
+
+# cordova-plugin-device
+
+[](https://travis-ci.org/apache/cordova-plugin-device)
+
+Questo plugin definisce un global `device` oggetto che descrive il dispositivo hardware e software. Sebbene l'oggetto sia in ambito globale, non è disponibile fino a dopo il `deviceready` evento.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## Installazione
+
+ cordova plugin add cordova-plugin-device
+
+
+## Proprietà
+
+ * device.cordova
+ * device.model
+ * device.platform
+ * device.uuid
+ * device.version
+
+## device.cordova
+
+Ottenere la versione di Cordova in esecuzione nel dispositivo.
+
+### Piattaforme supportate
+
+ * Amazon fuoco OS
+ * Android
+ * BlackBerry 10
+ * Browser
+ * Firefox OS
+ * iOS
+ * Tizen
+ * Windows Phone 7 e 8
+ * Windows 8
+
+## device.model
+
+Il `device.model` restituisce il nome del modello del dispositivo o del prodotto. Il valore viene impostato dal produttore del dispositivo e può essere differente tra le versioni dello stesso prodotto.
+
+### Piattaforme supportate
+
+ * Android
+ * BlackBerry 10
+ * Browser
+ * iOS
+ * Tizen
+ * Windows Phone 7 e 8
+ * Windows 8
+
+### Esempio rapido
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Vedi http://theiphonewiki.com/wiki/index.php?title=Models / / modello var = device.model;
+
+
+### Stranezze Android
+
+ * Ottiene il [nome del prodotto](http://developer.android.com/reference/android/os/Build.html#PRODUCT) anziché il [nome del modello](http://developer.android.com/reference/android/os/Build.html#MODEL), che è spesso il nome di codice di produzione. Ad esempio, restituisce il Nexus One `Passion` , e Motorola Droid restituisce`voles`.
+
+### Tizen stranezze
+
+ * Restituisce il modello di dispositivo assegnato dal fornitore, ad esempio,`TIZEN`
+
+### Windows Phone 7 e 8 stranezze
+
+ * Restituisce il modello di dispositivo specificato dal produttore. Ad esempio, restituisce il Samsung Focus`SGH-i917`.
+
+## device.platform
+
+Ottenere il nome del sistema operativo del dispositivo.
+
+ var string = device.platform;
+
+
+### Piattaforme supportate
+
+ * Android
+ * BlackBerry 10
+ * Browser4
+ * Firefox OS
+ * iOS
+ * Tizen
+ * Windows Phone 7 e 8
+ * Windows 8
+
+### Esempio rapido
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Windows Phone 7 capricci
+
+Windows Phone 7 dispositivi segnalano la piattaforma come`WinCE`.
+
+### Windows Phone 8 stranezze
+
+Dispositivi Windows Phone 8 segnalano la piattaforma come`Win32NT`.
+
+## device.uuid
+
+Ottenere identificatore del dispositivo univoco universale ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)).
+
+ var string = device.uuid;
+
+
+### Descrizione
+
+I dettagli di come viene generato un UUID sono determinati dal produttore del dispositivo e sono specifici per la piattaforma o il modello del dispositivo.
+
+### Piattaforme supportate
+
+ * Android
+ * BlackBerry 10
+ * iOS
+ * Tizen
+ * Windows Phone 7 e 8
+ * Windows 8
+
+### Esempio rapido
+
+ / / Android: restituisce un intero casuale di 64 bit (come stringa, ancora una volta!) / / il numero intero è generato al primo avvio del dispositivo / / / / BlackBerry: restituisce il numero PIN del dispositivo / / questo è un valore integer univoco a nove cifre (come stringa, benchè!) / / / / iPhone: (parafrasato dalla documentazione della classe UIDevice) / / restituisce una stringa di valori hash creata dall'hardware più identifica.
+ / / È garantito per essere unica per ogni dispositivo e non può essere legato / / per l'account utente.
+ / / Windows Phone 7: restituisce un hash dell'utente corrente, + dispositivo / / se l'utente non è definito, un guid generato e persisterà fino a quando l'applicazione viene disinstallata / / Tizen: restituisce il dispositivo IMEI (International Mobile Equipment Identity o IMEI è un numero / / unico per ogni cellulare GSM e UMTS.
+ var deviceID = device.uuid;
+
+
+### iOS Quirk
+
+Il `uuid` su iOS non è univoco per un dispositivo, ma varia per ogni applicazione, per ogni installazione. Cambia se si elimina e re-installare l'app, e possibilmente anche quando aggiornare iOS o anche aggiornare l'app per ogni versione (apparente in iOS 5.1). Il `uuid` non è un valore affidabile.
+
+### Windows Phone 7 e 8 stranezze
+
+Il `uuid` per Windows Phone 7 richiede l'autorizzazione `ID_CAP_IDENTITY_DEVICE` . Microsoft probabilmente sarà presto deprecare questa proprietà. Se la funzionalità non è disponibile, l'applicazione genera un guid persistente che viene mantenuto per la durata dell'installazione dell'applicazione sul dispositivo.
+
+## device.version
+
+Ottenere la versione del sistema operativo.
+
+ var string = device.version;
+
+
+### Piattaforme supportate
+
+ * Android 2.1 +
+ * BlackBerry 10
+ * Browser
+ * iOS
+ * Tizen
+ * Windows Phone 7 e 8
+ * Windows 8
+
+### Esempio rapido
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+ // Tizen: returns "TIZEN_20120425_2"
+ var deviceVersion = device.version;
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device/doc/it/index.md b/plugins/cordova-plugin-device/doc/it/index.md
new file mode 100644
index 0000000..98c6200
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/it/index.md
@@ -0,0 +1,206 @@
+
+
+# cordova-plugin-device
+
+Questo plugin definisce un global `device` oggetto che descrive il dispositivo hardware e software. Sebbene l'oggetto sia in ambito globale, non è disponibile fino a dopo il `deviceready` evento.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## Installazione
+
+ cordova plugin add cordova-plugin-device
+
+
+## Proprietà
+
+* device.cordova
+* device.model
+* device.platform
+* device.uuid
+* device.version
+
+## device.cordova
+
+Ottenere la versione di Cordova in esecuzione nel dispositivo.
+
+### Piattaforme supportate
+
+* Amazon fuoco OS
+* Android
+* BlackBerry 10
+* Browser
+* Firefox OS
+* iOS
+* Tizen
+* Windows Phone 7 e 8
+* Windows 8
+
+## device.model
+
+Il `device.model` restituisce il nome del modello del dispositivo o del prodotto. Il valore viene impostato dal produttore del dispositivo e può essere differente tra le versioni dello stesso prodotto.
+
+### Piattaforme supportate
+
+* Android
+* BlackBerry 10
+* Browser
+* iOS
+* Tizen
+* Windows Phone 7 e 8
+* Windows 8
+
+### Esempio rapido
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Vedi http://theiphonewiki.com/wiki/index.php?title=Models / / modello var = device.model;
+
+
+### Stranezze Android
+
+* Ottiene il [nome del prodotto][1] anziché il [nome del modello][2], che è spesso il nome di codice di produzione. Ad esempio, restituisce il Nexus One `Passion` , e Motorola Droid restituisce`voles`.
+
+ [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT
+ [2]: http://developer.android.com/reference/android/os/Build.html#MODEL
+
+### Tizen stranezze
+
+* Restituisce il modello di dispositivo assegnato dal fornitore, ad esempio,`TIZEN`
+
+### Windows Phone 7 e 8 stranezze
+
+* Restituisce il modello di dispositivo specificato dal produttore. Ad esempio, restituisce il Samsung Focus`SGH-i917`.
+
+## device.platform
+
+Ottenere il nome del sistema operativo del dispositivo.
+
+ var string = device.platform;
+
+
+### Piattaforme supportate
+
+* Android
+* BlackBerry 10
+* Browser4
+* Firefox OS
+* iOS
+* Tizen
+* Windows Phone 7 e 8
+* Windows 8
+
+### Esempio rapido
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Windows Phone 7 capricci
+
+Windows Phone 7 dispositivi segnalano la piattaforma come`WinCE`.
+
+### Windows Phone 8 stranezze
+
+Dispositivi Windows Phone 8 segnalano la piattaforma come`Win32NT`.
+
+## device.uuid
+
+Ottenere identificatore del dispositivo univoco universale ([UUID][3]).
+
+ [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier
+
+ var string = device.uuid;
+
+
+### Descrizione
+
+I dettagli di come viene generato un UUID sono determinati dal produttore del dispositivo e sono specifici per la piattaforma o il modello del dispositivo.
+
+### Piattaforme supportate
+
+* Android
+* BlackBerry 10
+* iOS
+* Tizen
+* Windows Phone 7 e 8
+* Windows 8
+
+### Esempio rapido
+
+ / / Android: restituisce un intero casuale di 64 bit (come stringa, ancora una volta!) / / il numero intero è generato al primo avvio del dispositivo / / / / BlackBerry: restituisce il numero PIN del dispositivo / / questo è un valore integer univoco a nove cifre (come stringa, benchè!) / / / / iPhone: (parafrasato dalla documentazione della classe UIDevice) / / restituisce una stringa di valori hash creata dall'hardware più identifica.
+ / / È garantito per essere unica per ogni dispositivo e non può essere legato / / per l'account utente.
+ / / Windows Phone 7: restituisce un hash dell'utente corrente, + dispositivo / / se l'utente non è definito, un guid generato e persisterà fino a quando l'applicazione viene disinstallata / / Tizen: restituisce il dispositivo IMEI (International Mobile Equipment Identity o IMEI è un numero / / unico per ogni cellulare GSM e UMTS.
+ var deviceID = device.uuid;
+
+
+### iOS Quirk
+
+Il `uuid` su iOS non è univoco per un dispositivo, ma varia per ogni applicazione, per ogni installazione. Cambia se si elimina e re-installare l'app, e possibilmente anche quando aggiornare iOS o anche aggiornare l'app per ogni versione (apparente in iOS 5.1). Il `uuid` non è un valore affidabile.
+
+### Windows Phone 7 e 8 stranezze
+
+Il `uuid` per Windows Phone 7 richiede l'autorizzazione `ID_CAP_IDENTITY_DEVICE` . Microsoft probabilmente sarà presto deprecare questa proprietà. Se la funzionalità non è disponibile, l'applicazione genera un guid persistente che viene mantenuto per la durata dell'installazione dell'applicazione sul dispositivo.
+
+## device.version
+
+Ottenere la versione del sistema operativo.
+
+ var string = device.version;
+
+
+### Piattaforme supportate
+
+* Android 2.1 +
+* BlackBerry 10
+* Browser
+* iOS
+* Tizen
+* Windows Phone 7 e 8
+* Windows 8
+
+### Esempio rapido
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+ // Tizen: returns "TIZEN_20120425_2"
+ var deviceVersion = device.version;
diff --git a/plugins/cordova-plugin-device/doc/ja/README.md b/plugins/cordova-plugin-device/doc/ja/README.md
new file mode 100644
index 0000000..5a345f8
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/ja/README.md
@@ -0,0 +1,203 @@
+
+
+# cordova-plugin-device
+
+[](https://travis-ci.org/apache/cordova-plugin-device)
+
+このプラグインをグローバル定義します `device` オブジェクトは、デバイスのハードウェアとソフトウェアについて説明します。 それは後まで利用可能なオブジェクトがグローバル スコープでは、 `deviceready` イベント。
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## インストール
+
+ cordova plugin add cordova-plugin-device
+
+
+## プロパティ
+
+ * device.cordova
+ * device.model
+ * device.platform
+ * device.uuid
+ * device.version
+
+## device.cordova
+
+デバイスで実行されているコルドバのバージョンを取得します。
+
+### サポートされているプラットフォーム
+
+ * アマゾン火 OS
+ * アンドロイド
+ * ブラックベリー 10
+ * ブラウザー
+ * Firefox の OS
+ * iOS
+ * Tizen
+ * Windows Phone 7 と 8
+ * Windows 8
+
+## device.model
+
+`device.model`、デバイスのモデルまたは製品の名前を返します。値は、デバイスの製造元によって設定され、同じ製品のバージョン間で異なる可能性があります。
+
+### サポートされているプラットフォーム
+
+ * アンドロイド
+ * ブラックベリー 10
+ * ブラウザー
+ * iOS
+ * Tizen
+ * Windows Phone 7 と 8
+ * Windows 8
+
+### 簡単な例
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Http://theiphonewiki.com/wiki/index.php?title=Models を参照してください//var モデル = device.model;
+
+
+### Android の癖
+
+ * 生産コード名は[モデル名](http://developer.android.com/reference/android/os/Build.html#MODEL)の代わりに[製品名](http://developer.android.com/reference/android/os/Build.html#PRODUCT)を取得します。 たとえば、ネクサス 1 つを返します `Passion` 、Motorola のドロイドを返します`voles`.
+
+### Tizen の癖
+
+ * たとえば、ベンダーによって割り当てられているデバイスのモデルを返します`TIZEN`
+
+### Windows Phone 7 と 8 癖
+
+ * 製造元によって指定されたデバイスのモデルを返します。たとえば、三星フォーカスを返します`SGH-i917`.
+
+## device.platform
+
+デバイスのオペレーティング システム名を取得します。
+
+ var string = device.platform;
+
+
+### サポートされているプラットフォーム
+
+ * アンドロイド
+ * ブラックベリー 10
+ * Browser4
+ * Firefox の OS
+ * iOS
+ * Tizen
+ * Windows Phone 7 と 8
+ * Windows 8
+
+### 簡単な例
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Windows Phone 7 の癖
+
+Windows Phone 7 デバイスとプラットフォームを報告します。`WinCE`.
+
+### Windows Phone 8 癖
+
+Windows Phone 8 デバイスとプラットフォームを報告します。`Win32NT`.
+
+## device.uuid
+
+デバイスのユニバーサル ・ ユニーク識別子 ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)を取得します。).
+
+ var string = device.uuid;
+
+
+### 解説
+
+UUID を生成する方法の詳細は、デバイスの製造元によって決定され、デバイスのプラットフォームやモデルに固有です。
+
+### サポートされているプラットフォーム
+
+ * アンドロイド
+ * ブラックベリー 10
+ * iOS
+ * Tizen
+ * Windows Phone 7 と 8
+ * Windows 8
+
+### 簡単な例
+
+ //アンドロイド: ランダムな 64 ビットの整数 (を文字列として返します、再び !)/デバイスの最初の起動時に生成される整数/////ブラックベリー: デバイスのピン番号を返します//これは 9 桁の一意な整数 (を文字列としても !)////iPhone: (UIDevice クラスのドキュメントから言い換え)//識別複数のハードウェアから作成されたハッシュ値の文字列を返します。。
+ //それはすべてのデバイスに対して一意であることが保証され、接続することはできません//ユーザー アカウント。
+ //Windows Phone 7: デバイス + 現在のユーザーのハッシュを返します//ユーザーが定義されていない場合 guid が生成され、アプリがアンインストールされるまで保持されます//Tizen: デバイスの IMEI を返します (国際モバイル機器アイデンティティまたは IMEI は番号です//すべての GSM および UMTS の携帯電話に固有です。
+ var deviceID = device.uuid;
+
+
+### iOS の気まぐれ
+
+`uuid`IOS で、デバイスに固有ではないインストールごと、アプリケーションごとに異なります。 削除、アプリを再インストールした場合に変更と多分またときアップグレード iOS の, またはもアップグレードするアプリ (iOS の 5.1 で明らかに) バージョンごと。 `uuid`は信頼性の高い値ではありません。
+
+### Windows Phone 7 と 8 癖
+
+`uuid`のために Windows Phone 7 には、権限が必要です `ID_CAP_IDENTITY_DEVICE` 。 Microsoft はすぐにこのプロパティを廃止して可能性があります。 機能が利用できない場合、アプリケーションはデバイスへのアプリケーションのインストールの持続期間のために保持されている永続的な guid を生成します。
+
+## device.version
+
+オペレーティング システムのバージョンを取得します。
+
+ var string = device.version;
+
+
+### サポートされているプラットフォーム
+
+ * アンドロイド 2.1 +
+ * ブラックベリー 10
+ * ブラウザー
+ * iOS
+ * Tizen
+ * Windows Phone 7 と 8
+ * Windows 8
+
+### 簡単な例
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+ // Tizen: returns "TIZEN_20120425_2"
+ var deviceVersion = device.version;
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device/doc/ja/index.md b/plugins/cordova-plugin-device/doc/ja/index.md
new file mode 100644
index 0000000..b4030fd
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/ja/index.md
@@ -0,0 +1,206 @@
+
+
+# cordova-plugin-device
+
+このプラグインをグローバル定義します `device` オブジェクトは、デバイスのハードウェアとソフトウェアについて説明します。 それは後まで利用可能なオブジェクトがグローバル スコープでは、 `deviceready` イベント。
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## インストール
+
+ cordova plugin add cordova-plugin-device
+
+
+## プロパティ
+
+* device.cordova
+* device.model
+* device.platform
+* device.uuid
+* device.version
+
+## device.cordova
+
+デバイスで実行されているコルドバのバージョンを取得します。
+
+### サポートされているプラットフォーム
+
+* アマゾン火 OS
+* アンドロイド
+* ブラックベリー 10
+* ブラウザー
+* Firefox の OS
+* iOS
+* Tizen
+* Windows Phone 7 と 8
+* Windows 8
+
+## device.model
+
+`device.model`、デバイスのモデルまたは製品の名前を返します。値は、デバイスの製造元によって設定され、同じ製品のバージョン間で異なる可能性があります。
+
+### サポートされているプラットフォーム
+
+* アンドロイド
+* ブラックベリー 10
+* ブラウザー
+* iOS
+* Tizen
+* Windows Phone 7 と 8
+* Windows 8
+
+### 簡単な例
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Http://theiphonewiki.com/wiki/index.php?title=Models を参照してください//var モデル = device.model;
+
+
+### Android の癖
+
+* 生産コード名は[モデル名][1]の代わりに[製品名][2]を取得します。 たとえば、ネクサス 1 つを返します `Passion` 、Motorola のドロイドを返します`voles`.
+
+ [1]: http://developer.android.com/reference/android/os/Build.html#MODEL
+ [2]: http://developer.android.com/reference/android/os/Build.html#PRODUCT
+
+### Tizen の癖
+
+* たとえば、ベンダーによって割り当てられているデバイスのモデルを返します`TIZEN`
+
+### Windows Phone 7 と 8 癖
+
+* 製造元によって指定されたデバイスのモデルを返します。たとえば、三星フォーカスを返します`SGH-i917`.
+
+## device.platform
+
+デバイスのオペレーティング システム名を取得します。
+
+ var string = device.platform;
+
+
+### サポートされているプラットフォーム
+
+* アンドロイド
+* ブラックベリー 10
+* Browser4
+* Firefox の OS
+* iOS
+* Tizen
+* Windows Phone 7 と 8
+* Windows 8
+
+### 簡単な例
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Windows Phone 7 の癖
+
+Windows Phone 7 デバイスとプラットフォームを報告します。`WinCE`.
+
+### Windows Phone 8 癖
+
+Windows Phone 8 デバイスとプラットフォームを報告します。`Win32NT`.
+
+## device.uuid
+
+デバイスのユニバーサル ・ ユニーク識別子 ([UUID][3]を取得します。).
+
+ [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier
+
+ var string = device.uuid;
+
+
+### 説明
+
+UUID を生成する方法の詳細は、デバイスの製造元によって決定され、デバイスのプラットフォームやモデルに固有です。
+
+### サポートされているプラットフォーム
+
+* アンドロイド
+* ブラックベリー 10
+* iOS
+* Tizen
+* Windows Phone 7 と 8
+* Windows 8
+
+### 簡単な例
+
+ //アンドロイド: ランダムな 64 ビットの整数 (を文字列として返します、再び !)/デバイスの最初の起動時に生成される整数/////ブラックベリー: デバイスのピン番号を返します//これは 9 桁の一意な整数 (を文字列としても !)////iPhone: (UIDevice クラスのドキュメントから言い換え)//識別複数のハードウェアから作成されたハッシュ値の文字列を返します。。
+ //それはすべてのデバイスに対して一意であることが保証され、接続することはできません//ユーザー アカウント。
+ //Windows Phone 7: デバイス + 現在のユーザーのハッシュを返します//ユーザーが定義されていない場合 guid が生成され、アプリがアンインストールされるまで保持されます//Tizen: デバイスの IMEI を返します (国際モバイル機器アイデンティティまたは IMEI は番号です//すべての GSM および UMTS の携帯電話に固有です。
+ var deviceID = device.uuid;
+
+
+### iOS の気まぐれ
+
+`uuid`IOS で、デバイスに固有ではないインストールごと、アプリケーションごとに異なります。 削除、アプリを再インストールした場合に変更と多分またときアップグレード iOS の, またはもアップグレードするアプリ (iOS の 5.1 で明らかに) バージョンごと。 `uuid`は信頼性の高い値ではありません。
+
+### Windows Phone 7 と 8 癖
+
+`uuid`のために Windows Phone 7 には、権限が必要です `ID_CAP_IDENTITY_DEVICE` 。 Microsoft はすぐにこのプロパティを廃止して可能性があります。 機能が利用できない場合、アプリケーションはデバイスへのアプリケーションのインストールの持続期間のために保持されている永続的な guid を生成します。
+
+## device.version
+
+オペレーティング システムのバージョンを取得します。
+
+ var string = device.version;
+
+
+### サポートされているプラットフォーム
+
+* アンドロイド 2.1 +
+* ブラックベリー 10
+* ブラウザー
+* iOS
+* Tizen
+* Windows Phone 7 と 8
+* Windows 8
+
+### 簡単な例
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+ // Tizen: returns "TIZEN_20120425_2"
+ var deviceVersion = device.version;
diff --git a/plugins/cordova-plugin-device/doc/ko/README.md b/plugins/cordova-plugin-device/doc/ko/README.md
new file mode 100644
index 0000000..a818aac
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/ko/README.md
@@ -0,0 +1,203 @@
+
+
+# cordova-plugin-device
+
+[](https://travis-ci.org/apache/cordova-plugin-device)
+
+이 플러그인 정의 전역 `device` 개체, 디바이스의 하드웨어 및 소프트웨어에 설명 합니다. 개체는 전역 범위에서 비록 그것은 후까지 사용할 수 있는 `deviceready` 이벤트.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## 설치
+
+ cordova plugin add cordova-plugin-device
+
+
+## 속성
+
+ * device.cordova
+ * device.model
+ * device.platform
+ * device.uuid
+ * device.version
+
+## device.cordova
+
+코르도바는 장치에서 실행 중인 버전을 얻을.
+
+### 지원 되는 플랫폼
+
+ * 아마존 화재 운영 체제
+ * 안 드 로이드
+ * 블랙베리 10
+ * 브라우저
+ * Firefox 운영 체제
+ * iOS
+ * Tizen
+ * Windows Phone 7과 8
+ * 윈도우 8
+
+## device.model
+
+`device.model`소자의 모델 또는 제품의 이름을 반환 합니다. 값 장치 제조업체에서 설정 되 고 동일 제품의 버전 간에 다를 수 있습니다.
+
+### 지원 되는 플랫폼
+
+ * 안 드 로이드
+ * 블랙베리 10
+ * 브라우저
+ * iOS
+ * Tizen
+ * Windows Phone 7과 8
+ * 윈도우 8
+
+### 빠른 예제
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Http://theiphonewiki.com/wiki/index.php?title=Models 참조 / / var 모델 = device.model;
+
+
+### 안 드 로이드 단점
+
+ * 어떤은 종종 프로덕션 코드 이름 대신 [제품 모델 이름](http://developer.android.com/reference/android/os/Build.html#MODEL), [제품 이름](http://developer.android.com/reference/android/os/Build.html#PRODUCT) 을 가져옵니다. 예를 들어 넥서스 하나 반환 합니다 `Passion` , 모토로라 Droid를 반환 합니다`voles`.
+
+### Tizen 특수
+
+ * 예를 들어, 공급 업체에 의해 할당 된 디바이스 모델을 반환 합니다.`TIZEN`
+
+### Windows Phone 7, 8 특수
+
+ * 제조업체에서 지정 하는 장치 모델을 반환 합니다. 예를 들어 삼성 포커스를 반환 합니다.`SGH-i917`.
+
+## device.platform
+
+장치의 운영 체제 이름을 얻을.
+
+ var string = device.platform;
+
+
+### 지원 되는 플랫폼
+
+ * 안 드 로이드
+ * 블랙베리 10
+ * Browser4
+ * Firefox 운영 체제
+ * iOS
+ * Tizen
+ * Windows Phone 7과 8
+ * 윈도우 8
+
+### 빠른 예제
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Windows Phone 7 단점
+
+Windows Phone 7 장치 보고 플랫폼으로`WinCE`.
+
+### Windows Phone 8 단점
+
+Windows Phone 8 장치 보고 플랫폼으로`Win32NT`.
+
+## device.uuid
+
+소자의 보편적으로 고유 식별자 ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier) 를 얻을합니다).
+
+ var string = device.uuid;
+
+
+### 설명
+
+UUID 생성 방법의 자세한 내용은 장치 제조업체에 의해 결정 됩니다 및 소자의 플랫폼 이나 모델.
+
+### 지원 되는 플랫폼
+
+ * 안 드 로이드
+ * 블랙베리 10
+ * iOS
+ * Tizen
+ * Windows Phone 7과 8
+ * 윈도우 8
+
+### 빠른 예제
+
+ / / 안 드 로이드: (문자열로 다시!) 임의의 64 비트 정수를 반환 합니다 / / 정수 장치의 첫 번째 부팅에서 생성 / / / / 블랙베리: 디바이스의 핀 번호를 반환 합니다 / / 이것은 9 자리 고유 정수 (문자열로 비록!) / / / / 아이폰: (UIDevice 클래스 설명서에서 읊 었) / / 문자열 여러 하드웨어에서 생성 하는 해시 값을 식별 하는 반환 합니다.
+ / 그것은 모든 장치에 대 한 고유 해야 보장 되 고 묶일 수 없습니다 / / / 사용자 계정에.
+ / / Windows Phone 7: 장치 + 현재 사용자의 해시를 반환 합니다 / / 사용자 정의 되지 않은 경우 guid 생성 되 고 응용 프로그램을 제거할 때까지 유지 됩니다 / / Tizen: 반환 장치 IMEI (국제 모바일 기기 식별 또는 IMEI 숫자입니다 / / 모든 GSM와 UMTS 휴대 전화 고유.
+ var deviceID = device.uuid;
+
+
+### iOS 특질
+
+`uuid`ios 장치에 고유 하지 않습니다 하지만 각 설치에 대 한 응용 프로그램 마다 다릅니다. 삭제 하 고 다시 애플 리 케이 션을 설치 하는 경우 변경 가능 하 게 또한 iOS를 업그레이드 하거나 때 버전 (iOS 5.1에에서 명백한) 당 응용 프로그램 업그레이드도 하 고. `uuid`은 신뢰할 수 있는 값이 아닙니다.
+
+### Windows Phone 7, 8 특수
+
+`uuid`Windows Phone 7 필요 허가 `ID_CAP_IDENTITY_DEVICE` . Microsoft는 곧이 속성을 세웁니다 가능성이 것입니다. 기능을 사용할 수 없는 경우 응용 프로그램 장치에 응용 프로그램의 설치 하는 동안 유지 하는 영구 guid를 생성 합니다.
+
+## device.version
+
+운영 체제 버전을 얻을.
+
+ var string = device.version;
+
+
+### 지원 되는 플랫폼
+
+ * 안 드 로이드 2.1 +
+ * 블랙베리 10
+ * 브라우저
+ * iOS
+ * Tizen
+ * Windows Phone 7과 8
+ * 윈도우 8
+
+### 빠른 예제
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+ // Tizen: returns "TIZEN_20120425_2"
+ var deviceVersion = device.version;
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device/doc/ko/index.md b/plugins/cordova-plugin-device/doc/ko/index.md
new file mode 100644
index 0000000..0fe38a7
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/ko/index.md
@@ -0,0 +1,206 @@
+
+
+# cordova-plugin-device
+
+이 플러그인 정의 전역 `device` 개체, 디바이스의 하드웨어 및 소프트웨어에 설명 합니다. 개체는 전역 범위에서 비록 그것은 후까지 사용할 수 있는 `deviceready` 이벤트.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## 설치
+
+ cordova plugin add cordova-plugin-device
+
+
+## 속성
+
+* device.cordova
+* device.model
+* device.platform
+* device.uuid
+* device.version
+
+## device.cordova
+
+코르도바는 장치에서 실행 중인 버전을 얻을.
+
+### 지원 되는 플랫폼
+
+* 아마존 화재 운영 체제
+* 안 드 로이드
+* 블랙베리 10
+* 브라우저
+* Firefox 운영 체제
+* iOS
+* Tizen
+* Windows Phone 7과 8
+* 윈도우 8
+
+## device.model
+
+`device.model`소자의 모델 또는 제품의 이름을 반환 합니다. 값 장치 제조업체에서 설정 되 고 동일 제품의 버전 간에 다를 수 있습니다.
+
+### 지원 되는 플랫폼
+
+* 안 드 로이드
+* 블랙베리 10
+* 브라우저
+* iOS
+* Tizen
+* Windows Phone 7과 8
+* 윈도우 8
+
+### 빠른 예제
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Http://theiphonewiki.com/wiki/index.php?title=Models 참조 / / var 모델 = device.model;
+
+
+### 안 드 로이드 단점
+
+* 어떤은 종종 프로덕션 코드 이름 대신 [제품 모델 이름][1], [제품 이름][2] 을 가져옵니다. 예를 들어 넥서스 하나 반환 합니다 `Passion` , 모토로라 Droid를 반환 합니다`voles`.
+
+ [1]: http://developer.android.com/reference/android/os/Build.html#MODEL
+ [2]: http://developer.android.com/reference/android/os/Build.html#PRODUCT
+
+### Tizen 특수
+
+* 예를 들어, 공급 업체에 의해 할당 된 디바이스 모델을 반환 합니다.`TIZEN`
+
+### Windows Phone 7, 8 특수
+
+* 제조업체에서 지정 하는 장치 모델을 반환 합니다. 예를 들어 삼성 포커스를 반환 합니다.`SGH-i917`.
+
+## device.platform
+
+장치의 운영 체제 이름을 얻을.
+
+ var string = device.platform;
+
+
+### 지원 되는 플랫폼
+
+* 안 드 로이드
+* 블랙베리 10
+* Browser4
+* Firefox 운영 체제
+* iOS
+* Tizen
+* Windows Phone 7과 8
+* 윈도우 8
+
+### 빠른 예제
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Windows Phone 7 단점
+
+Windows Phone 7 장치 보고 플랫폼으로`WinCE`.
+
+### Windows Phone 8 단점
+
+Windows Phone 8 장치 보고 플랫폼으로`Win32NT`.
+
+## device.uuid
+
+소자의 보편적으로 고유 식별자 ([UUID][3] 를 얻을합니다).
+
+ [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier
+
+ var string = device.uuid;
+
+
+### 설명
+
+UUID 생성 방법의 자세한 내용은 장치 제조업체에 의해 결정 됩니다 및 소자의 플랫폼 이나 모델.
+
+### 지원 되는 플랫폼
+
+* 안 드 로이드
+* 블랙베리 10
+* iOS
+* Tizen
+* Windows Phone 7과 8
+* 윈도우 8
+
+### 빠른 예제
+
+ / / 안 드 로이드: (문자열로 다시!) 임의의 64 비트 정수를 반환 합니다 / / 정수 장치의 첫 번째 부팅에서 생성 / / / / 블랙베리: 디바이스의 핀 번호를 반환 합니다 / / 이것은 9 자리 고유 정수 (문자열로 비록!) / / / / 아이폰: (UIDevice 클래스 설명서에서 읊 었) / / 문자열 여러 하드웨어에서 생성 하는 해시 값을 식별 하는 반환 합니다.
+ / 그것은 모든 장치에 대 한 고유 해야 보장 되 고 묶일 수 없습니다 / / / 사용자 계정에.
+ / / Windows Phone 7: 장치 + 현재 사용자의 해시를 반환 합니다 / / 사용자 정의 되지 않은 경우 guid 생성 되 고 응용 프로그램을 제거할 때까지 유지 됩니다 / / Tizen: 반환 장치 IMEI (국제 모바일 기기 식별 또는 IMEI 숫자입니다 / / 모든 GSM와 UMTS 휴대 전화 고유.
+ var deviceID = device.uuid;
+
+
+### iOS 특질
+
+`uuid`ios 장치에 고유 하지 않습니다 하지만 각 설치에 대 한 응용 프로그램 마다 다릅니다. 삭제 하 고 다시 애플 리 케이 션을 설치 하는 경우 변경 가능 하 게 또한 iOS를 업그레이드 하거나 때 버전 (iOS 5.1에에서 명백한) 당 응용 프로그램 업그레이드도 하 고. `uuid`은 신뢰할 수 있는 값이 아닙니다.
+
+### Windows Phone 7, 8 특수
+
+`uuid`Windows Phone 7 필요 허가 `ID_CAP_IDENTITY_DEVICE` . Microsoft는 곧이 속성을 세웁니다 가능성이 것입니다. 기능을 사용할 수 없는 경우 응용 프로그램 장치에 응용 프로그램의 설치 하는 동안 유지 하는 영구 guid를 생성 합니다.
+
+## device.version
+
+운영 체제 버전을 얻을.
+
+ var string = device.version;
+
+
+### 지원 되는 플랫폼
+
+* 안 드 로이드 2.1 +
+* 블랙베리 10
+* 브라우저
+* iOS
+* Tizen
+* Windows Phone 7과 8
+* 윈도우 8
+
+### 빠른 예제
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+ // Tizen: returns "TIZEN_20120425_2"
+ var deviceVersion = device.version;
diff --git a/plugins/cordova-plugin-device/doc/pl/README.md b/plugins/cordova-plugin-device/doc/pl/README.md
new file mode 100644
index 0000000..c38832d
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/pl/README.md
@@ -0,0 +1,214 @@
+
+
+# cordova-plugin-device
+
+[](https://travis-ci.org/apache/cordova-plugin-device)
+
+Ten plugin określa globalne `device` obiekt, który opisuje urządzenia sprzętowe i programowe. Mimo, że obiekt jest w globalnym zasięgu, nie jest dostępne dopiero po `deviceready` zdarzenie.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## Instalacja
+
+ cordova plugin add cordova-plugin-device
+
+
+## Właściwości
+
+ * device.cordova
+ * device.model
+ * device.platform
+ * device.uuid
+ * device.version
+
+## device.cordova
+
+Pobierz wersję Cordova działa na urządzeniu.
+
+### Obsługiwane platformy
+
+ * Amazon Fire OS
+ * Android
+ * BlackBerry 10
+ * Przeglądarka
+ * Firefox OS
+ * iOS
+ * Tizen
+ * Windows Phone 7 i 8
+ * Windows 8
+
+## device.model
+
+`device.model`Zwraca nazwę modelu lub produktu. Wartość jest zestaw przez producenta urządzenia i mogą się różnić między wersjami tego samego produktu.
+
+### Obsługiwane platformy
+
+ * Android
+ * BlackBerry 10
+ * Przeglądarka
+ * iOS
+ * Tizen
+ * Windows Phone 7 i 8
+ * Windows 8
+
+### Szybki przykład
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Zobacz http://theiphonewiki.com/wiki/index.php?title=Models / / modelu var = device.model;
+
+
+### Dziwactwa Androida
+
+ * Pobiera [nazwę produktu](http://developer.android.com/reference/android/os/Build.html#PRODUCT) zamiast [nazwy modelu](http://developer.android.com/reference/android/os/Build.html#MODEL), który często jest nazwą kod produkcji. Na przykład, Nexus One zwraca `Passion` , i zwraca Motorola Droid`voles`.
+
+### Dziwactwa Tizen
+
+ * Zwraca modelu urządzenia przypisane przez dostawcę, na przykład,`TIZEN`
+
+### Windows Phone 7 i 8 dziwactwa
+
+ * Zwraca modelu urządzenia, określonej przez producenta. Na przykład Samsung ostrości zwraca`SGH-i917`.
+
+## device.platform
+
+Uzyskać nazwę systemu operacyjnego urządzenia.
+
+ var string = device.platform;
+
+
+### Obsługiwane platformy
+
+ * Android
+ * BlackBerry 10
+ * Browser4
+ * Firefox OS
+ * iOS
+ * Tizen
+ * Windows Phone 7 i 8
+ * Windows 8
+
+### Szybki przykład
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Dziwactwa Windows Phone 7
+
+Urządzenia Windows Phone 7 raport platformy jako`WinCE`.
+
+### Windows Phone 8 dziwactwa
+
+Urządzenia Windows Phone 8 raport platformy jako`Win32NT`.
+
+## device.uuid
+
+Się urządzenia uniwersalnie unikatowy identyfikator ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)).
+
+ var string = device.uuid;
+
+
+### Opis
+
+Szczegóły jak UUID jest generowane są określane przez producenta urządzenia i są specyficzne dla platformy lub modelu urządzenia.
+
+### Obsługiwane platformy
+
+ * Android
+ * BlackBerry 10
+ * iOS
+ * Tizen
+ * Windows Phone 7 i 8
+ * Windows 8
+
+### Szybki przykład
+
+ // Android: Returns a random 64-bit integer (as a string, again!)
+ // The integer is generated on the device's first boot
+ //
+ // BlackBerry: Returns the PIN number of the device
+ // This is a nine-digit unique integer (as a string, though!)
+ //
+ // iPhone: (Paraphrased from the UIDevice Class documentation)
+ // Returns a string of hash values created from multiple hardware identifies.
+ // It is guaranteed to be unique for every device and can't be tied
+ // to the user account.
+ // Windows Phone 7 : Returns a hash of device+current user,
+ // if the user is not defined, a guid is generated and will persist until the app is uninstalled
+ // Tizen: returns the device IMEI (International Mobile Equipment Identity or IMEI is a number
+ // unique to every GSM and UMTS mobile phone.
+ var deviceID = device.uuid;
+
+
+### iOS dziwactwo
+
+`uuid`Na iOS nie jest przypisany do urządzenia, ale różni się dla każdej aplikacji, dla każdej instalacji. Zmienia się jeśli możesz usunąć i ponownie zainstalować aplikację, a ewentualnie także po aktualizacji iOS czy nawet uaktualnienia aplikacji dla wersji (widoczny w iOS 5.1). `uuid`Jest nie wiarygodne wartości.
+
+### Windows Phone 7 i 8 dziwactwa
+
+`uuid`Dla Windows Phone 7 wymaga uprawnień `ID_CAP_IDENTITY_DEVICE` . Microsoft będzie prawdopodobnie potępiać ten wkrótce. Jeśli funkcja nie jest dostępna, aplikacja generuje trwałe identyfikator guid, który jest utrzymywany przez czas trwania instalacji aplikacji na urządzeniu.
+
+## device.version
+
+Pobierz wersję systemu operacyjnego.
+
+ var string = device.version;
+
+
+### Obsługiwane platformy
+
+ * Android 2.1 +
+ * BlackBerry 10
+ * Przeglądarka
+ * iOS
+ * Tizen
+ * Windows Phone 7 i 8
+ * Windows 8
+
+### Szybki przykład
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+ // Tizen: returns "TIZEN_20120425_2"
+ var deviceVersion = device.version;
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device/doc/pl/index.md b/plugins/cordova-plugin-device/doc/pl/index.md
new file mode 100644
index 0000000..acc8f9c
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/pl/index.md
@@ -0,0 +1,206 @@
+
+
+# cordova-plugin-device
+
+Ten plugin określa globalne `device` obiekt, który opisuje urządzenia sprzętowe i programowe. Mimo, że obiekt jest w globalnym zasięgu, nie jest dostępne dopiero po `deviceready` zdarzenie.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## Instalacja
+
+ cordova plugin add cordova-plugin-device
+
+
+## Właściwości
+
+* device.cordova
+* device.model
+* device.platform
+* device.uuid
+* device.version
+
+## device.cordova
+
+Pobierz wersję Cordova działa na urządzeniu.
+
+### Obsługiwane platformy
+
+* Amazon Fire OS
+* Android
+* BlackBerry 10
+* Przeglądarka
+* Firefox OS
+* iOS
+* Tizen
+* Windows Phone 7 i 8
+* Windows 8
+
+## device.model
+
+`device.model`Zwraca nazwę modelu lub produktu. Wartość jest zestaw przez producenta urządzenia i mogą się różnić między wersjami tego samego produktu.
+
+### Obsługiwane platformy
+
+* Android
+* BlackBerry 10
+* Przeglądarka
+* iOS
+* Tizen
+* Windows Phone 7 i 8
+* Windows 8
+
+### Szybki przykład
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. Zobacz http://theiphonewiki.com/wiki/index.php?title=Models / / modelu var = device.model;
+
+
+### Dziwactwa Androida
+
+* Pobiera [nazwę produktu][1] zamiast [nazwy modelu][2], który często jest nazwą kod produkcji. Na przykład, Nexus One zwraca `Passion` , i zwraca Motorola Droid`voles`.
+
+ [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT
+ [2]: http://developer.android.com/reference/android/os/Build.html#MODEL
+
+### Dziwactwa Tizen
+
+* Zwraca modelu urządzenia przypisane przez dostawcę, na przykład,`TIZEN`
+
+### Windows Phone 7 i 8 dziwactwa
+
+* Zwraca modelu urządzenia, określonej przez producenta. Na przykład Samsung ostrości zwraca`SGH-i917`.
+
+## device.platform
+
+Uzyskać nazwę systemu operacyjnego urządzenia.
+
+ var string = device.platform;
+
+
+### Obsługiwane platformy
+
+* Android
+* BlackBerry 10
+* Browser4
+* Firefox OS
+* iOS
+* Tizen
+* Windows Phone 7 i 8
+* Windows 8
+
+### Szybki przykład
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Dziwactwa Windows Phone 7
+
+Urządzenia Windows Phone 7 raport platformy jako`WinCE`.
+
+### Windows Phone 8 dziwactwa
+
+Urządzenia Windows Phone 8 raport platformy jako`Win32NT`.
+
+## device.uuid
+
+Się urządzenia uniwersalnie unikatowy identyfikator ([UUID][3]).
+
+ [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier
+
+ var string = device.uuid;
+
+
+### Opis
+
+Szczegóły jak UUID jest generowane są określane przez producenta urządzenia i są specyficzne dla platformy lub modelu urządzenia.
+
+### Obsługiwane platformy
+
+* Android
+* BlackBerry 10
+* iOS
+* Tizen
+* Windows Phone 7 i 8
+* Windows 8
+
+### Szybki przykład
+
+ / / Android: zwraca losowe 64-bitowa liczba całkowita (jako ciąg, znowu!) / / liczba całkowita jest generowany na pierwszego uruchomienia urządzenia / / / / BlackBerry: zwraca numer PIN urządzenia / / to jest unikatową liczbą całkowitą dziewięciu cyfr (jako ciąg, choć!) / / / / iPhone: (zacytowana w dokumentacji klasy UIDevice) / / zwraca ciąg wartości mieszania utworzone z wielu sprzętu identyfikuje.
+ Zapewniona jest unikatowy dla każdego urządzenia i nie może być związane z / do konta użytkownika.
+ / / Windows Phone 7: zwraca wartość mieszania urządzenia + bieżący użytkownik, / / jeśli nie zdefiniowane przez użytkownika, identyfikator guid jest generowany i będzie trwać do czasu odinstalowania aplikacji / / Tizen: zwraca urządzenia IMEI (International Mobile Equipment Identity lub IMEI jest liczbą / / unikatowe dla każdego telefonu komórkowego GSM i UMTS.
+ var deviceID = device.uuid;
+
+
+### iOS dziwactwo
+
+`uuid`Na iOS nie jest przypisany do urządzenia, ale różni się dla każdej aplikacji, dla każdej instalacji. Zmienia się jeśli możesz usunąć i ponownie zainstalować aplikację, a ewentualnie także po aktualizacji iOS czy nawet uaktualnienia aplikacji dla wersji (widoczny w iOS 5.1). `uuid`Jest nie wiarygodne wartości.
+
+### Windows Phone 7 i 8 dziwactwa
+
+`uuid`Dla Windows Phone 7 wymaga uprawnień `ID_CAP_IDENTITY_DEVICE` . Microsoft będzie prawdopodobnie potępiać ten wkrótce. Jeśli funkcja nie jest dostępna, aplikacja generuje trwałe identyfikator guid, który jest utrzymywany przez czas trwania instalacji aplikacji na urządzeniu.
+
+## device.version
+
+Pobierz wersję systemu operacyjnego.
+
+ var string = device.version;
+
+
+### Obsługiwane platformy
+
+* Android 2.1 +
+* BlackBerry 10
+* Przeglądarka
+* iOS
+* Tizen
+* Windows Phone 7 i 8
+* Windows 8
+
+### Szybki przykład
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+ // Tizen: returns "TIZEN_20120425_2"
+ var deviceVersion = device.version;
diff --git a/plugins/cordova-plugin-device/doc/ru/index.md b/plugins/cordova-plugin-device/doc/ru/index.md
new file mode 100644
index 0000000..263b1cd
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/ru/index.md
@@ -0,0 +1,219 @@
+
+
+# cordova-plugin-device
+
+Этот плагин определяет глобальный объект `device`, который описывает оборудование и программное обеспечение устройства. Несмотря на то что объект в глобальной области видимости, он не доступен до того момента пока не произойдет событие `deviceready`.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## Установка
+
+ cordova plugin add cordova-plugin-device
+
+
+## Параметры
+
+* device.cordova
+* device.model
+* device.platform
+* device.uuid
+* device.version
+
+## device.cordova
+
+Возвращает версию Cordova, работающую на устройстве.
+
+### Поддерживаемые платформы
+
+* Amazon Fire OS
+* Android
+* BlackBerry 10
+* Обозреватель
+* Firefox OS
+* iOS
+* Tizen
+* Windows Phone 7 и 8
+* Windows 8
+
+## device.model
+
+Свойство `device.model` возвращает имя устройства модели или продукта. Значение устанавливается производителем устройства и могут отличаться в разных версиях одного и того же продукта.
+
+### Поддерживаемые платформы
+
+* Android
+* BlackBerry 10
+* Обозреватель
+* iOS
+* Tizen
+* Windows Phone 7 и 8
+* Windows 8
+
+### Краткий пример
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. See http://theiphonewiki.com/wiki/index.php?title=Models
+ //
+ var model = device.model;
+
+
+### Особенности Android
+
+* Возвращает [имя продукта][1] , а не [имя модели][2], которое часто является производственным кодом. Например, Nexus One из них возвращает `Passion` , и Motorola Droid возвращает `voles`.
+
+ [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT
+ [2]: http://developer.android.com/reference/android/os/Build.html#MODEL
+
+### Особенности Tizen
+
+* Возвращает модель устройства, назначенного вендором, например,`TIZEN`
+
+### Особенности Windows Phone 7 и 8
+
+* Возвращает модель устройства, указанной заводом-изготовителем. Например Samsung Focus возвращает `SGH-i917`.
+
+## device.platform
+
+Получите имя операционной системы устройства.
+
+ var string = device.platform;
+
+
+### Поддерживаемые платформы
+
+* Android
+* BlackBerry 10
+* Браузером4
+* Firefox OS
+* iOS
+* Tizen
+* Windows Phone 7 и 8
+* Windows 8
+
+### Краткий пример
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Особенности Windows Phone 7
+
+Windows Phone 7 устройства сообщают платформу как `WinCE`.
+
+### Особенности Windows Phone 8
+
+Устройства Windows Phone 8 сообщают платформу как `Win32NT`.
+
+## device.uuid
+
+Возвращает универсальный уникального идентификатора ([UUID][3] устройства).
+
+ [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier
+
+ var string = device.uuid;
+
+
+### Описание
+
+Подробная информация о том как UUID генерируется, определяются изготовителем устройства и являются специфическими для платформы или модели устройства.
+
+### Поддерживаемые платформы
+
+* Android
+* BlackBerry 10
+* iOS
+* Tizen
+* Windows Phone 7 и 8
+* Windows 8
+
+### Краткий пример
+
+ // Android: Возвращает случайное 64-разрядное целое число (в виде строки, опять!)
+ // целое число генерируется при первой загрузке устройства
+ //
+ // BlackBerry: Возвращает номер PIN устройства
+ // это 9 значный уникальный целочисленный (как строка, хотя!)
+ //
+ // iPhone: (Перефразировано из документации класса UIDevice)
+ // возвращает строку хэш-значения, созданные из нескольких аппаратных определяет.
+ // Это значение гарантированно является уникальным для каждого устройства и не может быть привязано
+ // к учетной записи пользователя.
+ // Windows Phone 7: Возвращает хэш устройство + текущего пользователя,
+ // если пользователь не определен, формируется guid который и будет сохраняться до тех пор, пока приложение не удалиться
+ // Tizen: возвращает IMEI устройства (Международный идентификатор мобильного оборудования или IMEI это число
+ // уникальное для каждого мобильного телефона GSM и UMTS.
+ var deviceID = device.uuid;
+
+
+### Особенности iOS
+
+На iOS `uuid` не является уникальным для устройства, но варьируется для каждого приложения, и для каждой установки. Значение меняется, если удалить и повторно установить приложение, и возможно также когда вы обновите iOS, или даже обновить приложение до следующей версии (очевидно в iOS 5.1). Значение `uuid` не является надежным.
+
+### Особенности Windows Phone 7 и 8
+
+Для Windows Phone 7 `uuid` требует разрешения `ID_CAP_IDENTITY_DEVICE` . Microsoft скорее всего скоро сделает это свойство устаревшим. Если возможность недоступна, приложение создает постоянные guid, который сохраняется на все время установки приложения на устройстве.
+
+## device.version
+
+Возвращает версию операционной системы.
+
+ var string = device.version;
+
+
+### Поддерживаемые платформы
+
+* Android 2.1 +
+* BlackBerry 10
+* Обозреватель
+* iOS
+* Tizen
+* Windows Phone 7 и 8
+* Windows 8
+
+### Краткий пример
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+ // Tizen: returns "TIZEN_20120425_2"
+ var deviceVersion = device.version;
diff --git a/plugins/cordova-plugin-device/doc/zh/README.md b/plugins/cordova-plugin-device/doc/zh/README.md
new file mode 100644
index 0000000..9a18a55
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/zh/README.md
@@ -0,0 +1,203 @@
+
+
+# cordova-plugin-device
+
+[](https://travis-ci.org/apache/cordova-plugin-device)
+
+這個外掛程式定義全球 `device` 物件,描述該設備的硬體和軟體。 雖然物件是在全球範圍內,但不是可用,直到後 `deviceready` 事件。
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## 安裝
+
+ cordova plugin add cordova-plugin-device
+
+
+## 屬性
+
+ * device.cordova
+ * device.model
+ * device.platform
+ * device.uuid
+ * device.version
+
+## device.cordova
+
+獲取科爾多瓦在設備上運行的版本。
+
+### 支援的平臺
+
+ * 亞馬遜火 OS
+ * Android 系統
+ * 黑莓 10
+ * 瀏覽器
+ * 火狐瀏覽器作業系統
+ * iOS
+ * Tizen
+ * Windows Phone 7 和 8
+ * Windows 8
+
+## device.model
+
+`device.model`返回設備的模型或產品的名稱。值由設備製造商設置和同一產品的不同版本可能不同。
+
+### 支援的平臺
+
+ * Android 系統
+ * 黑莓 10
+ * 瀏覽器
+ * iOS
+ * Tizen
+ * Windows Phone 7 和 8
+ * Windows 8
+
+### 快速的示例
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. 請參閱 HTTP://theiphonewiki.com/wiki/index.php?title=Models / / var 模型 = device.model ;
+
+
+### Android 的怪癖
+
+ * 獲取[產品名稱](http://developer.android.com/reference/android/os/Build.html#PRODUCT)而不是[產品型號名稱](http://developer.android.com/reference/android/os/Build.html#MODEL),這往往是生產代碼名稱。 例如,Nexus One 返回 `Passion` ,和摩托羅拉 Droid 返回`voles`.
+
+### Tizen 怪癖
+
+ * 例如,返回與供應商指派的設備模型`TIZEN`
+
+### Windows Phone 7 和 8 怪癖
+
+ * 返回由製造商指定的設備模型。例如,三星焦點返回`SGH-i917`.
+
+## device.platform
+
+獲取設備的作業系統名稱。
+
+ var string = device.platform;
+
+
+### 支援的平臺
+
+ * Android 系統
+ * 黑莓 10
+ * Browser4
+ * 火狐瀏覽器作業系統
+ * iOS
+ * Tizen
+ * Windows Phone 7 和 8
+ * Windows 8
+
+### 快速的示例
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Windows Phone 7 的怪癖
+
+Windows Phone 7 設備報告作為平臺`WinCE`.
+
+### Windows Phone 8 怪癖
+
+Windows Phone 8 設備報告作為平臺`Win32NT`.
+
+## device.uuid
+
+獲取設備的通用唯一識別碼 ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)).
+
+ var string = device.uuid;
+
+
+### 說明
+
+如何生成一個 UUID 的細節由設備製造商和特定于設備的平臺或模型。
+
+### 支援的平臺
+
+ * Android 系統
+ * 黑莓 10
+ * iOS
+ * Tizen
+ * Windows Phone 7 和 8
+ * Windows 8
+
+### 快速的示例
+
+ / / Android: 一個隨機的 64 位整數 (作為字串返回,再次!) / / 上設備的第一次啟動生成的整數 / / / / 黑莓手機: 返回設備的 PIN 號碼 / / 這是九個數字的唯一整數 (作為字串,雖然!) / / / / iPhone: (從 UIDevice 類文檔解釋) / / 返回一個字串的雜湊值創建的多個硬體標識。
+ / / 它保證是唯一的每個設備並不能綁 / / 到使用者帳戶。
+ / / Windows Phone 7: 返回的雜湊代碼的設備 + 當前使用者,/ / 如果未定義使用者,則一個 guid 生成的並且將會保留直到卸載該應用程式 / / Tizen: 返回設備 IMEI (國際行動裝置身份或 IMEI 是一個數位 / / 獨有的每一個 UMTS 和 GSM 行動電話。
+ var deviceID = device.uuid;
+
+
+### iOS 怪癖
+
+`uuid`在 iOS 不是唯一的一種裝置,但對於每個應用程式,為每個安裝而異。 如果您刪除並重新安裝該應用程式,它更改和可能還當你升級 iOS,或甚至升級每個版本 (iOS 5.1 中存在明顯的) 的應用程式。 `uuid`不是一個可靠的值。
+
+### Windows Phone 7 和 8 怪癖
+
+`uuid`為 Windows Phone 7 須經許可 `ID_CAP_IDENTITY_DEVICE` 。 Microsoft 可能會很快棄用此屬性。 如果沒有可用的能力,應用程式將生成設備上應用程式的安裝過程中保持持續的 guid。
+
+## device.version
+
+獲取作業系統版本。
+
+ var string = device.version;
+
+
+### 支援的平臺
+
+ * Android 2.1 +
+ * 黑莓 10
+ * 瀏覽器
+ * iOS
+ * Tizen
+ * Windows Phone 7 和 8
+ * Windows 8
+
+### 快速的示例
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+ // Tizen: returns "TIZEN_20120425_2"
+ var deviceVersion = device.version;
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device/doc/zh/index.md b/plugins/cordova-plugin-device/doc/zh/index.md
new file mode 100644
index 0000000..5626d69
--- /dev/null
+++ b/plugins/cordova-plugin-device/doc/zh/index.md
@@ -0,0 +1,206 @@
+
+
+# cordova-plugin-device
+
+這個外掛程式定義全球 `device` 物件,描述該設備的硬體和軟體。 雖然物件是在全球範圍內,但不是可用,直到後 `deviceready` 事件。
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(device.cordova);
+ }
+
+
+## 安裝
+
+ cordova plugin add cordova-plugin-device
+
+
+## 屬性
+
+* device.cordova
+* device.model
+* device.platform
+* device.uuid
+* device.version
+
+## device.cordova
+
+獲取科爾多瓦在設備上運行的版本。
+
+### 支援的平臺
+
+* 亞馬遜火 OS
+* Android 系統
+* 黑莓 10
+* 瀏覽器
+* 火狐瀏覽器的作業系統
+* iOS
+* 泰
+* Windows Phone 7 和 8
+* Windows 8
+
+## device.model
+
+`device.model`返回設備的模型或產品的名稱。值由設備製造商設置和同一產品的不同版本可能不同。
+
+### 支援的平臺
+
+* Android 系統
+* 黑莓 10
+* 瀏覽器
+* iOS
+* 泰
+* Windows Phone 7 和 8
+* Windows 8
+
+### 快速的示例
+
+ // Android: Nexus One returns "Passion" (Nexus One code name)
+ // Motorola Droid returns "voles"
+ // BlackBerry: Torch 9800 returns "9800"
+ // Browser: Google Chrome returns "Chrome"
+ // Safari returns "Safari"
+ // iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. 請參閱 HTTP://theiphonewiki.com/wiki/index.php?title=Models / / var 模型 = device.model ;
+
+
+### Android 的怪癖
+
+* 獲取[產品名稱][1]而不是[產品型號名稱][2],這往往是生產代碼名稱。 例如,Nexus One 返回 `Passion` ,和摩托羅拉 Droid 返回`voles`.
+
+ [1]: http://developer.android.com/reference/android/os/Build.html#PRODUCT
+ [2]: http://developer.android.com/reference/android/os/Build.html#MODEL
+
+### Tizen 怪癖
+
+* 例如,返回與供應商指派的設備模型`TIZEN`
+
+### Windows Phone 7 和 8 怪癖
+
+* 返回由製造商指定的設備模型。例如,三星焦點返回`SGH-i917`.
+
+## device.platform
+
+獲取設備的作業系統名稱。
+
+ var string = device.platform;
+
+
+### 支援的平臺
+
+* Android 系統
+* 黑莓 10
+* Browser4
+* 火狐瀏覽器的作業系統
+* iOS
+* 泰
+* Windows Phone 7 和 8
+* Windows 8
+
+### 快速的示例
+
+ // Depending on the device, a few examples are:
+ // - "Android"
+ // - "BlackBerry 10"
+ // - Browser: returns "MacIntel" on Mac
+ // returns "Win32" on Windows
+ // - "iOS"
+ // - "WinCE"
+ // - "Tizen"
+ var devicePlatform = device.platform;
+
+
+### Windows Phone 7 的怪癖
+
+Windows Phone 7 設備報告作為平臺`WinCE`.
+
+### Windows Phone 8 怪癖
+
+Windows Phone 8 設備報告作為平臺`Win32NT`.
+
+## device.uuid
+
+獲取設備的通用唯一識別碼 ([UUID][3]).
+
+ [3]: http://en.wikipedia.org/wiki/Universally_Unique_Identifier
+
+ var string = device.uuid;
+
+
+### 說明
+
+如何生成一個 UUID 的細節由設備製造商和特定于設備的平臺或模型。
+
+### 支援的平臺
+
+* Android 系統
+* 黑莓 10
+* iOS
+* Tizen
+* Windows Phone 7 和 8
+* Windows 8
+
+### 快速的示例
+
+ / / Android: 一個隨機的 64 位整數 (作為字串返回,再次!) / / 上設備的第一次啟動生成的整數 / / / / 黑莓手機: 返回設備的 PIN 號碼 / / 這是九個數字的唯一整數 (作為字串,雖然!) / / / / iPhone: (從 UIDevice 類文檔解釋) / / 返回一個字串的雜湊值創建的多個硬體標識。
+ / / 它保證是唯一的每個設備並不能綁 / / 到使用者帳戶。
+ / / Windows Phone 7: 返回的雜湊代碼的設備 + 當前使用者,/ / 如果未定義使用者,則一個 guid 生成的並且將會保留直到卸載該應用程式 / / Tizen: 返回設備 IMEI (國際行動裝置身份或 IMEI 是一個數位 / / 獨有的每一個 UMTS 和 GSM 行動電話。
+ var deviceID = device.uuid;
+
+
+### iOS 怪癖
+
+`uuid`在 iOS 不是唯一的一種裝置,但對於每個應用程式,為每個安裝而異。 如果您刪除並重新安裝該應用程式,它更改和可能還當你升級 iOS,或甚至升級每個版本 (iOS 5.1 中存在明顯的) 的應用程式。 `uuid`不是一個可靠的值。
+
+### Windows Phone 7 和 8 怪癖
+
+`uuid`為 Windows Phone 7 須經許可 `ID_CAP_IDENTITY_DEVICE` 。 Microsoft 可能會很快棄用此屬性。 如果沒有可用的能力,應用程式將生成設備上應用程式的安裝過程中保持持續的 guid。
+
+## device.version
+
+獲取作業系統版本。
+
+ var string = device.version;
+
+
+### 支援的平臺
+
+* Android 2.1 +
+* 黑莓 10
+* 瀏覽器
+* iOS
+* 泰
+* Windows Phone 7 和 8
+* Windows 8
+
+### 快速的示例
+
+ // Android: Froyo OS would return "2.2"
+ // Eclair OS would return "2.1", "2.0.1", or "2.0"
+ // Version can also return update level "2.1-update1"
+ //
+ // BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
+ //
+ // Browser: Returns version number for the browser
+ //
+ // iPhone: iOS 3.2 returns "3.2"
+ //
+ // Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
+ // Tizen: returns "TIZEN_20120425_2"
+ var deviceVersion = device.version;
diff --git a/plugins/cordova-plugin-device/package.json b/plugins/cordova-plugin-device/package.json
new file mode 100644
index 0000000..595b0c9
--- /dev/null
+++ b/plugins/cordova-plugin-device/package.json
@@ -0,0 +1,84 @@
+{
+ "_from": "cordova-plugin-device@2.0.2",
+ "_id": "cordova-plugin-device@2.0.2",
+ "_inBundle": false,
+ "_integrity": "sha1-/Ajzci5n7ve2xnv8mag99q3Quro=",
+ "_location": "/cordova-plugin-device",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "cordova-plugin-device@2.0.2",
+ "name": "cordova-plugin-device",
+ "escapedName": "cordova-plugin-device",
+ "rawSpec": "2.0.2",
+ "saveSpec": null,
+ "fetchSpec": "2.0.2"
+ },
+ "_requiredBy": [
+ "#DEV:/",
+ "#USER"
+ ],
+ "_resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.2.tgz",
+ "_shasum": "fc08f3722e67eef7b6c67bfc99a83df6add0baba",
+ "_spec": "cordova-plugin-device@2.0.2",
+ "_where": "/home/saherelm/Documents/My Projects/xFrameworkTest",
+ "author": {
+ "name": "Apache Software Foundation"
+ },
+ "bugs": {
+ "url": "https://issues.apache.org/jira/browse/CB"
+ },
+ "bundleDependencies": false,
+ "cordova": {
+ "id": "cordova-plugin-device",
+ "platforms": [
+ "android",
+ "ios",
+ "windows",
+ "browser",
+ "osx"
+ ]
+ },
+ "deprecated": false,
+ "description": "Cordova Device Plugin",
+ "devDependencies": {
+ "eslint": "^3.19.0",
+ "eslint-config-semistandard": "^11.0.0",
+ "eslint-config-standard": "^10.2.1",
+ "eslint-plugin-import": "^2.3.0",
+ "eslint-plugin-node": "^5.0.0",
+ "eslint-plugin-promise": "^3.5.0",
+ "eslint-plugin-standard": "^3.0.1"
+ },
+ "engines": {
+ "cordovaDependencies": {
+ "3.0.0": {
+ "cordova": ">100"
+ }
+ }
+ },
+ "homepage": "https://github.com/apache/cordova-plugin-device#readme",
+ "keywords": [
+ "cordova",
+ "device",
+ "ecosystem:cordova",
+ "cordova-android",
+ "cordova-ios",
+ "cordova-windows",
+ "cordova-browser",
+ "cordova-osx"
+ ],
+ "license": "Apache-2.0",
+ "name": "cordova-plugin-device",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/apache/cordova-plugin-device.git"
+ },
+ "scripts": {
+ "eslint": "node node_modules/eslint/bin/eslint www && node node_modules/eslint/bin/eslint src && node node_modules/eslint/bin/eslint tests",
+ "test": "npm run eslint"
+ },
+ "types": "./types/index.d.ts",
+ "version": "2.0.2"
+}
diff --git a/plugins/cordova-plugin-device/plugin.xml b/plugins/cordova-plugin-device/plugin.xml
new file mode 100644
index 0000000..7f60024
--- /dev/null
+++ b/plugins/cordova-plugin-device/plugin.xml
@@ -0,0 +1,93 @@
+
+
+
+
+ Device
+ Cordova Device Plugin
+ Apache 2.0
+ cordova,device
+ https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
+ https://issues.apache.org/jira/browse/CB/component/12320648
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/cordova-plugin-device/src/android/Device.java b/plugins/cordova-plugin-device/src/android/Device.java
new file mode 100644
index 0000000..e9efcb4
--- /dev/null
+++ b/plugins/cordova-plugin-device/src/android/Device.java
@@ -0,0 +1,174 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+package org.apache.cordova.device;
+
+import java.util.TimeZone;
+
+import org.apache.cordova.CordovaWebView;
+import org.apache.cordova.CallbackContext;
+import org.apache.cordova.CordovaPlugin;
+import org.apache.cordova.CordovaInterface;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import android.provider.Settings;
+
+public class Device extends CordovaPlugin {
+ public static final String TAG = "Device";
+
+ public static String platform; // Device OS
+ public static String uuid; // Device UUID
+
+ private static final String ANDROID_PLATFORM = "Android";
+ private static final String AMAZON_PLATFORM = "amazon-fireos";
+ private static final String AMAZON_DEVICE = "Amazon";
+
+ /**
+ * Constructor.
+ */
+ public Device() {
+ }
+
+ /**
+ * Sets the context of the Command. This can then be used to do things like
+ * get file paths associated with the Activity.
+ *
+ * @param cordova The context of the main Activity.
+ * @param webView The CordovaWebView Cordova is running in.
+ */
+ public void initialize(CordovaInterface cordova, CordovaWebView webView) {
+ super.initialize(cordova, webView);
+ Device.uuid = getUuid();
+ }
+
+ /**
+ * Executes the request and returns PluginResult.
+ *
+ * @param action The action to execute.
+ * @param args JSONArry of arguments for the plugin.
+ * @param callbackContext The callback id used when calling back into JavaScript.
+ * @return True if the action was valid, false if not.
+ */
+ public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
+ if ("getDeviceInfo".equals(action)) {
+ JSONObject r = new JSONObject();
+ r.put("uuid", Device.uuid);
+ r.put("version", this.getOSVersion());
+ r.put("platform", this.getPlatform());
+ r.put("model", this.getModel());
+ r.put("manufacturer", this.getManufacturer());
+ r.put("isVirtual", this.isVirtual());
+ r.put("serial", this.getSerialNumber());
+ callbackContext.success(r);
+ }
+ else {
+ return false;
+ }
+ return true;
+ }
+
+ //--------------------------------------------------------------------------
+ // LOCAL METHODS
+ //--------------------------------------------------------------------------
+
+ /**
+ * Get the OS name.
+ *
+ * @return
+ */
+ public String getPlatform() {
+ String platform;
+ if (isAmazonDevice()) {
+ platform = AMAZON_PLATFORM;
+ } else {
+ platform = ANDROID_PLATFORM;
+ }
+ return platform;
+ }
+
+ /**
+ * Get the device's Universally Unique Identifier (UUID).
+ *
+ * @return
+ */
+ public String getUuid() {
+ String uuid = Settings.Secure.getString(this.cordova.getActivity().getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
+ return uuid;
+ }
+
+ public String getModel() {
+ String model = android.os.Build.MODEL;
+ return model;
+ }
+
+ public String getProductName() {
+ String productname = android.os.Build.PRODUCT;
+ return productname;
+ }
+
+ public String getManufacturer() {
+ String manufacturer = android.os.Build.MANUFACTURER;
+ return manufacturer;
+ }
+
+ public String getSerialNumber() {
+ String serial = android.os.Build.SERIAL;
+ return serial;
+ }
+
+ /**
+ * Get the OS version.
+ *
+ * @return
+ */
+ public String getOSVersion() {
+ String osversion = android.os.Build.VERSION.RELEASE;
+ return osversion;
+ }
+
+ public String getSDKVersion() {
+ @SuppressWarnings("deprecation")
+ String sdkversion = android.os.Build.VERSION.SDK;
+ return sdkversion;
+ }
+
+ public String getTimeZoneID() {
+ TimeZone tz = TimeZone.getDefault();
+ return (tz.getID());
+ }
+
+ /**
+ * Function to check if the device is manufactured by Amazon
+ *
+ * @return
+ */
+ public boolean isAmazonDevice() {
+ if (android.os.Build.MANUFACTURER.equals(AMAZON_DEVICE)) {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean isVirtual() {
+ return android.os.Build.FINGERPRINT.contains("generic") ||
+ android.os.Build.PRODUCT.contains("sdk");
+ }
+
+}
diff --git a/plugins/cordova-plugin-device/src/browser/DeviceProxy.js b/plugins/cordova-plugin-device/src/browser/DeviceProxy.js
new file mode 100644
index 0000000..4dc80ec
--- /dev/null
+++ b/plugins/cordova-plugin-device/src/browser/DeviceProxy.js
@@ -0,0 +1,84 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+var browser = require('cordova/platform');
+
+function getPlatform () {
+ return 'browser';
+}
+
+function getModel () {
+ return getBrowserInfo(true);
+}
+
+function getVersion () {
+ return getBrowserInfo(false);
+}
+
+function getBrowserInfo (getModel) {
+ var userAgent = navigator.userAgent;
+ var returnVal = '';
+ var offset;
+
+ if ((offset = userAgent.indexOf('Edge')) !== -1) {
+ returnVal = (getModel) ? 'Edge' : userAgent.substring(offset + 5);
+ } else if ((offset = userAgent.indexOf('Chrome')) !== -1) {
+ returnVal = (getModel) ? 'Chrome' : userAgent.substring(offset + 7);
+ } else if ((offset = userAgent.indexOf('Safari')) !== -1) {
+ if (getModel) {
+ returnVal = 'Safari';
+ } else {
+ returnVal = userAgent.substring(offset + 7);
+
+ if ((offset = userAgent.indexOf('Version')) !== -1) {
+ returnVal = userAgent.substring(offset + 8);
+ }
+ }
+ } else if ((offset = userAgent.indexOf('Firefox')) !== -1) {
+ returnVal = (getModel) ? 'Firefox' : userAgent.substring(offset + 8);
+ } else if ((offset = userAgent.indexOf('MSIE')) !== -1) {
+ returnVal = (getModel) ? 'MSIE' : userAgent.substring(offset + 5);
+ } else if ((offset = userAgent.indexOf('Trident')) !== -1) {
+ returnVal = (getModel) ? 'MSIE' : '11';
+ }
+
+ if ((offset = returnVal.indexOf(';')) !== -1 || (offset = returnVal.indexOf(' ')) !== -1) {
+ returnVal = returnVal.substring(0, offset);
+ }
+
+ return returnVal;
+}
+
+module.exports = {
+ getDeviceInfo: function (success, error) {
+ setTimeout(function () {
+ success({
+ cordova: browser.cordovaVersion,
+ platform: getPlatform(),
+ model: getModel(),
+ version: getVersion(),
+ uuid: null,
+ isVirtual: false
+ });
+ }, 0);
+ }
+};
+
+require('cordova/exec/proxy').add('Device', module.exports);
diff --git a/plugins/cordova-plugin-device/src/ios/CDVDevice.h b/plugins/cordova-plugin-device/src/ios/CDVDevice.h
new file mode 100644
index 0000000..a146d88
--- /dev/null
+++ b/plugins/cordova-plugin-device/src/ios/CDVDevice.h
@@ -0,0 +1,30 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import
+#import
+
+@interface CDVDevice : CDVPlugin
+{}
+
++ (NSString*)cordovaVersion;
+
+- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command;
+
+@end
diff --git a/plugins/cordova-plugin-device/src/ios/CDVDevice.m b/plugins/cordova-plugin-device/src/ios/CDVDevice.m
new file mode 100644
index 0000000..4d75a57
--- /dev/null
+++ b/plugins/cordova-plugin-device/src/ios/CDVDevice.m
@@ -0,0 +1,112 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#include
+#include
+#include "TargetConditionals.h"
+
+#import
+#import "CDVDevice.h"
+
+@implementation UIDevice (ModelVersion)
+
+- (NSString*)modelVersion
+{
+ size_t size;
+
+ sysctlbyname("hw.machine", NULL, &size, NULL, 0);
+ char* machine = malloc(size);
+ sysctlbyname("hw.machine", machine, &size, NULL, 0);
+ NSString* platform = [NSString stringWithUTF8String:machine];
+ free(machine);
+
+ return platform;
+}
+
+@end
+
+@interface CDVDevice () {}
+@end
+
+@implementation CDVDevice
+
+- (NSString*)uniqueAppInstanceIdentifier:(UIDevice*)device
+{
+ NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
+ static NSString* UUID_KEY = @"CDVUUID";
+
+ // Check user defaults first to maintain backwards compaitibility with previous versions
+ // which didn't user identifierForVendor
+ NSString* app_uuid = [userDefaults stringForKey:UUID_KEY];
+ if (app_uuid == nil) {
+ if ([device respondsToSelector:@selector(identifierForVendor)]) {
+ app_uuid = [[device identifierForVendor] UUIDString];
+ } else {
+ CFUUIDRef uuid = CFUUIDCreate(NULL);
+ app_uuid = (__bridge_transfer NSString *)CFUUIDCreateString(NULL, uuid);
+ CFRelease(uuid);
+ }
+
+ [userDefaults setObject:app_uuid forKey:UUID_KEY];
+ [userDefaults synchronize];
+ }
+
+ return app_uuid;
+}
+
+- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command
+{
+ NSDictionary* deviceProperties = [self deviceProperties];
+ CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:deviceProperties];
+
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+}
+
+- (NSDictionary*)deviceProperties
+{
+ UIDevice* device = [UIDevice currentDevice];
+
+ return @{
+ @"manufacturer": @"Apple",
+ @"model": [device modelVersion],
+ @"platform": @"iOS",
+ @"version": [device systemVersion],
+ @"uuid": [self uniqueAppInstanceIdentifier:device],
+ @"cordova": [[self class] cordovaVersion],
+ @"isVirtual": @([self isVirtual])
+ };
+}
+
++ (NSString*)cordovaVersion
+{
+ return CDV_VERSION;
+}
+
+- (BOOL)isVirtual
+{
+ #if TARGET_OS_SIMULATOR
+ return true;
+ #elif TARGET_IPHONE_SIMULATOR
+ return true;
+ #else
+ return false;
+ #endif
+}
+
+@end
diff --git a/plugins/cordova-plugin-device/src/osx/CDVDevice.h b/plugins/cordova-plugin-device/src/osx/CDVDevice.h
new file mode 100644
index 0000000..9def254
--- /dev/null
+++ b/plugins/cordova-plugin-device/src/osx/CDVDevice.h
@@ -0,0 +1,28 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import
+
+@interface CDVDevice : CDVPlugin
+
++ (NSString*) cordovaVersion;
+
+- (void) getDeviceInfo:(CDVInvokedUrlCommand*)command;
+
+@end
diff --git a/plugins/cordova-plugin-device/src/osx/CDVDevice.m b/plugins/cordova-plugin-device/src/osx/CDVDevice.m
new file mode 100644
index 0000000..3a63588
--- /dev/null
+++ b/plugins/cordova-plugin-device/src/osx/CDVDevice.m
@@ -0,0 +1,113 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#include
+
+#import "CDVDevice.h"
+
+#define SYSTEM_VERSION_PLIST @"/System/Library/CoreServices/SystemVersion.plist"
+
+@implementation CDVDevice
+
+- (NSString*) modelVersion {
+ size_t size;
+
+ sysctlbyname("hw.machine", NULL, &size, NULL, 0);
+ char* machine = malloc(size);
+ sysctlbyname("hw.machine", machine, &size, NULL, 0);
+ NSString* modelVersion = [NSString stringWithUTF8String:machine];
+ free(machine);
+
+ return modelVersion;
+}
+
+
+- (NSString*) getSerialNr {
+ NSString* serialNr;
+ io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"));
+ if (platformExpert) {
+ CFTypeRef serialNumberAsCFString =
+ IORegistryEntryCreateCFProperty(platformExpert,
+ CFSTR(kIOPlatformSerialNumberKey),
+ kCFAllocatorDefault, 0);
+ if (serialNumberAsCFString) {
+ serialNr = (__bridge NSString*) serialNumberAsCFString;
+ }
+ IOObjectRelease(platformExpert);
+ }
+ return serialNr;
+}
+
+- (NSString*) uniqueAppInstanceIdentifier {
+ NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
+ static NSString* UUID_KEY = @"CDVUUID";
+
+ NSString* app_uuid = [userDefaults stringForKey:UUID_KEY];
+
+ if (app_uuid == nil) {
+ CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault);
+ CFStringRef uuidString = CFUUIDCreateString(kCFAllocatorDefault, uuidRef);
+
+ app_uuid = [NSString stringWithString:(__bridge NSString*) uuidString];
+ [userDefaults setObject:app_uuid forKey:UUID_KEY];
+ [userDefaults synchronize];
+
+ CFRelease(uuidString);
+ CFRelease(uuidRef);
+ }
+
+ return app_uuid;
+}
+
+- (NSString*) platform {
+ return [NSDictionary dictionaryWithContentsOfFile:SYSTEM_VERSION_PLIST][@"ProductName"];
+}
+
+- (NSString*) systemVersion {
+ return [NSDictionary dictionaryWithContentsOfFile:SYSTEM_VERSION_PLIST][@"ProductVersion"];
+}
+
+- (void) getDeviceInfo:(CDVInvokedUrlCommand*) command {
+ NSDictionary* deviceProperties = [self deviceProperties];
+ CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:deviceProperties];
+
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+}
+
+- (NSDictionary*) deviceProperties {
+ NSMutableDictionary* devProps = [NSMutableDictionary dictionaryWithCapacity:4];
+
+ devProps[@"manufacturer"] = @"Apple";
+ devProps[@"model"] = [self modelVersion];
+ devProps[@"platform"] = [self platform];
+ devProps[@"version"] = [self systemVersion];
+ devProps[@"uuid"] = [self uniqueAppInstanceIdentifier];
+ devProps[@"cordova"] = [[self class] cordovaVersion];
+ devProps[@"serial"] = [self getSerialNr];
+ devProps[@"isVirtual"] = @NO;
+
+ NSDictionary* devReturn = [NSDictionary dictionaryWithDictionary:devProps];
+ return devReturn;
+}
+
++ (NSString*) cordovaVersion {
+ return CDV_VERSION;
+}
+
+@end
diff --git a/plugins/cordova-plugin-device/src/windows/DeviceProxy.js b/plugins/cordova-plugin-device/src/windows/DeviceProxy.js
new file mode 100644
index 0000000..ccaaaee
--- /dev/null
+++ b/plugins/cordova-plugin-device/src/windows/DeviceProxy.js
@@ -0,0 +1,96 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* global Windows, createUUID */
+
+var ROOT_CONTAINER = '{00000000-0000-0000-FFFF-FFFFFFFFFFFF}';
+var DEVICE_CLASS_KEY = '{A45C254E-DF1C-4EFD-8020-67D146A850E0},10';
+var DEVICE_CLASS_KEY_NO_SEMICOLON = '{A45C254E-DF1C-4EFD-8020-67D146A850E0}10';
+var ROOT_CONTAINER_QUERY = 'System.Devices.ContainerId:="' + ROOT_CONTAINER + '"';
+var HAL_DEVICE_CLASS = '4d36e966-e325-11ce-bfc1-08002be10318';
+var DEVICE_DRIVER_VERSION_KEY = '{A8B865DD-2E3D-4094-AD97-E593A70C75D6},3';
+
+module.exports = {
+
+ getDeviceInfo: function (win, fail, args) {
+
+ // deviceId aka uuid, stored in Windows.Storage.ApplicationData.current.localSettings.values.deviceId
+ var deviceId;
+ // get deviceId, or create and store one
+ var localSettings = Windows.Storage.ApplicationData.current.localSettings;
+ if (localSettings.values.deviceId) {
+ deviceId = localSettings.values.deviceId;
+ } else {
+ // App-specific hardware id could be used as uuid, but it changes if the hardware changes...
+ try {
+ var ASHWID = Windows.System.Profile.HardwareIdentification.getPackageSpecificToken(null).id;
+ deviceId = Windows.Storage.Streams.DataReader.fromBuffer(ASHWID).readGuid();
+ } catch (e) {
+ // Couldn't get the hardware UUID
+ deviceId = createUUID();
+ }
+ // ...so cache it per-install
+ localSettings.values.deviceId = deviceId;
+ }
+
+ var userAgent = window.clientInformation.userAgent;
+ // this will report "windows" in windows8.1 and windows phone 8.1 apps
+ // and "windows8" in windows 8.0 apps similar to cordova.js
+ // See https://github.com/apache/cordova-js/blob/master/src/windows/platform.js#L25
+ var devicePlatform = userAgent.indexOf('MSAppHost/1.0') === -1 ? 'windows' : 'windows8';
+ var versionString = userAgent.match(/Windows (?:Phone |NT )?([0-9.]+)/)[1];
+
+ var deviceInfo = new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation();
+ // Running in the Windows Simulator is a remote session.
+ // Running in the Windows Phone Emulator has the systemProductName set to "Virtual"
+ var isVirtual = Windows.System.RemoteDesktop.InteractiveSession.isRemote || deviceInfo.systemProductName === 'Virtual';
+ var manufacturer = deviceInfo.systemManufacturer;
+ var model = deviceInfo.systemProductName;
+
+ var Pnp = Windows.Devices.Enumeration.Pnp;
+
+ Pnp.PnpObject.findAllAsync(Pnp.PnpObjectType.device,
+ [DEVICE_DRIVER_VERSION_KEY, DEVICE_CLASS_KEY],
+ ROOT_CONTAINER_QUERY)
+ .then(function (rootDevices) {
+ for (var i = 0; i < rootDevices.length; i++) {
+ var rootDevice = rootDevices[i];
+ if (!rootDevice.properties) continue;
+ if (rootDevice.properties[DEVICE_CLASS_KEY_NO_SEMICOLON] === HAL_DEVICE_CLASS) {
+ versionString = rootDevice.properties[DEVICE_DRIVER_VERSION_KEY];
+ break;
+ }
+ }
+
+ setTimeout(function () {
+ win({ platform: devicePlatform,
+ version: versionString,
+ uuid: deviceId,
+ isVirtual: isVirtual,
+ model: model,
+ manufacturer: manufacturer});
+ }, 0);
+ });
+ }
+
+}; // exports
+
+require('cordova/exec/proxy').add('Device', module.exports);
diff --git a/plugins/cordova-plugin-device/tests/package.json b/plugins/cordova-plugin-device/tests/package.json
new file mode 100644
index 0000000..0fa9978
--- /dev/null
+++ b/plugins/cordova-plugin-device/tests/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "cordova-plugin-device-tests",
+ "version": "1.1.6-dev",
+ "description": "",
+ "cordova": {
+ "id": "cordova-plugin-device-tests",
+ "platforms": []
+ },
+ "keywords": [
+ "ecosystem:cordova"
+ ],
+ "author": "",
+ "license": "Apache 2.0"
+}
diff --git a/plugins/cordova-plugin-device/tests/plugin.xml b/plugins/cordova-plugin-device/tests/plugin.xml
new file mode 100644
index 0000000..afb700b
--- /dev/null
+++ b/plugins/cordova-plugin-device/tests/plugin.xml
@@ -0,0 +1,31 @@
+
+
+
+
+ Cordova Device Plugin Tests
+ Apache 2.0
+
+
+
+
diff --git a/plugins/cordova-plugin-device/tests/tests.js b/plugins/cordova-plugin-device/tests/tests.js
new file mode 100644
index 0000000..03e1fc7
--- /dev/null
+++ b/plugins/cordova-plugin-device/tests/tests.js
@@ -0,0 +1,113 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* eslint-env jasmine */
+
+exports.defineAutoTests = function () {
+ describe('Device Information (window.device)', function () {
+ it('should exist', function () {
+ expect(window.device).toBeDefined();
+ });
+
+ it('should contain a platform specification that is a string', function () {
+ expect(window.device.platform).toBeDefined();
+ expect((String(window.device.platform)).length > 0).toBe(true);
+ });
+
+ it('should contain a version specification that is a string', function () {
+ expect(window.device.version).toBeDefined();
+ expect((String(window.device.version)).length > 0).toBe(true);
+ });
+
+ it('should contain a UUID specification that is a string or a number', function () {
+ expect(window.device.uuid).toBeDefined();
+ if (typeof window.device.uuid === 'string' || typeof window.device.uuid === 'object') {
+ expect((String(window.device.uuid)).length > 0).toBe(true);
+ } else {
+ expect(window.device.uuid > 0).toBe(true);
+ }
+ });
+
+ it('should contain a cordova specification that is a string', function () {
+ expect(window.device.cordova).toBeDefined();
+ expect((String(window.device.cordova)).length > 0).toBe(true);
+ });
+
+ it('should depend on the presence of cordova.version string', function () {
+ expect(window.cordova.version).toBeDefined();
+ expect((String(window.cordova.version)).length > 0).toBe(true);
+ });
+
+ it('should contain device.cordova equal to cordova.version', function () {
+ expect(window.device.cordova).toBe(window.cordova.version);
+ });
+
+ it('should contain a model specification that is a string', function () {
+ expect(window.device.model).toBeDefined();
+ expect((String(window.device.model)).length > 0).toBe(true);
+ });
+
+ it('should contain a manufacturer property that is a string', function () {
+ expect(window.device.manufacturer).toBeDefined();
+ expect((String(window.device.manufacturer)).length > 0).toBe(true);
+ });
+
+ it('should contain an isVirtual property that is a boolean', function () {
+ expect(window.device.isVirtual).toBeDefined();
+ expect(typeof window.device.isVirtual).toBe('boolean');
+ });
+
+ it('should contain a serial number specification that is a string', function () {
+ expect(window.device.serial).toBeDefined();
+ expect((String(window.device.serial)).length > 0).toBe(true);
+
+ });
+
+ });
+};
+
+exports.defineManualTests = function (contentEl, createActionButton) {
+ var logMessage = function (message, color) {
+ var log = document.getElementById('info');
+ var logLine = document.createElement('div');
+ if (color) {
+ logLine.style.color = color;
+ }
+ logLine.innerHTML = message;
+ log.appendChild(logLine);
+ };
+
+ var clearLog = function () {
+ var log = document.getElementById('info');
+ log.innerHTML = '';
+ };
+
+ var device_tests = 'Press Dump Device button to get device information
' +
+ '' +
+ 'Expected result: Status box will get updated with device info. (i.e. platform, version, uuid, model, etc)';
+
+ contentEl.innerHTML = '' + device_tests;
+
+ createActionButton('Dump device', function () {
+ clearLog();
+ logMessage(JSON.stringify(window.device, null, '\t'));
+ }, 'dump_device');
+};
diff --git a/plugins/cordova-plugin-device/types/index.d.ts b/plugins/cordova-plugin-device/types/index.d.ts
new file mode 100644
index 0000000..d4450b4
--- /dev/null
+++ b/plugins/cordova-plugin-device/types/index.d.ts
@@ -0,0 +1,36 @@
+// Type definitions for Apache Cordova Device plugin
+// Project: https://github.com/apache/cordova-plugin-device
+// Definitions by: Microsoft Open Technologies Inc
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+//
+// Copyright (c) Microsoft Open Technologies Inc
+// Licensed under the MIT license
+
+/**
+ * This plugin defines a global device object, which describes the device's hardware and software.
+ * Although the object is in the global scope, it is not available until after the deviceready event.
+ */
+interface Device {
+ /** Get the version of Cordova running on the device. */
+ cordova: string;
+ /** Indicates that Cordova initialize successfully. */
+ available: boolean;
+ /**
+ * The device.model returns the name of the device's model or product. The value is set
+ * by the device manufacturer and may be different across versions of the same product.
+ */
+ model: string;
+ /** Get the device's operating system name. */
+ platform: string;
+ /** Get the device's Universally Unique Identifier (UUID). */
+ uuid: string;
+ /** Get the operating system version. */
+ version: string;
+ /** Get the device's manufacturer. */
+ manufacturer: string;
+ /** Whether the device is running on a simulator. */
+ isVirtual: boolean;
+ /** Get the device hardware serial number. */
+ serial: string;}
+
+declare var device: Device;
\ No newline at end of file
diff --git a/plugins/cordova-plugin-device/www/device.js b/plugins/cordova-plugin-device/www/device.js
new file mode 100644
index 0000000..41ed04f
--- /dev/null
+++ b/plugins/cordova-plugin-device/www/device.js
@@ -0,0 +1,83 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+var argscheck = require('cordova/argscheck');
+var channel = require('cordova/channel');
+var utils = require('cordova/utils');
+var exec = require('cordova/exec');
+var cordova = require('cordova');
+
+channel.createSticky('onCordovaInfoReady');
+// Tell cordova channel to wait on the CordovaInfoReady event
+channel.waitForInitialization('onCordovaInfoReady');
+
+/**
+ * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
+ * phone, etc.
+ * @constructor
+ */
+function Device () {
+ this.available = false;
+ this.platform = null;
+ this.version = null;
+ this.uuid = null;
+ this.cordova = null;
+ this.model = null;
+ this.manufacturer = null;
+ this.isVirtual = null;
+ this.serial = null;
+
+ var me = this;
+
+ channel.onCordovaReady.subscribe(function () {
+ me.getInfo(function (info) {
+ // ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js
+ // TODO: CB-5105 native implementations should not return info.cordova
+ var buildLabel = cordova.version;
+ me.available = true;
+ me.platform = info.platform;
+ me.version = info.version;
+ me.uuid = info.uuid;
+ me.cordova = buildLabel;
+ me.model = info.model;
+ me.isVirtual = info.isVirtual;
+ me.manufacturer = info.manufacturer || 'unknown';
+ me.serial = info.serial || 'unknown';
+ channel.onCordovaInfoReady.fire();
+ }, function (e) {
+ me.available = false;
+ utils.alert('[ERROR] Error initializing Cordova: ' + e);
+ });
+ });
+}
+
+/**
+ * Get device info
+ *
+ * @param {Function} successCallback The function to call when the heading data is available
+ * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
+ */
+Device.prototype.getInfo = function (successCallback, errorCallback) {
+ argscheck.checkArgs('fF', 'Device.getInfo', arguments);
+ exec(successCallback, errorCallback, 'Device', 'getDeviceInfo', []);
+};
+
+module.exports = new Device();
diff --git a/plugins/cordova-plugin-ionic-keyboard/LICENSE b/plugins/cordova-plugin-ionic-keyboard/LICENSE
new file mode 100644
index 0000000..623c70a
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-keyboard/LICENSE
@@ -0,0 +1,23 @@
+Copyright 2015-present Drifty Co.
+http://drifty.com/
+
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/plugins/cordova-plugin-ionic-keyboard/README.md b/plugins/cordova-plugin-ionic-keyboard/README.md
new file mode 100644
index 0000000..4674035
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-keyboard/README.md
@@ -0,0 +1,220 @@
+# cordova-plugin-ionic-keyboard
+
+This plugin has been designed to work seamlessly with `cordova-plugin-ionic-webview`, so make sure you have it installed first:
+
+ - https://github.com/ionic-team/cordova-plugin-ionic-webview
+ - https://ionicframework.com/docs/wkwebview/
+
+## Installation
+
+```
+cordova plugin add cordova-plugin-ionic-keyboard --save
+```
+
+## Preferences
+
+### KeyboardResize (for iOS only)
+
+> Boolean (true by default)
+
+#### Possible values
+- `true`: Showing/hiding the keyboard will trigger some kind of resizing of the app (see KeyboardResizeMode)
+- `false`: Web will not be resized when the keyboard shows up.
+
+```xml
+
+```
+
+### KeyboardResizeMode (for iOS only)
+
+> String ('native' by default)
+
+#### Possible values
+
+- `native`: The whole native webview will be resized when the keyboard shows/hides, it will affect the `vh` relative unit.
+- `body`: Only the html `` element will be resized. Relative units are not affected, because the viewport does not change.
+- `ionic`: Only the html `ion-app` element will be resized. Only for ionic apps.
+
+```xml
+
+```
+
+### KeyboardStyle (for iOS only)
+
+> String ('light' by default)
+
+#### Possible values
+
+- `light`
+- `dark`
+
+```xml
+
+```
+
+### HideKeyboardFormAccessoryBar (for iOS only)
+
+> Boolean (true by default)
+
+#### Possible values
+- `true`: hides the keyboard accessory bar.
+- `false`: shows the keyboard accessory bar.
+
+```xml
+
+```
+
+### resizeOnFullScreen (for Android only)
+
+There is an Android bug that prevents the keyboard from resizing the WebView when the app is in full screen (i.e. if StatusBar plugin is used to hide the StatusBar). This setting, if set to true, add a workaround that resizes the WebView even when the app is in full screen.
+
+> Boolean (false by default)
+
+#### Possible values
+- `false`: doesn't resize the WebView when the app is in full screen.
+- `true`: resizes the WebView when the app is in full screen.
+
+
+```xml
+
+```
+
+
+## Methods
+
+### Keyboard.hideFormAccessoryBar (for iOS only)
+
+> Hide the keyboard toolbar.
+
+Set to true to hide the additional toolbar that is on top of the keyboard. This toolbar features the Prev, Next, and Done buttons.
+
+```js
+Keyboard.hideFormAccessoryBar(value, successCallback);
+```
+
+#### Quick Example
+
+```js
+Keyboard.hideFormAccessoryBar(true);
+Keyboard.hideFormAccessoryBar(false);
+Keyboard.hideFormAccessoryBar(null, (currentValue) => { console.log(currentValue); });
+```
+
+### Keyboard.hide
+
+> Hide the keyboard
+
+Call this method to hide the keyboard
+
+```js
+Keyboard.hide();
+```
+
+### Keyboard.show (for Android only)
+
+> Show the keyboard
+
+Call this method to show the keyboard.
+
+```js
+Keyboard.show();
+```
+
+### Keyboard.setResizeMode (for iOS only)
+
+> Programmatically set the resize mode
+
+Call the method with parameter to set the resize mode.
+
+```js
+// Possible values are the same as for 'KeyboardResizeMode' preference
+Keyboard.setResizeMode('native');
+Keyboard.setResizeMode('body');
+Keyboard.setResizeMode('ionic');
+```
+
+### Keyboard.setKeyboardStyle (for iOS only)
+
+> Programmatically set the keyboard style
+
+```js
+// Possible values are the same as for 'KeyboardStyle' preference
+Keyboard.setKeyboardStyle('light'); // <- default
+Keyboard.setKeyboardStyle('dark');
+```
+
+### Keyboard.disableScroll (for iOS only)
+
+> Programmatically enable or disable the WebView scroll
+
+```js
+Keyboard.disableScroll(true); // <- default
+Keyboard.disableScroll(false);
+```
+
+
+## Properties
+
+### Keyboard.isVisible
+
+> Determine if the keyboard is visible.
+
+Read this property to determine if the keyboard is visible.
+
+```js
+if (Keyboard.isVisible) {
+ // do something
+}
+```
+
+## Events
+
+### keyboardDidHide
+
+> This event is fired when the keyboard is fully closed.
+
+Attach handler to this event to be able to receive notification when keyboard is closed.
+
+```js
+window.addEventListener('keyboardDidHide', () => {
+ // Describe your logic which will be run each time keyboard is closed.
+});
+```
+
+### keyboardDidShow
+
+> This event is fired when the keyboard is fully open.
+
+Attach handler to this event to be able to receive notification when keyboard is opened.
+
+```js
+window.addEventListener('keyboardDidShow', (event) => {
+ // Describe your logic which will be run each time when keyboard is about to be shown.
+ console.log(event.keyboardHeight);
+});
+```
+
+### keyboardWillShow
+
+> This event fires before keyboard will be shown.
+
+Attach handler to this event to be able to receive notification when keyboard is about to be shown on the screen.
+
+```js
+window.addEventListener('keyboardWillShow', (event) => {
+ // Describe your logic which will be run each time when keyboard is about to be shown.
+ console.log(event.keyboardHeight);
+});
+```
+
+### keyboardWillHide
+
+> This event fires before keyboard will be closed.
+
+Attach handler to this event to be able to receive notification when keyboard is about to be closed.
+
+```js
+window.addEventListener('keyboardWillHide', () => {
+ // Describe your logic which will be run each time when keyboard is about to be closed.
+});
+```
diff --git a/plugins/cordova-plugin-ionic-keyboard/package.json b/plugins/cordova-plugin-ionic-keyboard/package.json
new file mode 100644
index 0000000..57ed006
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-keyboard/package.json
@@ -0,0 +1,59 @@
+{
+ "_from": "cordova-plugin-ionic-keyboard@^2.0.5",
+ "_id": "cordova-plugin-ionic-keyboard@2.2.0",
+ "_inBundle": false,
+ "_integrity": "sha512-yDUG+9ieKVRitq5mGlNxjaZh/MgEhFFIgTIPhqSbUaQ8UuZbawy5mhJAVClqY97q8/rcQtL6dCDa7x2sEtCLcA==",
+ "_location": "/cordova-plugin-ionic-keyboard",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "cordova-plugin-ionic-keyboard@^2.0.5",
+ "name": "cordova-plugin-ionic-keyboard",
+ "escapedName": "cordova-plugin-ionic-keyboard",
+ "rawSpec": "^2.0.5",
+ "saveSpec": null,
+ "fetchSpec": "^2.0.5"
+ },
+ "_requiredBy": [
+ "#DEV:/",
+ "#USER"
+ ],
+ "_resolved": "https://registry.npmjs.org/cordova-plugin-ionic-keyboard/-/cordova-plugin-ionic-keyboard-2.2.0.tgz",
+ "_shasum": "53ba9ccd5e765165446a094cfe042a2ddd87d81d",
+ "_spec": "cordova-plugin-ionic-keyboard@^2.0.5",
+ "_where": "/home/saherelm/Documents/My Projects/xFrameworkTest",
+ "author": {
+ "name": "Apache Software Foundation"
+ },
+ "bugs": {
+ "url": "https://github.com/ionic-team/cordova-plugin-ionic-keyboard/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Ionic Keyboard Plugin",
+ "devDependencies": {
+ "np": "^5.0.3",
+ "sync-cordova-xml": "^0.4.0"
+ },
+ "homepage": "https://github.com/ionic-team/cordova-plugin-ionic-keyboard#readme",
+ "keywords": [
+ "cordova",
+ "keyboard",
+ "ecosystem:cordova",
+ "cordova-ios",
+ "cordova-android"
+ ],
+ "license": "Apache 2.0",
+ "name": "cordova-plugin-ionic-keyboard",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/ionic-team/cordova-plugin-ionic-keyboard.git"
+ },
+ "scripts": {
+ "deploy": "np --yolo",
+ "sync_plugin_xml": "sync-cordova-xml package.json plugin.xml --output=plugin.xml",
+ "version": "npm run sync_plugin_xml && git add plugin.xml"
+ },
+ "version": "2.2.0"
+}
diff --git a/plugins/cordova-plugin-ionic-keyboard/plugin.xml b/plugins/cordova-plugin-ionic-keyboard/plugin.xml
new file mode 100644
index 0000000..5badf01
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-keyboard/plugin.xml
@@ -0,0 +1,47 @@
+
+
+
+ cordova-plugin-ionic-keyboard
+ Ionic Keyboard Plugin
+ Apache 2.0
+ cordova,keyboard,ecosystem:cordova,cordova-ios,cordova-android
+ https://github.com/ionic-team/cordova-plugin-ionic-keyboard.git
+ https://github.com/ionic-team/cordova-plugin-ionic-keyboard/issues
+ Apache Software Foundation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/cordova-plugin-ionic-keyboard/src/android/CDVIonicKeyboard.java b/plugins/cordova-plugin-ionic-keyboard/src/android/CDVIonicKeyboard.java
new file mode 100644
index 0000000..b7ec455
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-keyboard/src/android/CDVIonicKeyboard.java
@@ -0,0 +1,165 @@
+package io.ionic.keyboard;
+
+import org.apache.cordova.CallbackContext;
+import org.apache.cordova.CordovaInterface;
+import org.apache.cordova.CordovaPlugin;
+import org.apache.cordova.CordovaWebView;
+import org.apache.cordova.PluginResult;
+import org.apache.cordova.PluginResult.Status;
+import org.json.JSONArray;
+import org.json.JSONException;
+
+import android.content.Context;
+import android.graphics.Rect;
+import android.util.DisplayMetrics;
+import android.view.View;
+import android.view.ViewTreeObserver;
+import android.view.ViewTreeObserver.OnGlobalLayoutListener;
+import android.view.inputmethod.InputMethodManager;
+
+// import additionally required classes for calculating screen height
+import android.view.Display;
+import android.graphics.Point;
+import android.os.Build;
+import android.widget.FrameLayout;
+
+public class CDVIonicKeyboard extends CordovaPlugin {
+ private OnGlobalLayoutListener list;
+ private View rootView;
+ private View mChildOfContent;
+ private int usableHeightPrevious;
+ private FrameLayout.LayoutParams frameLayoutParams;
+
+ public void initialize(CordovaInterface cordova, CordovaWebView webView) {
+ super.initialize(cordova, webView);
+ }
+
+ public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
+ if ("hide".equals(action)) {
+ cordova.getThreadPool().execute(new Runnable() {
+ public void run() {
+ //http://stackoverflow.com/a/7696791/1091751
+ InputMethodManager inputManager = (InputMethodManager) cordova.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
+ View v = cordova.getActivity().getCurrentFocus();
+
+ if (v == null) {
+ callbackContext.error("No current focus");
+ } else {
+ inputManager.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
+ callbackContext.success(); // Thread-safe.
+ }
+ }
+ });
+ return true;
+ }
+ if ("show".equals(action)) {
+ cordova.getThreadPool().execute(new Runnable() {
+ public void run() {
+ ((InputMethodManager) cordova.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(0, InputMethodManager.HIDE_IMPLICIT_ONLY);
+ callbackContext.success(); // Thread-safe.
+ }
+ });
+ return true;
+ }
+ if ("init".equals(action)) {
+ cordova.getThreadPool().execute(new Runnable() {
+ public void run() {
+ //calculate density-independent pixels (dp)
+ //http://developer.android.com/guide/practices/screens_support.html
+ DisplayMetrics dm = new DisplayMetrics();
+ cordova.getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm);
+ final float density = dm.density;
+
+ //http://stackoverflow.com/a/4737265/1091751 detect if keyboard is showing
+ FrameLayout content = (FrameLayout) cordova.getActivity().findViewById(android.R.id.content);
+ rootView = content.getRootView();
+ list = new OnGlobalLayoutListener() {
+ int previousHeightDiff = 0;
+ @Override
+ public void onGlobalLayout() {
+ boolean resize = preferences.getBoolean("resizeOnFullScreen", false);
+ if (resize) {
+ possiblyResizeChildOfContent();
+ }
+ Rect r = new Rect();
+ //r will be populated with the coordinates of your view that area still visible.
+ rootView.getWindowVisibleDisplayFrame(r);
+
+ PluginResult result;
+
+ // cache properties for later use
+ int rootViewHeight = rootView.getRootView().getHeight();
+ int resultBottom = r.bottom;
+
+ // calculate screen height differently for android versions >= 21: Lollipop 5.x, Marshmallow 6.x
+ //http://stackoverflow.com/a/29257533/3642890 beware of nexus 5
+ int screenHeight;
+
+ if (Build.VERSION.SDK_INT >= 21) {
+ Display display = cordova.getActivity().getWindowManager().getDefaultDisplay();
+ Point size = new Point();
+ display.getSize(size);
+ screenHeight = size.y;
+ } else {
+ screenHeight = rootViewHeight;
+ }
+
+ int heightDiff = screenHeight - resultBottom;
+
+ int pixelHeightDiff = (int)(heightDiff / density);
+ if (pixelHeightDiff > 100 && pixelHeightDiff != previousHeightDiff) { // if more than 100 pixels, its probably a keyboard...
+ String msg = "S" + Integer.toString(pixelHeightDiff);
+ result = new PluginResult(PluginResult.Status.OK, msg);
+ result.setKeepCallback(true);
+ callbackContext.sendPluginResult(result);
+ }
+ else if ( pixelHeightDiff != previousHeightDiff && ( previousHeightDiff - pixelHeightDiff ) > 100 ){
+ String msg = "H";
+ result = new PluginResult(PluginResult.Status.OK, msg);
+ result.setKeepCallback(true);
+ callbackContext.sendPluginResult(result);
+ }
+ previousHeightDiff = pixelHeightDiff;
+ }
+
+ private void possiblyResizeChildOfContent() {
+ int usableHeightNow = computeUsableHeight();
+ if (usableHeightNow != usableHeightPrevious) {
+ int usableHeightSansKeyboard = mChildOfContent.getRootView().getHeight();
+ int heightDifference = usableHeightSansKeyboard - usableHeightNow;
+ if (heightDifference > (usableHeightSansKeyboard/4)) {
+ frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;
+ } else {
+ frameLayoutParams.height = usableHeightSansKeyboard;
+ }
+ mChildOfContent.requestLayout();
+ usableHeightPrevious = usableHeightNow;
+ }
+ }
+
+ private int computeUsableHeight() {
+ Rect r = new Rect();
+ mChildOfContent.getWindowVisibleDisplayFrame(r);
+ return (r.bottom - r.top);
+ }
+ };
+
+ mChildOfContent = content.getChildAt(0);
+ rootView.getViewTreeObserver().addOnGlobalLayoutListener(list);
+ frameLayoutParams = (FrameLayout.LayoutParams) mChildOfContent.getLayoutParams();
+ PluginResult dataResult = new PluginResult(PluginResult.Status.OK);
+ dataResult.setKeepCallback(true);
+ callbackContext.sendPluginResult(dataResult);
+ }
+ });
+ return true;
+ }
+ return false; // Returning false results in a "MethodNotFound" error.
+ }
+
+ @Override
+ public void onDestroy() {
+ rootView.getViewTreeObserver().removeOnGlobalLayoutListener(list);
+ }
+
+}
diff --git a/plugins/cordova-plugin-ionic-keyboard/src/ios/CDVIonicKeyboard.h b/plugins/cordova-plugin-ionic-keyboard/src/ios/CDVIonicKeyboard.h
new file mode 100644
index 0000000..aae6766
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-keyboard/src/ios/CDVIonicKeyboard.h
@@ -0,0 +1,24 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import
+
+@interface CDVIonicKeyboard : CDVPlugin
+
+@end
diff --git a/plugins/cordova-plugin-ionic-keyboard/src/ios/CDVIonicKeyboard.m b/plugins/cordova-plugin-ionic-keyboard/src/ios/CDVIonicKeyboard.m
new file mode 100644
index 0000000..e4615a8
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-keyboard/src/ios/CDVIonicKeyboard.m
@@ -0,0 +1,411 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVIonicKeyboard.h"
+#import
+#import
+#import
+
+typedef enum : NSUInteger {
+ ResizeNone,
+ ResizeNative,
+ ResizeBody,
+ ResizeIonic,
+} ResizePolicy;
+
+#ifndef __CORDOVA_3_2_0
+#warning "The keyboard plugin is only supported in Cordova 3.2 or greater, it may not work properly in an older version. If you do use this plugin in an older version, make sure the HideKeyboardFormAccessoryBar and KeyboardShrinksView preference values are false."
+#endif
+
+@interface CDVIonicKeyboard ()
+
+@property (readwrite, assign, nonatomic) BOOL disableScroll;
+@property (readwrite, assign, nonatomic) BOOL hideFormAccessoryBar;
+@property (readwrite, assign, nonatomic) BOOL keyboardIsVisible;
+@property (nonatomic, readwrite) ResizePolicy keyboardResizes;
+@property (readwrite, assign, nonatomic) NSString* keyboardStyle;
+@property (nonatomic, readwrite) BOOL isWK;
+@property (nonatomic, readwrite) int paddingBottom;
+
+@end
+
+@implementation CDVIonicKeyboard
+
+NSTimer *hideTimer;
+
+- (id)settingForKey:(NSString *)key
+{
+ return [self.commandDelegate.settings objectForKey:[key lowercaseString]];
+}
+
+#pragma mark Initialize
+
+NSString* UIClassString;
+NSString* WKClassString;
+NSString* UITraitsClassString;
+
+- (void)pluginInitialize
+{
+ UIClassString = [@[@"UI", @"Web", @"Browser", @"View"] componentsJoinedByString:@""];
+ WKClassString = [@[@"WK", @"Content", @"View"] componentsJoinedByString:@""];
+ UITraitsClassString = [@[@"UI", @"Text", @"Input", @"Traits"] componentsJoinedByString:@""];
+
+ NSDictionary *settings = self.commandDelegate.settings;
+
+ self.disableScroll = ![settings cordovaBoolSettingForKey:@"ScrollEnabled" defaultValue:NO];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(statusBarDidChangeFrame:) name: UIApplicationDidChangeStatusBarFrameNotification object:nil];
+
+ self.keyboardResizes = ResizeNative;
+ BOOL doesResize = [settings cordovaBoolSettingForKey:@"KeyboardResize" defaultValue:YES];
+ if (!doesResize) {
+ self.keyboardResizes = ResizeNone;
+ NSLog(@"CDVIonicKeyboard: no resize");
+
+ } else {
+ NSString *resizeMode = [settings cordovaSettingForKey:@"KeyboardResizeMode"];
+ if (resizeMode) {
+ if ([resizeMode isEqualToString:@"ionic"]) {
+ self.keyboardResizes = ResizeIonic;
+ } else if ([resizeMode isEqualToString:@"body"]) {
+ self.keyboardResizes = ResizeBody;
+ }
+ }
+ NSLog(@"CDVIonicKeyboard: resize mode %lu", (unsigned long)self.keyboardResizes);
+ }
+ self.hideFormAccessoryBar = [settings cordovaBoolSettingForKey:@"HideKeyboardFormAccessoryBar" defaultValue:YES];
+
+ NSString *keyboardStyle = [settings cordovaSettingForKey:@"KeyboardStyle"];
+ if (keyboardStyle) {
+ [self setKeyboardStyle:keyboardStyle];
+ }
+
+ if ([settings cordovaBoolSettingForKey:@"KeyboardAppearanceDark" defaultValue:NO]) {
+ [self setKeyboardStyle:@"dark"];
+ }
+
+ NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
+
+ [nc addObserver:self selector:@selector(onKeyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
+ [nc addObserver:self selector:@selector(onKeyboardDidHide:) name:UIKeyboardDidHideNotification object:nil];
+ [nc addObserver:self selector:@selector(onKeyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
+ [nc addObserver:self selector:@selector(onKeyboardDidShow:) name:UIKeyboardDidShowNotification object:nil];
+
+ // Prevent WKWebView to resize window
+ BOOL isWK = self.isWK = [self.webView isKindOfClass:NSClassFromString(@"WKWebView")];
+ if (!isWK) {
+ NSLog(@"CDVIonicKeyboard: WARNING!!: Keyboard plugin works better with WK");
+ }
+
+ if (isWK) {
+ [nc removeObserver:self.webView name:UIKeyboardWillHideNotification object:nil];
+ [nc removeObserver:self.webView name:UIKeyboardWillShowNotification object:nil];
+ [nc removeObserver:self.webView name:UIKeyboardWillChangeFrameNotification object:nil];
+ [nc removeObserver:self.webView name:UIKeyboardDidChangeFrameNotification object:nil];
+ }
+}
+
+-(void)statusBarDidChangeFrame:(NSNotification*)notification
+{
+ [self _updateFrame];
+}
+
+
+#pragma mark Keyboard events
+
+- (void)resetScrollView
+{
+ UIScrollView *scrollView = [self.webView scrollView];
+ [scrollView setContentInset:UIEdgeInsetsZero];
+}
+
+- (void)onKeyboardWillHide:(NSNotification *)sender
+{
+ if (self.isWK) {
+ [self setKeyboardHeight:0 delay:0.01];
+ [self resetScrollView];
+ }
+ hideTimer = [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(fireOnHiding) userInfo:nil repeats:NO];
+}
+
+- (void)fireOnHiding {
+ [self.commandDelegate evalJs:@"Keyboard.fireOnHiding();"];
+}
+
+- (void)onKeyboardWillShow:(NSNotification *)note
+{
+ if (hideTimer != nil) {
+ [hideTimer invalidate];
+ }
+ CGRect rect = [[note.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
+ double height = rect.size.height;
+
+ if (self.isWK) {
+ double duration = [[note.userInfo valueForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
+ [self setKeyboardHeight:height delay:duration+0.2];
+ [self resetScrollView];
+ }
+
+ [self setKeyboardStyle:self.keyboardStyle];
+
+ NSString *js = [NSString stringWithFormat:@"Keyboard.fireOnShowing(%d);", (int)height];
+ [self.commandDelegate evalJs:js];
+}
+
+- (void)onKeyboardDidShow:(NSNotification *)note
+{
+ CGRect rect = [[note.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
+ double height = rect.size.height;
+
+ if (self.isWK) {
+ [self resetScrollView];
+ }
+
+ NSString *js = [NSString stringWithFormat:@"Keyboard.fireOnShow(%d);", (int)height];
+ [self.commandDelegate evalJs:js];
+}
+
+- (void)onKeyboardDidHide:(NSNotification *)sender
+{
+ [self.commandDelegate evalJs:@"Keyboard.fireOnHide();"];
+ [self resetScrollView];
+}
+
+- (void)setKeyboardHeight:(int)height delay:(NSTimeInterval)delay
+{
+ if (self.keyboardResizes != ResizeNone) {
+ [self setPaddingBottom: height delay:delay];
+ }
+}
+
+- (void)setPaddingBottom:(int)paddingBottom delay:(NSTimeInterval)delay
+{
+ if (self.paddingBottom == paddingBottom) {
+ return;
+ }
+
+ self.paddingBottom = paddingBottom;
+
+ __weak CDVIonicKeyboard* weakSelf = self;
+ SEL action = @selector(_updateFrame);
+ [NSObject cancelPreviousPerformRequestsWithTarget:weakSelf selector:action object:nil];
+ if (delay == 0) {
+ [self _updateFrame];
+ } else {
+ [weakSelf performSelector:action withObject:nil afterDelay:delay];
+ }
+}
+
+- (void)_updateFrame
+{
+ CGSize statusBarSize = [[UIApplication sharedApplication] statusBarFrame].size;
+ int statusBarHeight = MIN(statusBarSize.width, statusBarSize.height);
+
+ int _paddingBottom = (int)self.paddingBottom;
+
+ if (statusBarHeight == 40) {
+ _paddingBottom = _paddingBottom + 20;
+ }
+ NSLog(@"CDVIonicKeyboard: updating frame");
+ // NOTE: to handle split screen correctly, the application's window bounds must be used as opposed to the screen's bounds.
+ CGRect f = [[[[UIApplication sharedApplication] delegate] window] bounds];
+ CGRect wf = self.webView.frame;
+ switch (self.keyboardResizes) {
+ case ResizeBody:
+ {
+ NSString *js = [NSString stringWithFormat:@"Keyboard.fireOnResize(%d, %d, document.body);",
+ _paddingBottom, (int)f.size.height];
+ [self.commandDelegate evalJs:js];
+ break;
+ }
+ case ResizeIonic:
+ {
+ NSString *js = [NSString stringWithFormat:@"Keyboard.fireOnResize(%d, %d, document.querySelector('ion-app'));",
+ _paddingBottom, (int)f.size.height];
+ [self.commandDelegate evalJs:js];
+ break;
+ }
+ case ResizeNative:
+ {
+ [self.webView setFrame:CGRectMake(wf.origin.x, wf.origin.y, f.size.width - wf.origin.x, f.size.height - wf.origin.y - self.paddingBottom)];
+ break;
+ }
+ default:
+ break;
+ }
+ [self resetScrollView];
+}
+
+#pragma mark Keyboard Style
+
+ - (void)setKeyboardStyle:(NSString*)style
+{
+ IMP newImp = [style isEqualToString:@"dark"] ? imp_implementationWithBlock(^(id _s) {
+ return UIKeyboardAppearanceDark;
+ }) : imp_implementationWithBlock(^(id _s) {
+ return UIKeyboardAppearanceLight;
+ });
+
+ if (self.isWK) {
+ for (NSString* classString in @[WKClassString, UITraitsClassString]) {
+ Class c = NSClassFromString(classString);
+ Method m = class_getInstanceMethod(c, @selector(keyboardAppearance));
+
+ if (m != NULL) {
+ method_setImplementation(m, newImp);
+ } else {
+ class_addMethod(c, @selector(keyboardAppearance), newImp, "l@:");
+ }
+ }
+ }
+ else {
+ for (NSString* classString in @[UIClassString, UITraitsClassString]) {
+ Class c = NSClassFromString(classString);
+ Method m = class_getInstanceMethod(c, @selector(keyboardAppearance));
+
+ if (m != NULL) {
+ method_setImplementation(m, newImp);
+ } else {
+ class_addMethod(c, @selector(keyboardAppearance), newImp, "l@:");
+ }
+ }
+ }
+
+ _keyboardStyle = style;
+}
+
+#pragma mark HideFormAccessoryBar
+
+static IMP UIOriginalImp;
+static IMP WKOriginalImp;
+
+- (void)setHideFormAccessoryBar:(BOOL)hideFormAccessoryBar
+{
+ if (hideFormAccessoryBar == _hideFormAccessoryBar) {
+ return;
+ }
+
+ Method UIMethod = class_getInstanceMethod(NSClassFromString(UIClassString), @selector(inputAccessoryView));
+ Method WKMethod = class_getInstanceMethod(NSClassFromString(WKClassString), @selector(inputAccessoryView));
+
+ if (hideFormAccessoryBar) {
+ UIOriginalImp = method_getImplementation(UIMethod);
+ WKOriginalImp = method_getImplementation(WKMethod);
+
+ IMP newImp = imp_implementationWithBlock(^(id _s) {
+ return nil;
+ });
+
+ method_setImplementation(UIMethod, newImp);
+ method_setImplementation(WKMethod, newImp);
+ } else {
+ method_setImplementation(UIMethod, UIOriginalImp);
+ method_setImplementation(WKMethod, WKOriginalImp);
+ }
+
+ _hideFormAccessoryBar = hideFormAccessoryBar;
+}
+
+#pragma mark scroll
+
+- (void)setDisableScroll:(BOOL)disableScroll {
+ if (disableScroll == _disableScroll) {
+ return;
+ }
+ if (disableScroll) {
+ self.webView.scrollView.scrollEnabled = NO;
+ self.webView.scrollView.delegate = self;
+ }
+ else {
+ self.webView.scrollView.scrollEnabled = YES;
+ self.webView.scrollView.delegate = nil;
+ }
+ _disableScroll = disableScroll;
+}
+
+- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
+ [scrollView setContentOffset: CGPointZero];
+}
+
+#pragma mark Plugin interface
+
+- (void)hideFormAccessoryBar:(CDVInvokedUrlCommand *)command
+{
+ if (command.arguments.count > 0) {
+ id value = [command.arguments objectAtIndex:0];
+ if (!([value isKindOfClass:[NSNumber class]])) {
+ value = [NSNumber numberWithBool:NO];
+ }
+
+ self.hideFormAccessoryBar = [value boolValue];
+ }
+
+ [self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:self.hideFormAccessoryBar]
+ callbackId:command.callbackId];
+}
+
+- (void)hide:(CDVInvokedUrlCommand *)command
+{
+ [self.webView endEditing:YES];
+}
+
+- (void)setResizeMode:(CDVInvokedUrlCommand *)command
+{
+ NSString * mode = [command.arguments objectAtIndex:0];
+ if ([mode isEqualToString:@"ionic"]) {
+ self.keyboardResizes = ResizeIonic;
+ } else if ([mode isEqualToString:@"body"]) {
+ self.keyboardResizes = ResizeBody;
+ } else if ([mode isEqualToString:@"native"]) {
+ self.keyboardResizes = ResizeNative;
+ } else {
+ self.keyboardResizes = ResizeNone;
+ }
+}
+
+- (void)keyboardStyle:(CDVInvokedUrlCommand*)command
+{
+ id value = [command.arguments objectAtIndex:0];
+ if ([value isKindOfClass:[NSString class]]) {
+ value = [(NSString*)value lowercaseString];
+ } else {
+ value = @"light";
+ }
+
+ self.keyboardStyle = value;
+}
+
+- (void)disableScroll:(CDVInvokedUrlCommand*)command {
+ if (!command.arguments || ![command.arguments count]){
+ return;
+ }
+ id value = [command.arguments objectAtIndex:0];
+ if (value != [NSNull null]) {
+ self.disableScroll = [value boolValue];
+ }
+}
+
+#pragma mark dealloc
+
+- (void)dealloc
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+}
+
+@end
diff --git a/plugins/cordova-plugin-ionic-keyboard/www/android/keyboard.js b/plugins/cordova-plugin-ionic-keyboard/www/android/keyboard.js
new file mode 100644
index 0000000..ac68cfc
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-keyboard/www/android/keyboard.js
@@ -0,0 +1,84 @@
+var argscheck = require('cordova/argscheck'),
+ utils = require('cordova/utils'),
+ exec = require('cordova/exec'),
+ channel = require('cordova/channel');
+
+var Keyboard = function () {};
+
+Keyboard.fireOnShow = function (height) {
+ Keyboard.isVisible = true;
+ cordova.fireWindowEvent('keyboardDidShow', {
+ 'keyboardHeight': height
+ });
+
+ // To support the keyboardAttach directive listening events
+ // inside Ionic's main bundle
+ cordova.fireWindowEvent('native.keyboardshow', {
+ 'keyboardHeight': height
+ });
+};
+
+Keyboard.fireOnHide = function () {
+ Keyboard.isVisible = false;
+ cordova.fireWindowEvent('keyboardDidHide');
+
+ // To support the keyboardAttach directive listening events
+ // inside Ionic's main bundle
+ cordova.fireWindowEvent('native.keyboardhide');
+};
+
+Keyboard.fireOnHiding = function () {
+ cordova.fireWindowEvent('keyboardWillHide');
+};
+
+Keyboard.fireOnShowing = function (height) {
+ cordova.fireWindowEvent('keyboardWillShow', {
+ 'keyboardHeight': height
+ });
+};
+
+Keyboard.hideFormAccessoryBar = Keyboard.hideKeyboardAccessoryBar = function (hide) {
+ console.warn("Keyboard.hideKeyboardAccessoryBar() not supported in Android");
+};
+
+Keyboard.hide = function () {
+ exec(null, null, "CDVIonicKeyboard", "hide", []);
+};
+
+Keyboard.show = function () {
+ exec(null, null, "CDVIonicKeyboard", "show", []);
+};
+
+Keyboard.disableScroll = function (disable) {
+ console.warn("Keyboard.disableScroll() not supported in Android");
+};
+
+Keyboard.setResizeMode = function (mode) {
+ console.warn("Keyboard.setResizeMode() not supported in Android");
+}
+
+Keyboard.setKeyboardStyle = function(style) {
+ console.warn("Keyboard.setKeyboardStyle() not supported in Android");
+};
+
+channel.onCordovaReady.subscribe(function () {
+ exec(success, null, 'CDVIonicKeyboard', 'init', []);
+
+ function success(msg) {
+ var action = msg.charAt(0);
+ if (action === 'S') {
+ var keyboardHeight = parseInt(msg.substr(1));
+ Keyboard.fireOnShowing(keyboardHeight);
+ Keyboard.fireOnShow(keyboardHeight);
+
+ } else if (action === 'H') {
+ Keyboard.fireOnHiding();
+ Keyboard.fireOnHide();
+ }
+ }
+});
+
+
+Keyboard.isVisible = false;
+
+module.exports = Keyboard;
diff --git a/plugins/cordova-plugin-ionic-keyboard/www/ios/keyboard.js b/plugins/cordova-plugin-ionic-keyboard/www/ios/keyboard.js
new file mode 100644
index 0000000..e9c8cb1
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-keyboard/www/ios/keyboard.js
@@ -0,0 +1,103 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+var argscheck = require('cordova/argscheck'),
+ utils = require('cordova/utils'),
+ exec = require('cordova/exec');
+
+var Keyboard = function () {};
+
+Keyboard.fireOnShow = function (height) {
+ Keyboard.isVisible = true;
+ cordova.fireWindowEvent('keyboardDidShow', {
+ 'keyboardHeight': height
+ });
+
+ // To support the keyboardAttach directive listening events
+ // inside Ionic's main bundle
+ cordova.fireWindowEvent('native.keyboardshow', {
+ 'keyboardHeight': height
+ });
+};
+
+Keyboard.fireOnHide = function () {
+ Keyboard.isVisible = false;
+ cordova.fireWindowEvent('keyboardDidHide');
+
+ // To support the keyboardAttach directive listening events
+ // inside Ionic's main bundle
+ cordova.fireWindowEvent('native.keyboardhide');
+};
+
+Keyboard.fireOnHiding = function () {
+ cordova.fireWindowEvent('keyboardWillHide');
+};
+
+Keyboard.fireOnShowing = function (height) {
+ cordova.fireWindowEvent('keyboardWillShow', {
+ 'keyboardHeight': height
+ });
+};
+
+Keyboard.fireOnResize = function (height, screenHeight, ele) {
+ if (!ele) {
+ return;
+ }
+ if (height === 0) {
+ ele.style.height = null;
+ } else {
+ ele.style.height = (screenHeight - height) + 'px';
+ }
+};
+
+Keyboard.hideFormAccessoryBar = function (hide, success) {
+ if (hide !== null && hide !== undefined) {
+ exec(success, null, "CDVIonicKeyboard", "hideFormAccessoryBar", [hide]);
+ } else {
+ exec(success, null, "CDVIonicKeyboard", "hideFormAccessoryBar", []);
+ }
+};
+
+Keyboard.hide = function () {
+ exec(null, null, "CDVIonicKeyboard", "hide", []);
+};
+
+Keyboard.show = function () {
+ console.warn('Showing keyboard not supported in iOS due to platform limitations.');
+ console.warn('Instead, use input.focus(), and ensure that you have the following setting in your config.xml: \n');
+ console.warn(' \n');
+};
+
+Keyboard.disableScroll = function (disable) {
+ exec(null, null, "CDVIonicKeyboard", "disableScroll", [disable]);
+};
+
+Keyboard.setResizeMode = function (mode) {
+ exec(null, null, "CDVIonicKeyboard", "setResizeMode", [mode]);
+}
+
+Keyboard.setKeyboardStyle = function(style) {
+ exec(null, null, "CDVIonicKeyboard", "keyboardStyle", [style]);
+};
+
+Keyboard.isVisible = false;
+
+module.exports = Keyboard;
\ No newline at end of file
diff --git a/plugins/cordova-plugin-ionic-webview/.circleci/config.yml b/plugins/cordova-plugin-ionic-webview/.circleci/config.yml
new file mode 100644
index 0000000..c610218
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/.circleci/config.yml
@@ -0,0 +1,57 @@
+version: 2
+
+aliases:
+ - &restore-cache
+ keys:
+ - dependency-cache-{{ checksum "package.json" }}-1
+
+ - &save-cache
+ key: dependency-cache-{{ checksum "package.json" }}-1
+ paths:
+ - node_modules
+
+defaults: &defaults
+ docker:
+ - image: circleci/node:10
+ working_directory: /tmp/workspace
+
+jobs:
+ build:
+ <<: *defaults
+ steps:
+ - checkout
+ - restore_cache: *restore-cache
+ - run: npm install
+ - save_cache: *save-cache
+ - persist_to_workspace:
+ root: /tmp/workspace
+ paths:
+ - "*"
+
+ deploy:
+ <<: *defaults
+ environment:
+ GIT_AUTHOR_NAME: Ionitron
+ GIT_AUTHOR_EMAIL: hi@ionicframework.com
+ GIT_COMMITTER_NAME: Ionitron
+ GIT_COMMITTER_EMAIL: hi@ionicframework.com
+ steps:
+ - add_ssh_keys:
+ fingerprints:
+ - "ae:6d:3a:f1:cf:39:e1:94:6e:22:2a:9f:54:f9:b0:1b" # ionitron user key
+ - checkout
+ - attach_workspace:
+ at: /tmp/workspace
+ - run: npx semantic-release
+
+
+workflows:
+ version: 2
+ build:
+ jobs:
+ - build
+ - deploy:
+ requires: [build]
+ filters:
+ branches:
+ only: stable
diff --git a/plugins/cordova-plugin-ionic-webview/CHANGELOG.md b/plugins/cordova-plugin-ionic-webview/CHANGELOG.md
new file mode 100644
index 0000000..4b77112
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/CHANGELOG.md
@@ -0,0 +1,248 @@
+## [4.2.1](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v4.2.0...v4.2.1) (2020-04-28)
+
+
+### Bug Fixes
+
+* **ios:** release userAgentLock for IAB compat ([#558](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/558)) ([4c027f3](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/4c027f3e1dadf790b1d699936b90b670b401db9e)), closes [#551](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/551)
+
+# [4.2.0](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v4.1.3...v4.2.0) (2020-04-14)
+
+
+### Bug Fixes
+
+* **ionassethandler.m:** fix startPath is getting null ([#463](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/463)) ([0bf16f1](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/0bf16f1b73b853f40781c5de83964457cc4493d5))
+* **ios:** avoid app scrolling to top on keyboard hide ([#533](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/533)) ([7974eb4](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/7974eb4160f5e83cf4b3e98905beba1f874464a6))
+* **ios:** Replace deprecated APIs ([#539](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/539)) ([27b9021](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/27b9021d5d76b3e6dc6bfc83ab46b98cd301e694))
+
+
+### Features
+
+* **android:** proxy service worker requests through local server ([#452](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/452)) ([c672175](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/c672175b7527d64b077f7715b2ff145325524add))
+* **ios:** implement custom userAgent handling ([#537](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/537)) ([8587114](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/85871147ba8e5b23b693e518bf5ea800cccce8cc))
+
+## [4.1.3](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v4.1.2...v4.1.3) (2019-10-30)
+
+
+### Bug Fixes
+
+* **android:** return proper mimeType for .mjs files ([#455](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/455)) ([173a313](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/173a313))
+* **ios:** mitigate media memory usage ([#459](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/459)) ([cbd526d](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/cbd526d))
+* **ios:** remove itms-services private scheme ([#464](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/464)) ([d7d2600](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/d7d2600))
+
+## [4.1.2](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v4.1.1...v4.1.2) (2019-09-25)
+
+
+### Bug Fixes
+
+* **android:** allow schemes that start by https ([#437](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/437)) ([fab9d1f](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/fab9d1f))
+* **Android:** return proper mimeType for wasm files ([0eb8a37](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/0eb8a37))
+* **ios:** make programmatically focus work on iOS 13 ([#438](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/438)) ([7a514b0](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/7a514b0)), closes [#435](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/435)
+
+## [4.1.1](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v4.1.0...v4.1.1) (2019-06-26)
+
+
+### Bug Fixes
+
+* **ios:** show error message when app fails to load ([#382](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/382)) ([cb1f026](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/cb1f026))
+
+# [4.1.0](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v4.0.1...v4.1.0) (2019-06-10)
+
+
+### Features
+
+* **ios:** Add WKSuspendInBackground preference ([#356](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/356)) ([3613602](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/3613602))
+
+## [4.0.1](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v4.0.0...v4.0.1) (2019-03-26)
+
+
+### Bug Fixes
+
+* **ios:** Fix autofocus on iOS 12.2 ([#334](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/334)) ([cb4c491](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/cb4c491)), closes [#330](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/330)
+* account port on resolving uri path ([#321](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/321)) ([fdfe8aa](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/fdfe8aa))
+
+# [4.0.0](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v3.1.2...v4.0.0) (2019-02-18)
+
+
+### Features
+
+* **ios:** Make iOS app Scheme configurable with a preference ([#307](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/307)) ([d52d37e](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/d52d37e)), closes [#282](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/282)
+* **ios:** Remove WKSuspendInBackground preference ([#309](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/309)) ([73b6659](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/73b6659)), closes [#286](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/286)
+
+
+### BREAKING CHANGES
+
+* **ios:** Remove the WKSuspendInBackground preference, so app relying on that prefere will
+not behave as expected
+
+## [3.1.2](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v3.1.1...v3.1.2) (2019-02-04)
+
+
+### Bug Fixes
+
+* **Android:** Handle Range Requests for proper media file handling ([#298](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/298)) ([6f18248](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/6f18248)), closes [#248](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/248) [#205](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/205) [#141](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/141)
+
+## [3.1.1](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v3.1.0...v3.1.1) (2019-01-18)
+
+
+### Bug Fixes
+
+* **ios:** Remove unused code ([#281](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/281)) ([fc7ea27](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/fc7ea27))
+
+# [3.1.0](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v3.0.0...v3.1.0) (2019-01-17)
+
+
+### Bug Fixes
+
+* **ios:** Fix video playback of files with uppercase extension ([#264](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/264)) ([2c4b225](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/2c4b225)), closes [#260](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/260)
+* Set engines to require Cordova CLI 7.1.0 or newer ([#276](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/276)) ([40f42e1](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/40f42e1)), closes [#263](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/263)
+* Use a single scheme for all files ([#270](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/270)) ([3d1bcdd](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/3d1bcdd)), closes [#258](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/258)
+
+
+### Features
+
+* **Android:** Make app Scheme configurable with a preference ([#274](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/274)) ([18d9f2c](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/18d9f2c)), closes [#269](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/269) [#255](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/255)
+
+# [3.0.0](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v2.3.1...v3.0.0) (2019-01-03)
+
+
+### Bug Fixes
+
+* **iOS:** Remove unused code ([#247](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/247)) ([bceb17a](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/bceb17a))
+
+
+### Features
+
+* Allows configuration of Mixed Content Mode ([#240](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/240)) ([486d412](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/486d412)), closes [#231](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/231)
+* **Android:** Implement ionic-file and ionic-content urls ([#242](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/242)) ([8ef0c30](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/8ef0c30)), closes [#204](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/204) [#183](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/183)
+* **iOS:** Remove GCDWebServer ([#244](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/244)) ([0dee0cf](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/0dee0cf))
+* **WebViewLocalServer.java:** return 404 error code when a local file is not found ([#217](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/217)) ([f7a551e](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/f7a551e)), closes [#216](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/216)
+
+
+### BREAKING CHANGES
+
+* **iOS:** Sets deployment-target to 11, so will only work on iOS 11+
+
+* Address changes
+* changes the default from 1 (never) to 0 (always)
+* **WebViewLocalServer.java:** Until now, the Android part of the plugin was returning a 200 http code even though
+the requested file didn't exist. This behavior was inconsistent with the historical behavior of the
+iOS webView. This change makes them both work in the same manner but introduces a breaking change
+for the current Android users that are expecting a 200 http code no matter what and are testing the
+not found error just by checking if the body is null.
+
+## [2.3.1](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v2.3.0...v2.3.1) (2018-12-06)
+
+
+### Bug Fixes
+
+* Handle convertFileSrc when using ionic:// scheme ([#236](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/236)) ([89ce899](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/89ce899))
+
+# [2.3.0](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v2.2.5...v2.3.0) (2018-12-05)
+
+
+### Features
+
+* **ios:** Add URLSchemeHandler for iOS 11+ ([#221](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/221)) ([4a973f4](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/4a973f4))
+
+## [2.2.5](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v2.2.4...v2.2.5) (2018-11-20)
+
+
+### Bug Fixes
+
+* Add option for Dark keyboard appearance ([#44](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/44)) ([6c0fe56](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/6c0fe56))
+
+## [2.2.4](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v2.2.3...v2.2.4) (2018-11-20)
+
+
+### Bug Fixes
+
+* fix keyboard displacement bug in iOS 12 WKWebView ([#201](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/201)) ([a670568](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/a670568))
+
+## [2.2.3](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v2.2.2...v2.2.3) (2018-11-09)
+
+
+### Bug Fixes
+
+* Remove main and fix description ([d52db66](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/d52db66))
+
+## [2.2.2](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v2.2.1...v2.2.2) (2018-11-09)
+
+### Bug Fixes
+
+* Add more server checks before loading urls or reloading ([#211](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/211)) ([60eff2f](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/60eff2f))
+
+## [2.2.1](https://github.com/ionic-team/cordova-plugin-ionic-webview/compare/v2.2.0...v2.2.1) (2018-11-07)
+
+
+### Bug Fixes
+
+* Show error page if server is not running ([#207](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/207)) ([6a2e07e](https://github.com/ionic-team/cordova-plugin-ionic-webview/commit/6a2e07e))
+
+
+### 2.2.0 (2018-10-04)
+
+* Fix issue where two apps running on the same port could conflict with each other ([#169](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/165) & [#186](https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/186))
+* Add kitkat support (API 19) ([#144](https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/144)) [@leo6104](https://github.com/leo6104)
+* Fix issue where local server was being used if launch URL is external ([#169](https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/169))
+
+
+### 2.1.4 (2018-09-13)
+
+* Allow Ionic Deploy `DisableDeploy` preference to disable loading of deploy updates ([#172](https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/172))
+
+
+### 2.1.3 (2018-09-06)
+
+* Make server path relative ([#164](https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/164))
+
+
+### 2.1.2 (2018-09-05)
+
+* Return 404 response when file doesn't exist ([#162](https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/162))
+* Load local assets if the app is a freshly installed binary ([#155](https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/155))
+* Reset stored server path on new binary ([#161](https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/161))
+
+
+### 2.1.1 (2018-09-04)
+
+* Allow range requests for local files ([#154](https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/154))
+
+
+### 2.1.0 (2018-08-23)
+
+* Add support for `cordova-android` 6 ([#150](https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/150))
+
+
+### 2.0.3 (2018-08-14)
+
+* Fix nil reference by setting up the server URL before routes are set up. ([#135](https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/135)) [@matejkramny](https://github.com/matejkramny)
+* Resolve issue when app is launched in background. ([#124](https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/124)) [@ghenry22](https://github.com/ghenry22)
+
+
+### 2.0.2 (2018-07-30)
+
+* Immediately load new server base path upon setting it. ([#132](https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/132))
+
+
+### 2.0.1 (2018-07-25)
+
+* Avoid "not modified" response on iOS by always overriding last modified date. ([#127](https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/127))
+
+
+### 2.0.0 (2018-07-23)
+
+* **BREAKING**: HTTP server now runs for iOS **and** Android, instead of just iOS. The server is configured the same for both platforms.
+* **BREAKING**: HTTP server now loads the app from a base href of `/`. The app URL behaves like `http://localhost:8080/index.html` instead of `http://localhost:8080/Users/.../index.html`.
+* **BREAKING**: HTTP server is configured to run in HTML5 routing mode (push state) by default.
+* **BREAKING**: File access through the Web View must be served by the HTTP server to avoid security errors in the Web View. Loading files via `file://` is not allowed by the Web View. The HTTP server will serve files via the `_file_` prefix, e.g. `http://localhost:8080/_file_/Users/.../file.png`.
+* `window.Ionic.normalizeURL()` has been deprecated. Use `window.Ionic.WebView.convertFileSrc()`.
+* iOS update HTTP server to latest upstream version (GCDwebserve 3.4.2)
+* iOS update HTTP server to restart sockets with error state when resuming from background
+* iOS enable HTTP server to continue running in background if the webview is running.
+* iOS enable Webview to continue running in background. Requires background mode capability enabled in xcode + valid use case as per app store requirements. If your app is not performing valid background tasks it will still be suspended by the OS as usual. As long as valid background tasks are running the webview will continue to function as expected.
+* iOS add config.xml options:
+ * WKSuspendInBackground - defaults to true, if set to false then the webview and HTTP server will continue to run when the app is in the background or screen is locked
+ * WKPort - defaults to 8080, define the port that the HTTP server will listen on
+ * WKBind - defaults to localhost, if set to 127.0.0.1 then this IP will be used instead of the localhost hostname for the HTTP server
+
+See [Github releases](https://github.com/ionic-team/cordova-plugin-ionic-webview/releases) for earlier changes.
diff --git a/plugins/cordova-plugin-ionic-webview/CONTRIBUTING.md b/plugins/cordova-plugin-ionic-webview/CONTRIBUTING.md
new file mode 100644
index 0000000..07fab3f
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/CONTRIBUTING.md
@@ -0,0 +1,32 @@
+# Contributing
+
+:mega: **Support/Questions?**: Please see our [Support Page](https://ionicframework.com/support) for general support questions. The issues on GitHub should be reserved for bug reports and feature requests.
+
+### Bug Reports
+
+Please create an issue describing the bug in detail.
+
+### Feature Requests
+
+Please create an issue!
+
+## Developing
+
+Please familiarize yourself with [Cordova plugin development](https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/).
+
+You can use `cordova plugin add` with a local directory to copy and compile plugin changes into a test project.
+
+### Workflow
+
+This repo uses [semantic-release](https://github.com/semantic-release/semantic-release), so it's important to follow a strict workflow to ensure properly automated releases.
+
+* Work off of `master` branch (create new branch or fork)
+* Make changes
+* Use `npm run cz` (or `git cz` if [commitizen](https://github.com/commitizen/cz-cli) is installed globally) to make commits
+* Create a pull request
+ * Pull requests will be approved and squashed into the `master` branch
+ * Try to make pull requests with a single objective (don't have multiple features in one PR, don't mix fixes and features in one PR, etc.)
+
+### Publishing
+
+Releases are automated in CI using [semantic-release](https://github.com/semantic-release/semantic-release) when the `stable` branch is pushed to Github. Rebase `master` with `stable`. Commits in `master` should be appropriately formatted from the PR workflow (see [Workflow](#workflow)).
diff --git a/plugins/cordova-plugin-ionic-webview/LICENSE b/plugins/cordova-plugin-ionic-webview/LICENSE
new file mode 100644
index 0000000..7a4a3ea
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-ionic-webview/README.md b/plugins/cordova-plugin-ionic-webview/README.md
new file mode 100644
index 0000000..b9bf625
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/README.md
@@ -0,0 +1,181 @@
+
+
+
+
+[](https://github.com/semantic-release/semantic-release)
+[](https://dependabot.com)
+[](https://www.npmjs.com/package/cordova-plugin-ionic-webview)
+
+# Ionic Web View for Cordova
+
+A Web View plugin for Cordova, focused on providing the highest performance experience for Ionic apps (but can be used with any Cordova app).
+
+This plugin uses WKWebView on iOS and the latest evergreen webview on Android. Additionally, this plugin makes it easy to use HTML5 style routing that web developers expect for building single-page apps.
+
+Note: This repo and its documentation are for `cordova-plugin-ionic-webview` @ `4.x`, which uses the new features that may not work with all apps. See [Requirements](#plugin-requirements) and [Migrating to 4.x](#migrating-to-4x).
+
+2.x documentation can be found [here](https://github.com/ionic-team/cordova-plugin-ionic-webview/blob/2.x/README.md).
+
+:book: **Documentation**: [https://beta.ionicframework.com/docs/building/webview][ionic-webview-docs]
+
+:mega: **Support/Questions?** Please see our [Support Page][ionic-support] for general support questions. The issues on GitHub should be reserved for bug reports and feature requests.
+
+:sparkling_heart: **Want to contribute?** Please see [CONTRIBUTING.md](https://github.com/ionic-team/cordova-plugin-ionic-webview/blob/master/CONTRIBUTING.md).
+
+## Configuration
+
+This plugin has several configuration options that can be set in `config.xml`.
+
+### Android and iOS Preferences
+
+Preferences available for both iOS and Android
+
+#### Hostname
+
+``
+
+Default value is `localhost`.
+
+Example `ionic://app` on iOS, `http://app` on Android.
+
+If you change it, you'll need to add a new `allow-navigation` entry in the `config.xml` for the configured url (i.e `` if `Hostname` is set to `app`).
+This is only needed for the Android url when using `http://`, `https://` or a custom scheme. All `ionic://` urls are whitelisted by the plugin.
+
+### Android Preferences
+
+Preferences only available Android platform
+
+#### Scheme
+
+```xml
+
+```
+
+Default value is `http`
+
+Configures the Scheme the app uses to load the content.
+
+#### ResolveServiceWorkerRequests
+
+```xml
+
+```
+
+Default value is `false`
+
+Enable to resolve requests made by Service Workers through the local server.
+
+#### MixedContentMode
+
+```xml
+
+```
+
+Configures the WebView's behavior when an origin attempts to load a resource from a different origin.
+
+Default value is `0` (`MIXED_CONTENT_ALWAYS_ALLOW`), which allows loading resources from other origins.
+
+Other possible values are `1` (`MIXED_CONTENT_NEVER_ALLOW`) and `2` (`MIXED_CONTENT_COMPATIBILITY_MODE`)
+
+
+[Android documentation](https://developer.android.com/reference/android/webkit/WebSettings.html#setMixedContentMode(int))
+
+
+### iOS Preferences
+
+Preferences only available for iOS platform
+
+#### iosScheme
+
+```xml
+
+```
+
+Default value is `ionic`
+
+Configures the Scheme the app uses to load the content.
+
+Values like `http`, `https` or `file` are not valid and will use default value instead.
+
+If you change it, you'll need to add a new `allow-navigation` entry in the `config.xml` for the configured scheme (i.e `` if `iosScheme` is set to `httpsionic`).
+
+#### WKSuspendInBackground
+
+ ```xml
+
+```
+
+Default value is `true` (suspend).
+
+Set to false to stop WKWebView suspending in background too eagerly.
+
+#### KeyboardAppearanceDark
+
+```xml
+
+```
+
+Whether to use a dark styled keyboard on iOS
+
+#### ScrollEnabled
+
+```xml
+
+```
+
+Ionic apps work better if the WKWebView is not scrollable, so the scroll is disabled by default, but can be enabled with this preference. This only affects the main ScrollView of the WKWebView, so only affects the body, not other scrollable components.
+
+## Plugin Requirements
+
+* **Cordova CLI**: 7.1.0+
+* **iOS**: iOS 11+ and `cordova-ios` 4+
+* **Android**: Android 4.4+ and `cordova-android` 6.4+
+
+## Migrating to 4.x
+
+1. Remove and re-add the Web View plugin:
+
+ ```
+ cordova plugin rm cordova-plugin-ionic-webview
+ cordova plugin add cordova-plugin-ionic-webview@latest
+ ```
+
+1. Apps are now served from HTTP on Android by default.
+
+ * The default origin for requests from the Android WebView is `http://localhost`. If `Hostname` and `Scheme` preferences are set, then origin will be `schemeValue://HostnameValue`.
+
+1. Apps are now served from `ionic://` scheme on iOS by default.
+
+ * The default origin for requests from the iOS WebView is `ionic://localhost`. If `Hostname` and `iosScheme` preferences are set, then origin will be `iosSchemeValue://HostnameValue`.
+
+1. The WebView is not able to display images, videos or other files from file or content protocols or if it doesn't have protocol at all. For those cases use `window.Ionic.WebView.convertFileSrc()` to get the proper url.
+
+1. Replace any usages of `window.Ionic.normalizeURL()` with `window.Ionic.WebView.convertFileSrc()`.
+
+ * For Ionic Angular projects, there is an [Ionic Native wrapper](https://beta.ionicframework.com/docs/native/ionic-webview):
+
+ ```
+ npm install @ionic-native/ionic-webview@beta
+ ```
+
+[ionic-homepage]: https://ionicframework.com
+[ionic-docs]: https://ionicframework.com/docs
+[ionic-webview-docs]: https://beta.ionicframework.com/docs/building/webview
+[ionic-support]: https://ionicframework.com/support
diff --git a/plugins/cordova-plugin-ionic-webview/package.json b/plugins/cordova-plugin-ionic-webview/package.json
new file mode 100644
index 0000000..2e8d3df
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/package.json
@@ -0,0 +1,107 @@
+{
+ "_from": "cordova-plugin-ionic-webview@^4.0.0",
+ "_id": "cordova-plugin-ionic-webview@4.2.1",
+ "_inBundle": false,
+ "_integrity": "sha512-7KrmqLaOGq1RP8N2z1ezN1kqkWFzTwwMvQ3/qAkd+exxFZuOe3DIN4eaU1gdNphsxdirI8Ajnr9q4So5vQbWqw==",
+ "_location": "/cordova-plugin-ionic-webview",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "cordova-plugin-ionic-webview@^4.0.0",
+ "name": "cordova-plugin-ionic-webview",
+ "escapedName": "cordova-plugin-ionic-webview",
+ "rawSpec": "^4.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^4.0.0"
+ },
+ "_requiredBy": [
+ "#DEV:/",
+ "#USER"
+ ],
+ "_resolved": "https://registry.npmjs.org/cordova-plugin-ionic-webview/-/cordova-plugin-ionic-webview-4.2.1.tgz",
+ "_shasum": "42a67bef248472659d421494feb8245ef27becfa",
+ "_spec": "cordova-plugin-ionic-webview@^4.0.0",
+ "_where": "/home/saherelm/Documents/My Projects/xFrameworkTest",
+ "author": {
+ "name": "Ionic Team"
+ },
+ "bugs": {
+ "url": "https://github.com/ionic-team/cordova-plugin-ionic-webview/issues"
+ },
+ "bundleDependencies": false,
+ "config": {
+ "commitizen": {
+ "path": "./node_modules/cz-conventional-changelog"
+ }
+ },
+ "deprecated": false,
+ "description": "Ionic Web View Engine Plugin",
+ "devDependencies": {
+ "@semantic-release/changelog": "^3.0.0",
+ "@semantic-release/exec": "^3.3.0",
+ "@semantic-release/git": "^7.0.4",
+ "@semantic-release/github": "^5.0.6",
+ "@semantic-release/npm": "^5.0.4",
+ "commitizen": "^4.0.3",
+ "cz-conventional-changelog": "^3.0.2",
+ "semantic-release": "^15.9.17",
+ "sync-cordova-xml": "^0.4.0"
+ },
+ "engines": {
+ "cordovaDependencies": {
+ "2.0.0": {
+ "cordova-android": ">=6.4.0",
+ "cordova-ios": ">=4.0.0-dev"
+ },
+ "3.1.0": {
+ "cordova": ">=7.1.0",
+ "cordova-android": ">=6.4.0",
+ "cordova-ios": ">=4.0.0-dev"
+ }
+ }
+ },
+ "homepage": "https://github.com/ionic-team/cordova-plugin-ionic-webview#readme",
+ "keywords": [
+ "cordova",
+ "wkwebview"
+ ],
+ "license": "Apache-2.0",
+ "name": "cordova-plugin-ionic-webview",
+ "release": {
+ "branch": "stable",
+ "verifyConditions": [
+ "@semantic-release/changelog",
+ "@semantic-release/npm",
+ "@semantic-release/git",
+ "@semantic-release/github"
+ ],
+ "prepare": [
+ "@semantic-release/changelog",
+ "@semantic-release/npm",
+ "@semantic-release/exec",
+ "@semantic-release/git"
+ ],
+ "publish": [
+ "@semantic-release/github",
+ "@semantic-release/npm"
+ ],
+ "success": [
+ "@semantic-release/github"
+ ],
+ "failure": [
+ "@semantic-release/github"
+ ],
+ "prepareCmd": "npm run version"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/ionic-team/cordova-plugin-ionic-webview.git"
+ },
+ "scripts": {
+ "cz": "git-cz",
+ "sync_plugin_xml": "sync-cordova-xml package.json plugin.xml --output=plugin.xml",
+ "version": "npm run sync_plugin_xml && git add plugin.xml"
+ },
+ "version": "4.2.1"
+}
diff --git a/plugins/cordova-plugin-ionic-webview/plugin.xml b/plugins/cordova-plugin-ionic-webview/plugin.xml
new file mode 100644
index 0000000..f8f442e
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/plugin.xml
@@ -0,0 +1,88 @@
+
+
+
+
+
+ cordova-plugin-ionic-webview
+ Ionic Web View Engine Plugin
+ Apache-2.0
+ cordova,wkwebview
+ https://github.com/ionic-team/cordova-plugin-ionic-webview
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ https://github.com/ionic-team/cordova-plugin-ionic-webview/issues
+ Ionic Team
+
diff --git a/plugins/cordova-plugin-ionic-webview/src/android/com/ionicframework/cordova/webview/AndroidProtocolHandler.java b/plugins/cordova-plugin-ionic-webview/src/android/com/ionicframework/cordova/webview/AndroidProtocolHandler.java
new file mode 100644
index 0000000..6202a5b
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/android/com/ionicframework/cordova/webview/AndroidProtocolHandler.java
@@ -0,0 +1,107 @@
+package com.ionicframework.cordova.webview;
+
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import android.content.Context;
+import android.content.res.AssetManager;
+import android.net.Uri;
+import android.util.Log;
+import android.util.TypedValue;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+
+
+public class AndroidProtocolHandler {
+ private static final String TAG = "AndroidProtocolHandler";
+
+ private Context context;
+
+ public AndroidProtocolHandler(Context context) {
+ this.context = context;
+ }
+
+ public InputStream openAsset(String path) throws IOException {
+ return context.getAssets().open(path, AssetManager.ACCESS_STREAMING);
+ }
+
+ public InputStream openResource(Uri uri) {
+ assert uri.getPath() != null;
+ // The path must be of the form ".../asset_type/asset_name.ext".
+ List pathSegments = uri.getPathSegments();
+ String assetType = pathSegments.get(pathSegments.size() - 2);
+ String assetName = pathSegments.get(pathSegments.size() - 1);
+
+ // Drop the file extension.
+ assetName = assetName.split("\\.")[0];
+ try {
+ // Use the application context for resolving the resource package name so that we do
+ // not use the browser's own resources. Note that if 'context' here belongs to the
+ // test suite, it does not have a separate application context. In that case we use
+ // the original context object directly.
+ if (context.getApplicationContext() != null) {
+ context = context.getApplicationContext();
+ }
+ int fieldId = getFieldId(context, assetType, assetName);
+ int valueType = getValueType(context, fieldId);
+ if (valueType == TypedValue.TYPE_STRING) {
+ return context.getResources().openRawResource(fieldId);
+ } else {
+ Log.e(TAG, "Asset not of type string: " + uri);
+ return null;
+ }
+ } catch (ClassNotFoundException e) {
+ Log.e(TAG, "Unable to open resource URL: " + uri, e);
+ return null;
+ } catch (NoSuchFieldException e) {
+ Log.e(TAG, "Unable to open resource URL: " + uri, e);
+ return null;
+ } catch (IllegalAccessException e) {
+ Log.e(TAG, "Unable to open resource URL: " + uri, e);
+ return null;
+ }
+ }
+
+ public InputStream openFile(String filePath) throws IOException {
+ String realPath = filePath.replace(WebViewLocalServer.fileStart, "");
+ File localFile = new File(realPath);
+ return new FileInputStream(localFile);
+ }
+
+ public InputStream openContentUrl(Uri uri) throws IOException {
+ Integer port = uri.getPort();
+ String realPath;
+ if (port == -1) {
+ realPath = uri.toString().replace(uri.getScheme() + "://" + uri.getHost() + WebViewLocalServer.contentStart, "content:/");
+ } else {
+ realPath = uri.toString().replace(uri.getScheme() + "://" + uri.getHost() + ":" + port + WebViewLocalServer.contentStart, "content:/");
+ }
+ InputStream stream = null;
+ try {
+ stream = context.getContentResolver().openInputStream(Uri.parse(realPath));
+ } catch (SecurityException e) {
+ Log.e(TAG, "Unable to open content URL: " + uri, e);
+ }
+ return stream;
+ }
+
+ private static int getFieldId(Context context, String assetType, String assetName)
+ throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException {
+ Class> d = context.getClassLoader()
+ .loadClass(context.getPackageName() + ".R$" + assetType);
+ java.lang.reflect.Field field = d.getField(assetName);
+ int id = field.getInt(null);
+ return id;
+ }
+
+ private static int getValueType(Context context, int fieldId) {
+ TypedValue value = new TypedValue();
+ context.getResources().getValue(fieldId, value, true);
+ return value.type;
+ }
+}
diff --git a/plugins/cordova-plugin-ionic-webview/src/android/com/ionicframework/cordova/webview/IonicWebView.java b/plugins/cordova-plugin-ionic-webview/src/android/com/ionicframework/cordova/webview/IonicWebView.java
new file mode 100644
index 0000000..ff77137
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/android/com/ionicframework/cordova/webview/IonicWebView.java
@@ -0,0 +1,41 @@
+package com.ionicframework.cordova.webview;
+
+import android.app.Activity;
+import android.content.SharedPreferences;
+
+import org.apache.cordova.CallbackContext;
+import org.apache.cordova.CordovaPlugin;
+import org.json.JSONArray;
+import org.json.JSONException;
+
+public class IonicWebView extends CordovaPlugin {
+
+ public static final String WEBVIEW_PREFS_NAME = "WebViewSettings";
+ public static final String CDV_SERVER_PATH = "serverBasePath";
+
+ public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
+
+ if (action.equals("setServerBasePath")) {
+ final String path = args.getString(0);
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ ((IonicWebViewEngine)webView.getEngine()).setServerBasePath(path);
+ }
+ });
+ return true;
+ } else if (action.equals("getServerBasePath")) {
+ callbackContext.success(((IonicWebViewEngine)webView.getEngine()).getServerBasePath());
+ return true;
+ } else if (action.equals("persistServerBasePath")) {
+ String path = ((IonicWebViewEngine)webView.getEngine()).getServerBasePath();
+ SharedPreferences prefs = cordova.getActivity().getApplicationContext().getSharedPreferences(WEBVIEW_PREFS_NAME, Activity.MODE_PRIVATE);
+ SharedPreferences.Editor editor = prefs.edit();
+ editor.putString(CDV_SERVER_PATH, path);
+ editor.apply();
+ return true;
+ }
+ return false;
+ }
+
+}
+
diff --git a/plugins/cordova-plugin-ionic-webview/src/android/com/ionicframework/cordova/webview/IonicWebViewEngine.java b/plugins/cordova-plugin-ionic-webview/src/android/com/ionicframework/cordova/webview/IonicWebViewEngine.java
new file mode 100644
index 0000000..02bdaf8
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/android/com/ionicframework/cordova/webview/IonicWebViewEngine.java
@@ -0,0 +1,181 @@
+package com.ionicframework.cordova.webview;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.content.pm.PackageInfo;
+import android.annotation.TargetApi;
+import android.graphics.Bitmap;
+import android.net.Uri;
+import android.os.Build;
+import android.support.annotation.RequiresApi;
+import android.util.Log;
+import android.webkit.ServiceWorkerController;
+import android.webkit.ServiceWorkerClient;
+import android.webkit.WebResourceRequest;
+import android.webkit.WebResourceResponse;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import org.apache.cordova.ConfigXmlParser;
+import org.apache.cordova.CordovaInterface;
+import org.apache.cordova.CordovaPreferences;
+import org.apache.cordova.CordovaResourceApi;
+import org.apache.cordova.CordovaWebView;
+import org.apache.cordova.CordovaWebViewEngine;
+import org.apache.cordova.NativeToJsMessageQueue;
+import org.apache.cordova.PluginManager;
+import org.apache.cordova.engine.SystemWebViewClient;
+import org.apache.cordova.engine.SystemWebViewEngine;
+import org.apache.cordova.engine.SystemWebView;
+
+public class IonicWebViewEngine extends SystemWebViewEngine {
+ public static final String TAG = "IonicWebViewEngine";
+
+ private WebViewLocalServer localServer;
+ private String CDV_LOCAL_SERVER;
+ private String scheme;
+ private static final String LAST_BINARY_VERSION_CODE = "lastBinaryVersionCode";
+ private static final String LAST_BINARY_VERSION_NAME = "lastBinaryVersionName";
+
+ /**
+ * Used when created via reflection.
+ */
+ public IonicWebViewEngine(Context context, CordovaPreferences preferences) {
+ super(new SystemWebView(context), preferences);
+ Log.d(TAG, "Ionic Web View Engine Starting Right Up 1...");
+ }
+
+ public IonicWebViewEngine(SystemWebView webView) {
+ super(webView, null);
+ Log.d(TAG, "Ionic Web View Engine Starting Right Up 2...");
+ }
+
+ public IonicWebViewEngine(SystemWebView webView, CordovaPreferences preferences) {
+ super(webView, preferences);
+ Log.d(TAG, "Ionic Web View Engine Starting Right Up 3...");
+ }
+
+ @Override
+ public void init(CordovaWebView parentWebView, CordovaInterface cordova, final CordovaWebViewEngine.Client client,
+ CordovaResourceApi resourceApi, PluginManager pluginManager,
+ NativeToJsMessageQueue nativeToJsMessageQueue) {
+ ConfigXmlParser parser = new ConfigXmlParser();
+ parser.parse(cordova.getActivity());
+
+ String hostname = preferences.getString("Hostname", "localhost");
+ scheme = preferences.getString("Scheme", "http");
+ CDV_LOCAL_SERVER = scheme + "://" + hostname;
+
+ localServer = new WebViewLocalServer(cordova.getActivity(), hostname, true, parser, scheme);
+ localServer.hostAssets("www");
+
+ webView.setWebViewClient(new ServerClient(this, parser));
+
+ super.init(parentWebView, cordova, client, resourceApi, pluginManager, nativeToJsMessageQueue);
+ if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ final WebSettings settings = webView.getSettings();
+ int mode = preferences.getInteger("MixedContentMode", 0);
+ settings.setMixedContentMode(mode);
+ }
+ SharedPreferences prefs = cordova.getActivity().getApplicationContext().getSharedPreferences(IonicWebView.WEBVIEW_PREFS_NAME, Activity.MODE_PRIVATE);
+ String path = prefs.getString(IonicWebView.CDV_SERVER_PATH, null);
+ if (!isDeployDisabled() && !isNewBinary() && path != null && !path.isEmpty()) {
+ setServerBasePath(path);
+ }
+
+ boolean setAsServiceWorkerClient = preferences.getBoolean("ResolveServiceWorkerRequests", false);
+ ServiceWorkerController controller = null;
+
+ if (setAsServiceWorkerClient && android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
+ controller = ServiceWorkerController.getInstance();
+ controller.setServiceWorkerClient(new ServiceWorkerClient(){
+ @Override
+ public WebResourceResponse shouldInterceptRequest(WebResourceRequest request) {
+ return localServer.shouldInterceptRequest(request.getUrl(), request);
+ }
+ });
+ }
+ }
+
+ private boolean isNewBinary() {
+ String versionCode = "";
+ String versionName = "";
+ SharedPreferences prefs = cordova.getActivity().getApplicationContext().getSharedPreferences(IonicWebView.WEBVIEW_PREFS_NAME, Activity.MODE_PRIVATE);
+ String lastVersionCode = prefs.getString(LAST_BINARY_VERSION_CODE, null);
+ String lastVersionName = prefs.getString(LAST_BINARY_VERSION_NAME, null);
+
+ try {
+ PackageInfo pInfo = this.cordova.getActivity().getPackageManager().getPackageInfo(this.cordova.getActivity().getPackageName(), 0);
+ versionCode = Integer.toString(pInfo.versionCode);
+ versionName = pInfo.versionName;
+ } catch(Exception ex) {
+ Log.e(TAG, "Unable to get package info", ex);
+ }
+
+ if (!versionCode.equals(lastVersionCode) || !versionName.equals(lastVersionName)) {
+ SharedPreferences.Editor editor = prefs.edit();
+ editor.putString(LAST_BINARY_VERSION_CODE, versionCode);
+ editor.putString(LAST_BINARY_VERSION_NAME, versionName);
+ editor.putString(IonicWebView.CDV_SERVER_PATH, "");
+ editor.apply();
+ return true;
+ }
+ return false;
+ }
+
+ private boolean isDeployDisabled() {
+ return preferences.getBoolean("DisableDeploy", false);
+ }
+ private class ServerClient extends SystemWebViewClient {
+ private ConfigXmlParser parser;
+
+ public ServerClient(SystemWebViewEngine parentEngine, ConfigXmlParser parser) {
+ super(parentEngine);
+ this.parser = parser;
+ }
+
+ @RequiresApi(Build.VERSION_CODES.LOLLIPOP)
+ @Override
+ public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
+ return localServer.shouldInterceptRequest(request.getUrl(), request);
+ }
+
+ @TargetApi(Build.VERSION_CODES.KITKAT)
+ @Override
+ public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
+ return localServer.shouldInterceptRequest(Uri.parse(url), null);
+ }
+
+ @Override
+ public void onPageStarted(WebView view, String url, Bitmap favicon) {
+ super.onPageStarted(view, url, favicon);
+ String launchUrl = parser.getLaunchUrl();
+ if (!launchUrl.contains(WebViewLocalServer.httpsScheme) && !launchUrl.contains(WebViewLocalServer.httpScheme) && url.equals(launchUrl)) {
+ view.stopLoading();
+ // When using a custom scheme the app won't load if server start url doesn't end in /
+ String startUrl = CDV_LOCAL_SERVER;
+ if (!scheme.equalsIgnoreCase(WebViewLocalServer.httpsScheme) && !scheme.equalsIgnoreCase(WebViewLocalServer.httpScheme)) {
+ startUrl += "/";
+ }
+ view.loadUrl(startUrl);
+ }
+ }
+
+ @Override
+ public void onPageFinished(WebView view, String url) {
+ super.onPageFinished(view, url);
+ view.loadUrl("javascript:(function() { " +
+ "window.WEBVIEW_SERVER_URL = '" + CDV_LOCAL_SERVER + "';" +
+ "})()");
+ }
+ }
+
+ public void setServerBasePath(String path) {
+ localServer.hostFiles(path);
+ webView.loadUrl(CDV_LOCAL_SERVER);
+ }
+
+ public String getServerBasePath() {
+ return this.localServer.getBasePath();
+ }
+}
diff --git a/plugins/cordova-plugin-ionic-webview/src/android/com/ionicframework/cordova/webview/UriMatcher.java b/plugins/cordova-plugin-ionic-webview/src/android/com/ionicframework/cordova/webview/UriMatcher.java
new file mode 100644
index 0000000..d8addb9
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/android/com/ionicframework/cordova/webview/UriMatcher.java
@@ -0,0 +1,183 @@
+package com.ionicframework.cordova.webview;
+
+/*
+ * Copyright (C) 2006 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//package com.google.webviewlocalserver.third_party.android;
+
+import android.net.Uri;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Pattern;
+
+public class UriMatcher {
+ /**
+ * Creates the root node of the URI tree.
+ *
+ * @param code the code to match for the root URI
+ */
+ public UriMatcher(Object code) {
+ mCode = code;
+ mWhich = -1;
+ mChildren = new ArrayList();
+ mText = null;
+ }
+
+ private UriMatcher() {
+ mCode = null;
+ mWhich = -1;
+ mChildren = new ArrayList();
+ mText = null;
+ }
+
+ /**
+ * Add a URI to match, and the code to return when this URI is
+ * matched. URI nodes may be exact match string, the token "*"
+ * that matches any text, or the token "#" that matches only
+ * numbers.
+ *
+ * Starting from API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2},
+ * this method will accept a leading slash in the path.
+ *
+ * @param authority the authority to match
+ * @param path the path to match. * may be used as a wild card for
+ * any text, and # may be used as a wild card for numbers.
+ * @param code the code that is returned when a URI is matched
+ * against the given components. Must be positive.
+ */
+ public void addURI(String scheme, String authority, String path, Object code) {
+ if (code == null) {
+ throw new IllegalArgumentException("Code can't be null");
+ }
+
+ String[] tokens = null;
+ if (path != null) {
+ String newPath = path;
+ // Strip leading slash if present.
+ if (path.length() > 0 && path.charAt(0) == '/') {
+ newPath = path.substring(1);
+ }
+ tokens = PATH_SPLIT_PATTERN.split(newPath);
+ }
+
+ int numTokens = tokens != null ? tokens.length : 0;
+ UriMatcher node = this;
+ for (int i = -2; i < numTokens; i++) {
+ String token;
+ if (i == -2)
+ token = scheme;
+ else if (i == -1)
+ token = authority;
+ else
+ token = tokens[i];
+ ArrayList children = node.mChildren;
+ int numChildren = children.size();
+ UriMatcher child;
+ int j;
+ for (j = 0; j < numChildren; j++) {
+ child = children.get(j);
+ if (token.equals(child.mText)) {
+ node = child;
+ break;
+ }
+ }
+ if (j == numChildren) {
+ // Child not found, create it
+ child = new UriMatcher();
+ if (token.equals("**")) {
+ child.mWhich = REST;
+ } else if (token.equals("*")) {
+ child.mWhich = TEXT;
+ } else {
+ child.mWhich = EXACT;
+ }
+ child.mText = token;
+ node.mChildren.add(child);
+ node = child;
+ }
+ }
+ node.mCode = code;
+ }
+
+ static final Pattern PATH_SPLIT_PATTERN = Pattern.compile("/");
+
+ /**
+ * Try to match against the path in a url.
+ *
+ * @param uri The url whose path we will match against.
+ * @return The code for the matched node (added using addURI),
+ * or null if there is no matched node.
+ */
+ public Object match(Uri uri) {
+ final List pathSegments = uri.getPathSegments();
+ final int li = pathSegments.size();
+
+ UriMatcher node = this;
+
+ if (li == 0 && uri.getAuthority() == null) {
+ return this.mCode;
+ }
+
+ for (int i = -2; i < li; i++) {
+ String u;
+ if (i == -2)
+ u = uri.getScheme();
+ else if (i == -1)
+ u = uri.getAuthority();
+ else
+ u = pathSegments.get(i);
+ ArrayList list = node.mChildren;
+ if (list == null) {
+ break;
+ }
+ node = null;
+ int lj = list.size();
+ for (int j = 0; j < lj; j++) {
+ UriMatcher n = list.get(j);
+ which_switch:
+ switch (n.mWhich) {
+ case EXACT:
+ if (n.mText.equals(u)) {
+ node = n;
+ }
+ break;
+ case TEXT:
+ node = n;
+ break;
+ case REST:
+ return n.mCode;
+ }
+ if (node != null) {
+ break;
+ }
+ }
+ if (node == null) {
+ return null;
+ }
+ }
+
+ return node.mCode;
+ }
+
+ private static final int EXACT = 0;
+ private static final int TEXT = 1;
+ private static final int REST = 2;
+
+ private Object mCode;
+ private int mWhich;
+ private String mText;
+ private ArrayList mChildren;
+}
diff --git a/plugins/cordova-plugin-ionic-webview/src/android/com/ionicframework/cordova/webview/WebViewLocalServer.java b/plugins/cordova-plugin-ionic-webview/src/android/com/ionicframework/cordova/webview/WebViewLocalServer.java
new file mode 100644
index 0000000..cf13493
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/android/com/ionicframework/cordova/webview/WebViewLocalServer.java
@@ -0,0 +1,645 @@
+/*
+Copyright 2015 Google Inc. All rights reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+ */
+package com.ionicframework.cordova.webview;
+
+import android.content.Context;
+import android.net.Uri;
+import android.os.Build;
+import android.util.Log;
+import android.webkit.WebResourceRequest;
+import android.webkit.WebResourceResponse;
+
+import org.apache.cordova.ConfigXmlParser;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.SocketTimeoutException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * Helper class meant to be used with the android.webkit.WebView class to enable hosting assets,
+ * resources and other data on 'virtual' http(s):// URL.
+ * Hosting assets and resources on http(s):// URLs is desirable as it is compatible with the
+ * Same-Origin policy.
+ *
+ * This class is intended to be used from within the
+ * {@link android.webkit.WebViewClient#shouldInterceptRequest(android.webkit.WebView, String)} and
+ * {@link android.webkit.WebViewClient#shouldInterceptRequest(android.webkit.WebView,
+ * android.webkit.WebResourceRequest)}
+ * methods.
+ */
+public class WebViewLocalServer {
+ private static String TAG = "WebViewAssetServer";
+ private String basePath;
+ public final static String httpScheme = "http";
+ public final static String httpsScheme = "https";
+ public final static String fileStart = "/_app_file_";
+ public final static String contentStart = "/_app_content_";
+
+ private final UriMatcher uriMatcher;
+ private final AndroidProtocolHandler protocolHandler;
+ private final String authority;
+ private final String customScheme;
+ // Whether we're serving local files or proxying (for example, when doing livereload on a
+ // non-local endpoint (will be false in that case)
+ private boolean isAsset;
+ // Whether to route all requests to paths without extensions back to `index.html`
+ private final boolean html5mode;
+ private ConfigXmlParser parser;
+
+ public String getAuthority() { return authority; }
+
+ /**
+ * A handler that produces responses for paths on the virtual asset server.
+ *
+ * Methods of this handler will be invoked on a background thread and care must be taken to
+ * correctly synchronize access to any shared state.
+ *
+ * On Android KitKat and above these methods may be called on more than one thread. This thread
+ * may be different than the thread on which the shouldInterceptRequest method was invoke.
+ * This means that on Android KitKat and above it is possible to block in this method without
+ * blocking other resources from loading. The number of threads used to parallelize loading
+ * is an internal implementation detail of the WebView and may change between updates which
+ * means that the amount of time spend blocking in this method should be kept to an absolute
+ * minimum.
+ */
+ public abstract static class PathHandler {
+ protected String mimeType;
+ private String encoding;
+ private String charset;
+ private int statusCode;
+ private String reasonPhrase;
+ private Map responseHeaders;
+
+ public PathHandler() {
+ this(null, null, 200, "OK", null);
+ }
+
+ public PathHandler(String encoding, String charset, int statusCode,
+ String reasonPhrase, Map responseHeaders) {
+ this.encoding = encoding;
+ this.charset = charset;
+ this.statusCode = statusCode;
+ this.reasonPhrase = reasonPhrase;
+ Map tempResponseHeaders;
+ if (responseHeaders == null) {
+ tempResponseHeaders = new HashMap();
+ } else {
+ tempResponseHeaders = responseHeaders;
+ }
+ tempResponseHeaders.put("Cache-Control", "no-cache");
+ this.responseHeaders = tempResponseHeaders;
+ }
+
+ abstract public InputStream handle(Uri url);
+
+ public String getEncoding() {
+ return encoding;
+ }
+
+ public String getCharset() {
+ return charset;
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public String getReasonPhrase() {
+ return reasonPhrase;
+ }
+
+ public Map getResponseHeaders() {
+ return responseHeaders;
+ }
+ }
+
+ /**
+ * Information about the URLs used to host the assets in the WebView.
+ */
+ public static class AssetHostingDetails {
+ private Uri httpPrefix;
+ private Uri httpsPrefix;
+
+ /*package*/ AssetHostingDetails(Uri httpPrefix, Uri httpsPrefix) {
+ this.httpPrefix = httpPrefix;
+ this.httpsPrefix = httpsPrefix;
+ }
+
+ /**
+ * Gets the http: scheme prefix at which assets are hosted.
+ *
+ * @return the http: scheme prefix at which assets are hosted. Can return null.
+ */
+ public Uri getHttpPrefix() {
+ return httpPrefix;
+ }
+
+ /**
+ * Gets the https: scheme prefix at which assets are hosted.
+ *
+ * @return the https: scheme prefix at which assets are hosted. Can return null.
+ */
+ public Uri getHttpsPrefix() {
+ return httpsPrefix;
+ }
+ }
+
+ WebViewLocalServer(Context context, String authority, boolean html5mode, ConfigXmlParser parser, String customScheme) {
+ uriMatcher = new UriMatcher(null);
+ this.html5mode = html5mode;
+ this.parser = parser;
+ this.protocolHandler = new AndroidProtocolHandler(context.getApplicationContext());
+ this.authority = authority;
+ this.customScheme = customScheme;
+ }
+
+ private static Uri parseAndVerifyUrl(String url) {
+ if (url == null) {
+ return null;
+ }
+ Uri uri = Uri.parse(url);
+ if (uri == null) {
+ Log.e(TAG, "Malformed URL: " + url);
+ return null;
+ }
+ String path = uri.getPath();
+ if (path == null || path.length() == 0) {
+ Log.e(TAG, "URL does not have a path: " + url);
+ return null;
+ }
+ return uri;
+ }
+
+ private static WebResourceResponse createWebResourceResponse(String mimeType, String encoding, int statusCode, String reasonPhrase, Map responseHeaders, InputStream data) {
+ if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ int finalStatusCode = statusCode;
+ try {
+ if (data.available() == 0) {
+ finalStatusCode = 404;
+ }
+ } catch (IOException e) {
+ finalStatusCode = 500;
+ }
+ return new WebResourceResponse(mimeType, encoding, finalStatusCode, reasonPhrase, responseHeaders, data);
+ } else {
+ return new WebResourceResponse(mimeType, encoding, data);
+ }
+ }
+
+ /**
+ * Attempt to retrieve the WebResourceResponse associated with the given request.
+ * This method should be invoked from within
+ * {@link android.webkit.WebViewClient#shouldInterceptRequest(android.webkit.WebView,
+ * android.webkit.WebResourceRequest)}.
+ *
+ * @param uri the request Uri to process.
+ * @return a response if the request URL had a matching handler, null if no handler was found.
+ */
+ public WebResourceResponse shouldInterceptRequest(Uri uri, WebResourceRequest request) {
+ PathHandler handler;
+ synchronized (uriMatcher) {
+ handler = (PathHandler) uriMatcher.match(uri);
+ }
+ if (handler == null) {
+ return null;
+ }
+
+ if (isLocalFile(uri) || uri.getAuthority().equals(this.authority)) {
+ Log.d("SERVER", "Handling local request: " + uri.toString());
+ return handleLocalRequest(uri, handler, request);
+ } else {
+ return handleProxyRequest(uri, handler);
+ }
+ }
+
+ private boolean isLocalFile(Uri uri) {
+ String path = uri.getPath();
+ if (path.startsWith(contentStart) || path.startsWith(fileStart)) {
+ return true;
+ }
+ return false;
+ }
+
+
+ private WebResourceResponse handleLocalRequest(Uri uri, PathHandler handler, WebResourceRequest request) {
+ String path = uri.getPath();
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && request != null && request.getRequestHeaders().get("Range") != null) {
+ InputStream responseStream = new LollipopLazyInputStream(handler, uri);
+ String mimeType = getMimeType(path, responseStream);
+ Map tempResponseHeaders = handler.getResponseHeaders();
+ int statusCode = 206;
+ try {
+ int totalRange = responseStream.available();
+ String rangeString = request.getRequestHeaders().get("Range");
+ String[] parts = rangeString.split("=");
+ String[] streamParts = parts[1].split("-");
+ String fromRange = streamParts[0];
+ int range = totalRange-1;
+ if (streamParts.length > 1) {
+ range = Integer.parseInt(streamParts[1]);
+ }
+ tempResponseHeaders.put("Accept-Ranges", "bytes");
+ tempResponseHeaders.put("Content-Range", "bytes " + fromRange + "-" + range + "/" + totalRange);
+ } catch (IOException e) {
+ statusCode = 404;
+ }
+ return createWebResourceResponse(mimeType, handler.getEncoding(),
+ statusCode, handler.getReasonPhrase(), tempResponseHeaders, responseStream);
+ }
+ if (isLocalFile(uri)) {
+ InputStream responseStream = new LollipopLazyInputStream(handler, uri);
+ String mimeType = getMimeType(path, responseStream);
+ return createWebResourceResponse(mimeType, handler.getEncoding(),
+ handler.getStatusCode(), handler.getReasonPhrase(), handler.getResponseHeaders(), responseStream);
+ }
+
+ if (path.equals("") || path.equals("/") || (!uri.getLastPathSegment().contains(".") && html5mode)) {
+ InputStream stream;
+ String launchURL = parser.getLaunchUrl();
+ String launchFile = launchURL.substring(launchURL.lastIndexOf("/") + 1, launchURL.length());
+ try {
+ String startPath = this.basePath + "/" + launchFile;
+ if (isAsset) {
+ stream = protocolHandler.openAsset(startPath);
+ } else {
+ stream = protocolHandler.openFile(startPath);
+ }
+
+ } catch (IOException e) {
+ Log.e(TAG, "Unable to open " + launchFile, e);
+ return null;
+ }
+
+ return createWebResourceResponse("text/html", handler.getEncoding(),
+ handler.getStatusCode(), handler.getReasonPhrase(), handler.getResponseHeaders(), stream);
+ }
+
+ int periodIndex = path.lastIndexOf(".");
+ if (periodIndex >= 0) {
+ InputStream responseStream = new LollipopLazyInputStream(handler, uri);
+ String mimeType = getMimeType(path, responseStream);
+ return createWebResourceResponse(mimeType, handler.getEncoding(),
+ handler.getStatusCode(), handler.getReasonPhrase(), handler.getResponseHeaders(), responseStream);
+ }
+
+ return null;
+ }
+
+ /**
+ * Instead of reading files from the filesystem/assets, proxy through to the URL
+ * and let an external server handle it.
+ * @param uri
+ * @param handler
+ * @return
+ */
+ private WebResourceResponse handleProxyRequest(Uri uri, PathHandler handler) {
+ try {
+ String path = uri.getPath();
+ URL url = new URL(uri.toString());
+ HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+ conn.setRequestMethod("GET");
+ conn.setReadTimeout(30 * 1000);
+ conn.setConnectTimeout(30 * 1000);
+
+ InputStream stream = conn.getInputStream();
+
+ if (path.equals("/") || (!uri.getLastPathSegment().contains(".") && html5mode)) {
+ return createWebResourceResponse("text/html", handler.getEncoding(),
+ handler.getStatusCode(), handler.getReasonPhrase(), handler.getResponseHeaders(), stream);
+ }
+
+ int periodIndex = path.lastIndexOf(".");
+ if (periodIndex >= 0) {
+ String ext = path.substring(path.lastIndexOf("."), path.length());
+
+ // TODO: Conjure up a bit more subtlety than this
+ if (ext.equals(".html")) {
+ }
+
+ String mimeType = getMimeType(path, stream);
+
+ return createWebResourceResponse(mimeType, handler.getEncoding(),
+ handler.getStatusCode(), handler.getReasonPhrase(), handler.getResponseHeaders(), stream);
+ }
+
+ return createWebResourceResponse("", handler.getEncoding(),
+ handler.getStatusCode(), handler.getReasonPhrase(), handler.getResponseHeaders(), stream);
+
+ } catch (SocketTimeoutException ex) {
+ // bridge.handleAppUrlLoadError(ex);
+ } catch (Exception ex) {
+ // bridge.handleAppUrlLoadError(ex);
+ }
+ return null;
+ }
+
+ private String getMimeType(String path, InputStream stream) {
+ String mimeType = null;
+ try {
+ mimeType = URLConnection.guessContentTypeFromName(path); // Does not recognize *.js
+ if (mimeType != null && path.endsWith(".js") && mimeType.equals("image/x-icon")) {
+ Log.d(IonicWebViewEngine.TAG, "We shouldn't be here");
+ }
+ if (mimeType == null) {
+ if (path.endsWith(".js") || path.endsWith(".mjs")) {
+ // Make sure JS files get the proper mimetype to support ES modules
+ mimeType = "application/javascript";
+ } else if (path.endsWith(".wasm")) {
+ mimeType = "application/wasm";
+ } else {
+ mimeType = URLConnection.guessContentTypeFromStream(stream);
+ }
+ }
+ } catch (Exception ex) {
+ Log.e(TAG, "Unable to get mime type" + path, ex);
+ }
+ return mimeType;
+ }
+
+ /**
+ * Registers a handler for the given uri. The handler will be invoked
+ * every time the shouldInterceptRequest method of the instance is called with
+ * a matching uri.
+ *
+ * @param uri the uri to use the handler for. The scheme and authority (domain) will be matched
+ * exactly. The path may contain a '*' element which will match a single element of
+ * a path (so a handler registered for /a/* will be invoked for /a/b and /a/c.html
+ * but not for /a/b/b) or the '**' element which will match any number of path
+ * elements.
+ * @param handler the handler to use for the uri.
+ */
+ void register(Uri uri, PathHandler handler) {
+ synchronized (uriMatcher) {
+ uriMatcher.addURI(uri.getScheme(), uri.getAuthority(), uri.getPath(), handler);
+ }
+ }
+
+ /**
+ * Hosts the application's assets on an http(s):// URL. Assets from the local path
+ * assetPath/... will be available under
+ * http(s)://{uuid}.androidplatform.net/assets/....
+ *
+ * @param assetPath the local path in the application's asset folder which will be made
+ * available by the server (for example "/www").
+ */
+ public void hostAssets(String assetPath) {
+ hostAssets(authority, assetPath);
+ }
+
+
+ /**
+ * Hosts the application's assets on an http(s):// URL. Assets from the local path
+ * assetPath/... will be available under
+ * http(s)://{domain}/{virtualAssetPath}/....
+ *
+ * @param domain custom domain on which the assets should be hosted (for example "example.com").
+ * @param assetPath the local path in the application's asset folder which will be made
+ * available by the server (for example "/www").
+ * @return prefixes under which the assets are hosted.
+ */
+ public void hostAssets(final String domain,
+ final String assetPath) {
+ this.isAsset = true;
+ this.basePath = assetPath;
+
+ createHostingDetails();
+ }
+
+ private void createHostingDetails() {
+ final String assetPath = this.basePath;
+
+ if (assetPath.indexOf('*') != -1) {
+ throw new IllegalArgumentException("assetPath cannot contain the '*' character.");
+ }
+
+ PathHandler handler = new PathHandler() {
+ @Override
+ public InputStream handle(Uri url) {
+ InputStream stream = null;
+ String path = url.getPath();
+ try {
+ if (path.startsWith(contentStart)) {
+ stream = protocolHandler.openContentUrl(url);
+ } else if (path.startsWith(fileStart) || !isAsset) {
+ if (!path.startsWith(fileStart)) {
+ path = basePath + url.getPath();
+ }
+ stream = protocolHandler.openFile(path);
+ } else {
+ stream = protocolHandler.openAsset(assetPath + path);
+ }
+ } catch (IOException e) {
+ Log.e(TAG, "Unable to open asset URL: " + url);
+ return null;
+ }
+
+ return stream;
+ }
+ };
+
+ registerUriForScheme(httpScheme, handler, authority);
+ registerUriForScheme(httpsScheme, handler, authority);
+ if (!customScheme.equals(httpScheme) && !customScheme.equals(httpsScheme)) {
+ registerUriForScheme(customScheme, handler, authority);
+ }
+
+ }
+
+ private void registerUriForScheme(String scheme, PathHandler handler, String authority) {
+ Uri.Builder uriBuilder = new Uri.Builder();
+ uriBuilder.scheme(scheme);
+ uriBuilder.authority(authority);
+ uriBuilder.path("");
+ Uri uriPrefix = uriBuilder.build();
+
+ register(Uri.withAppendedPath(uriPrefix, "/"), handler);
+ register(Uri.withAppendedPath(uriPrefix, "**"), handler);
+ }
+
+ /**
+ * Hosts the application's resources on an http(s):// URL. Resources
+ * http(s)://{uuid}.androidplatform.net/res/{resource_type}/{resource_name}.
+ *
+ * @return prefixes under which the resources are hosted.
+ */
+ public AssetHostingDetails hostResources() {
+ return hostResources(authority, "/res", true, true);
+ }
+
+ /**
+ * Hosts the application's resources on an http(s):// URL. Resources
+ * http(s)://{uuid}.androidplatform.net/{virtualResourcesPath}/{resource_type}/{resource_name}.
+ *
+ * @param virtualResourcesPath the path on the local server under which the resources
+ * should be hosted.
+ * @param enableHttp whether to enable hosting using the http scheme.
+ * @param enableHttps whether to enable hosting using the https scheme.
+ * @return prefixes under which the resources are hosted.
+ */
+ public AssetHostingDetails hostResources(final String virtualResourcesPath, boolean enableHttp,
+ boolean enableHttps) {
+ return hostResources(authority, virtualResourcesPath, enableHttp, enableHttps);
+ }
+
+ /**
+ * Hosts the application's resources on an http(s):// URL. Resources
+ * http(s)://{domain}/{virtualResourcesPath}/{resource_type}/{resource_name}.
+ *
+ * @param domain custom domain on which the assets should be hosted (for example "example.com").
+ * If untrusted content is to be loaded into the WebView it is advised to make
+ * this random.
+ * @param virtualResourcesPath the path on the local server under which the resources
+ * should be hosted.
+ * @param enableHttp whether to enable hosting using the http scheme.
+ * @param enableHttps whether to enable hosting using the https scheme.
+ * @return prefixes under which the resources are hosted.
+ */
+ public AssetHostingDetails hostResources(final String domain,
+ final String virtualResourcesPath, boolean enableHttp,
+ boolean enableHttps) {
+ if (virtualResourcesPath.indexOf('*') != -1) {
+ throw new IllegalArgumentException(
+ "virtualResourcesPath cannot contain the '*' character.");
+ }
+
+ Uri.Builder uriBuilder = new Uri.Builder();
+ uriBuilder.scheme(httpScheme);
+ uriBuilder.authority(domain);
+ uriBuilder.path(virtualResourcesPath);
+
+ Uri httpPrefix = null;
+ Uri httpsPrefix = null;
+
+ PathHandler handler = new PathHandler() {
+ @Override
+ public InputStream handle(Uri url) {
+ InputStream stream = protocolHandler.openResource(url);
+ String mimeType = null;
+ try {
+ mimeType = URLConnection.guessContentTypeFromStream(stream);
+ } catch (Exception ex) {
+ Log.e(TAG, "Unable to get mime type" + url);
+ }
+
+ return stream;
+ }
+ };
+
+ if (enableHttp) {
+ httpPrefix = uriBuilder.build();
+ register(Uri.withAppendedPath(httpPrefix, "**"), handler);
+ }
+ if (enableHttps) {
+ uriBuilder.scheme(httpsScheme);
+ httpsPrefix = uriBuilder.build();
+ register(Uri.withAppendedPath(httpsPrefix, "**"), handler);
+ }
+ return new AssetHostingDetails(httpPrefix, httpsPrefix);
+ }
+
+
+ /**
+ * Hosts the application's files on an http(s):// URL. Files from the basePath
+ * basePath/... will be available under
+ * http(s)://{uuid}.androidplatform.net/....
+ *
+ * @param basePath the local path in the application's data folder which will be made
+ * available by the server (for example "/www").
+ */
+ public void hostFiles(final String basePath) {
+ this.isAsset = false;
+ this.basePath = basePath;
+ createHostingDetails();
+ }
+
+ /**
+ * The KitKat WebView reads the InputStream on a separate threadpool. We can use that to
+ * parallelize loading.
+ */
+ private static abstract class LazyInputStream extends InputStream {
+ protected final PathHandler handler;
+ private InputStream is = null;
+
+ public LazyInputStream(PathHandler handler) {
+ this.handler = handler;
+ }
+
+ private InputStream getInputStream() {
+ if (is == null) {
+ is = handle();
+ }
+ return is;
+ }
+
+ protected abstract InputStream handle();
+
+ @Override
+ public int available() throws IOException {
+ InputStream is = getInputStream();
+ return (is != null) ? is.available() : 0;
+ }
+
+ @Override
+ public int read() throws IOException {
+ InputStream is = getInputStream();
+ return (is != null) ? is.read() : -1;
+ }
+
+ @Override
+ public int read(byte b[]) throws IOException {
+ InputStream is = getInputStream();
+ return (is != null) ? is.read(b) : -1;
+ }
+
+ @Override
+ public int read(byte b[], int off, int len) throws IOException {
+ InputStream is = getInputStream();
+ return (is != null) ? is.read(b, off, len) : -1;
+ }
+
+ @Override
+ public long skip(long n) throws IOException {
+ InputStream is = getInputStream();
+ return (is != null) ? is.skip(n) : 0;
+ }
+ }
+
+ // For L and above.
+ private static class LollipopLazyInputStream extends LazyInputStream {
+ private Uri uri;
+ private InputStream is;
+
+ public LollipopLazyInputStream(PathHandler handler, Uri uri) {
+ super(handler);
+ this.uri = uri;
+ }
+
+ @Override
+ protected InputStream handle() {
+ return handler.handle(uri);
+ }
+ }
+
+ public String getBasePath(){
+ return this.basePath;
+ }
+}
diff --git a/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKProcessPoolFactory.h b/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKProcessPoolFactory.h
new file mode 100644
index 0000000..f4f8816
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKProcessPoolFactory.h
@@ -0,0 +1,27 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import
+
+@interface CDVWKProcessPoolFactory : NSObject
+@property (nonatomic, retain) WKProcessPool* sharedPool;
+
++(instancetype) sharedFactory;
+-(WKProcessPool*) sharedProcessPool;
+@end
diff --git a/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKProcessPoolFactory.m b/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKProcessPoolFactory.m
new file mode 100644
index 0000000..48ac09e
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKProcessPoolFactory.m
@@ -0,0 +1,49 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import
+#import
+#import "CDVWKProcessPoolFactory.h"
+
+static CDVWKProcessPoolFactory *factory = nil;
+
+@implementation CDVWKProcessPoolFactory
+
++ (instancetype)sharedFactory
+{
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ factory = [[CDVWKProcessPoolFactory alloc] init];
+ });
+
+ return factory;
+}
+
+- (instancetype)init
+{
+ if (self = [super init]) {
+ _sharedPool = [[WKProcessPool alloc] init];
+ }
+ return self;
+}
+
+- (WKProcessPool*) sharedProcessPool {
+ return _sharedPool;
+}
+@end
diff --git a/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKWebViewEngine.h b/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKWebViewEngine.h
new file mode 100644
index 0000000..9dd7b24
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKWebViewEngine.h
@@ -0,0 +1,31 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import
+#import
+
+@interface CDVWKWebViewEngine : CDVPlugin
+
+@property (nonatomic, strong, readonly) id uiDelegate;
+@property (nonatomic, strong) NSString * basePath;
+
+-(void)setServerBasePath:(CDVInvokedUrlCommand*)command;
+-(void)getServerBasePath:(CDVInvokedUrlCommand*)command;
+
+@end
diff --git a/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKWebViewEngine.m b/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKWebViewEngine.m
new file mode 100644
index 0000000..d6b2408
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKWebViewEngine.m
@@ -0,0 +1,825 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import
+#import
+#import
+#import
+#import
+
+#import "CDVWKWebViewEngine.h"
+#import "CDVWKWebViewUIDelegate.h"
+#import "CDVWKProcessPoolFactory.h"
+#import "IONAssetHandler.h"
+
+#define CDV_BRIDGE_NAME @"cordova"
+#define CDV_IONIC_STOP_SCROLL @"stopScroll"
+#define CDV_SERVER_PATH @"serverBasePath"
+#define LAST_BINARY_VERSION_CODE @"lastBinaryVersionCode"
+#define LAST_BINARY_VERSION_NAME @"lastBinaryVersionName"
+
+@implementation UIScrollView (BugIOS11)
+
++ (void)load {
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ Class class = [self class];
+ SEL originalSelector = @selector(init);
+ SEL swizzledSelector = @selector(xxx_init);
+
+ Method originalMethod = class_getInstanceMethod(class, originalSelector);
+ Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector);
+
+ BOOL didAddMethod =
+ class_addMethod(class,
+ originalSelector,
+ method_getImplementation(swizzledMethod),
+ method_getTypeEncoding(swizzledMethod));
+
+ if (didAddMethod) {
+ class_replaceMethod(class,
+ swizzledSelector,
+ method_getImplementation(originalMethod),
+ method_getTypeEncoding(originalMethod));
+ } else {
+ method_exchangeImplementations(originalMethod, swizzledMethod);
+ }
+ });
+}
+
+#pragma mark - Method Swizzling
+
+- (id)xxx_init {
+ id a = [self xxx_init];
+ NSArray *stack = [NSThread callStackSymbols];
+ for(NSString *trace in stack) {
+ if([trace containsString:@"WebKit"]) {
+ [a setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
+ break;
+ }
+ }
+ return a;
+}
+
+@end
+
+
+@interface CDVWKWeakScriptMessageHandler : NSObject
+
+@property (nonatomic, weak, readonly) idscriptMessageHandler;
+
+- (instancetype)initWithScriptMessageHandler:(id)scriptMessageHandler;
+
+@end
+
+
+@interface CDVWKWebViewEngine ()
+
+@property (nonatomic, strong, readwrite) UIView* engineWebView;
+@property (nonatomic, strong, readwrite) id uiDelegate;
+@property (nonatomic, weak) id weakScriptMessageHandler;
+@property (nonatomic, readwrite) CGRect frame;
+@property (nonatomic, strong) NSString *userAgentCreds;
+@property (nonatomic, strong) IONAssetHandler * handler;
+
+@property (nonatomic, readwrite) NSString *CDV_LOCAL_SERVER;
+@end
+
+// expose private configuration value required for background operation
+@interface WKWebViewConfiguration ()
+
+@end
+
+
+// see forwardingTargetForSelector: selector comment for the reason for this pragma
+#pragma clang diagnostic ignored "-Wprotocol"
+
+@implementation CDVWKWebViewEngine
+
+@synthesize engineWebView = _engineWebView;
+
+- (instancetype)initWithFrame:(CGRect)frame
+{
+ self = [super init];
+ if (self) {
+ if (NSClassFromString(@"WKWebView") == nil) {
+ return nil;
+ }
+ // add to keyWindow to ensure it is 'active'
+ [UIApplication.sharedApplication.keyWindow addSubview:self.engineWebView];
+
+ self.frame = frame;
+ }
+ return self;
+}
+
+-(NSString *) getStartPath {
+ NSString * wwwPath = [[NSBundle mainBundle] pathForResource:@"www" ofType: nil];
+
+ NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
+ NSString * persistedPath = [userDefaults objectForKey:CDV_SERVER_PATH];
+ if (![self isDeployDisabled] && ![self isNewBinary] && persistedPath && ![persistedPath isEqualToString:@""]) {
+ NSString *libPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0];
+ NSString * cordovaDataDirectory = [libPath stringByAppendingPathComponent:@"NoCloud"];
+ NSString * snapshots = [cordovaDataDirectory stringByAppendingPathComponent:@"ionic_built_snapshots"];
+ wwwPath = [snapshots stringByAppendingPathComponent:[persistedPath lastPathComponent]];
+ }
+ self.basePath = wwwPath;
+ return wwwPath;
+}
+
+-(BOOL) isNewBinary
+{
+ NSString * versionCode = [[NSBundle mainBundle] infoDictionary][@"CFBundleVersion"];
+ NSString * versionName = [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"];
+ NSUserDefaults * prefs = [NSUserDefaults standardUserDefaults];
+ NSString * lastVersionCode = [prefs stringForKey:LAST_BINARY_VERSION_CODE];
+ NSString * lastVersionName = [prefs stringForKey:LAST_BINARY_VERSION_NAME];
+ if (![versionCode isEqualToString:lastVersionCode] || ![versionName isEqualToString:lastVersionName]) {
+ [prefs setObject:versionCode forKey:LAST_BINARY_VERSION_CODE];
+ [prefs setObject:versionName forKey:LAST_BINARY_VERSION_NAME];
+ [prefs setObject:@"" forKey:CDV_SERVER_PATH];
+ [prefs synchronize];
+ return YES;
+ }
+ return NO;
+}
+
+-(BOOL) isDeployDisabled {
+ return [[self.commandDelegate.settings objectForKey:[@"DisableDeploy" lowercaseString]] boolValue];
+}
+
+- (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)settings
+{
+ WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init];
+ configuration.processPool = [[CDVWKProcessPoolFactory sharedFactory] sharedProcessPool];
+ configuration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone;
+
+ if (settings == nil) {
+ return configuration;
+ }
+
+ if(![settings cordovaBoolSettingForKey:@"WKSuspendInBackground" defaultValue:YES]){
+ NSString* _BGStatus;
+ if (@available(iOS 12.2, *)) {
+ // do stuff for iOS 12.2 and newer
+ NSLog(@"iOS 12.2+ detected");
+ NSString* str = @"YWx3YXlzUnVuc0F0Rm9yZWdyb3VuZFByaW9yaXR5";
+ NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0];
+ _BGStatus = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
+ } else {
+ // do stuff for iOS 12.1 and older
+ NSLog(@"iOS Below 12.2 detected");
+ NSString* str = @"X2Fsd2F5c1J1bnNBdEZvcmVncm91bmRQcmlvcml0eQ==";
+ NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0];
+ _BGStatus = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
+ }
+ [configuration setValue:[NSNumber numberWithBool:YES]
+ forKey:_BGStatus];
+ }
+ NSString *userAgent = configuration.applicationNameForUserAgent;
+ if (
+ [settings cordovaSettingForKey:@"OverrideUserAgent"] == nil &&
+ [settings cordovaSettingForKey:@"AppendUserAgent"] != nil
+ ) {
+ userAgent = [NSString stringWithFormat:@"%@ %@", userAgent, [settings cordovaSettingForKey:@"AppendUserAgent"]];
+ }
+ configuration.applicationNameForUserAgent = userAgent;
+ configuration.allowsInlineMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowInlineMediaPlayback" defaultValue:YES];
+ configuration.suppressesIncrementalRendering = [settings cordovaBoolSettingForKey:@"SuppressesIncrementalRendering" defaultValue:NO];
+ configuration.allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
+ return configuration;
+}
+
+- (void)pluginInitialize
+{
+ // viewController would be available now. we attempt to set all possible delegates to it, by default
+ NSDictionary* settings = self.commandDelegate.settings;
+ NSString *bind = [settings cordovaSettingForKey:@"Hostname"];
+ if(bind == nil){
+ bind = @"localhost";
+ }
+ NSString *scheme = [settings cordovaSettingForKey:@"iosScheme"];
+ if(scheme == nil || [scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [scheme isEqualToString:@"file"]){
+ scheme = @"ionic";
+ }
+ self.CDV_LOCAL_SERVER = [NSString stringWithFormat:@"%@://%@", scheme, bind];
+
+ self.uiDelegate = [[CDVWKWebViewUIDelegate alloc] initWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]];
+
+ CDVWKWeakScriptMessageHandler *weakScriptMessageHandler = [[CDVWKWeakScriptMessageHandler alloc] initWithScriptMessageHandler:self];
+
+ WKUserContentController* userContentController = [[WKUserContentController alloc] init];
+ [userContentController addScriptMessageHandler:weakScriptMessageHandler name:CDV_BRIDGE_NAME];
+ [userContentController addScriptMessageHandler:weakScriptMessageHandler name:CDV_IONIC_STOP_SCROLL];
+
+ // Inject XHR Polyfill
+ NSLog(@"CDVWKWebViewEngine: trying to inject XHR polyfill");
+ WKUserScript *wkScript = [self wkPluginScript];
+ if (wkScript) {
+ [userContentController addUserScript:wkScript];
+ }
+
+ WKUserScript *configScript = [self configScript];
+ if (configScript) {
+ [userContentController addUserScript:configScript];
+ }
+
+ BOOL autoCordova = [settings cordovaBoolSettingForKey:@"AutoInjectCordova" defaultValue:NO];
+ if (autoCordova){
+ NSLog(@"CDVWKWebViewEngine: trying to inject XHR polyfill");
+ WKUserScript *cordova = [self autoCordovify];
+ if (cordova) {
+ [userContentController addUserScript:cordova];
+ }
+ }
+
+ BOOL audioCanMix = [settings cordovaBoolSettingForKey:@"AudioCanMix" defaultValue:NO];
+ if (audioCanMix) {
+ [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord
+ withOptions:AVAudioSessionCategoryOptionMixWithOthers
+ error:nil];
+ }
+
+ WKWebViewConfiguration* configuration = [self createConfigurationFromSettings:settings];
+ configuration.userContentController = userContentController;
+
+ self.handler = [[IONAssetHandler alloc] initWithBasePath:[self getStartPath] andScheme:scheme];
+ [configuration setURLSchemeHandler:self.handler forURLScheme:scheme];
+
+ // re-create WKWebView, since we need to update configuration
+ // remove from keyWindow before recreating
+ [self.engineWebView removeFromSuperview];
+ WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:self.frame configuration:configuration];
+
+ [wkWebView.scrollView setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
+
+ wkWebView.UIDelegate = self.uiDelegate;
+ self.engineWebView = wkWebView;
+ // add to keyWindow to ensure it is 'active'
+ [UIApplication.sharedApplication.keyWindow addSubview:self.engineWebView];
+
+ NSString * overrideUserAgent = [settings cordovaSettingForKey:@"OverrideUserAgent"];
+ if (overrideUserAgent != nil) {
+ wkWebView.customUserAgent = overrideUserAgent;
+ }
+
+ if ([self.viewController conformsToProtocol:@protocol(WKUIDelegate)]) {
+ wkWebView.UIDelegate = (id )self.viewController;
+ }
+
+ if ([self.viewController conformsToProtocol:@protocol(WKNavigationDelegate)]) {
+ wkWebView.navigationDelegate = (id )self.viewController;
+ } else {
+ wkWebView.navigationDelegate = (id )self;
+ }
+
+ if ([self.viewController conformsToProtocol:@protocol(WKScriptMessageHandler)]) {
+ [wkWebView.configuration.userContentController addScriptMessageHandler:(id < WKScriptMessageHandler >)self.viewController name:CDV_BRIDGE_NAME];
+ }
+
+ [self keyboardDisplayDoesNotRequireUserAction];
+
+ if ([settings cordovaBoolSettingForKey:@"KeyboardAppearanceDark" defaultValue:NO]) {
+ [self setKeyboardAppearanceDark];
+ }
+
+ [self updateSettings:settings];
+
+ // check if content thread has died on resume
+ NSLog(@"%@", @"CDVWKWebViewEngine will reload WKWebView if required on resume");
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(onAppWillEnterForeground:)
+ name:UIApplicationWillEnterForegroundNotification object:nil];
+
+ // If less than ios 13.4
+ if (@available(iOS 13.4, *)) {} else {
+ // For keyboard dismissal leaving viewport shifted (can potentially be removed when apple releases the fix for the issue discussed here: https://github.com/apache/cordova-ios/issues/417#issuecomment-423340885)
+ // Apple has released a fix in 13.4, but not in 12.x (as of 12.4.6)
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(keyboardWillHide)
+ name:UIKeyboardWillHideNotification object:nil];
+ }
+
+ NSLog(@"Using Ionic WKWebView");
+
+}
+
+// https://github.com/Telerik-Verified-Plugins/WKWebView/commit/04e8296adeb61f289f9c698045c19b62d080c7e3#L609-L620
+- (void) keyboardDisplayDoesNotRequireUserAction {
+ Class class = NSClassFromString(@"WKContentView");
+ NSOperatingSystemVersion iOS_11_3_0 = (NSOperatingSystemVersion){11, 3, 0};
+ NSOperatingSystemVersion iOS_12_2_0 = (NSOperatingSystemVersion){12, 2, 0};
+ NSOperatingSystemVersion iOS_13_0_0 = (NSOperatingSystemVersion){13, 0, 0};
+ char * methodSignature = "_startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:";
+
+ if ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion: iOS_13_0_0]) {
+ methodSignature = "_elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:";
+ } else if ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion: iOS_12_2_0]) {
+ methodSignature = "_elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:";
+ }
+
+ if ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion: iOS_11_3_0]) {
+ SEL selector = sel_getUid(methodSignature);
+ Method method = class_getInstanceMethod(class, selector);
+ IMP original = method_getImplementation(method);
+ IMP override = imp_implementationWithBlock(^void(id me, void* arg0, BOOL arg1, BOOL arg2, BOOL arg3, id arg4) {
+ ((void (*)(id, SEL, void*, BOOL, BOOL, BOOL, id))original)(me, selector, arg0, TRUE, arg2, arg3, arg4);
+ });
+ method_setImplementation(method, override);
+ } else {
+ SEL selector = sel_getUid("_startAssistingNode:userIsInteracting:blurPreviousNode:userObject:");
+ Method method = class_getInstanceMethod(class, selector);
+ IMP original = method_getImplementation(method);
+ IMP override = imp_implementationWithBlock(^void(id me, void* arg0, BOOL arg1, BOOL arg2, id arg3) {
+ ((void (*)(id, SEL, void*, BOOL, BOOL, id))original)(me, selector, arg0, TRUE, arg2, arg3);
+ });
+ method_setImplementation(method, override);
+ }
+}
+
+- (void)setKeyboardAppearanceDark
+{
+ IMP darkImp = imp_implementationWithBlock(^(id _s) {
+ return UIKeyboardAppearanceDark;
+ });
+ for (NSString* classString in @[@"WKContentView", @"UITextInputTraits"]) {
+ Class c = NSClassFromString(classString);
+ Method m = class_getInstanceMethod(c, @selector(keyboardAppearance));
+ if (m != NULL) {
+ method_setImplementation(m, darkImp);
+ } else {
+ class_addMethod(c, @selector(keyboardAppearance), darkImp, "l@:");
+ }
+ }
+}
+
+
+
+- (void)onAppWillEnterForeground:(NSNotification *)notification {
+ if ([self shouldReloadWebView]) {
+ NSLog(@"%@", @"CDVWKWebViewEngine reloading!");
+ [(WKWebView*)_engineWebView reload];
+ }
+}
+
+
+-(void)keyboardWillHide
+{
+ // For keyboard dismissal leaving viewport shifted (can potentially be removed when apple releases the fix for the issue discussed here: https://github.com/apache/cordova-ios/issues/417#issuecomment-423340885)
+ UIScrollView * scrollView = self.webView.scrollView;
+ // Calculate some vars for convenience
+ CGFloat contentLengthWithInsets = scrollView.contentSize.height + scrollView.adjustedContentInset.top + scrollView.adjustedContentInset.bottom;
+ CGFloat contentOffsetY = scrollView.contentOffset.y;
+ CGFloat screenHeight = scrollView.frame.size.height;
+ CGFloat maxAllowedOffsetY = fmax(contentLengthWithInsets - screenHeight, 0); // 0 is for the case where content is shorter than screen
+
+ // If the keyboard allowed the user to get to an offset beyond the max
+ if (contentOffsetY > maxAllowedOffsetY) {
+ // Reset the scroll to the max allowed so that there is no additional empty white space at the bottom where the keyboard occupied!
+ CGPoint bottomOfPage = CGPointMake(scrollView.contentOffset.x, maxAllowedOffsetY);
+ [scrollView setContentOffset:bottomOfPage];
+ }
+}
+
+- (BOOL)shouldReloadWebView
+{
+ WKWebView* wkWebView = (WKWebView*)_engineWebView;
+ return [self shouldReloadWebView:wkWebView.URL title:wkWebView.title];
+}
+
+- (BOOL)shouldReloadWebView:(NSURL *)location title:(NSString*)title
+{
+ BOOL title_is_nil = (title == nil);
+ BOOL location_is_blank = [[location absoluteString] isEqualToString:@"about:blank"];
+
+ BOOL reload = (title_is_nil || location_is_blank);
+
+#ifdef DEBUG
+ NSLog(@"%@", @"CDVWKWebViewEngine shouldReloadWebView::");
+ NSLog(@"CDVWKWebViewEngine shouldReloadWebView title: %@", title);
+ NSLog(@"CDVWKWebViewEngine shouldReloadWebView location: %@", [location absoluteString]);
+ NSLog(@"CDVWKWebViewEngine shouldReloadWebView reload: %u", reload);
+#endif
+
+ return reload;
+}
+
+
+- (id)loadRequest:(NSURLRequest *)request
+{
+ if (request.URL.fileURL) {
+ NSURL* startURL = [NSURL URLWithString:((CDVViewController *)self.viewController).startPage];
+ NSString* startFilePath = [self.commandDelegate pathForResource:[startURL path]];
+ NSURL *url = [[NSURL URLWithString:self.CDV_LOCAL_SERVER] URLByAppendingPathComponent:request.URL.path];
+ if ([request.URL.path isEqualToString:startFilePath]) {
+ url = [NSURL URLWithString:self.CDV_LOCAL_SERVER];
+ }
+ if(request.URL.query) {
+ url = [NSURL URLWithString:[@"?" stringByAppendingString:request.URL.query] relativeToURL:url];
+ }
+ if(request.URL.fragment) {
+ url = [NSURL URLWithString:[@"#" stringByAppendingString:request.URL.fragment] relativeToURL:url];
+ }
+ request = [NSURLRequest requestWithURL:url];
+ }
+ return [(WKWebView*)_engineWebView loadRequest:request];
+}
+
+- (id)loadHTMLString:(NSString *)string baseURL:(NSURL*)baseURL
+{
+ return [(WKWebView*)_engineWebView loadHTMLString:string baseURL:baseURL];
+}
+
+- (NSURL*) URL
+{
+ return [(WKWebView*)_engineWebView URL];
+}
+
+- (BOOL)canLoadRequest:(NSURLRequest *)request
+{
+ return TRUE;
+}
+
+- (void)updateSettings:(NSDictionary *)settings
+{
+ WKWebView* wkWebView = (WKWebView *)_engineWebView;
+
+ // By default, DisallowOverscroll is false (thus bounce is allowed)
+ BOOL bounceAllowed = !([settings cordovaBoolSettingForKey:@"DisallowOverscroll" defaultValue:NO]);
+
+ // prevent webView from bouncing
+ if (!bounceAllowed) {
+ if ([wkWebView respondsToSelector:@selector(scrollView)]) {
+ ((UIScrollView*)[wkWebView scrollView]).bounces = NO;
+ } else {
+ for (id subview in wkWebView.subviews) {
+ if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {
+ ((UIScrollView*)subview).bounces = NO;
+ }
+ }
+ }
+ }
+
+ wkWebView.configuration.preferences.minimumFontSize = [settings cordovaFloatSettingForKey:@"MinimumFontSize" defaultValue:0.0];
+ wkWebView.allowsLinkPreview = [settings cordovaBoolSettingForKey:@"AllowLinkPreview" defaultValue:NO];
+ wkWebView.scrollView.scrollEnabled = [settings cordovaBoolSettingForKey:@"ScrollEnabled" defaultValue:NO];
+ wkWebView.allowsBackForwardNavigationGestures = [settings cordovaBoolSettingForKey:@"AllowBackForwardNavigationGestures" defaultValue:NO];
+}
+
+- (void)updateWithInfo:(NSDictionary *)info
+{
+ NSDictionary* scriptMessageHandlers = [info objectForKey:kCDVWebViewEngineScriptMessageHandlers];
+ NSDictionary* settings = [info objectForKey:kCDVWebViewEngineWebViewPreferences];
+ id navigationDelegate = [info objectForKey:kCDVWebViewEngineWKNavigationDelegate];
+ id uiDelegate = [info objectForKey:kCDVWebViewEngineWKUIDelegate];
+
+ WKWebView* wkWebView = (WKWebView*)_engineWebView;
+
+ if (scriptMessageHandlers && [scriptMessageHandlers isKindOfClass:[NSDictionary class]]) {
+ NSArray* allKeys = [scriptMessageHandlers allKeys];
+
+ for (NSString* key in allKeys) {
+ id object = [scriptMessageHandlers objectForKey:key];
+ if ([object conformsToProtocol:@protocol(WKScriptMessageHandler)]) {
+ [wkWebView.configuration.userContentController addScriptMessageHandler:object name:key];
+ }
+ }
+ }
+
+ if (navigationDelegate && [navigationDelegate conformsToProtocol:@protocol(WKNavigationDelegate)]) {
+ wkWebView.navigationDelegate = navigationDelegate;
+ }
+
+ if (uiDelegate && [uiDelegate conformsToProtocol:@protocol(WKUIDelegate)]) {
+ wkWebView.UIDelegate = uiDelegate;
+ }
+
+ if (settings && [settings isKindOfClass:[NSDictionary class]]) {
+ [self updateSettings:settings];
+ }
+}
+
+// This forwards the methods that are in the header that are not implemented here.
+// loadHTMLString:baseURL:
+// loadRequest:
+- (id)forwardingTargetForSelector:(SEL)aSelector
+{
+ return _engineWebView;
+}
+
+- (UIView *)webView
+{
+ return self.engineWebView;
+}
+
+- (WKUserScript *)wkPluginScript
+{
+ NSString *scriptFile = [[NSBundle mainBundle] pathForResource:@"www/wk-plugin" ofType:@"js"];
+ if (scriptFile == nil) {
+ NSLog(@"CDVWKWebViewEngine: WK plugin was not found");
+ return nil;
+ }
+ NSError *error = nil;
+ NSString *source = [NSString stringWithContentsOfFile:scriptFile encoding:NSUTF8StringEncoding error:&error];
+ if (source == nil || error != nil) {
+ NSLog(@"CDVWKWebViewEngine: WK plugin can not be loaded: %@", error);
+ return nil;
+ }
+ source = [source stringByAppendingString:[NSString stringWithFormat:@"window.WEBVIEW_SERVER_URL = '%@';", self.CDV_LOCAL_SERVER]];
+
+ return [[WKUserScript alloc] initWithSource:source
+ injectionTime:WKUserScriptInjectionTimeAtDocumentStart
+ forMainFrameOnly:YES];
+}
+
+- (WKUserScript *)configScript
+{
+ Class keyboard = NSClassFromString(@"CDVIonicKeyboard");
+ BOOL keyboardPlugin = keyboard != nil;
+ if(!keyboardPlugin) {
+ return nil;
+ }
+
+ BOOL keyboardResizes = [self.commandDelegate.settings cordovaBoolSettingForKey:@"KeyboardResize" defaultValue:YES];
+ NSString *source = [NSString stringWithFormat:
+ @"window.Ionic = window.Ionic || {};"
+ @"window.Ionic.keyboardPlugin=true;"
+ @"window.Ionic.keyboardResizes=%@",
+ keyboardResizes ? @"true" : @"false"];
+
+ return [[WKUserScript alloc] initWithSource:source
+ injectionTime:WKUserScriptInjectionTimeAtDocumentStart
+ forMainFrameOnly:YES];
+}
+
+- (WKUserScript *)autoCordovify
+{
+ NSURL *cordovaURL = [[NSBundle mainBundle] URLForResource:@"www/cordova" withExtension:@"js"];
+ if (cordovaURL == nil) {
+ NSLog(@"CDVWKWebViewEngine: cordova.js WAS NOT FOUND");
+ return nil;
+ }
+ NSError *error = nil;
+ NSString *source = [NSString stringWithContentsOfURL:cordovaURL encoding:NSUTF8StringEncoding error:&error];
+ if (source == nil || error != nil) {
+ NSLog(@"CDVWKWebViewEngine: cordova.js can not be loaded: %@", error);
+ return nil;
+ }
+ NSLog(@"CDVWKWebViewEngine: auto injecting cordova");
+ NSString *cordovaPath = [self.CDV_LOCAL_SERVER stringByAppendingString:cordovaURL.URLByDeletingLastPathComponent.path];
+ NSString *replacement = [NSString stringWithFormat:@"var pathPrefix = '%@/';", cordovaPath];
+ source = [source stringByReplacingOccurrencesOfString:@"var pathPrefix = findCordovaPath();" withString:replacement];
+
+ return [[WKUserScript alloc] initWithSource:source
+ injectionTime:WKUserScriptInjectionTimeAtDocumentStart
+ forMainFrameOnly:YES];
+}
+
+#pragma mark WKScriptMessageHandler implementation
+
+- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
+{
+ if ([message.name isEqualToString:CDV_BRIDGE_NAME]) {
+ [self handleCordovaMessage: message];
+ } else if ([message.name isEqualToString:CDV_IONIC_STOP_SCROLL]) {
+ [self handleStopScroll];
+ }
+}
+
+- (void)handleCordovaMessage:(WKScriptMessage*)message
+{
+ CDVViewController *vc = (CDVViewController*)self.viewController;
+
+ NSArray *jsonEntry = message.body; // NSString:callbackId, NSString:service, NSString:action, NSArray:args
+ CDVInvokedUrlCommand* command = [CDVInvokedUrlCommand commandFromJson:jsonEntry];
+ CDV_EXEC_LOG(@"Exec(%@): Calling %@.%@", command.callbackId, command.className, command.methodName);
+
+ if (![vc.commandQueue execute:command]) {
+#ifdef DEBUG
+ NSError* error = nil;
+ NSString* commandJson = nil;
+ NSData* jsonData = [NSJSONSerialization dataWithJSONObject:jsonEntry
+ options:0
+ error:&error];
+
+ if (error == nil) {
+ commandJson = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+ }
+
+ static NSUInteger maxLogLength = 1024;
+ NSString* commandString = ([commandJson length] > maxLogLength) ?
+ [NSString stringWithFormat : @"%@[...]", [commandJson substringToIndex:maxLogLength]] :
+ commandJson;
+
+ NSLog(@"FAILED pluginJSON = %@", commandString);
+#endif
+ }
+}
+
+- (void)handleStopScroll
+{
+ WKWebView* wkWebView = (WKWebView*)_engineWebView;
+ NSLog(@"CDVWKWebViewEngine: handleStopScroll");
+ [self recursiveStopScroll:[wkWebView scrollView]];
+ [wkWebView evaluateJavaScript:@"window.IonicStopScroll.fire()" completionHandler:nil];
+}
+
+- (void)recursiveStopScroll:(UIView *)node
+{
+ if([node isKindOfClass: [UIScrollView class]]) {
+ UIScrollView *nodeAsScroll = (UIScrollView *)node;
+
+ if([nodeAsScroll isScrollEnabled] && ![nodeAsScroll isHidden]) {
+ [nodeAsScroll setScrollEnabled: NO];
+ [nodeAsScroll setScrollEnabled: YES];
+ }
+ }
+
+ // iterate tree recursivelly
+ for (UIView *child in [node subviews]) {
+ [self recursiveStopScroll:child];
+ }
+}
+
+
+#pragma mark WKNavigationDelegate implementation
+
+- (void)webView:(WKWebView*)webView didStartProvisionalNavigation:(WKNavigation*)navigation
+{
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginResetNotification object:webView]];
+}
+
+- (void)webView:(WKWebView*)webView didFinishNavigation:(WKNavigation*)navigation
+{
+ #ifndef __CORDOVA_6_0_0
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+ [CDVUserAgentUtil releaseLock:vc.userAgentLockToken];
+ #endif
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification object:webView]];
+}
+
+- (void)webView:(WKWebView*)theWebView didFailProvisionalNavigation:(WKNavigation*)navigation withError:(NSError*)error
+{
+ [self webView:theWebView didFailNavigation:navigation withError:error];
+}
+
+- (void)webView:(WKWebView*)theWebView didFailNavigation:(WKNavigation*)navigation withError:(NSError*)error
+{
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+ #ifndef __CORDOVA_6_0_0
+ [CDVUserAgentUtil releaseLock:vc.userAgentLockToken];
+ #endif
+
+ NSString* message = [NSString stringWithFormat:@"Failed to load webpage with error: %@", [error localizedDescription]];
+ NSLog(@"%@", message);
+
+ NSURL* errorUrl = vc.errorURL;
+ if (errorUrl) {
+ NSCharacterSet *charSet = [NSCharacterSet URLFragmentAllowedCharacterSet];
+ errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEncodingWithAllowedCharacters:charSet]] relativeToURL:errorUrl];
+ NSLog(@"%@", [errorUrl absoluteString]);
+ [theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]];
+ }
+#ifdef DEBUG
+ UIAlertController *alertController = [UIAlertController alertControllerWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"] message:message preferredStyle:UIAlertControllerStyleAlert];
+ [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:nil]];
+ [vc presentViewController:alertController animated:YES completion:nil];
+#endif
+}
+
+- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView
+{
+ [webView reload];
+}
+
+- (BOOL)defaultResourcePolicyForURL:(NSURL*)url
+{
+ // all file:// urls are allowed
+ if ([url isFileURL]) {
+ return YES;
+ }
+
+ return NO;
+}
+
+- (void) webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction*)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
+{
+ NSURL* url = [navigationAction.request URL];
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+
+ /*
+ * Give plugins the chance to handle the url
+ */
+ BOOL anyPluginsResponded = NO;
+ BOOL shouldAllowRequest = NO;
+
+ for (NSString* pluginName in vc.pluginObjects) {
+ CDVPlugin* plugin = [vc.pluginObjects objectForKey:pluginName];
+ SEL selector = NSSelectorFromString(@"shouldOverrideLoadWithRequest:navigationType:");
+ if ([plugin respondsToSelector:selector]) {
+ anyPluginsResponded = YES;
+ // https://issues.apache.org/jira/browse/CB-12497
+ int navType = (int)navigationAction.navigationType;
+ if (WKNavigationTypeOther == navigationAction.navigationType) {
+ #ifdef __CORDOVA_6_0_0
+ navType = -1;
+ #else
+ navType = 5;
+ #endif
+ }
+ shouldAllowRequest = (((BOOL (*)(id, SEL, id, int))objc_msgSend)(plugin, selector, navigationAction.request, navType));
+ if (!shouldAllowRequest) {
+ break;
+ }
+ }
+ }
+
+ if (!anyPluginsResponded) {
+ /*
+ * Handle all other types of urls (tel:, sms:), and requests to load a url in the main webview.
+ */
+ shouldAllowRequest = [self defaultResourcePolicyForURL:url];
+ if (!shouldAllowRequest) {
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
+ }
+ }
+
+ if (shouldAllowRequest) {
+ NSString *scheme = url.scheme;
+ if ([scheme isEqualToString:@"tel"] ||
+ [scheme isEqualToString:@"mailto"] ||
+ [scheme isEqualToString:@"facetime"] ||
+ [scheme isEqualToString:@"sms"] ||
+ [scheme isEqualToString:@"maps"]) {
+ [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
+ decisionHandler(WKNavigationActionPolicyCancel);
+ } else {
+ decisionHandler(WKNavigationActionPolicyAllow);
+ }
+ } else {
+ decisionHandler(WKNavigationActionPolicyCancel);
+ }
+}
+
+-(void)getServerBasePath:(CDVInvokedUrlCommand*)command
+{
+ [self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:self.basePath] callbackId:command.callbackId];
+}
+
+-(void)setServerBasePath:(CDVInvokedUrlCommand*)command
+{
+ NSString * path = [command argumentAtIndex:0];
+ self.basePath = path;
+ [self.handler setAssetPath:path];
+
+ NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.CDV_LOCAL_SERVER]];
+ [(WKWebView*)_engineWebView loadRequest:request];
+}
+
+-(void)persistServerBasePath:(CDVInvokedUrlCommand*)command
+{
+ NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
+ [userDefaults setObject:[self.basePath lastPathComponent] forKey:CDV_SERVER_PATH];
+ [userDefaults synchronize];
+}
+
+@end
+
+#pragma mark - CDVWKWeakScriptMessageHandler
+
+@implementation CDVWKWeakScriptMessageHandler
+
+- (instancetype)initWithScriptMessageHandler:(id)scriptMessageHandler
+{
+ self = [super init];
+ if (self) {
+ _scriptMessageHandler = scriptMessageHandler;
+ }
+ return self;
+}
+
+- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
+{
+ [self.scriptMessageHandler userContentController:userContentController didReceiveScriptMessage:message];
+}
+
+@end
diff --git a/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKWebViewUIDelegate.h b/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKWebViewUIDelegate.h
new file mode 100644
index 0000000..33a179b
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKWebViewUIDelegate.h
@@ -0,0 +1,28 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import
+
+@interface CDVWKWebViewUIDelegate : NSObject
+
+@property (nonatomic, copy) NSString* title;
+
+- (instancetype)initWithTitle:(NSString*)title;
+
+@end
diff --git a/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKWebViewUIDelegate.m b/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKWebViewUIDelegate.m
new file mode 100644
index 0000000..a7a16f2
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/ios/CDVWKWebViewUIDelegate.m
@@ -0,0 +1,123 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVWKWebViewUIDelegate.h"
+
+@implementation CDVWKWebViewUIDelegate
+
+- (instancetype)initWithTitle:(NSString*)title
+{
+ self = [super init];
+ if (self) {
+ self.title = title;
+ }
+
+ return self;
+}
+
+- (void) webView:(WKWebView*)webView runJavaScriptAlertPanelWithMessage:(NSString*)message
+ initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(void))completionHandler
+{
+ UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
+ message:message
+ preferredStyle:UIAlertControllerStyleAlert];
+
+ UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler();
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+
+ [alert addAction:ok];
+
+ UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
+
+ [rootController presentViewController:alert animated:YES completion:nil];
+}
+
+- (void) webView:(WKWebView*)webView runJavaScriptConfirmPanelWithMessage:(NSString*)message
+ initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(BOOL result))completionHandler
+{
+ UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
+ message:message
+ preferredStyle:UIAlertControllerStyleAlert];
+
+ UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler(YES);
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+
+ [alert addAction:ok];
+
+ UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler(NO);
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+ [alert addAction:cancel];
+
+ UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
+
+ [rootController presentViewController:alert animated:YES completion:nil];
+}
+
+- (void) webView:(WKWebView*)webView runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt
+ defaultText:(NSString*)defaultText initiatedByFrame:(WKFrameInfo*)frame
+ completionHandler:(void (^)(NSString* result))completionHandler
+{
+ UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
+ message:prompt
+ preferredStyle:UIAlertControllerStyleAlert];
+
+ UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler(((UITextField*)alert.textFields[0]).text);
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+
+ [alert addAction:ok];
+
+ UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
+ style:UIAlertActionStyleDefault
+ handler:^(UIAlertAction* action)
+ {
+ completionHandler(nil);
+ [alert dismissViewControllerAnimated:YES completion:nil];
+ }];
+ [alert addAction:cancel];
+
+ [alert addTextFieldWithConfigurationHandler:^(UITextField* textField) {
+ textField.text = defaultText;
+ }];
+
+ UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
+
+ [rootController presentViewController:alert animated:YES completion:nil];
+}
+
+@end
diff --git a/plugins/cordova-plugin-ionic-webview/src/ios/IONAssetHandler.h b/plugins/cordova-plugin-ionic-webview/src/ios/IONAssetHandler.h
new file mode 100644
index 0000000..aee8d1c
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/ios/IONAssetHandler.h
@@ -0,0 +1,13 @@
+#import
+#import
+
+@interface IONAssetHandler : NSObject
+
+@property (nonatomic, strong) NSString * basePath;
+@property (nonatomic, strong) NSString * scheme;
+
+-(void)setAssetPath:(NSString *)assetPath;
+- (instancetype)initWithBasePath:(NSString *)basePath andScheme:(NSString *)scheme;
+
+
+@end
diff --git a/plugins/cordova-plugin-ionic-webview/src/ios/IONAssetHandler.m b/plugins/cordova-plugin-ionic-webview/src/ios/IONAssetHandler.m
new file mode 100644
index 0000000..64cf5ec
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/ios/IONAssetHandler.m
@@ -0,0 +1,92 @@
+#import "IONAssetHandler.h"
+#import
+#import "CDVWKWebViewEngine.h"
+
+@implementation IONAssetHandler
+
+-(void)setAssetPath:(NSString *)assetPath {
+ self.basePath = assetPath;
+}
+
+- (instancetype)initWithBasePath:(NSString *)basePath andScheme:(NSString *)scheme {
+ self = [super init];
+ if (self) {
+ _basePath = basePath;
+ _scheme = scheme;
+ }
+ return self;
+}
+
+- (void)webView:(WKWebView *)webView startURLSchemeTask:(id )urlSchemeTask
+{
+ NSString * startPath = @"";
+ NSURL * url = urlSchemeTask.request.URL;
+ NSString * stringToLoad = url.path;
+ NSString * scheme = url.scheme;
+
+ if ([scheme isEqualToString:self.scheme]) {
+ if ([stringToLoad hasPrefix:@"/_app_file_"]) {
+ startPath = [stringToLoad stringByReplacingOccurrencesOfString:@"/_app_file_" withString:@""];
+ } else {
+ startPath = self.basePath ? self.basePath : @"";
+ if ([stringToLoad isEqualToString:@""] || [url.pathExtension isEqualToString:@""]) {
+ startPath = [startPath stringByAppendingString:@"/index.html"];
+ } else {
+ startPath = [startPath stringByAppendingString:stringToLoad];
+ }
+ }
+ }
+ NSError * fileError = nil;
+ NSData * data = nil;
+ if ([self isMediaExtension:url.pathExtension]) {
+ data = [NSData dataWithContentsOfFile:startPath options:NSDataReadingMappedIfSafe error:&fileError];
+ }
+ if (!data || fileError) {
+ data = [[NSData alloc] initWithContentsOfFile:startPath];
+ }
+ NSInteger statusCode = 200;
+ if (!data) {
+ statusCode = 404;
+ }
+ NSURL * localUrl = [NSURL URLWithString:url.absoluteString];
+ NSString * mimeType = [self getMimeType:url.pathExtension];
+ id response = nil;
+ if (data && [self isMediaExtension:url.pathExtension]) {
+ response = [[NSURLResponse alloc] initWithURL:localUrl MIMEType:mimeType expectedContentLength:data.length textEncodingName:nil];
+ } else {
+ NSDictionary * headers = @{ @"Content-Type" : mimeType, @"Cache-Control": @"no-cache"};
+ response = [[NSHTTPURLResponse alloc] initWithURL:localUrl statusCode:statusCode HTTPVersion:nil headerFields:headers];
+ }
+
+ [urlSchemeTask didReceiveResponse:response];
+ [urlSchemeTask didReceiveData:data];
+ [urlSchemeTask didFinish];
+
+}
+
+- (void)webView:(nonnull WKWebView *)webView stopURLSchemeTask:(nonnull id)urlSchemeTask
+{
+ NSLog(@"stop");
+}
+
+-(NSString *) getMimeType:(NSString *)fileExtension {
+ if (fileExtension && ![fileExtension isEqualToString:@""]) {
+ NSString *UTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)fileExtension, NULL);
+ NSString *contentType = (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)UTI, kUTTagClassMIMEType);
+ return contentType ? contentType : @"application/octet-stream";
+ } else {
+ return @"text/html";
+ }
+}
+
+-(BOOL) isMediaExtension:(NSString *) pathExtension {
+ NSArray * mediaExtensions = @[@"m4v", @"mov", @"mp4",
+ @"aac", @"ac3", @"aiff", @"au", @"flac", @"m4a", @"mp3", @"wav"];
+ if ([mediaExtensions containsObject:pathExtension.lowercaseString]) {
+ return YES;
+ }
+ return NO;
+}
+
+
+@end
diff --git a/plugins/cordova-plugin-ionic-webview/src/ios/LICENSE b/plugins/cordova-plugin-ionic-webview/src/ios/LICENSE
new file mode 100644
index 0000000..a73ffc9
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/ios/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2012 Niklas von Hertzen
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-ionic-webview/src/ios/wk-plugin.js b/plugins/cordova-plugin-ionic-webview/src/ios/wk-plugin.js
new file mode 100644
index 0000000..336ab8b
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/ios/wk-plugin.js
@@ -0,0 +1,51 @@
+
+(function _wk_plugin() {
+ // Check if we are running in WKWebView
+ if (!window.webkit || !window.webkit.messageHandlers) {
+ return;
+ }
+
+ // Initialize Ionic
+ window.Ionic = window.Ionic || {};
+
+ function normalizeURL(url) {
+ console.warn('normalizeURL is deprecated, use window.Ionic.WebView.convertFileSrc');
+ return window.Ionic.WebView.convertFileSrc(url);
+ }
+ if (typeof window.wkRewriteURL === 'undefined') {
+ window.wkRewriteURL = function (url) {
+ console.warn('wkRewriteURL is deprecated, use window.Ionic.WebView.convertFileSrc instead');
+ return window.Ionic.WebView.convertFileSrc(url);
+ }
+ }
+ window.Ionic.normalizeURL = normalizeURL;
+
+ var stopScrollHandler = window.webkit.messageHandlers.stopScroll;
+ if (!stopScrollHandler) {
+ console.error('Can not find stopScroll handler');
+ return;
+ }
+
+ var stopScrollFunc = null;
+ var stopScroll = {
+ stop: function stop(callback) {
+ if (!stopScrollFunc) {
+ stopScrollFunc = callback;
+ stopScrollHandler.postMessage('');
+ }
+ },
+ fire: function fire() {
+ stopScrollFunc && stopScrollFunc();
+ stopScrollFunc = null;
+ },
+ cancel: function cancel() {
+ stopScrollFunc = null;
+ }
+ };
+
+ window.Ionic.StopScroll = stopScroll;
+ // deprecated
+ window.IonicStopScroll = stopScroll;
+
+ console.debug("Ionic Stop Scroll injected!");
+})();
diff --git a/plugins/cordova-plugin-ionic-webview/src/www/ios/ios-wkwebview-exec.js b/plugins/cordova-plugin-ionic-webview/src/www/ios/ios-wkwebview-exec.js
new file mode 100644
index 0000000..331fe93
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/www/ios/ios-wkwebview-exec.js
@@ -0,0 +1,174 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/**
+ * Creates the exec bridge used to notify the native code of
+ * commands.
+ */
+var cordova = require('cordova');
+var utils = require('cordova/utils');
+var base64 = require('cordova/base64');
+
+function massageArgsJsToNative (args) {
+ if (!args || utils.typeName(args) !== 'Array') {
+ return args;
+ }
+ var ret = [];
+ args.forEach(function (arg, i) {
+ if (utils.typeName(arg) === 'ArrayBuffer') {
+ ret.push({
+ 'CDVType': 'ArrayBuffer',
+ 'data': base64.fromArrayBuffer(arg)
+ });
+ } else {
+ ret.push(arg);
+ }
+ });
+ return ret;
+}
+
+function massageMessageNativeToJs (message) {
+ if (message.CDVType === 'ArrayBuffer') {
+ var stringToArrayBuffer = function (str) {
+ var ret = new Uint8Array(str.length);
+ for (var i = 0; i < str.length; i++) {
+ ret[i] = str.charCodeAt(i);
+ }
+ return ret.buffer;
+ };
+ var base64ToArrayBuffer = function (b64) {
+ return stringToArrayBuffer(atob(b64)); // eslint-disable-line no-undef
+ };
+ message = base64ToArrayBuffer(message.data);
+ }
+ return message;
+}
+
+function convertMessageToArgsNativeToJs (message) {
+ var args = [];
+ if (!message || !message.hasOwnProperty('CDVType')) {
+ args.push(message);
+ } else if (message.CDVType === 'MultiPart') {
+ message.messages.forEach(function (e) {
+ args.push(massageMessageNativeToJs(e));
+ });
+ } else {
+ args.push(massageMessageNativeToJs(message));
+ }
+ return args;
+}
+
+var iOSExec = function () {
+ // detect change in bridge, if there is a change, we forward to new bridge
+
+ // if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova && window.webkit.messageHandlers.cordova.postMessage) {
+ // bridgeMode = jsToNativeModes.WK_WEBVIEW_BINDING;
+ // }
+
+ var successCallback, failCallback, service, action, actionArgs;
+ var callbackId = null;
+ if (typeof arguments[0] !== 'string') {
+ // FORMAT ONE
+ successCallback = arguments[0];
+ failCallback = arguments[1];
+ service = arguments[2];
+ action = arguments[3];
+ actionArgs = arguments[4];
+
+ // Since we need to maintain backwards compatibility, we have to pass
+ // an invalid callbackId even if no callback was provided since plugins
+ // will be expecting it. The Cordova.exec() implementation allocates
+ // an invalid callbackId and passes it even if no callbacks were given.
+ callbackId = 'INVALID';
+ } else {
+ throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' + // eslint-disable-line
+ 'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);');
+ }
+
+ // If actionArgs is not provided, default to an empty array
+ actionArgs = actionArgs || [];
+
+ // Register the callbacks and add the callbackId to the positional
+ // arguments if given.
+ if (successCallback || failCallback) {
+ callbackId = service + cordova.callbackId++;
+ cordova.callbacks[callbackId] =
+ {success: successCallback, fail: failCallback};
+ }
+
+ actionArgs = massageArgsJsToNative(actionArgs);
+
+ // CB-10133 DataClone DOM Exception 25 guard (fast function remover)
+ var command = [callbackId, service, action, JSON.parse(JSON.stringify(actionArgs))];
+ window.webkit.messageHandlers.cordova.postMessage(command);
+};
+
+iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, debug) {
+ var success = status === 0 || status === 1;
+ var args = convertMessageToArgsNativeToJs(message);
+ Promise.resolve().then(function () {
+ cordova.callbackFromNative(callbackId, success, status, args, keepCallback); // eslint-disable-line
+ });
+};
+
+// for backwards compatibility
+iOSExec.nativeEvalAndFetch = function (func) {
+ try {
+ func();
+ } catch (e) {
+ console.log(e);
+ }
+};
+
+// Proxy the exec for bridge changes. See CB-10106
+
+function cordovaExec () {
+ var cexec = require('cordova/exec');
+ var cexec_valid = (typeof cexec.nativeFetchMessages === 'function') && (typeof cexec.nativeEvalAndFetch === 'function') && (typeof cexec.nativeCallback === 'function');
+ return (cexec_valid && execProxy !== cexec) ? cexec : iOSExec;
+}
+
+function execProxy () {
+ cordovaExec().apply(null, arguments);
+}
+
+execProxy.nativeFetchMessages = function () {
+ return cordovaExec().nativeFetchMessages.apply(null, arguments);
+};
+
+execProxy.nativeEvalAndFetch = function () {
+ return cordovaExec().nativeEvalAndFetch.apply(null, arguments);
+};
+
+execProxy.nativeCallback = function () {
+ return cordovaExec().nativeCallback.apply(null, arguments);
+};
+
+module.exports = execProxy;
+
+if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova && window.webkit.messageHandlers.cordova.postMessage) {
+ // unregister the old bridge
+ cordova.define.remove('cordova/exec');
+ // redefine bridge to our new bridge
+ cordova.define('cordova/exec', function (require, exports, module) {
+ module.exports = execProxy;
+ });
+}
diff --git a/plugins/cordova-plugin-ionic-webview/src/www/util.js b/plugins/cordova-plugin-ionic-webview/src/www/util.js
new file mode 100644
index 0000000..ba52a8e
--- /dev/null
+++ b/plugins/cordova-plugin-ionic-webview/src/www/util.js
@@ -0,0 +1,30 @@
+var exec = require('cordova/exec');
+
+var WebView = {
+ convertFileSrc: function(url) {
+ if (!url) {
+ return url;
+ }
+ if (url.indexOf('/')===0) {
+ return window.WEBVIEW_SERVER_URL + '/_app_file_' + url;
+ }
+ if (url.indexOf('file://')===0) {
+ return window.WEBVIEW_SERVER_URL + url.replace('file://', '/_app_file_');
+ }
+ if (url.indexOf('content://')===0) {
+ return window.WEBVIEW_SERVER_URL + url.replace('content:/', '/_app_content_');
+ }
+ return url;
+ },
+ setServerBasePath: function(path) {
+ exec(null, null, 'IonicWebView', 'setServerBasePath', [path]);
+ },
+ getServerBasePath: function(callback) {
+ exec(callback, null, 'IonicWebView', 'getServerBasePath', []);
+ },
+ persistServerBasePath: function() {
+ exec(null, null, 'IonicWebView', 'persistServerBasePath', []);
+ }
+}
+
+module.exports = WebView;
diff --git a/plugins/cordova-plugin-splashscreen/.appveyor.yml b/plugins/cordova-plugin-splashscreen/.appveyor.yml
new file mode 100644
index 0000000..a7b2426
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/.appveyor.yml
@@ -0,0 +1,28 @@
+# appveyor file
+# http://www.appveyor.com/docs/appveyor-yml
+
+max_jobs: 1
+
+shallow_clone: true
+
+init:
+ - git config --global core.autocrlf true
+
+image:
+ - Visual Studio 2017
+
+environment:
+ nodejs_version: "4"
+ matrix:
+ - PLATFORM: windows-10-store
+ JUST_BUILD: --justBuild
+install:
+ - npm cache clean -f
+ - node --version
+ - npm install -g cordova-paramedic@https://github.com/apache/cordova-paramedic.git
+ - npm install -g cordova
+
+build: off
+
+test_script:
+ - cordova-paramedic --config pr\%PLATFORM% --plugin . %JUST_BUILD%
diff --git a/plugins/cordova-plugin-splashscreen/.github/PULL_REQUEST_TEMPLATE.md b/plugins/cordova-plugin-splashscreen/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..91582f4
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,22 @@
+
+
+### Platforms affected
+
+
+### What does this PR do?
+
+
+### What testing has been done on this change?
+
+
+### Checklist
+- [ ] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
+- [ ] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
+- [ ] Added automated test coverage as appropriate for this change.
diff --git a/plugins/cordova-plugin-splashscreen/.jshintignore b/plugins/cordova-plugin-splashscreen/.jshintignore
new file mode 100644
index 0000000..09bc22e
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/.jshintignore
@@ -0,0 +1 @@
+tests/ios
diff --git a/plugins/cordova-plugin-splashscreen/.jshintrc b/plugins/cordova-plugin-splashscreen/.jshintrc
new file mode 100644
index 0000000..cf48aac
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/.jshintrc
@@ -0,0 +1,16 @@
+{
+ "browser": true
+ , "devel": true
+ , "bitwise": true
+ , "undef": true
+ , "trailing": true
+ , "quotmark": false
+ , "indent": 4
+ , "unused": "vars"
+ , "latedef": "nofunc"
+ , "globals": {
+ "module": false,
+ "exports": false,
+ "require": false
+ }
+}
diff --git a/plugins/cordova-plugin-splashscreen/.npmignore b/plugins/cordova-plugin-splashscreen/.npmignore
new file mode 100644
index 0000000..7d3b1ce
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/.npmignore
@@ -0,0 +1,28 @@
+#If ignorance is bliss, then somebody knock the smile off my face
+
+*.csproj.user
+*.suo
+*.cache
+Thumbs.db
+*.DS_Store
+
+*.bak
+*.cache
+*.log
+*.swp
+*.user
+
+
+
+
+
+
+
+
+
+
+node_modules
+
+/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcuserdata/
+
+/tests/ios/CDVSplashScreenTest.xcworkspace/xcuserdata/
diff --git a/plugins/cordova-plugin-splashscreen/.travis.yml b/plugins/cordova-plugin-splashscreen/.travis.yml
new file mode 100644
index 0000000..c5d3cdd
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/.travis.yml
@@ -0,0 +1,98 @@
+sudo: false
+addons:
+ jwt:
+ secure: UmbBQ73ydIzhTCfaTb/g0beTwnOHjYxlILmQYK2Tl9Gna/KbpawiVmbloX1eZakevkeYgzQmAHEF0LyDINy5AUk97azYeP0Sz/IOjIDfXAdc6U6sZb7BScneBMt6ET/hCprG4f3mbmleQ+gx+dmNWez6rlb3Xu+XWfJuwDfAWm0=
+env:
+ global:
+ - SAUCE_USERNAME=snay
+ - TRAVIS_NODE_VERSION="4.2"
+matrix:
+ include:
+ - env: PLATFORM=browser-chrome
+ os: linux
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=browser-firefox
+ os: linux
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=browser-safari
+ os: linux
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=browser-edge
+ os: linux
+ language: node_js
+ node_js: '4.2'
+ - env: TEST_DIR=.
+ language: objective-c
+ osx_image: xcode7
+ - env: TEST_DIR=./tests/ios
+ language: objective-c
+ osx_image: xcode7
+ - env: PLATFORM=ios-9.3
+ os: osx
+ osx_image: xcode7.3
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=ios-10.0
+ os: osx
+ osx_image: xcode7.3
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=android-4.4
+ os: linux
+ language: android
+ jdk: oraclejdk8
+ android:
+ components:
+ - tools
+ - extra-android-m2repository
+ - build-tools-26.0.2
+ - env: PLATFORM=android-5.1
+ os: linux
+ language: android
+ jdk: oraclejdk8
+ android:
+ components:
+ - tools
+ - extra-android-m2repository
+ - build-tools-26.0.2
+ - env: PLATFORM=android-6.0
+ os: linux
+ language: android
+ jdk: oraclejdk8
+ android:
+ components:
+ - tools
+ - extra-android-m2repository
+ - build-tools-26.0.2
+ - env: PLATFORM=android-7.0
+ os: linux
+ language: android
+ jdk: oraclejdk8
+ android:
+ components:
+ - tools
+ - extra-android-m2repository
+ - build-tools-26.0.2
+before_install:
+- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm
+ && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm
+ install $TRAVIS_NODE_VERSION
+- node --version
+- if [[ "$PLATFORM" =~ android ]]; then gradle --version; fi
+- if [[ "$PLATFORM" =~ ios ]]; then npm install -g ios-deploy; fi
+- if [[ "$PLATFORM" =~ android ]]; then echo y | android update sdk -u --filter android-22,android-23,android-24,android-25,android-26;
+ fi
+- git clone https://github.com/apache/cordova-paramedic /tmp/paramedic && pushd /tmp/paramedic
+ && npm install && popd
+- npm install -g cordova
+install:
+- npm install
+script:
+- if [[ "$TEST_DIR" != "" ]];
+ then cd $TEST_DIR && npm install && (npm test || npm test);
+ else node /tmp/paramedic/main.js --config pr/$PLATFORM --plugin $(pwd) --shouldUseSauce
+ --buildName travis-plugin-splashscreen-$TRAVIS_JOB_NUMBER;
+ fi
diff --git a/plugins/cordova-plugin-splashscreen/CONTRIBUTING.md b/plugins/cordova-plugin-splashscreen/CONTRIBUTING.md
new file mode 100644
index 0000000..4c8e6a5
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/CONTRIBUTING.md
@@ -0,0 +1,37 @@
+
+
+# Contributing to Apache Cordova
+
+Anyone can contribute to Cordova. And we need your contributions.
+
+There are multiple ways to contribute: report bugs, improve the docs, and
+contribute code.
+
+For instructions on this, start with the
+[contribution overview](http://cordova.apache.org/contribute/).
+
+The details are explained there, but the important items are:
+ - Sign and submit an Apache ICLA (Contributor License Agreement).
+ - Have a Jira issue open that corresponds to your contribution.
+ - Run the tests so your patch doesn't break existing functionality.
+
+We look forward to your contributions!
diff --git a/plugins/cordova-plugin-splashscreen/LICENSE b/plugins/cordova-plugin-splashscreen/LICENSE
new file mode 100644
index 0000000..7a4a3ea
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-splashscreen/NOTICE b/plugins/cordova-plugin-splashscreen/NOTICE
new file mode 100644
index 0000000..8ec56a5
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/NOTICE
@@ -0,0 +1,5 @@
+Apache Cordova
+Copyright 2012 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
diff --git a/plugins/cordova-plugin-splashscreen/README.md b/plugins/cordova-plugin-splashscreen/README.md
new file mode 100644
index 0000000..49ff0ef
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/README.md
@@ -0,0 +1,522 @@
+---
+title: Splashscreen
+description: Control the splash screen for your app.
+---
+
+
+|AppVeyor|Travis CI|
+|:-:|:-:|
+|[](https://ci.appveyor.com/project/ApacheSoftwareFoundation/cordova-plugin-splashscreen)|[](https://travis-ci.org/apache/cordova-plugin-splashscreen)|
+
+# cordova-plugin-splashscreen
+
+This plugin is required to work with splash screens. This plugin displays and hides a splash screen during application launch.
+
+Report issues with this plugin on the [Apache Cordova issue tracker][Apache Cordova issue tracker].
+
+## Installation
+
+ // npm hosted (new) id
+ cordova plugin add cordova-plugin-splashscreen
+
+ // you may also install directly from this repo
+ cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git
+
+## Supported Platforms
+
+- Android
+- iOS
+- Windows (`cordova-windows` version >= 4.4.0 is required)
+- Browser
+
+__Note__: Extended splashscreen does not require the plugin on Windows (as opposed to Android and iOS) in case you don't use the plugin API, i.e. programmatic hide/show.
+
+### iOS-specific information
+
+There are two mechanisms for displaying a launch screen on iOS:
+
+1. Legacy launch images: images are sized exactly for the device's screen size. Does not support the iPad Pro 12.9's native resolution or split-screen/slide-over multitasking.
+
+2. Launch storyboard images: Images are sized based on scale, idiom, and size classes. Supports all devices, and can be used with split-screen/slide-over multitasking.
+
+Apple is moving away from legacy launch images. There is no official support for providing a native-resolution launch image for the iPad Pro 12.9 or for providing launch images that work with split-screen multitasking or slide-over. If your app doesn't need to support these contexts, then you can continue to use legacy launch images for as long as you like.
+
+The preferred method of providing launch images is to use a launch storyboard. For native app developers, the ideal launch storyboard is an unpopulated version of the app's user interface at launch. For non-native app developers who don't wish to learn Interface Builder, however, this plugin simulates the legacy launch image method as much as is feasible.
+
+#### Legacy launch images
+
+If you choose to use legacy launch images, you will use the following syntax in `config.xml`:
+
+```
+
+
+
+
+
+
+
+
+
+```
+
+Technically the filename for the `src` attribute can be anything you want; the filenames are used because they match what will be used when your project is compiled. The width and height attributes determine which launch images are displayed on which devices as follows:
+
+| width | height | device (orientation) |
+|:-----------:|:------------:|:--------------------------------:|
+| 320 | 480 | All non-retina iPhones and iPods |
+| 640 | 960 | iPhone 4/4s (portrait) |
+| 640 | 1136 | iPhone 5/5s/SE (portrait) |
+| 750 | 1334 | iPhone 6/6s/7 (portrait) |
+| 1242 | 2208 | iPhone 6+/6s+/7+ (portrait) |
+| 2208 | 1242 | iPhone 6+/6s+/7+ (landscape) |
+| 768 | 1024 | All non-retina iPads (portrait) |
+| 1024 | 768 | All non-retina iPads (landscape) |
+| 1536 | 2048 | All retina iPads (portrait) |
+| 2048 | 1536 | All retina iPads (landscape) |
+
+Note: It is vitally important that the source image actually matches the size specified in the `width` and `height` attributes. If it does not, the device may fail to render it properly, if at all.
+
+#### Launch storyboard images
+
+In order to support newer form factors and split-screen/slide-over multitasking, you should use launch storyboard images. These are similar to the legacy launch images above, but there are crucial differences:
+
+ - images are not specific to a given device.
+
+ - images are scaled to fill the available viewport (while maintaining the aspect ratio).
+
+ - the outer edges of the images will be cropped, and the amount will vary based on device an viewport.
+
+ - there is no need to provide an image for each possible device, viewport, and orientation; iOS will choose the best image for the situation automatically.
+
+##### Designing launch storyboard images
+
+The key to designing a launch storyboard image is understanding that the edges of the image will almost certainly be cropped. Therefore, one should not place any important information near the edges of any images provided to the launch storyboard. Only the center is a safe area, and this all but guarantees that following Apple's advice of presenting an unpopulated user interface will not work well.
+
+Instead, the following tips should enable you to create a launch image that works across a multitude of form factors, viewports, and orientations:
+
+ - Important graphics (logos, icons, titles) should be centered. The safe bounding region will vary, so you will need to test to ensure that the important graphics are never cropped. Better yet, don't supply any important graphics in the first place.
+
+ - You _can_ fine-tune the placement and size of these graphics, but you don't have the same fine-grained control as you did with legacy launch images.
+
+ - Use a simple color wash. If you use two colors, you'll want one color to fill the top half of the image, and the second to fill the bottom half. If you use a gradient, you'll probably want to ensure that the middle of the gradient lines up with the center of the image.
+
+ - Don't worry about pixel perfection -- because the images are scaled, there's almost no chance the images will be perfectly fit to the pixel grid. Since all supported iOS devices use retina screens, users will be hard pressed to notice it anyway.
+
+It is important to understand the concept of scale, idiom, and size class traits in order to use launch storyboard images effectively. Of the images supplied to the launch storyboard, iOS will choose the image that best matches the device and viewport and render that image. It is possible to supply only one launch image if so desired, but it is also possible to fine-tune the displayed launch image based on traits. When fine-tuning, one can ignore traits that aren't targeted or supported by the app.
+
+> Note: If you are using launch storyboard images, there is no need to include legacy images. If you do, the legacy images will be copied, but not used.
+
+##### Scale
+
+| scale | devices |
+|:-----------:|:----------------------:|
+| 1x | All non-retina devices |
+| 2x | Most retina devices |
+| 3x | iPhone 6+/6s+,7s+ |
+
+In general, you'll want to supply 2x and 3x images. Cordova only supports retina devices now, so there's no point in supplying 1x images.
+
+##### Idioms
+
+| idiom | devices |
+|:-----------:|:-------------:|
+| ipad | All iPads |
+| iphone | All iPhones and iPod Touches |
+| universal | All devices |
+
+You only need to provide universal images unless you need to fine-tune for a specific device idiom.
+
+##### Size classes
+
+There are two size classes applies to both screen axes. Narrow viewports are considered to be the "compact" size class, and remaining viewports are considered "regular". When supplying images to Xcode, however, one must choose between "any & compact" and "any & regular". To stay consistent with the native terminology, this feature will match based on "any" and "compact". `any` will match regular-sized viewports.
+
+Note: this feature uses `com` as an abbreviation for "compact" classes.
+
+The following classes are supported by this feature:
+
+| width | height | orientation |
+|:-----------:|:------------:|:-----------------:|
+| any | any | any |
+| com | any | portrait |
+| any | com | landscape (wide) |
+| com | com | landscape (narrow)|
+
+To see the complete list of size classes associated with devices and viewports, see .
+
+##### Single-image launch screen
+
+If your launch image is simple, you may be able to avoid creating a lot of different launch images and supply only one. The launch image needs to meet the following requirements:
+
+ - the image should be square
+
+ - the image should be large enough to fit on an iPad Pro 12.9": 2732x2732
+
+ - anything important should fit within the center
+
+ Keep in mind that the image will be cropped, possibly quite severely, depending upon the viewport.
+
+Once the image is created, you can include it in your project by adding the following to `config.xml`:
+
+```
+
+```
+
+Because only one image is provided, iOS will utilize it in every context.
+
+##### Multi-image launch screen
+
+If a single launch image won't meet your needs, you will probably need to supply at least six images, if not more. Furthermore, keep in mind that it will not be possible to fine tune the image to a specific device, but only to a device class, display factor, and viewport size.
+
+If you don't need to target images to a specific idiom, you should create six images, as follows:
+
+| scale | idiom | width | height | size | filename |
+|:-----------:|:-----------:|:-----------:|:------------:|:----------:|:--------------:|
+| 2x* | universal | any | any | 2732x2732 | `Default@2x~universal~anyany.png` |
+| 2x | universal | com | any | 1278x2732 | `Default@2x~universal~comany.png` |
+| 2x | universal | com | com | 1334x750 | `Default@2x~universal~comcom.png` |
+| 3x* | universal | any | any | 2208x2208 | `Default@3x~universal~anyany.png` |
+| 3x | universal | any | com | 2208x1242 | `Default@3x~universal~anycom.png` |
+| 3x | universal | com | any | 1242x2208 | `Default@3x~universal~comany.png` |
+
+\* this image is required in order for iOS utilize the other images within this scale and idiom.
+
+> Note: If the 3x sizes look small too you, that's because there's only one device class that currently has a 3x density: the iPhone 6+/6s+/7+.
+
+The above looks like the following snippet when present in `config.xml`:
+
+```
+
+
+
+
+
+
+```
+
+Should one need to further fine tune based upon device idiom, one can do so. This might look like so:
+
+| scale | idiom | width | height | size | filename |
+|:-----------:|:-----------:|:-----------:|:------------:|:----------:|:--------------:|
+| 2x* | iphone | any | any | 1334x1334 | `Default@2x~iphone~anyany.png` |
+| 2x | iphone | com | any | 750x1334 | `Default@2x~iphone~comany.png` |
+| 2x | iphone | com | com | 1334x750 | `Default@2x~iphone~comcom.png` |
+| 3x* | iphone | any | any | 2208x2208 | `Default@3x~iphone~anyany.png` |
+| 3x | iphone | any | com | 2208x1242 | `Default@3x~iphone~anycom.png` |
+| 3x | iphone | com | any | 1242x2208 | `Default@3x~iphone~comany.png` |
+| 2x* | ipad | any | any | 2732x2732 | `Default@2x~ipad~anyany.png` |
+| 2x | ipad | com | any | 1278x2732 | `Default@2x~ipad~comany.png` |
+
+\* this image is required in order for iOS utilize the other images within this scale and idiom.
+
+The above looks like the following in `config.xml`:
+
+```
+
+
+
+
+
+
+
+
+```
+
+##### Quirks and Known Issues
+
+1. **App on target may not reflect changes to images**
+ Once you run the app on a target, iOS caches the launch image. Unfortunately, when you chance the images, iOS does _not_ invalidate the cache, which means you'll still see the old launch image. You should either: delete the app, or reset content & settings (simulator).
+
+2. **Simulator may not show expected images when launched from CLI**
+ When Xcode deploys to a specific simulator, it only copies the assets that match the simulator's characteristics. For example, if you try to run an app on the iPhone 6s Plus simulator, only @3x launch images are copied. When compiling from the CLI, however, the default is to assume an iPhone 5s, which means only @2x launch images are copied. Unless your launch images are markedly different, chances are good the difference would go unnoticed, but this does mean that the only accurate method of testing is to test on a physical device.
+
+3. **`anyany` must be provided for other variations to be used**
+ If you don't provide an `anyany` version of the launch image for a specific scale and idiom, the other variations (like `anycom`, `comany`, and `comcom`) will ignored.
+
+## Windows-specific information
+
+Splash screen images can be defined using the [MRT](https://cordova.apache.org/docs/en/dev/config_ref/images.html#windows) concept.
+If you specify src="res/windows/splashscreen.png" the following files will be copied into the application's images folder:
+`res/windows/splashscreen.png` | `res/windows/splashscreen.scale-100.png`, `res/windows/splashscreen.scale-125.png`, etc.
+The following are supported:
+
+| Scale, % | Project | Width | Height | Filename |
+|:------------:|:-------------------:|:-----------:|:------------:|:---------------------------------:|
+| 100 | Windows 10/8.1 | 620 | 300 | `splashscreen.png` \| `splashscreen.scale-100.png` |
+| 125 | Windows 10 | 775 | 375 | `splashscreen.scale-125.png` |
+| 150 | Windows 10 | 930 | 450 | `splashscreen.scale-150.png` |
+| 200 | Windows 10 | 1240 | 600 | `splashscreen.scale-200.png` |
+| 400 | Windows 10 | 2480 | 1200 | `splashscreen.scale-400.png` |
+| 140 | Windows 8.1 | 868 | 420 | `splashscreen.scale-140.png` |
+| 180 | Windows 8.1 | 1116 | 540 | `splashscreen.scale-180.png` |
+| 100 | Windows Phone 8.1 | 480 | 800 | `splashscreenphone.png` \| `splashscreenphone.scale-100.png` |
+| 140 | Windows Phone 8.1 | 672 | 1120 | `splashscreenphone.scale-140.png` |
+| 240 | Windows Phone 8.1 | 1152 | 1920 | `splashscreenphone.scale-240.png` |
+
+__Note__: SplashScreens size for Windows 10 project should not exceed 200 KBytes.
+__Note__: Supported formats are `.png`, `.jpg`, `.jpeg`. Mixing of the extensions within a target is not supported. I.e. you can have `splashscreen.jpg` and `splashscreenphone.png` but not `splashscreen.scale-100.png`, `splashscreen.scale-400.jpg`.
+__Note__: You may need to reopen Visual Studio solution after changing the images and doing a `cordova prepare` for the changes to take effect.
+
+## Example Configuration
+In the top-level `config.xml` file (not the one in `platforms`), add configuration elements like those specified here.
+
+Please notice that the value of the "src" attribute is relative to the project root directory and not to the www directory (see `Directory structure` below). You can name the source image whatever you like. The internal name in the app is determined by Cordova.
+
+Directory structure:
+
+```
+projectRoot
+ hooks
+ platforms
+ plugins
+ www
+ css
+ img
+ js
+ res
+ screen
+ android
+ ios
+ windows
+```
+
+```xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+## Preferences
+
+#### config.xml
+
+- `AutoHideSplashScreen` (boolean, default to `true`). Indicates whether to hide splash screen automatically or not. Splash screen hidden after amount of time specified in the `SplashScreenDelay` preference.
+
+```xml
+
+```
+
+- `SplashScreenDelay` (number, default to 3000). Amount of time in milliseconds to wait before automatically hide splash screen.
+
+```xml
+
+```
+
+Note also that this value used to be seconds, and not milliseconds, so values less than 30 will still be treated as seconds. ( Consider this a deprecated patch that will disapear in some future version. )
+
+To disable the splashscreen add the following preference to `config.xml`:
+```xml
+
+```
+
+**Windows Quirk**: You should disable the splashscreen in case you are updating the entire document body dynamically (f.e. with a SPA router) to avoid affecting UI/controls.
+Note that you should also directly reference `WinJS/base.js` in the page HTML in this case to avoid the issues with activation context ([CB-11658](https://issues.apache.org/jira/browse/CB-11658)).
+
+**iOS Quirk**: to disable the splashscreen on `ios` platform you should also add `` to `config.xml`.
+
+- `FadeSplashScreen` (boolean, defaults to `true`): Set to `false` to
+ prevent the splash screen from fading in and out when its display
+ state changes.
+
+```xml
+
+```
+
+- `FadeSplashScreenDuration` (float, defaults to `500`): Specifies the
+ number of milliseconds for the splash screen fade effect to execute.
+
+```xml
+
+```
+
+_Note_: `FadeSplashScreenDuration` is included into `SplashScreenDelay`, for example if you have `` and `` defined in `config.xml`:
+
+- 00:00 - splashscreen is shown
+- 00:02 - fading has started
+- 00:03 - splashscreen is hidden
+
+Turning the fading off via `` technically means fading duration to be `0` so that in this example the overall splash delay will still be 3 seconds.
+
+_Note_: This only applies to the app startup - you need to take the fading timeout into account when manually showing/hiding the splashscreen in the code:
+
+```javascript
+navigator.splashscreen.show();
+window.setTimeout(function () {
+ navigator.splashscreen.hide();
+}, splashDuration - fadeDuration);
+```
+
+- `ShowSplashScreenSpinner` (boolean, defaults to `true`): Set to `false`
+ to hide the splash-screen spinner.
+
+```xml
+
+```
+
+### Android Quirks
+
+In your `config.xml`, you can add the following preferences:
+
+```xml
+
+
+
+```
+
+"SplashMaintainAspectRatio" preference is optional. If set to true, splash screen drawable is not stretched to fit screen, but instead simply "covers" the screen, like CSS "background-size:cover". This is very useful when splash screen images cannot be distorted in any way, for example when they contain scenery or text. This setting works best with images that have large margins (safe areas) that can be safely cropped on screens with different aspect ratios.
+
+The plugin reloads splash drawable whenever orientation changes, so you can specify different drawables for portrait and landscape orientations.
+
+"SplashShowOnlyFirstTime" preference is also optional and defaults to `true`. When set to `true` splash screen will only appear on application launch. However, if you plan to use `navigator.app.exitApp()` to close application and force splash screen appear on next launch, you should set this property to `false` (this also applies to closing the App with Back button).
+
+"SplashScreenSpinnerColor" preference is also optional and is ignored when not set. Setting it to a valid color name or HEX color code will change the color of the spinner on Android 5.0+ devices.
+
+### Browser Quirks
+
+You can use the following preferences in your `config.xml`:
+
+```xml
+
+
+
+
+
+
+
+
+
+```
+
+__Note__: `SplashScreen` value should be absolute in order to work in a sub-page. The `SplashScreen` value is used only for the browser platform. The value will be ignored for other platforms.
+
+### iOS Quirks
+
+- In iOS, the splashscreen images are called launch images. These images are mandatory on iOS.
+
+### Windows Quirks
+
+- `SplashScreenSpinnerColor` (string, defaults to system accent color): hash, rgb notation or CSS color name.
+
+```xml
+
+
+
+```
+
+- `SplashScreenBackgroundColor` (string, defaults to #464646): hex notation.
+
+```xml
+
+```
+
+## Methods
+
+- splashscreen.show
+- splashscreen.hide
+
+## splashscreen.hide
+
+Dismiss the splash screen.
+
+```js
+navigator.splashscreen.hide();
+```
+
+
+### iOS Quirk
+
+The `config.xml` file's `AutoHideSplashScreen` setting must be
+`false`. To delay hiding the splash screen for two seconds, add a
+timer such as the following in the `deviceready` event handler:
+
+```js
+setTimeout(function() {
+ navigator.splashscreen.hide();
+}, 2000);
+```
+
+## splashscreen.show
+
+Displays the splash screen.
+
+```js
+navigator.splashscreen.show();
+```
+
+Your application cannot call `navigator.splashscreen.show()` until the app has
+started and the `deviceready` event has fired. But since typically the splash
+screen is meant to be visible before your app has started, that would seem to
+defeat the purpose of the splash screen. Providing some configuration in
+`config.xml` will automatically `show` the splash screen immediately after your
+app launch and before it has fully started and received the `deviceready`
+event. For this reason, it is unlikely you need to call `navigator.splashscreen.show()` to make the splash
+screen visible for app startup.
+
+[Apache Cordova issue tracker]: https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Splashscreen%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC
diff --git a/plugins/cordova-plugin-splashscreen/RELEASENOTES.md b/plugins/cordova-plugin-splashscreen/RELEASENOTES.md
new file mode 100644
index 0000000..e0c90c9
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/RELEASENOTES.md
@@ -0,0 +1,238 @@
+
+# Release Notes
+
+### 5.0.2 (Jan 24, 2018)
+* [CB-13750](https://issues.apache.org/jira/browse/CB-13750) Add build-tools-26.0.2 to travis
+* [CB-13737](https://issues.apache.org/jira/browse/CB-13737) (iOS): fix Splash screen images for iPhone X
+
+### 5.0.1 (Dec 27, 2017)
+* [CB-13709](https://issues.apache.org/jira/browse/CB-13709) Fix to allow 5.0.0 version install (#144)
+
+### 5.0.0 (Dec 15, 2017)
+* [CB-13677](https://issues.apache.org/jira/browse/CB-13677) Remove deprecated platforms
+
+### 4.1.0 (Nov 06, 2017)
+* [CB-13473](https://issues.apache.org/jira/browse/CB-13473) (CI) Removed **Browser** builds from AppVeyor
+* [CB-12011](https://issues.apache.org/jira/browse/CB-12011) (android) added the possibility to change the spinner color on **Android 5.0**+ apps
+* [CB-13028](https://issues.apache.org/jira/browse/CB-13028) (CI) **Browser** builds on Travis and AppVeyor
+* [CB-13094](https://issues.apache.org/jira/browse/CB-13094) (android) Don't show splash when activity being finished
+* [CB-11487](https://issues.apache.org/jira/browse/CB-11487) (browser) Documented `AutoHideSplashScreen` for **Browser**
+* [CB-11488](https://issues.apache.org/jira/browse/CB-11488) (browser) The `hide()` call became non re-entrant after the addition of fade out. This fixes the issue.
+* [CB-11487](https://issues.apache.org/jira/browse/CB-11487) (browser) The standard `AutoHideSplashScreen` `config.xml` property is now supported by the **Browser** platform.
+* [CB-11486](https://issues.apache.org/jira/browse/CB-11486) (browser) `splashScreenDelay` now feed through `parseInt` to ensure it is an integer by the time it's value is passed in to `setTimeout()` in `hide()`.
+* [CB-12847](https://issues.apache.org/jira/browse/CB-12847) added `bugs` entry to `package.json`.
+
+### 4.0.3 (Apr 27, 2017)
+* [CB-12622](https://issues.apache.org/jira/browse/CB-12622) Added **Android 6.0** build badge to `README`
+* [CB-12685](https://issues.apache.org/jira/browse/CB-12685) added `package.json` to tests folder
+
+### 4.0.2 (Feb 28, 2017)
+* [CB-12353](https://issues.apache.org/jira/browse/CB-12353) Corrected merges usage in `plugin.xml`
+* [CB-12369](https://issues.apache.org/jira/browse/CB-12369) Add plugin typings from `DefinitelyTyped`
+* [CB-12363](https://issues.apache.org/jira/browse/CB-12363) Added build badges for **iOS 9.3** and **iOS 10.0**
+* [CB-12230](https://issues.apache.org/jira/browse/CB-12230) Removed **Windows 8.1** build badges
+
+### 4.0.1 (Dec 07, 2016)
+* [CB-12224](https://issues.apache.org/jira/browse/CB-12224) Updated version and RELEASENOTES.md for release 4.0.1
+* [CB-11751](https://issues.apache.org/jira/browse/CB-11751) 'extendedSplashScreen' is undefined Document that splashscreen needs to be disabled on Windows in case of updating entire document body
+* [CB-9287](https://issues.apache.org/jira/browse/CB-9287) Not enough Icons and Splashscreens for **Windows 8.1** and Windows Phone 8.1
+* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…"
+* [CB-11830](https://issues.apache.org/jira/browse/CB-11830) (iOS) Fix doc typos in PR#114
+* [CB-11829](https://issues.apache.org/jira/browse/CB-11829) (iOS) Support for CB-9762; docs (CB-11830)
+* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version.
+
+### 4.0.0 (Sep 08, 2016)
+* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies
+* [CB-11326](https://issues.apache.org/jira/browse/CB-11326) Prevent crash when initializing plugin after navigating to another URL
+* Fix crash on **iOS** when reloading page from remote **Safari**
+* Add badges for paramedic builds on Jenkins
+* Add pull request template.
+* [CB-11179](https://issues.apache.org/jira/browse/CB-11179) Extend the windows-splashscreen docs
+* [CB-11159](https://issues.apache.org/jira/browse/CB-11159) Fix flaky splashscreen native tests
+* [CB-11156](https://issues.apache.org/jira/browse/CB-11156) Change default `FadeSplashScreenDuration` value
+* [CB-8056](https://issues.apache.org/jira/browse/CB-8056) Updated the dependency version, added it to the docs
+* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to README.md
+* [CB-8056](https://issues.apache.org/jira/browse/CB-8056) Implement splashscreen for **Windows** platform
+* [CB-6498](https://issues.apache.org/jira/browse/CB-6498) Misleading documentation in **Android** Quirks
+
+### 3.2.2 (Apr 15, 2016)
+* [CB-10979](https://issues.apache.org/jira/browse/CB-10979) Fix splashscreen **iOS** native tests. Added `jshintignore` for tests/ios
+* [CB-10895](https://issues.apache.org/jira/browse/CB-10895) Transparent Splashscreen view sometimes remains
+* [CB-10562](https://issues.apache.org/jira/browse/CB-10562) `hide()` not working in latest splashscreen plug in 3.1.0 in **iOS**
+* [CB-10688](https://issues.apache.org/jira/browse/CB-10688) Plugin Splashscreen Readme must have examples.
+* [CB-10864](https://issues.apache.org/jira/browse/CB-10864) Run **iOS** native tests on Travis
+
+### 3.2.1 (Mar 09, 2016)
+* [CB-10764](https://issues.apache.org/jira/browse/CB-10764) Remove emoji in cordova-plugin-splashscreen
+* [CB-10650](https://issues.apache.org/jira/browse/CB-10650) Non-index content.src causes Splashscreen to be not displayed on **Browser**
+* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add JSHint for plugins
+* [CB-10606](https://issues.apache.org/jira/browse/CB-10606) fix deprecation warning for interfaceOrientation on **iOS**
+* chore: edit package.json license to match SPDX id
+
+### 3.2.0 (Feb 09, 2016)
+* [CB-10422](https://issues.apache.org/jira/browse/CB-10422) Splashscreen displays black screen with no image on Android
+* [CB-10412](https://issues.apache.org/jira/browse/CB-10412) AutoHideSplashScreen "false" isn't taken in account on iOS
+* [CB-9516](https://issues.apache.org/jira/browse/CB-9516) Android SplashScreen - Spinner Does Not Display
+* [CB-9094](https://issues.apache.org/jira/browse/CB-9094) Smarter autohide logic on Android
+* [CB-8396](https://issues.apache.org/jira/browse/CB-8396) Add AutoHideSplashScreen logic to Android's Splashscreen
+
+### 3.1.0 (Jan 15, 2016)
+* [CB-9538](https://issues.apache.org/jira/browse/CB-9538) Implementing `FadeSplashScreen` feature for **Android**
+* [CB-9240](https://issues.apache.org/jira/browse/CB-9240) Cordova splash screen plugin **iPad** landscape mode issue
+* [CB-10263](https://issues.apache.org/jira/browse/CB-10263) Fix splashscreen plugin filenames for Asset Catalog
+* [CB-9374](https://issues.apache.org/jira/browse/CB-9374) **Android** add `SplashShowOnlyFirstTime` as preference
+* [CB-10244](https://issues.apache.org/jira/browse/CB-10244) Don't rotate the **iPhone 6 Plus** splash
+* [CB-9043](https://issues.apache.org/jira/browse/CB-9043) Fix the **ios** splashscreen being deformed on orientation change
+* [CB-10079](https://issues.apache.org/jira/browse/CB-10079) Splashscreen plugin does not honor `SplashScreenDelay` on **iOS**
+* [CB-10231](https://issues.apache.org/jira/browse/CB-10231) Fix `FadeSplashScreen` to default to true on **iOS**
+
+### 3.0.0 (Nov 18, 2015)
+* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
+* Fixing contribute link.
+* [CB-9750](https://issues.apache.org/jira/browse/CB-9750) `FadeSplashDuration` is now in `msecs`
+* [CB-8875](https://issues.apache.org/jira/browse/CB-8875) `FadeSplashScreen` was not fading
+* [CB-9467](https://issues.apache.org/jira/browse/CB-9467) SplashScreen does not show any image in hosted app on **Windows 10**
+* [CB-7282](https://issues.apache.org/jira/browse/CB-7282) Document `AutoHideSplashScreenpreference`
+* [CB-9327](https://issues.apache.org/jira/browse/CB-9327) - Splashscreen not receiving `CDVPageLoadNotification`
+* WP8: Avoid config `value` of a wrong element.
+
+### 2.1.0 (Jun 17, 2015)
+* added missing license headers
+* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen
+* fix npm md issue
+* Fixed iOS unit tests.
+* [CB-3562](https://issues.apache.org/jira/browse/CB-3562): Disable screen rotation for iPhone when splash screen is shown. (closes #47)
+* [CB-8988](https://issues.apache.org/jira/browse/CB-8988): Fix rotation on iOS/iPad (closes #46)
+* [CB-8904](https://issues.apache.org/jira/browse/CB-8904): Don't reset the static variable when it's destroyed, otherwise we might as well just have a member variable
+* Removed wp7 from `plugin.xml` and package.json
+* [CB-8750](https://issues.apache.org/jira/browse/CB-8750) [wp8]: Rewrite resoultion helper
+* [CB-8750](https://issues.apache.org/jira/browse/CB-8750) [wp8]: Allow resolution-specific splashscreen images
+* [CB-8758](https://issues.apache.org/jira/browse/CB-8758) [wp8]: UnauthorizedAccessException on hide()
+
+### 2.0.0 (Apr 15, 2015)
+* give users a way to install the bleeding edge.
+* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
+* [CB-8797](https://issues.apache.org/jira/browse/CB-8797) - Splashscreen preferences FadeSplashScreenDuration and FadeSplashScreen (iOS) are missing
+* [CB-8836](https://issues.apache.org/jira/browse/CB-8836) - Crashes after animating splashscreen
+* [CB-8753](https://issues.apache.org/jira/browse/CB-8753) android: Fix missing import in previous commit
+* [CB-8753](https://issues.apache.org/jira/browse/CB-8753) android: Adds `SplashMaintainAspectRatio` preference (close #43)
+* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
+* [CB-8345](https://issues.apache.org/jira/browse/CB-8345) Make default for splashscreen resource "screen" (which is what template and CLI assume it to be)
+* Revert "CB-8345 android: Make "splash" the default resource ID instead of null"
+* Use TRAVIS_BUILD_DIR, install paramedic by npm
+* [CB-8345](https://issues.apache.org/jira/browse/CB-8345) android: Make "splash" the default resource ID instead of null
+* docs: added Windows to supported platforms
+* [CB-7964](https://issues.apache.org/jira/browse/CB-7964) Add cordova-plugin-splashscreen support for browser platform
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
+* [wp8] oops, Added back config parse result checks
+* [WP8] code cleanup, minor refactors, comments to clarify some stuff.
+* Extend WP8 Splash Screen to respect SplashScreen and SplashScreenDelay preferences from config file
+* [CB-8574](https://issues.apache.org/jira/browse/CB-8574) Integrate TravisCI
+* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen
+* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
+* [CB-8397](https://issues.apache.org/jira/browse/CB-8397) Add support to 'windows' for showing the Windows Phone splashscreen
+
+### 1.0.0 (Feb 04, 2015)
+* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Stop using deprecated IsIpad macro
+* [CB-3679](https://issues.apache.org/jira/browse/CB-3679) Add engine tag for Android >= 3.6.0 due to use of `preferences`
+* [CB-3679](https://issues.apache.org/jira/browse/CB-3679) Make SplashScreen plugin compatible with cordova-android@4.0.x
+
+### 0.3.5 (Dec 02, 2014)
+* [CB-7204](https://issues.apache.org/jira/browse/CB-7204) - Race condition when hiding and showing spinner (closes #21)
+* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-splashscreen documentation translation: cordova-plugin-splashscreen
+
+### 0.3.4 (Oct 03, 2014)
+* Finalized iOS splash screen (image name) tests. 176 tests in all, 44 for each type of device (iPad, iPhone, iPhone5, iPhone6, iPhone 6 Plus).
+* [CB-7633](https://issues.apache.org/jira/browse/CB-7633) - (Re-fix based on updated unit tests) iPhone 6 Plus support
+* Updated iOS tests for locked orientations
+* Added more iOS splash screen tests.
+* [CB-7633](https://issues.apache.org/jira/browse/CB-7633) - Add support for iPhone 6/6+
+* Added failing iPhone 6/6 Plus tests.
+* Added 'npm test'
+* [CB-7663](https://issues.apache.org/jira/browse/CB-7663) - iOS unit tests for splash screen
+* Properly formatted splashscreen preference docs.
+
+### 0.3.3 (Sep 17, 2014)
+* [CB-7249](https://issues.apache.org/jira/browse/CB-7249) cordova-plugin-splashscreen documentation translation
+* Renamed test dir, added nested `plugin.xml`
+* added documentation for manual tests
+* [CB-7196](https://issues.apache.org/jira/browse/CB-7196) port splashscreen tests to framework
+
+### 0.3.2 (Aug 06, 2014)
+* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
+* [CB-7041](https://issues.apache.org/jira/browse/CB-7041) ios: Fix image filename logic when setting the iPad splash screen
+* fixes Splashscreen crash on WP8
+* Remove outdated doc
+
+### 0.3.1 (Jun 05, 2014)
+* documentation translation: cordova-plugin-splashscreen
+* Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen
+* Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen
+* Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen
+* Lisa testing pulling in plugins for plugin: cordova-plugin-splashscreen
+* [CB-6810](https://issues.apache.org/jira/browse/CB-6810) Add license to CONTRIBUTING.md
+* [wp8] updated quirk for and combined iOS,WP8,BB10 quirks as they are all the same
+* [wp] implemented OnInit so splash screen can be shown before cordova page is loaded
+* [wp] plugin must be autoloaded for AutoHideSplashScreen preference to work
+* [CB-6483](https://issues.apache.org/jira/browse/CB-6483) Use splash screen image from manifest on Windows8
+* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
+* Revert "Merge branch 'tizen' of http://github.com/siovene/cordova-plugin-splashscreen"
+
+### 0.3.0 (Apr 17, 2014)
+* Add Tizen support to plugin
+* [CB-6422](https://issues.apache.org/jira/browse/CB-6422): [windows8] use cordova/exec/proxy
+* [CB-4051](https://issues.apache.org/jira/browse/CB-4051): [ios] - Re-fix - Splashscreen rotation problem (closes #13)
+* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
+* [CB-6465](https://issues.apache.org/jira/browse/CB-6465): Add license headers to Tizen code
+* Add NOTICE file
+
+### 0.2.7 (Feb 05, 2014)
+* [CB-3562](https://issues.apache.org/jira/browse/CB-3562) Fix aspect ratio on landscape-only iPhone applications
+* [CB-4051](https://issues.apache.org/jira/browse/CB-4051) fix for splashscreen rotation problem
+
+### 0.2.6 (Jan 02, 2014)
+* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Splashscreen plugin
+* Handle error when splash image is missing.
+
+### 0.2.5 (Dec 4, 2013)
+* add ubuntu platform
+* Added amazon-fireos platform. Change to use amazon-fireos as a platform if the user agent string contains 'cordova-amazon-fireos'
+* [CB-5124](https://issues.apache.org/jira/browse/CB-5124) - Remove splashscreen config.xml values from iOS Configuration Docs, move to plugin docs
+
+### 0.2.4 (Oct 28, 2013)
+* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): add repo + issue tag to `plugin.xml` for splashscreen plugin
+* [CB-5010](https://issues.apache.org/jira/browse/CB-5010) Incremented plugin version on dev branch.
+
+### 0.2.3 (Oct 9, 2013)
+* [CB-4806](https://issues.apache.org/jira/browse/CB-4806) Re-fix Update splashscreen image bounds for iOS 7
+* [CB-4934](https://issues.apache.org/jira/browse/CB-4934) plugin-splashscreen should not show by default on Windows8
+* [CB-4929](https://issues.apache.org/jira/browse/CB-4929) plugin-splashscreen not loading proxy windows8
+* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
+
+### 0.2.2 (Sept 25, 2013)
+* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version
+* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.splashscreen to org.apache.cordova.splashscreen
+* Rename CHANGELOG.md -> RELEASENOTES.md
+* [CB-4806](https://issues.apache.org/jira/browse/CB-4806) Update splashscreen image bounds for iOS 7
+* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch.
diff --git a/plugins/cordova-plugin-splashscreen/doc/de/README.md b/plugins/cordova-plugin-splashscreen/doc/de/README.md
new file mode 100644
index 0000000..f876eff
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/de/README.md
@@ -0,0 +1,119 @@
+
+
+# cordova-plugin-splashscreen
+
+[](https://travis-ci.org/apache/cordova-plugin-splashscreen)
+
+Dieses Plugin zeigt und verbirgt einen Splash-Screen beim Start der Anwendung.
+
+## Installation
+
+ // npm hosted (new) id
+ cordova plugin add cordova-plugin-splashscreen
+ // you may also install directly from this repo
+ cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git
+
+
+## Unterstützte Plattformen
+
+ * Amazon Fire OS
+ * Android
+ * BlackBerry 10
+ * iOS
+ * Windows Phone 7 und 8
+ * Windows 8
+ * Windows
+ * Browser
+
+## Methoden
+
+ * SplashScreen.Show
+ * SplashScreen.Hide
+
+### Android Eigenarten
+
+Sie müssen in Ihrem `"config.xml"`fügen Sie die folgenden Einstellungen:
+
+
+
+
+
+
+Wo Foo ist der Name der Datei Splashscreen, vorzugsweise eine 9-Patch-Datei. Stellen Sie sicher, Splashcreen Dateien zu Ihrem res/xml-Verzeichnis unter den entsprechenden Ordnern hinzuzufügen. Der zweite Parameter stellt dar, wie lange das Splashscreen in Millisekunden angezeigt werden. Es wird standardmäßig auf 3000 ms. Weitere Informationen finden Sie unter [Symbole und Splash-Screens](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html).
+
+"SplashMaintainAspectRatio" Präferenz ist optional. Wenn wahr, Splash-Screen zeichenbaren nicht gestreckt wird, um den Bildschirm passen, sondern stattdessen einfach "" den Bildschirm, wie CSS abdeckt "Hintergrund-Größe: Schutz vor". Dies ist sehr nützlich, wenn Splash-Bildschirm Bilder können nicht, in keiner Weise, zum Beispiel verzerrt werden wenn sie Landschaft oder Text enthalten. Diese Einstellung funktioniert am besten mit Bildern, die große Margen (sichere Bereiche) haben, die sicher auf Bildschirme mit unterschiedlichen Seitenverhältnissen zugeschnitten werden können.
+
+Das Plugin lädt platsch zeichenbaren wenn Ausrichtung ändert, sodass Sie verschiedene Drawables für hoch- und Querformat Ausrichtungen angeben können.
+
+### Browser-Eigenheiten
+
+In Ihrem `"config.xml"`können Sie die folgenden Einstellungen:
+
+
+
+
+
+
+
+
+
+
+
+### iOS Macken
+
+ * `FadeSplashScreen` (Boolean, standardmäßig auf `true festgelegt`): um zu verhindern, dass den Begrüßungsbildschirm ein-und ausblenden bei ihrer Anzeige Statusänderungen auf `false` festgelegt.
+
+
+
+
+ * `FadeSplashScreenDuration` (float, Standardwert ist `2`): gibt die Anzahl der Sekunden für den Begrüßungsbildschirm fade Effekt ausgeführt.
+
+
+
+
+ * `ShowSplashScreenSpinner` (Boolean, standardmäßig auf `true festgelegt`): auf `false` festgelegt wird, um den Begrüßungsbildschirm Spinner auszublenden.
+
+
+
+
+## SplashScreen.Hide
+
+Schließen Sie den Splash-Screen.
+
+ navigator.splashscreen.hide();
+
+
+### BlackBerry 10, WP8, iOS Eigenarten
+
+Die Datei `config.xml` `AutoHideSplashScreen` Einstellung muss `false` sein. Verstecken des Begrüßungsbildschirms für zwei Sekunden Verzögerung, fügen Sie einen Timer wie die folgende in der `deviceready`-Ereignishandler:
+
+ setTimeout(function() {
+ navigator.splashscreen.hide();
+ }, 2000);
+
+
+## SplashScreen.Show
+
+Zeigt den Begrüßungsbildschirm.
+
+ navigator.splashscreen.show();
+
+
+Ihre Anwendung kann nicht `navigator.splashscreen.show()` aufrufen, bis die app begonnen hat und das `deviceready`-Ereignis ausgelöst hat. Aber da in der Regel der Splash-Screen soll sichtbar sein, bevor die Anwendung gestartet wurde, scheint die Niederlage der Zweck des Begrüßungsbildschirms. Somit einige Konfiguration in der Datei `config.xml` werden automatisch die Splash `show` sofort nach Ihrer app-Start und Bildschirm bevor es voll begonnen hat, und das `deviceready`-Ereignis empfangen. Weitere Informationen zu dieser Konfiguration finden Sie unter [Symbole und Splash-Screens](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). Aus diesem Grund ist es unwahrscheinlich, dass Sie `navigator.splashscreen.show()` damit den Splash-Screen sichtbar ist für app-Start aufrufen müssen.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-splashscreen/doc/de/index.md b/plugins/cordova-plugin-splashscreen/doc/de/index.md
new file mode 100644
index 0000000..b9fc40d
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/de/index.md
@@ -0,0 +1,78 @@
+
+
+# cordova-plugin-splashscreen
+
+Dieses Plugin zeigt und verbirgt einen Splash-Screen beim Start der Anwendung.
+
+## Installation
+
+ cordova plugin add cordova-plugin-splashscreen
+
+
+## Unterstützte Plattformen
+
+* Amazon Fire OS
+* Android
+* BlackBerry 10
+* iOS
+* Windows Phone 7 und 8
+* Windows 8
+
+## Methoden
+
+* SplashScreen.Show
+* SplashScreen.Hide
+
+### Android Eigenarten
+
+Sie müssen in der config.xml folgende Einstellungen vornehmen:
+
+
+
+
+
+Wo Foo ist der Name der Datei Splashscreen, vorzugsweise eine 9-Patch-Datei. Stellen Sie sicher, Splashcreen Dateien zu Ihrem res/xml-Verzeichnis unter den entsprechenden Ordnern hinzuzufügen. Der zweite Parameter stellt dar, wie lange das Splashscreen in Millisekunden angezeigt werden. Es wird standardmäßig auf 3000 ms. Weitere Informationen finden Sie unter [Symbole und Splash-Screens][1].
+
+ [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
+
+## SplashScreen.Hide
+
+Schließen Sie den Splash-Screen.
+
+ navigator.splashscreen.hide();
+
+
+### BlackBerry 10, WP8, iOS Eigenarten
+
+Die Datei `config.xml` `AutoHideSplashScreen` Einstellung muss `false` sein. Verstecken des Begrüßungsbildschirms für zwei Sekunden Verzögerung, fügen Sie einen Timer wie die folgende in der `deviceready`-Ereignishandler:
+
+ setTimeout(function() {
+ navigator.splashscreen.hide();
+ }, 2000);
+
+
+## SplashScreen.Show
+
+Zeigt den Begrüßungsbildschirm.
+
+ navigator.splashscreen.show();
+
+
+Ihre Anwendung kann nicht `navigator.splashscreen.show()` aufrufen, bis die app begonnen hat und das `deviceready`-Ereignis ausgelöst hat. Aber da in der Regel der Splash-Screen soll sichtbar sein, bevor die Anwendung gestartet wurde, scheint die Niederlage der Zweck des Begrüßungsbildschirms. Somit einige Konfiguration in der Datei `config.xml` werden automatisch die Splash `show` sofort nach Ihrer app-Start und Bildschirm bevor es voll begonnen hat, und das `deviceready`-Ereignis empfangen. Weitere Informationen zu dieser Konfiguration finden Sie unter [Symbole und Splash-Screens][1]. Aus diesem Grund ist es unwahrscheinlich, dass Sie `navigator.splashscreen.show()` damit den Splash-Screen sichtbar ist für app-Start aufrufen müssen.
diff --git a/plugins/cordova-plugin-splashscreen/doc/es/README.md b/plugins/cordova-plugin-splashscreen/doc/es/README.md
new file mode 100644
index 0000000..1a94161
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/es/README.md
@@ -0,0 +1,119 @@
+
+
+# cordova-plugin-splashscreen
+
+[](https://travis-ci.org/apache/cordova-plugin-splashscreen)
+
+Este plugin muestra y esconde una pantalla de bienvenida durante el inicio de la aplicación.
+
+## Instalación
+
+ // npm hosted (new) id
+ cordova plugin add cordova-plugin-splashscreen
+ // you may also install directly from this repo
+ cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git
+
+
+## Plataformas soportadas
+
+ * Amazon fire OS
+ * Android
+ * BlackBerry 10
+ * iOS
+ * Windows Phone 7 y 8
+ * Windows 8
+ * Windows
+ * Explorador
+
+## Métodos
+
+ * splashscreen.show
+ * splashscreen.hide
+
+### Rarezas Android
+
+En el `archivo config.xml`, es necesario agregar las siguientes preferencias:
+
+
+
+
+
+
+Donde foo es el nombre del archivo splashscreen, preferiblemente un archivo de 9 parche. Asegúrese de agregar tus archivos splashcreen en tu directorio res/xml bajo las carpetas apropiadas. El segundo parámetro representa cuánto aparecerán el splashscreen en milisegundos. Valor predeterminado es ms 3000. Ver [los iconos y salpicadura pantallas](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) para obtener más información.
+
+Preferencia "SplashMaintainAspectRatio" es opcional. Si establece en true, pantalla dibujable no es estirado para caber la pantalla, pero en su lugar simplemente "cover" la pantalla, como CSS "background-size: cover". Esto es muy útil cuando las imágenes de pantallas splash no distorsionadas de cualquier manera, por ejemplo cuando contienen texto o paisaje. Esta opción funciona mejor con imágenes que tienen bordes grandes (zonas seguras) que pueden ser recortadas con seguridad en pantallas con diferentes relaciones de aspecto.
+
+El plugin recarga splash dibujable cuando cambia de orientación, por lo que puede especificar diferente dibujo para orientaciones vertical y horizontal.
+
+### Navegador rarezas
+
+Puede utilizar las siguientes preferencias en el `archivo config.xml`:
+
+
+
+
+
+
+
+
+
+
+
+### iOS rarezas
+
+ * `FadeSplashScreen` (booleano, por defecto `true`): establecida en `false` para evitar que la pantalla de bienvenida de descolorarse adentro y hacia fuera cuando cambia su estado de presentación.
+
+
+
+
+ * `FadeSplashScreenDuration` (float, por defecto es `2`): especifica el número de segundos para que la pantalla se descolora efecto para ejecutar.
+
+
+
+
+ * `ShowSplashScreenSpinner` (booleano, por defecto `true`): establecida en `false` para ocultar la ruleta de la pantalla de bienvenida.
+
+
+
+
+## splashscreen.hide
+
+Despedir a la pantalla de bienvenida.
+
+ navigator.splashscreen.hide();
+
+
+### BlackBerry 10, WP8, iOS Quirk
+
+El `config.xml` del archivo `AutoHideSplashScreen` la configuración debe ser `false` . Para retrasar oculta la pantalla splash durante dos segundos, agregue un temporizador como la siguiente en el `deviceready` controlador de eventos:
+
+ setTimeout(function() {
+ navigator.splashscreen.hide();
+ }, 2000);
+
+
+## splashscreen.show
+
+Muestra la pantalla de bienvenida.
+
+ navigator.splashscreen.show();
+
+
+La aplicación no se puede llamar `navigator.splashscreen.show()` hasta que haya iniciado la aplicación y el `deviceready` evento ha despedido. Pero puesto que normalmente la pantalla está destinada a ser visible antes de que comience su aplicación, que parecería que el propósito de la pantalla de bienvenida. Proporcionar cierta configuración en `config.xml` automáticamente `show` la pantalla de presentación inmediatamente después de su lanzamiento de la aplicación y antes de ser completamente ha iniciado y recibió el `deviceready` evento. Ver [los iconos y salpicadura pantallas](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) para obtener más información sobre haciendo esta configuración. Por esta razón, es poco probable que necesitas llamar a `navigator.splashscreen.show()` para hacer la pantalla visible para el inicio de la aplicación.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-splashscreen/doc/es/index.md b/plugins/cordova-plugin-splashscreen/doc/es/index.md
new file mode 100644
index 0000000..3295c27
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/es/index.md
@@ -0,0 +1,76 @@
+
+
+# cordova-plugin-splashscreen
+
+Este plugin muestra y esconde una pantalla de bienvenida durante el inicio de la aplicación.
+
+## Instalación
+
+ cordova plugin add cordova-plugin-splashscreen
+
+
+## Plataformas soportadas
+
+* Amazon fire OS
+* Android
+* BlackBerry 10
+* iOS
+* Windows Phone 7 y 8
+* Windows 8
+
+## Métodos
+
+* splashscreen.show
+* splashscreen.hide
+
+### Rarezas Android
+
+En el archivo config.xml, tienes que añadir las siguientes preferencias:
+
+ < nombre de preferencia = "SplashScreen" value = "foo" / >< nombre de preferencia = "SplashScreenDelay" value = "10000" / >
+
+
+Donde foo es el nombre del archivo splashscreen, preferiblemente un archivo de 9 parche. Asegúrese de agregar tus archivos splashcreen en tu directorio res/xml bajo las carpetas apropiadas. El segundo parámetro representa cuánto aparecerán el splashscreen en milisegundos. Valor predeterminado es ms 3000. Ver [los iconos y salpicadura pantallas][1] para obtener más información.
+
+ [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
+
+## splashscreen.hide
+
+Despedir a la pantalla de bienvenida.
+
+ Navigator.SplashScreen.Hide();
+
+
+### BlackBerry 10, WP8, iOS Quirk
+
+El `config.xml` del archivo `AutoHideSplashScreen` la configuración debe ser `false` . Para retrasar oculta la pantalla splash durante dos segundos, agregue un temporizador como la siguiente en el `deviceready` controlador de eventos:
+
+ setTimeout(function() {navigator.splashscreen.hide();
+ }, 2000);
+
+
+## splashscreen.show
+
+Muestra la pantalla de bienvenida.
+
+ Navigator.SplashScreen.Show();
+
+
+La aplicación no se puede llamar `navigator.splashscreen.show()` hasta que haya iniciado la aplicación y el `deviceready` evento ha despedido. Pero puesto que normalmente la pantalla está destinada a ser visible antes de que comience su aplicación, que parecería que el propósito de la pantalla de bienvenida. Proporcionar cierta configuración en `config.xml` automáticamente `show` la pantalla de presentación inmediatamente después de su lanzamiento de la aplicación y antes de ser completamente ha iniciado y recibió el `deviceready` evento. Ver [los iconos y salpicadura pantallas][1] para obtener más información sobre haciendo esta configuración. Por esta razón, es poco probable que necesitas llamar a `navigator.splashscreen.show()` para hacer la pantalla visible para el inicio de la aplicación.
diff --git a/plugins/cordova-plugin-splashscreen/doc/fr/README.md b/plugins/cordova-plugin-splashscreen/doc/fr/README.md
new file mode 100644
index 0000000..65f5880
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/fr/README.md
@@ -0,0 +1,119 @@
+
+
+# cordova-plugin-splashscreen
+
+[](https://travis-ci.org/apache/cordova-plugin-splashscreen)
+
+Ce plugin affiche et masque un écran de démarrage lors du lancement de l'application.
+
+## Installation
+
+ // npm hosted (new) id
+ cordova plugin add cordova-plugin-splashscreen
+ // you may also install directly from this repo
+ cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git
+
+
+## Plates-formes supportées
+
+ * Amazon Fire OS
+ * Android
+ * BlackBerry 10
+ * iOS
+ * Windows Phone 7 et 8
+ * Windows 8
+ * Windows
+ * Navigateur
+
+## Méthodes
+
+ * splashscreen.Show
+ * splashscreen.Hide
+
+### Quirks Android
+
+Dans votre `fichier config.xml`, vous devez ajouter les préférences suivantes :
+
+
+
+
+
+
+Où foo est le nom du fichier splashscreen, préférablement un fichier de 9 correctif. Assurez-vous d'ajouter vos fichiers splashcreen dans votre répertoire res/xml dans les dossiers appropriés. Le deuxième paramètre représente combien de temps le splashscreen apparaîtra en millisecondes. Il est par défaut à 3000 ms. Pour plus d'informations, consultez [icônes et écrans de démarrage](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html).
+
+Préférence de « SplashMaintainAspectRatio » est facultative. Si défini à true, écran de démarrage drawable n'est pas étirée pour s'adapter écran, mais plutôt simplement « couvre » l'écran, comme CSS "fond-taille : couverture". Ceci est très utile lorsque images écran de démarrage ne peut pas être déformées en quelque sorte, par exemple lorsqu'ils contiennent des décors ou texte. Ce paramètre fonctionne mieux avec des images qui ont des marges importantes (zones de sécurité) qui peuvent être recadrées en toute sécurité sur les écrans avec des proportions différentes.
+
+Le plugin recharge splash drawable chaque fois que l'orientation change, donc vous pouvez spécifier différents drawables pour les orientations portrait et paysage.
+
+### Bizarreries navigateur
+
+Vous pouvez utiliser les préférences suivantes dans votre `fichier config.xml`:
+
+
+
+
+
+
+
+
+
+
+
+### Notes au sujet d'iOS
+
+ * `FadeSplashScreen` (boolean, par défaut est `true`): la valeur `false` pour empêcher l'écran de démarrage de fading in et out lorsque son état d'affichage est modifié.
+
+
+
+
+ * `FadeSplashScreenDuration` (float, la valeur par défaut `2`): spécifie le nombre de secondes que l'écran de démarrage s'estomper l'effet d'exécuter.
+
+
+
+
+ * `ShowSplashScreenSpinner` (boolean, par défaut est `true`): la valeur `false` pour masquer le cône de l'écran de démarrage.
+
+
+
+
+## splashscreen.Hide
+
+Faire disparaître de l'écran de démarrage.
+
+ navigator.splashscreen.hide();
+
+
+### BlackBerry 10, WP8, iOS Quirk
+
+Paramètre `AutoHideSplashScreen` du fichier `config.xml` doit avoir la valeur `false`. Pour retarder la cacher l'écran de démarrage pendant deux secondes, ajouter un minuteur semblable à la suivante dans le gestionnaire d'événements `deviceready` :
+
+ setTimeout(function() {
+ navigator.splashscreen.hide();
+ }, 2000);
+
+
+## splashscreen.Show
+
+Affiche l'écran de démarrage.
+
+ navigator.splashscreen.show();
+
+
+Votre application ne peut pas appeler `navigator.splashscreen.show()` jusqu'à ce que l'application a commencé et l'événement `deviceready` est déclenché. Mais puisqu'en général, l'écran de démarrage est destiné à être visible avant que votre application a commencé, qui semblerait à l'encontre des objectifs de l'écran de démarrage. Fournir une configuration dans le fichier `config.xml` automatiquement `show` le splash projettera immédiatement après votre lancement de l'app et avant qu'il a complètement démarré et a reçu l'événement `deviceready`. Voir les [icônes et les écrans de démarrage](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) pour plus d'informations sur la conduite de cette configuration. Pour cette raison, il est peu probable que vous devez appeler `navigator.splashscreen.show()` pour rendre l'écran de démarrage visible pour le démarrage de l'application.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-splashscreen/doc/fr/index.md b/plugins/cordova-plugin-splashscreen/doc/fr/index.md
new file mode 100644
index 0000000..6d2fd08
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/fr/index.md
@@ -0,0 +1,78 @@
+
+
+# cordova-plugin-splashscreen
+
+Ce plugin affiche et masque un écran de démarrage lors du lancement de l'application.
+
+## Installation
+
+ cordova plugin add cordova-plugin-splashscreen
+
+
+## Plates-formes prises en charge
+
+* Amazon Fire OS
+* Android
+* BlackBerry 10
+* iOS
+* Windows Phone 7 et 8
+* Windows 8
+
+## Méthodes
+
+* splashscreen.Show
+* splashscreen.Hide
+
+### Quirks Android
+
+Dans votre fichier config.xml, vous devez ajouter les préférences suivantes :
+
+
+
+
+
+Où foo est le nom du fichier splashscreen, préférablement un fichier de 9 correctif. Assurez-vous d'ajouter vos fichiers splashcreen dans votre répertoire res/xml dans les dossiers appropriés. Le deuxième paramètre représente combien de temps le splashscreen apparaîtra en millisecondes. Il est par défaut à 3000 ms. Pour plus d'informations, consultez [icônes et écrans de démarrage][1].
+
+ [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
+
+## splashscreen.Hide
+
+Faire disparaître de l'écran de démarrage.
+
+ navigator.splashscreen.hide();
+
+
+### BlackBerry 10, WP8, iOS Quirk
+
+Paramètre `AutoHideSplashScreen` du fichier `config.xml` doit avoir la valeur `false`. Pour retarder la cacher l'écran de démarrage pendant deux secondes, ajouter un minuteur semblable à la suivante dans le gestionnaire d'événements `deviceready` :
+
+ setTimeout(function() {
+ navigator.splashscreen.hide();
+ }, 2000);
+
+
+## splashscreen.Show
+
+Affiche l'écran de démarrage.
+
+ navigator.splashscreen.show();
+
+
+Votre application ne peut pas appeler `navigator.splashscreen.show()` jusqu'à ce que l'application a commencé et l'événement `deviceready` est déclenché. Mais puisqu'en général, l'écran de démarrage est destiné à être visible avant que votre application a commencé, qui semblerait à l'encontre des objectifs de l'écran de démarrage. Fournir une configuration dans le fichier `config.xml` automatiquement `show` le splash projettera immédiatement après votre lancement de l'app et avant qu'il a complètement démarré et a reçu l'événement `deviceready`. Voir les [icônes et les écrans de démarrage][1] pour plus d'informations sur la conduite de cette configuration. Pour cette raison, il est peu probable que vous devez appeler `navigator.splashscreen.show()` pour rendre l'écran de démarrage visible pour le démarrage de l'application.
diff --git a/plugins/cordova-plugin-splashscreen/doc/it/README.md b/plugins/cordova-plugin-splashscreen/doc/it/README.md
new file mode 100644
index 0000000..2a6c6ba
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/it/README.md
@@ -0,0 +1,119 @@
+
+
+# cordova-plugin-splashscreen
+
+[](https://travis-ci.org/apache/cordova-plugin-splashscreen)
+
+Questo plugin Visualizza e nasconde una schermata iniziale durante l'avvio dell'applicazione.
+
+## Installazione
+
+ // npm hosted (new) id
+ cordova plugin add cordova-plugin-splashscreen
+ // you may also install directly from this repo
+ cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git
+
+
+## Piattaforme supportate
+
+ * Amazon fuoco OS
+ * Android
+ * BlackBerry 10
+ * iOS
+ * Windows Phone 7 e 8
+ * Windows 8
+ * Windows
+ * Browser
+
+## Metodi
+
+ * splashscreen
+ * splashscreen.Hide
+
+### Stranezze Android
+
+Nel vostro `config. XML`, è necessario aggiungere le seguenti preferenze:
+
+
+
+
+
+
+Dove foo è il nome del file splashscreen, preferibilmente un file 9 patch. Assicurati di aggiungere i tuoi file splashcreen res/xml nella directory sotto cartelle appropriate. Il secondo parametro rappresenta quanto tempo lo splashscreen apparirà in millisecondi. Il valore predefinito è 3000 ms. Per ulteriori informazioni, vedere [icone e schermate iniziali](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html).
+
+"SplashMaintainAspectRatio" preferenza è facoltativo. Se impostato su true, schermata iniziale drawable non viene adattata per misura lo schermo, ma invece semplicemente "copre" lo schermo, come CSS "sfondo-dimensione: copertina". Questo è molto utile quando immagini schermata iniziale non possono essere distorta in qualche modo, per esempio quando contengono testo o scenario. Questa impostazione funziona meglio con immagini che hanno grandi margini (zone sicure) che possono essere ritagliati in modo sicuro su schermi con proporzioni diverse.
+
+Il plugin viene ricaricata splash drawable ogni volta che cambia orientamento, è possibile specificare diversi parte per orientamento verticale e orizzontale.
+
+### Stranezze browser
+
+Nel vostro `config. XML`, è possibile utilizzare le seguenti preferenze:
+
+
+
+
+
+
+
+
+
+
+
+### iOS stranezze
+
+ * `FadeSplashScreen` (boolean, impostazioni predefinite a `true`): impostare su `false` per impedire che la schermata iniziale e scompaiono quando cambia il relativo stato di visualizzazione.
+
+
+
+
+ * `FadeSplashScreenDuration` (float, il valore predefinito è `2`): specifica il numero di secondi per la schermata iniziale dissolvenza effetto da eseguire.
+
+
+
+
+ * `ShowSplashScreenSpinner` (boolean, impostazioni predefinite a `true`): impostare su `false` per nascondere la filatrice schermata iniziale.
+
+
+
+
+## splashscreen.Hide
+
+Respingere la schermata iniziale.
+
+ navigator.splashscreen.hide();
+
+
+### BlackBerry 10, WP8, iOS Quirk
+
+Impostazione `AutoHideSplashScreen` del file `config.xml` deve essere `false`. Per ritardare nascondendo la schermata iniziale per due secondi, aggiungere un timer ad esempio nel gestore eventi `deviceready`:
+
+ setTimeout(function() {
+ navigator.splashscreen.hide();
+ }, 2000);
+
+
+## splashscreen
+
+Visualizza la schermata iniziale.
+
+ navigator.splashscreen.show();
+
+
+L'applicazione non può chiamare `navigator.splashscreen.show()` fino a quando l'app ha iniziato e ha generato l'evento `deviceready`. Ma poiché in genere la schermata iniziale è destinata ad essere visibile prima app ha iniziato, che sembrerebbe per sconfiggere lo scopo della schermata iniziale. Fornendo qualche configurazione nel `file config.xml` sarà automaticamente `show` il tonfo schermo subito dopo il lancio dell'app e prima che completamente ha iniziato e ha ricevuto l'evento `deviceready`. Per ulteriori informazioni su facendo questa configurazione, vedere [icone e schermate iniziali](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). Per questo motivo, è improbabile che dovete chiamare `navigator.splashscreen.show()` per rendere la schermata visibile per avvio di app.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-splashscreen/doc/it/index.md b/plugins/cordova-plugin-splashscreen/doc/it/index.md
new file mode 100644
index 0000000..7043541
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/it/index.md
@@ -0,0 +1,78 @@
+
+
+# cordova-plugin-splashscreen
+
+Questo plugin Visualizza e nasconde una schermata iniziale durante l'avvio dell'applicazione.
+
+## Installazione
+
+ cordova plugin add cordova-plugin-splashscreen
+
+
+## Piattaforme supportate
+
+* Amazon fuoco OS
+* Android
+* BlackBerry 10
+* iOS
+* Windows Phone 7 e 8
+* Windows 8
+
+## Metodi
+
+* splashscreen
+* splashscreen.Hide
+
+### Stranezze Android
+
+Nel vostro config. xml, è necessario aggiungere le seguenti preferenze:
+
+
+
+
+
+Dove foo è il nome del file splashscreen, preferibilmente un file 9 patch. Assicurati di aggiungere i tuoi file splashcreen res/xml nella directory sotto cartelle appropriate. Il secondo parametro rappresenta quanto tempo lo splashscreen apparirà in millisecondi. Il valore predefinito è 3000 ms. Per ulteriori informazioni, vedere [icone e schermate iniziali][1].
+
+ [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
+
+## splashscreen.Hide
+
+Respingere la schermata iniziale.
+
+ navigator.splashscreen.hide();
+
+
+### BlackBerry 10, WP8, iOS Quirk
+
+Impostazione `AutoHideSplashScreen` del file `config.xml` deve essere `false`. Per ritardare nascondendo la schermata iniziale per due secondi, aggiungere un timer ad esempio nel gestore eventi `deviceready`:
+
+ setTimeout(function() {
+ navigator.splashscreen.hide();
+ }, 2000);
+
+
+## splashscreen
+
+Visualizza la schermata iniziale.
+
+ navigator.splashscreen.show();
+
+
+L'applicazione non può chiamare `navigator.splashscreen.show()` fino a quando l'app ha iniziato e ha generato l'evento `deviceready`. Ma poiché in genere la schermata iniziale è destinata ad essere visibile prima app ha iniziato, che sembrerebbe per sconfiggere lo scopo della schermata iniziale. Fornendo qualche configurazione nel `file config.xml` sarà automaticamente `show` il tonfo schermo subito dopo il lancio dell'app e prima che completamente ha iniziato e ha ricevuto l'evento `deviceready`. Per ulteriori informazioni su facendo questa configurazione, vedere [icone e schermate iniziali][1]. Per questo motivo, è improbabile che dovete chiamare `navigator.splashscreen.show()` per rendere la schermata visibile per avvio di app.
diff --git a/plugins/cordova-plugin-splashscreen/doc/ja/README.md b/plugins/cordova-plugin-splashscreen/doc/ja/README.md
new file mode 100644
index 0000000..a688b27
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/ja/README.md
@@ -0,0 +1,119 @@
+
+
+# cordova-plugin-splashscreen
+
+[](https://travis-ci.org/apache/cordova-plugin-splashscreen)
+
+このプラグインが表示され、アプリケーションの起動中にスプラッシュ スクリーンを非表示にします。
+
+## インストール
+
+ // npm hosted (new) id
+ cordova plugin add cordova-plugin-splashscreen
+ // you may also install directly from this repo
+ cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git
+
+
+## サポートされているプラットフォーム
+
+ * アマゾン火 OS
+ * アンドロイド
+ * ブラックベリー 10
+ * iOS
+ * Windows Phone 7 と 8
+ * Windows 8
+ * Windows
+ * ブラウザー
+
+## メソッド
+
+ * splashscreen.show
+ * splashscreen.hide
+
+### Android の癖
+
+あなたの`config.xml`内の次の設定を追加する必要があります。
+
+
+
+
+
+
+Foo ができれば 9 パッチファイル splashscreen ファイルの名前です。 解像度/xml ディレクトリの適切なフォルダーの下に splashcreen ファイルを追加することを確認します。 2 番目のパラメーターは、スプラッシュ ・ スクリーンがの表示時間 (ミリ秒単位) を表します。 デフォルトでは 3000 ミリ秒です。 詳細については、[アイコンとスプラッシュ画面](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) を参照してください。
+
+"SplashMaintainAspectRatio"の設定はオプションです。 True の場合、スプラッシュ画面描画に設定画面を埋めるために拡大されませんが、代わりに単に「カバー」画面では、CSS のような場合「背景-サイズ: カバー」. これは、たとえば風景またはテキストが含まれている場合、任意の方法でスプラッシュ画面画像が歪むことができない非常に便利です。 この設定は、画面と異なる縦横比で安全にトリミングすることができます大規模なマージン (安全な地域) の画像に適しています。
+
+縦長と横長の異なるドロウアブルを指定できるように、プラグインは向きを変更するたびにスプラッシュ ドロウアブルをリロードします。
+
+### ブラウザーの癖
+
+あなたの`config.xml`で次の設定を使用できます。
+
+
+
+
+
+
+
+
+
+
+
+### iOS の癖
+
+ * `FadeSplashScreen`(ブール値、既定で [ `true`): スプラッシュ画面がフェードインとフェードアウトの表示状態が変更されたときすることを防ぐために`false`に設定します。
+
+
+
+
+ * `FadeSplashScreenDuration`(float, デフォルトは`2`): スプラッシュ画面の秒数のフェードを実行する効果を指定します。
+
+
+
+
+ * `ShowSplashScreenSpinner`(ブール値、既定で [ `true`): スプラッシュ スクリーン スピナーを非表示にするを`false`に設定します。
+
+
+
+
+## splashscreen.hide
+
+スプラッシュ スクリーンを閉じます。
+
+ navigator.splashscreen.hide();
+
+
+### ブラックベリー 10、WP8、iOS の気まぐれ
+
+`config.xml` ファイルの `AutoHideSplashScreen` の設定は `false` である必要があります。 遅延を 2 秒間スプラッシュ スクリーンを非表示に `deviceready` イベント ハンドラーで、次のようタイマーを追加します。
+
+ setTimeout(function() {
+ navigator.splashscreen.hide();
+ }, 2000);
+
+
+## splashscreen.show
+
+スプラッシュ画面が表示されます。
+
+ navigator.splashscreen.show();
+
+
+アプリが開始され、`deviceready` イベントが発生するまで、アプリケーションは `navigator.splashscreen.show()` を呼び出すことはできません。 しかし、以来、通常スプラッシュ画面アプリ開始前に表示するものですと思われる、スプラッシュ スクリーンの目的の敗北します。 `config.xml` にいくつかの構成を提供するは自動的に `表示` スプラッシュ画面、アプリを起動後すぐに、それが完全に起動し、`deviceready` イベントを受信する前に。 詳細についてはこの構成を行うには、[アイコンとスプラッシュ画面](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) を参照してください。 この理由のためにアプリ起動時のスプラッシュ スクリーンを確認 `navigator.splashscreen.show()` をコールする必要がある可能性が高いです。
\ No newline at end of file
diff --git a/plugins/cordova-plugin-splashscreen/doc/ja/index.md b/plugins/cordova-plugin-splashscreen/doc/ja/index.md
new file mode 100644
index 0000000..24e72e5
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/ja/index.md
@@ -0,0 +1,78 @@
+
+
+# cordova-plugin-splashscreen
+
+このプラグインが表示され、アプリケーションの起動中にスプラッシュ スクリーンを非表示にします。
+
+## インストール
+
+ cordova plugin add cordova-plugin-splashscreen
+
+
+## サポートされているプラットフォーム
+
+* アマゾン火 OS
+* アンドロイド
+* ブラックベリー 10
+* iOS
+* Windows Phone 7 と 8
+* Windows 8
+
+## メソッド
+
+* splashscreen.show
+* splashscreen.hide
+
+### Android の癖
+
+あなたの config.xml を以下の設定を追加する必要があります。
+
+
+
+
+
+Foo ができれば 9 パッチファイル splashscreen ファイルの名前です。 解像度/xml ディレクトリの適切なフォルダーの下に splashcreen ファイルを追加することを確認します。 2 番目のパラメーターは、スプラッシュ ・ スクリーンがの表示時間 (ミリ秒単位) を表します。 デフォルトでは 3000 ミリ秒です。 詳細については、[アイコンとスプラッシュ画面][1] を参照してください。
+
+ [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
+
+## splashscreen.hide
+
+スプラッシュ スクリーンを閉じます。
+
+ navigator.splashscreen.hide();
+
+
+### ブラックベリー 10、WP8、iOS の気まぐれ
+
+`config.xml` ファイルの `AutoHideSplashScreen` の設定は `false` である必要があります。 遅延を 2 秒間スプラッシュ スクリーンを非表示に `deviceready` イベント ハンドラーで、次のようタイマーを追加します。
+
+ setTimeout(function() {
+ navigator.splashscreen.hide();
+ }, 2000);
+
+
+## splashscreen.show
+
+スプラッシュ画面が表示されます。
+
+ navigator.splashscreen.show();
+
+
+アプリが開始され、`deviceready` イベントが発生するまで、アプリケーションは `navigator.splashscreen.show()` を呼び出すことはできません。 しかし、以来、通常スプラッシュ画面アプリ開始前に表示するものですと思われる、スプラッシュ スクリーンの目的の敗北します。 `config.xml` にいくつかの構成を提供するは自動的に `表示` スプラッシュ画面、アプリを起動後すぐに、それが完全に起動し、`deviceready` イベントを受信する前に。 詳細についてはこの構成を行うには、[アイコンとスプラッシュ画面][1] を参照してください。 この理由のためにアプリ起動時のスプラッシュ スクリーンを確認 `navigator.splashscreen.show()` をコールする必要がある可能性が高いです。
diff --git a/plugins/cordova-plugin-splashscreen/doc/ko/README.md b/plugins/cordova-plugin-splashscreen/doc/ko/README.md
new file mode 100644
index 0000000..5e10d20
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/ko/README.md
@@ -0,0 +1,119 @@
+
+
+# cordova-plugin-splashscreen
+
+[](https://travis-ci.org/apache/cordova-plugin-splashscreen)
+
+이 플러그인은 표시 하 고 응용 프로그램 실행 하는 동안 시작 화면을 숨깁니다.
+
+## 설치
+
+ // npm hosted (new) id
+ cordova plugin add cordova-plugin-splashscreen
+ // you may also install directly from this repo
+ cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git
+
+
+## 지원 되는 플랫폼
+
+ * 아마존 화재 운영 체제
+ * 안 드 로이드
+ * 블랙베리 10
+ * iOS
+ * Windows Phone 7과 8
+ * 윈도우 8
+ * 윈도우
+ * 브라우저
+
+## 메서드
+
+ * splashscreen.show
+ * splashscreen.hide
+
+### 안 드 로이드 단점
+
+`Config.xml`에 다음 환경 설정에 추가 해야 합니다.
+
+
+
+
+
+
+여기서 foo splashscreen 파일, 선호 9 패치 파일의 이름입니다. 적절 한 폴더 아래 res/xml 디렉토리에 splashcreen 파일을 추가 해야 합니다. 두 번째 매개 변수는 splashscreen 얼마나 밀리초 단위로 표시 됩니다 나타냅니다. 3000 ms 기본값으로 사용 됩니다. 자세한 내용은 [아이콘 및 시작 화면을](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) 참조 하십시오.
+
+"SplashMaintainAspectRatio" 취향은 선택 사항입니다. Drawable, 시작 화면 설정 화면에 맞게 확장 되지 하지만 대신 단순히 "커버" CSS 같은 화면 "배경-크기: 덮개". 시작 화면 이미지 예: 풍경 또는 텍스트를 포함 하는 경우 어떤 식으로든에서 왜곡 될 수 없는 경우에 매우 유용 합니다. 이 설정은 큰 여백 (안전 지역) 안전 하 게 다른 종횡비와 화면에 자를 수 있는 이미지에 가장 적합 합니다.
+
+플러그인 다시 로드 스플래시 drawable 방향이 변경 될 때마다 세로 및 가로 방향에 대 한 다른 drawables를 지정할 수 있도록 합니다.
+
+### 브라우저 만지면
+
+`Config.xml`에 다음 기본 설정을 사용할 수 있습니다.
+
+
+
+
+
+
+
+
+
+
+
+### iOS 단점
+
+ * `FadeSplashScreen` (부울 `true`로 기본값): 시작 화면 표시 상태로 변경 될 때 밖으로 퇴색 하지 않도록 하려면 `false` 로 설정.
+
+
+
+
+ * `FadeSplashScreenDuration` (부동, `2`기본값): 시작 화면에 대 한 초 페이드 효과를 실행 하는 지정 합니다.
+
+
+
+
+ * `ShowSplashScreenSpinner` (부울 `true`로 기본값): 스플래시 화면 회전자를 숨기려면 `false` 로 설정.
+
+
+
+
+## splashscreen.hide
+
+시작 화면을 닫습니다.
+
+ navigator.splashscreen.hide();
+
+
+### 블랙베리 10, WP8, iOS 특질
+
+`config.xml` 파일의 `AutoHideSplashScreen` 설정을 `false` 여야 합니다. 2 초 동안 시작 화면을 숨기고 지연, `deviceready` 이벤트 처리기에서 다음과 같은 타이머를 추가:
+
+ setTimeout(function() {
+ navigator.splashscreen.hide();
+ }, 2000);
+
+
+## splashscreen.show
+
+시작 화면을 표시합니다.
+
+ navigator.splashscreen.show();
+
+
+응용 프로그램 시작 및 `deviceready` 이벤트는 발생 될 때까지 응용 프로그램이 `navigator.splashscreen.show()`을 호출할 수 없습니다. 하지만 그 스플래시 스크린의 목적 것 같다 일반적으로 시작 화면이 당신의 애플 리 케이 션 시작 하기 전에 표시 될 운명이 다, 이후. `config.xml에서` 몇 가지 구성을 제공 하 자동으로 스플래시 `표시` 화면 애플 리 케이 션 출시 직후와 그것은 완벽 하 게 시작 하 고 `deviceready` 이벤트를 받은 전에. 이 구성 하 고 자세한 내용은 [아이콘 및 시작 화면을](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html) 참조 하십시오. 이러한 이유로, 그것은 가능성이 시작 화면은 응용 프로그램 시작에 대 한 표시 되도록 `navigator.splashscreen.show()`를 호출 해야입니다.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-splashscreen/doc/ko/index.md b/plugins/cordova-plugin-splashscreen/doc/ko/index.md
new file mode 100644
index 0000000..6a0ea98
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/ko/index.md
@@ -0,0 +1,78 @@
+
+
+# cordova-plugin-splashscreen
+
+이 플러그인은 표시 하 고 응용 프로그램 실행 하는 동안 시작 화면을 숨깁니다.
+
+## 설치
+
+ cordova plugin add cordova-plugin-splashscreen
+
+
+## 지원 되는 플랫폼
+
+* 아마존 화재 운영 체제
+* 안 드 로이드
+* 블랙베리 10
+* iOS
+* Windows Phone 7과 8
+* 윈도우 8
+
+## 메서드
+
+* splashscreen.show
+* splashscreen.hide
+
+### 안 드 로이드 단점
+
+당신의 config.xml에 다음 환경 설정에 추가 해야 합니다.
+
+
+
+
+
+여기서 foo splashscreen 파일, 선호 9 패치 파일의 이름입니다. 적절 한 폴더 아래 res/xml 디렉토리에 splashcreen 파일을 추가 해야 합니다. 두 번째 매개 변수는 splashscreen 얼마나 밀리초 단위로 표시 됩니다 나타냅니다. 3000 ms 기본값으로 사용 됩니다. 자세한 내용은 [아이콘 및 시작 화면을][1] 참조 하십시오.
+
+ [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
+
+## splashscreen.hide
+
+시작 화면을 닫습니다.
+
+ navigator.splashscreen.hide();
+
+
+### 블랙베리 10, WP8, iOS 특질
+
+`config.xml` 파일의 `AutoHideSplashScreen` 설정을 `false` 여야 합니다. 2 초 동안 시작 화면을 숨기고 지연, `deviceready` 이벤트 처리기에서 다음과 같은 타이머를 추가:
+
+ setTimeout(function() {
+ navigator.splashscreen.hide();
+ }, 2000);
+
+
+## splashscreen.show
+
+시작 화면을 표시합니다.
+
+ navigator.splashscreen.show();
+
+
+응용 프로그램 시작 및 `deviceready` 이벤트는 발생 될 때까지 응용 프로그램이 `navigator.splashscreen.show()`을 호출할 수 없습니다. 하지만 그 스플래시 스크린의 목적 것 같다 일반적으로 시작 화면이 당신의 애플 리 케이 션 시작 하기 전에 표시 될 운명이 다, 이후. `config.xml에서` 몇 가지 구성을 제공 하 자동으로 스플래시 `표시` 화면 애플 리 케이 션 출시 직후와 그것은 완벽 하 게 시작 하 고 `deviceready` 이벤트를 받은 전에. 이 구성 하 고 자세한 내용은 [아이콘 및 시작 화면을][1] 참조 하십시오. 이러한 이유로, 그것은 가능성이 시작 화면은 응용 프로그램 시작에 대 한 표시 되도록 `navigator.splashscreen.show()`를 호출 해야입니다.
diff --git a/plugins/cordova-plugin-splashscreen/doc/pl/README.md b/plugins/cordova-plugin-splashscreen/doc/pl/README.md
new file mode 100644
index 0000000..0156be5
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/pl/README.md
@@ -0,0 +1,119 @@
+
+
+# cordova-plugin-splashscreen
+
+[](https://travis-ci.org/apache/cordova-plugin-splashscreen)
+
+Ten plugin wyświetla i ukrywa ekran powitalny podczas uruchamiania aplikacji.
+
+## Instalacja
+
+ // npm hosted (new) id
+ cordova plugin add cordova-plugin-splashscreen
+ // you may also install directly from this repo
+ cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git
+
+
+## Obsługiwane platformy
+
+ * Amazon Fire OS
+ * Android
+ * BlackBerry 10
+ * iOS
+ * Windows Phone 7 i 8
+ * Windows 8
+ * Windows
+ * Przeglądarka
+
+## Metody
+
+ * splashscreen.show
+ * splashscreen.Hide
+
+### Dziwactwa Androida
+
+W pliku `config.xml`musisz dodać następujące preferencje:
+
+
+
+
+
+
+Gdzie foo jest nazwą pliku ekranu powitalnego, najlepiej 9 łatce. Upewnij się dodać pliki splashcreen do katalogu res/xml w odpowiednich folderach. Drugi parametr reprezentuje, jak długo ekranu powitalnego pojawi się w milisekundach. Domyślnie 3000 ms. Aby uzyskać więcej informacji, zobacz [ikony i ekrany powitalne w aplikacjach](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html).
+
+"SplashMaintainAspectRatio" preferencji jest opcjonalne. Jeśli zestaw na wartość true, ekran powitalny dolarowe nie jest rozciągnięty do ekranów, ale zamiast po prostu "obejmuje" ekranu, jak CSS "tło-rozmiar: okładka". Jest to bardzo przydatne, kiedy opryskać tęcza obrazy nie zniekształcony w jakikolwiek sposób, na przykład, gdy zawierają one dekoracje lub tekst. To ustawienie działa najlepiej z obrazów, które mają duże marginesy (bezpiecznych obszarów), które mogą być bezpiecznie przycięte na ekrany z różnych proporcji.
+
+Plugin ładuje rozchlapać dolarowe, gdy zmienia orientację, tak można określić różnych drawables do orientacji pionowej i poziomej.
+
+### Quirks przeglądarki
+
+W pliku `config.xml`można użyć następujące preferencje:
+
+
+
+
+
+
+
+
+
+
+
+### Dziwactwa iOS
+
+ * `FadeSplashScreen` (wartość logiczna, domyślnie `true`): zestaw na `false` , aby zapobiec Znikająca i odkładane po zmianie stanu wyświetlania ekranu powitalnego.
+
+
+
+
+ * `FadeSplashScreenDuration` (float, domyślnie `2`): określa liczbę sekund dla ekranu powitalnego zanikanie efekt do wykonać.
+
+
+
+
+ * `ShowSplashScreenSpinner` (wartość logiczna, domyślnie `true`): zestaw na `false` , aby ukryć pokrętła ekran powitalny.
+
+
+
+
+## splashscreen.Hide
+
+Odrzucić ten opryskaæ têcza.
+
+ navigator.splashscreen.hide();
+
+
+### Jeżyna 10, WP8, iOS dziwactwo
+
+Plik `config.xml` `AutoHideSplashScreen` ustawienie musi być `false`. Opóźnienia, ukrywanie ekranu powitalnego przez dwie sekundy, dodać timer następujących w `deviceready` obsługa zdarzeń:
+
+ setTimeout(function() {
+ navigator.splashscreen.hide();
+ }, 2000);
+
+
+## splashscreen.show
+
+Wyświetla ekran powitalny.
+
+ navigator.splashscreen.show();
+
+
+Aplikacja nie można wywołać `navigator.splashscreen.show()`, aż aplikacja została uruchomiona i zdarzenie `deviceready` został zwolniony. Ale ponieważ zazwyczaj opryskać tęcza ma być widoczne przed rozpoczęciem aplikacji, wydaje się sprzeczne z celem ekranu powitalnego. Dostarczanie niektórych konfiguracji w `pliku config.xml` będzie automatycznie `show` splash na ekranie natychmiast po uruchomienie aplikacji i przed pełni rozpoczął i odebrał zdarzenie `deviceready`. Aby uzyskać więcej informacji na robienie tej konfiguracji, zobacz [ikony i ekrany powitalne w aplikacjach](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html). Z tego powodu jest mało prawdopodobne, należy zadzwonić `navigator.splashscreen.show()`, aby wyświetlić ekran powitalny dla uruchamiania aplikacji.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-splashscreen/doc/pl/index.md b/plugins/cordova-plugin-splashscreen/doc/pl/index.md
new file mode 100644
index 0000000..33045cb
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/pl/index.md
@@ -0,0 +1,78 @@
+
+
+# cordova-plugin-splashscreen
+
+Ten plugin wyświetla i ukrywa ekran powitalny podczas uruchamiania aplikacji.
+
+## Instalacja
+
+ cordova plugin add cordova-plugin-splashscreen
+
+
+## Obsługiwane platformy
+
+* Amazon Fire OS
+* Android
+* BlackBerry 10
+* iOS
+* Windows Phone 7 i 8
+* Windows 8
+
+## Metody
+
+* splashscreen.show
+* splashscreen.Hide
+
+### Dziwactwa Androida
+
+W pliku config.xml musisz dodać następujące preferencje:
+
+
+
+
+
+Gdzie foo jest nazwą pliku ekranu powitalnego, najlepiej 9 łatce. Upewnij się dodać pliki splashcreen do katalogu res/xml w odpowiednich folderach. Drugi parametr reprezentuje, jak długo ekranu powitalnego pojawi się w milisekundach. Domyślnie 3000 ms. Aby uzyskać więcej informacji, zobacz [ikony i ekrany powitalne w aplikacjach][1].
+
+ [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
+
+## splashscreen.Hide
+
+Odrzucić ten opryskaæ têcza.
+
+ navigator.splashscreen.hide();
+
+
+### Jeżyna 10, WP8, iOS dziwactwo
+
+Plik `config.xml` `AutoHideSplashScreen` ustawienie musi być `false`. Opóźnienia, ukrywanie ekranu powitalnego przez dwie sekundy, dodać timer następujących w `deviceready` obsługa zdarzeń:
+
+ setTimeout(function() {
+ navigator.splashscreen.hide();
+ }, 2000);
+
+
+## splashscreen.show
+
+Wyświetla ekran powitalny.
+
+ navigator.splashscreen.show();
+
+
+Aplikacja nie można wywołać `navigator.splashscreen.show()`, aż aplikacja została uruchomiona i zdarzenie `deviceready` został zwolniony. Ale ponieważ zazwyczaj opryskać tęcza ma być widoczne przed rozpoczęciem aplikacji, wydaje się sprzeczne z celem ekranu powitalnego. Dostarczanie niektórych konfiguracji w `pliku config.xml` będzie automatycznie `show` splash na ekranie natychmiast po uruchomienie aplikacji i przed pełni rozpoczął i odebrał zdarzenie `deviceready`. Aby uzyskać więcej informacji na robienie tej konfiguracji, zobacz [ikony i ekrany powitalne w aplikacjach][1]. Z tego powodu jest mało prawdopodobne, należy zadzwonić `navigator.splashscreen.show()`, aby wyświetlić ekran powitalny dla uruchamiania aplikacji.
diff --git a/plugins/cordova-plugin-splashscreen/doc/ru/index.md b/plugins/cordova-plugin-splashscreen/doc/ru/index.md
new file mode 100644
index 0000000..635c22d
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/ru/index.md
@@ -0,0 +1,75 @@
+
+
+# cordova-plugin-splashscreen
+
+Этот плагин отображает и скрывает экран-заставку при запуске приложения.
+
+## Установка
+
+ cordova plugin add cordova-plugin-splashscreen
+
+
+## Поддерживаемые платформы
+
+* Amazon Fire OS
+* Android
+* BlackBerry 10
+* iOS
+* Windows Phone 7 и 8
+* Windows 8
+
+## Методы
+
+* splashscreen.show
+* splashscreen.hide
+
+### Особенности Android
+
+В вашем файле config.xml необходимо добавить следующие настройки:
+
+`` ``
+
+Где foo это имя файла splashscreen, желательно 9 заплатку. Убедитесь в том добавить ваши splashcreen файлы в папку res/xml в соответствующие папки. Второй параметр представляет, как долго splashscreen появится в миллисекундах. По умолчанию он 3000 МС. Увидеть [иконки и заставки][1] для получения дополнительной информации.
+
+ [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
+
+## splashscreen.hide
+
+Закройте экран-заставка.
+
+ Navigator.SplashScreen.Hide();
+
+
+### Особенности BlackBerry 10, WP8, iOS
+
+`config.xml`Файла `AutoHideSplashScreen` должен быть `false` . Для задержки скрытия заставки на две секунды, добавить таймер, например в `deviceready` обработчик событий:
+
+ setTimeout(function() {navigator.splashscreen.hide();
+ }, 2000);
+
+
+## splashscreen.show
+
+Отображает экран-заставку.
+
+ Navigator.SplashScreen.Show();
+
+
+Ваше приложение не может вызвать `navigator.splashscreen.show()` до тех пор, пока приложение началась и `deviceready` событие инициировано. Но поскольку обычно экран-заставка должен быть видимым до начала вашего приложения, что казалось бы поражение цели экрана-заставки. Предоставление некоторых конфигурации в `config.xml` будет автоматически `show` экран-заставку сразу же после запуска вашего приложения и перед его полностью запущен и получил `deviceready` событие. Увидеть [иконки и заставки][1] для получения дополнительной информации на делать этой конфигурации. По этой причине маловероятно, вам нужно вызвать `navigator.splashscreen.show()` для отображения экрана-заставки для запуска приложения.
diff --git a/plugins/cordova-plugin-splashscreen/doc/zh/README.md b/plugins/cordova-plugin-splashscreen/doc/zh/README.md
new file mode 100644
index 0000000..da37405
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/zh/README.md
@@ -0,0 +1,119 @@
+
+
+# cordova-plugin-splashscreen
+
+[](https://travis-ci.org/apache/cordova-plugin-splashscreen)
+
+這個外掛程式顯示和隱藏在應用程式啟動期間的初始螢幕。
+
+## 安裝
+
+ // npm hosted (new) id
+ cordova plugin add cordova-plugin-splashscreen
+ // you may also install directly from this repo
+ cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git
+
+
+## 支援的平臺
+
+ * 亞馬遜火 OS
+ * Android 系統
+ * 黑莓 10
+ * iOS
+ * Windows Phone 7 和 8
+ * Windows 8
+ * Windows
+ * 瀏覽器
+
+## 方法
+
+ * splashscreen.show
+ * splashscreen.hide
+
+### Android 的怪癖
+
+在你的`config.xml`,您需要添加以下優惠:
+
+
+
+
+
+
+美孚在哪裡閃屏檔,最好是 9 修補程式檔的名稱。 請確保您的 splashcreen 檔添加到 res/xml 目錄下相應的資料夾。 第二個參數表示多久閃屏會顯示以毫秒為單位。 它將預設為 3000 毫秒。 有關更多資訊,請參見 [圖示和啟動畫面](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html)。
+
+"SplashMaintainAspectRatio"首選項是可選的。 如果設置為 true,可繪製的初始螢幕不會拉伸以適合螢幕,但相反只是"覆蓋"螢幕,像 CSS"背景-大小: 蓋"。 這是非常有用的不能以任何方式,例如當他們包含文本或風景畸變閃屏圖像時。 此設置適用于有大利潤 (安全區),可以安全地裁剪不同長寬比與螢幕上的圖像。
+
+該外掛程式重新載入初始可繪製只要方向發生變化,所以您可以指定不同的畫板為縱向和橫向方向。
+
+### 瀏覽器的怪癖
+
+你可以用你的`config.xml`下列優先選項:
+
+
+
+
+
+
+
+
+
+
+
+### iOS 的怪癖
+
+ * `FadeSplashScreen`(預設為`true`的布林值): 設置為`false` ,以防止出現閃屏衰落和退出其顯示狀態發生變化時。
+
+
+
+
+ * `FadeSplashScreenDuration`(float,預設為`2`): 指定的閃屏秒數淡出效果來執行。
+
+
+
+
+ * `ShowSplashScreenSpinner`(boolean, `true`的布林值): 設置為`false`來隱藏初始螢幕微調框。
+
+
+
+
+## splashscreen.hide
+
+解雇的閃屏。
+
+ navigator.splashscreen.hide();
+
+
+### 黑莓 10,WP8,iOS 怪癖
+
+`config.xml` 檔 `AutoHideSplashScreen` 設置必須是 `假` 的。 若要延遲兩秒鐘隱藏的閃屏,`deviceready` 事件處理常式中添加一個計時器,如下所示:
+
+ setTimeout(function() {
+ navigator.splashscreen.hide();
+ }, 2000);
+
+
+## splashscreen.show
+
+顯示初始螢幕。
+
+ navigator.splashscreen.show();
+
+
+您的應用程式無法調用 `navigator.splashscreen.show()`,直到該應用程式已啟動,且觸發了 `deviceready` 事件。 但是,由於通常的閃屏為了是可見的在您的應用程式啟動之前,這似乎會打敗閃屏的目的。 提供一些配置在 `config.xml` 中的會自動 `show` 初始螢幕您的應用程式啟動後立即和之前它已經完全起步並收到 `deviceready` 事件。 做這種配置的詳細資訊,請參閱 [圖示和啟動畫面](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html)。 出於此原因,不太可能您需要調用 `navigator.splashscreen.show()`,使初始螢幕可見為應用程式啟動。
\ No newline at end of file
diff --git a/plugins/cordova-plugin-splashscreen/doc/zh/index.md b/plugins/cordova-plugin-splashscreen/doc/zh/index.md
new file mode 100644
index 0000000..efb309d
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/doc/zh/index.md
@@ -0,0 +1,78 @@
+
+
+# cordova-plugin-splashscreen
+
+這個外掛程式顯示和隱藏在應用程式啟動期間的初始螢幕。
+
+## 安裝
+
+ cordova plugin add cordova-plugin-splashscreen
+
+
+## 支援的平臺
+
+* 亞馬遜火 OS
+* Android 系統
+* 黑莓 10
+* iOS
+* Windows Phone 7 和 8
+* Windows 8
+
+## 方法
+
+* splashscreen.show
+* splashscreen.hide
+
+### Android 的怪癖
+
+在你的 config.xml,您需要添加以下優惠:
+
+
+
+
+
+美孚在哪裡閃屏檔,最好是 9 修補程式檔的名稱。 請確保您的 splashcreen 檔添加到 res/xml 目錄下相應的資料夾。 第二個參數表示多久閃屏會顯示以毫秒為單位。 它將預設為 3000 毫秒。 有關更多資訊,請參見 [圖示和啟動畫面][1]。
+
+ [1]: http://cordova.apache.org/docs/en/edge/config_ref_images.md.html
+
+## splashscreen.hide
+
+解雇的閃屏。
+
+ navigator.splashscreen.hide();
+
+
+### 黑莓 10,WP8,iOS 怪癖
+
+`config.xml` 檔 `AutoHideSplashScreen` 設置必須是 `假` 的。 若要延遲兩秒鐘隱藏的閃屏,`deviceready` 事件處理常式中添加一個計時器,如下所示:
+
+ setTimeout(function() {
+ navigator.splashscreen.hide();
+ }, 2000);
+
+
+## splashscreen.show
+
+顯示初始螢幕。
+
+ navigator.splashscreen.show();
+
+
+您的應用程式無法調用 `navigator.splashscreen.show()`,直到該應用程式已啟動,且觸發了 `deviceready` 事件。 但是,由於通常的閃屏為了是可見的在您的應用程式啟動之前,這似乎會打敗閃屏的目的。 提供一些配置在 `config.xml` 中的會自動 `show` 初始螢幕您的應用程式啟動後立即和之前它已經完全起步並收到 `deviceready` 事件。 做這種配置的詳細資訊,請參閱 [圖示和啟動畫面][1]。 出於此原因,不太可能您需要調用 `navigator.splashscreen.show()`,使初始螢幕可見為應用程式啟動。
diff --git a/plugins/cordova-plugin-splashscreen/package.json b/plugins/cordova-plugin-splashscreen/package.json
new file mode 100644
index 0000000..8a951b1
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/package.json
@@ -0,0 +1,83 @@
+{
+ "_from": "cordova-plugin-splashscreen@5.0.2",
+ "_id": "cordova-plugin-splashscreen@5.0.2",
+ "_inBundle": false,
+ "_integrity": "sha1-dH509W4gHNWFvGLRS8oZ9oZ/8e0=",
+ "_location": "/cordova-plugin-splashscreen",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "cordova-plugin-splashscreen@5.0.2",
+ "name": "cordova-plugin-splashscreen",
+ "escapedName": "cordova-plugin-splashscreen",
+ "rawSpec": "5.0.2",
+ "saveSpec": null,
+ "fetchSpec": "5.0.2"
+ },
+ "_requiredBy": [
+ "#DEV:/",
+ "#USER"
+ ],
+ "_resolved": "https://registry.npmjs.org/cordova-plugin-splashscreen/-/cordova-plugin-splashscreen-5.0.2.tgz",
+ "_shasum": "747e74f56e201cd585bc62d14bca19f6867ff1ed",
+ "_spec": "cordova-plugin-splashscreen@5.0.2",
+ "_where": "/home/saherelm/Documents/My Projects/xFrameworkTest",
+ "author": {
+ "name": "Apache Software Foundation"
+ },
+ "bugs": {
+ "url": "https://issues.apache.org/jira/browse/CB"
+ },
+ "bundleDependencies": false,
+ "cordova": {
+ "id": "cordova-plugin-splashscreen",
+ "platforms": [
+ "android",
+ "ubuntu",
+ "ios",
+ "windows",
+ "browser"
+ ]
+ },
+ "deprecated": false,
+ "description": "Cordova Splashscreen Plugin",
+ "devDependencies": {
+ "jshint": "^2.6.0"
+ },
+ "engines": {
+ "cordovaDependencies": {
+ "2.0.0": {
+ "cordova-android": ">=3.6.0"
+ },
+ "4.0.0": {
+ "cordova-android": ">=3.6.0",
+ "cordova-windows": ">=4.4.0"
+ },
+ "6.0.0": {
+ "cordova": ">100"
+ }
+ }
+ },
+ "homepage": "https://github.com/apache/cordova-plugin-splashscreen#readme",
+ "keywords": [
+ "cordova",
+ "splashscreen",
+ "ecosystem:cordova",
+ "cordova-android",
+ "cordova-ios",
+ "cordova-windows"
+ ],
+ "license": "Apache-2.0",
+ "name": "cordova-plugin-splashscreen",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/apache/cordova-plugin-splashscreen.git"
+ },
+ "scripts": {
+ "jshint": "node node_modules/jshint/bin/jshint www && node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint tests",
+ "test": "npm run jshint"
+ },
+ "types": "./types/index.d.ts",
+ "version": "5.0.2"
+}
diff --git a/plugins/cordova-plugin-splashscreen/plugin.xml b/plugins/cordova-plugin-splashscreen/plugin.xml
new file mode 100644
index 0000000..bf3c8a4
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/plugin.xml
@@ -0,0 +1,82 @@
+
+
+
+
+ Splashscreen
+ Cordova Splashscreen Plugin
+ Apache 2.0
+ cordova,splashscreen
+ https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git
+ https://issues.apache.org/jira/browse/CB/component/12320653
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/cordova-plugin-splashscreen/src/android/SplashScreen.java b/plugins/cordova-plugin-splashscreen/src/android/SplashScreen.java
new file mode 100644
index 0000000..6f56c6c
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/src/android/SplashScreen.java
@@ -0,0 +1,413 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+package org.apache.cordova.splashscreen;
+
+import android.app.Dialog;
+import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.res.Configuration;
+import android.content.res.ColorStateList;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
+import android.os.Handler;
+import android.view.Display;
+import android.view.Gravity;
+import android.view.View;
+import android.view.ViewGroup.LayoutParams;
+import android.view.WindowManager;
+import android.view.animation.Animation;
+import android.view.animation.AlphaAnimation;
+import android.view.animation.DecelerateInterpolator;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ProgressBar;
+import android.widget.RelativeLayout;
+
+import org.apache.cordova.CallbackContext;
+import org.apache.cordova.CordovaPlugin;
+import org.apache.cordova.CordovaWebView;
+import org.json.JSONArray;
+import org.json.JSONException;
+
+public class SplashScreen extends CordovaPlugin {
+ private static final String LOG_TAG = "SplashScreen";
+ // Cordova 3.x.x has a copy of this plugin bundled with it (SplashScreenInternal.java).
+ // Enable functionality only if running on 4.x.x.
+ private static final boolean HAS_BUILT_IN_SPLASH_SCREEN = Integer.valueOf(CordovaWebView.CORDOVA_VERSION.split("\\.")[0]) < 4;
+ private static final int DEFAULT_SPLASHSCREEN_DURATION = 3000;
+ private static final int DEFAULT_FADE_DURATION = 500;
+ private static Dialog splashDialog;
+ private static ProgressDialog spinnerDialog;
+ private static boolean firstShow = true;
+ private static boolean lastHideAfterDelay; // https://issues.apache.org/jira/browse/CB-9094
+
+ /**
+ * Displays the splash drawable.
+ */
+ private ImageView splashImageView;
+
+ /**
+ * Remember last device orientation to detect orientation changes.
+ */
+ private int orientation;
+
+ // Helper to be compile-time compatible with both Cordova 3.x and 4.x.
+ private View getView() {
+ try {
+ return (View)webView.getClass().getMethod("getView").invoke(webView);
+ } catch (Exception e) {
+ return (View)webView;
+ }
+ }
+
+ private int getSplashId() {
+ int drawableId = 0;
+ String splashResource = preferences.getString("SplashScreen", "screen");
+ if (splashResource != null) {
+ drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getClass().getPackage().getName());
+ if (drawableId == 0) {
+ drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getPackageName());
+ }
+ }
+ return drawableId;
+ }
+
+ @Override
+ protected void pluginInitialize() {
+ if (HAS_BUILT_IN_SPLASH_SCREEN) {
+ return;
+ }
+ // Make WebView invisible while loading URL
+ // CB-11326 Ensure we're calling this on UI thread
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ getView().setVisibility(View.INVISIBLE);
+ }
+ });
+ int drawableId = getSplashId();
+
+ // Save initial orientation.
+ orientation = cordova.getActivity().getResources().getConfiguration().orientation;
+
+ if (firstShow) {
+ boolean autoHide = preferences.getBoolean("AutoHideSplashScreen", true);
+ showSplashScreen(autoHide);
+ }
+
+ if (preferences.getBoolean("SplashShowOnlyFirstTime", true)) {
+ firstShow = false;
+ }
+ }
+
+ /**
+ * Shorter way to check value of "SplashMaintainAspectRatio" preference.
+ */
+ private boolean isMaintainAspectRatio () {
+ return preferences.getBoolean("SplashMaintainAspectRatio", false);
+ }
+
+ private int getFadeDuration () {
+ int fadeSplashScreenDuration = preferences.getBoolean("FadeSplashScreen", true) ?
+ preferences.getInteger("FadeSplashScreenDuration", DEFAULT_FADE_DURATION) : 0;
+
+ if (fadeSplashScreenDuration < 30) {
+ // [CB-9750] This value used to be in decimal seconds, so we will assume that if someone specifies 10
+ // they mean 10 seconds, and not the meaningless 10ms
+ fadeSplashScreenDuration *= 1000;
+ }
+
+ return fadeSplashScreenDuration;
+ }
+
+ @Override
+ public void onPause(boolean multitasking) {
+ if (HAS_BUILT_IN_SPLASH_SCREEN) {
+ return;
+ }
+ // hide the splash screen to avoid leaking a window
+ this.removeSplashScreen(true);
+ }
+
+ @Override
+ public void onDestroy() {
+ if (HAS_BUILT_IN_SPLASH_SCREEN) {
+ return;
+ }
+ // hide the splash screen to avoid leaking a window
+ this.removeSplashScreen(true);
+ // If we set this to true onDestroy, we lose track when we go from page to page!
+ //firstShow = true;
+ }
+
+ @Override
+ public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
+ if (action.equals("hide")) {
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ webView.postMessage("splashscreen", "hide");
+ }
+ });
+ } else if (action.equals("show")) {
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ webView.postMessage("splashscreen", "show");
+ }
+ });
+ } else {
+ return false;
+ }
+
+ callbackContext.success();
+ return true;
+ }
+
+ @Override
+ public Object onMessage(String id, Object data) {
+ if (HAS_BUILT_IN_SPLASH_SCREEN) {
+ return null;
+ }
+ if ("splashscreen".equals(id)) {
+ if ("hide".equals(data.toString())) {
+ this.removeSplashScreen(false);
+ } else {
+ this.showSplashScreen(false);
+ }
+ } else if ("spinner".equals(id)) {
+ if ("stop".equals(data.toString())) {
+ getView().setVisibility(View.VISIBLE);
+ }
+ } else if ("onReceivedError".equals(id)) {
+ this.spinnerStop();
+ }
+ return null;
+ }
+
+ // Don't add @Override so that plugin still compiles on 3.x.x for a while
+ public void onConfigurationChanged(Configuration newConfig) {
+ if (newConfig.orientation != orientation) {
+ orientation = newConfig.orientation;
+
+ // Splash drawable may change with orientation, so reload it.
+ if (splashImageView != null) {
+ int drawableId = getSplashId();
+ if (drawableId != 0) {
+ splashImageView.setImageDrawable(cordova.getActivity().getResources().getDrawable(drawableId));
+ }
+ }
+ }
+ }
+
+ private void removeSplashScreen(final boolean forceHideImmediately) {
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ if (splashDialog != null && splashDialog.isShowing()) {
+ final int fadeSplashScreenDuration = getFadeDuration();
+ // CB-10692 If the plugin is being paused/destroyed, skip the fading and hide it immediately
+ if (fadeSplashScreenDuration > 0 && forceHideImmediately == false) {
+ AlphaAnimation fadeOut = new AlphaAnimation(1, 0);
+ fadeOut.setInterpolator(new DecelerateInterpolator());
+ fadeOut.setDuration(fadeSplashScreenDuration);
+
+ splashImageView.setAnimation(fadeOut);
+ splashImageView.startAnimation(fadeOut);
+
+ fadeOut.setAnimationListener(new Animation.AnimationListener() {
+ @Override
+ public void onAnimationStart(Animation animation) {
+ spinnerStop();
+ }
+
+ @Override
+ public void onAnimationEnd(Animation animation) {
+ if (splashDialog != null && splashDialog.isShowing()) {
+ splashDialog.dismiss();
+ splashDialog = null;
+ splashImageView = null;
+ }
+ }
+
+ @Override
+ public void onAnimationRepeat(Animation animation) {
+ }
+ });
+ } else {
+ spinnerStop();
+ splashDialog.dismiss();
+ splashDialog = null;
+ splashImageView = null;
+ }
+ }
+ }
+ });
+ }
+
+ /**
+ * Shows the splash screen over the full Activity
+ */
+ @SuppressWarnings("deprecation")
+ private void showSplashScreen(final boolean hideAfterDelay) {
+ final int splashscreenTime = preferences.getInteger("SplashScreenDelay", DEFAULT_SPLASHSCREEN_DURATION);
+ final int drawableId = getSplashId();
+
+ final int fadeSplashScreenDuration = getFadeDuration();
+ final int effectiveSplashDuration = Math.max(0, splashscreenTime - fadeSplashScreenDuration);
+
+ lastHideAfterDelay = hideAfterDelay;
+
+ // Prevent to show the splash dialog if the activity is in the process of finishing
+ if (cordova.getActivity().isFinishing()) {
+ return;
+ }
+ // If the splash dialog is showing don't try to show it again
+ if (splashDialog != null && splashDialog.isShowing()) {
+ return;
+ }
+ if (drawableId == 0 || (splashscreenTime <= 0 && hideAfterDelay)) {
+ return;
+ }
+
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ // Get reference to display
+ Display display = cordova.getActivity().getWindowManager().getDefaultDisplay();
+ Context context = webView.getContext();
+
+ // Use an ImageView to render the image because of its flexible scaling options.
+ splashImageView = new ImageView(context);
+ splashImageView.setImageResource(drawableId);
+ LayoutParams layoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
+ splashImageView.setLayoutParams(layoutParams);
+
+ splashImageView.setMinimumHeight(display.getHeight());
+ splashImageView.setMinimumWidth(display.getWidth());
+
+ // TODO: Use the background color of the webView's parent instead of using the preference.
+ splashImageView.setBackgroundColor(preferences.getInteger("backgroundColor", Color.BLACK));
+
+ if (isMaintainAspectRatio()) {
+ // CENTER_CROP scale mode is equivalent to CSS "background-size:cover"
+ splashImageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
+ }
+ else {
+ // FIT_XY scales image non-uniformly to fit into image view.
+ splashImageView.setScaleType(ImageView.ScaleType.FIT_XY);
+ }
+
+ // Create and show the dialog
+ splashDialog = new Dialog(context, android.R.style.Theme_Translucent_NoTitleBar);
+ // check to see if the splash screen should be full screen
+ if ((cordova.getActivity().getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN)
+ == WindowManager.LayoutParams.FLAG_FULLSCREEN) {
+ splashDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
+ WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ }
+ splashDialog.setContentView(splashImageView);
+ splashDialog.setCancelable(false);
+ splashDialog.show();
+
+ if (preferences.getBoolean("ShowSplashScreenSpinner", true)) {
+ spinnerStart();
+ }
+
+ // Set Runnable to remove splash screen just in case
+ if (hideAfterDelay) {
+ final Handler handler = new Handler();
+ handler.postDelayed(new Runnable() {
+ public void run() {
+ if (lastHideAfterDelay) {
+ removeSplashScreen(false);
+ }
+ }
+ }, effectiveSplashDuration);
+ }
+ }
+ });
+ }
+
+ // Show only spinner in the center of the screen
+ private void spinnerStart() {
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ spinnerStop();
+
+ spinnerDialog = new ProgressDialog(webView.getContext());
+ spinnerDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
+ public void onCancel(DialogInterface dialog) {
+ spinnerDialog = null;
+ }
+ });
+
+ spinnerDialog.setCancelable(false);
+ spinnerDialog.setIndeterminate(true);
+
+ RelativeLayout centeredLayout = new RelativeLayout(cordova.getActivity());
+ centeredLayout.setGravity(Gravity.CENTER);
+ centeredLayout.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
+
+ ProgressBar progressBar = new ProgressBar(webView.getContext());
+ RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
+ layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
+ progressBar.setLayoutParams(layoutParams);
+
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
+ String colorName = preferences.getString("SplashScreenSpinnerColor", null);
+ if(colorName != null){
+ int[][] states = new int[][] {
+ new int[] { android.R.attr.state_enabled}, // enabled
+ new int[] {-android.R.attr.state_enabled}, // disabled
+ new int[] {-android.R.attr.state_checked}, // unchecked
+ new int[] { android.R.attr.state_pressed} // pressed
+ };
+ int progressBarColor = Color.parseColor(colorName);
+ int[] colors = new int[] {
+ progressBarColor,
+ progressBarColor,
+ progressBarColor,
+ progressBarColor
+ };
+ ColorStateList colorStateList = new ColorStateList(states, colors);
+ progressBar.setIndeterminateTintList(colorStateList);
+ }
+ }
+
+ centeredLayout.addView(progressBar);
+
+ spinnerDialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
+ spinnerDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
+
+ spinnerDialog.show();
+ spinnerDialog.setContentView(centeredLayout);
+ }
+ });
+ }
+
+ private void spinnerStop() {
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ if (spinnerDialog != null && spinnerDialog.isShowing()) {
+ spinnerDialog.dismiss();
+ spinnerDialog = null;
+ }
+ }
+ });
+ }
+}
diff --git a/plugins/cordova-plugin-splashscreen/src/browser/SplashScreenProxy.js b/plugins/cordova-plugin-splashscreen/src/browser/SplashScreenProxy.js
new file mode 100644
index 0000000..1a5cd30
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/src/browser/SplashScreenProxy.js
@@ -0,0 +1,170 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+// Default parameter values including image size can be changed in `config.xml`
+var splashImageWidth = 170;
+var splashImageHeight = 200;
+var position = { x: 0, y: 0, width: splashImageWidth, height: splashImageHeight };
+var localSplash; // the image to display
+var localSplashImage;
+var bgColor = "#464646";
+var imageSrc = '/img/logo.png';
+var splashScreenDelay = 3000; // in milliseconds
+var showSplashScreen = true; // show splashcreen by default
+var cordova = require('cordova');
+var configHelper = cordova.require('cordova/confighelper');
+var autoHideSplashScreen = true;
+
+function updateImageLocation() {
+ position.width = Math.min(splashImageWidth, window.innerWidth);
+ position.height = position.width * (splashImageHeight / splashImageWidth);
+
+ localSplash.style.width = window.innerWidth + "px";
+ localSplash.style.height = window.innerHeight + "px";
+ localSplash.style.top = "0px";
+ localSplash.style.left = "0px";
+
+ localSplashImage.style.top = "50%";
+ localSplashImage.style.left = "50%";
+ localSplashImage.style.height = position.height + "px";
+ localSplashImage.style.width = position.width + "px";
+ localSplashImage.style.marginTop = (-position.height / 2) + "px";
+ localSplashImage.style.marginLeft = (-position.width / 2) + "px";
+}
+
+function onResize() {
+ updateImageLocation();
+}
+
+var SplashScreen = {
+ setBGColor: function (cssBGColor) {
+ bgColor = cssBGColor;
+ if (localSplash) {
+ localSplash.style.backgroundColor = bgColor;
+ }
+ },
+ show: function () {
+ if(!localSplash) {
+ window.addEventListener("resize", onResize, false);
+ localSplash = document.createElement("div");
+ localSplash.style.backgroundColor = bgColor;
+ localSplash.style.position = "absolute";
+ localSplash.style["z-index"] = "99999";
+
+ localSplashImage = document.createElement("img");
+ localSplashImage.src = imageSrc;
+ localSplashImage.style.position = "absolute";
+
+ updateImageLocation();
+
+ localSplash.appendChild(localSplashImage);
+ document.body.appendChild(localSplash);
+
+ // deviceready fires earlier than the plugin init on cold-start
+ if (SplashScreen.shouldHideImmediately) {
+ SplashScreen.shouldHideImmediately = false;
+ window.setTimeout(function () {
+ SplashScreen.hide();
+ }, 1000);
+ }
+ }
+ },
+ hide: function () {
+ if(localSplash) {
+ var innerLocalSplash = localSplash;
+ localSplash = null;
+ window.removeEventListener("resize", onResize, false);
+
+ innerLocalSplash.style.opacity = '0';
+ innerLocalSplash.style["-webkit-transition"] = "opacity 1s ease-in-out";
+ innerLocalSplash.style["-moz-transition"] = "opacity 1s ease-in-out";
+ innerLocalSplash.style["-ms-transition"] = "opacity 1s ease-in-out";
+ innerLocalSplash.style["-o-transition"] = "opacity 1s ease-in-out";
+
+ window.setTimeout(function () {
+ document.body.removeChild(innerLocalSplash);
+ innerLocalSplash = null;
+ }, 1000);
+ } else {
+ SplashScreen.shouldHideImmediately = true;
+ }
+ }
+};
+
+/**
+ * Reads preferences via ConfigHelper and substitutes default parameters.
+ */
+function readPreferencesFromCfg(cfg) {
+ try {
+ var value = cfg.getPreferenceValue('ShowSplashScreen');
+ if(typeof value != 'undefined') {
+ showSplashScreen = value === 'true';
+ }
+
+ splashScreenDelay = cfg.getPreferenceValue('SplashScreenDelay') || splashScreenDelay;
+ splashScreenDelay = parseInt(splashScreenDelay, 10);
+
+ imageSrc = cfg.getPreferenceValue('SplashScreen') || imageSrc;
+ bgColor = cfg.getPreferenceValue('SplashScreenBackgroundColor') || bgColor;
+ splashImageWidth = cfg.getPreferenceValue('SplashScreenWidth') || splashImageWidth;
+ splashImageHeight = cfg.getPreferenceValue('SplashScreenHeight') || splashImageHeight;
+ autoHideSplashScreen = cfg.getPreferenceValue('AutoHideSplashScreen') || autoHideSplashScreen;
+ autoHideSplashScreen = (autoHideSplashScreen === true || autoHideSplashScreen.toLowerCase() === 'true');
+ } catch(e) {
+ var msg = '[Browser][SplashScreen] Error occurred on loading preferences from config.xml: ' + JSON.stringify(e);
+ console.error(msg);
+ }
+}
+
+/**
+ * Shows and hides splashscreen if it is enabled, with a delay according the current preferences.
+ */
+function showAndHide() {
+ if(showSplashScreen) {
+ SplashScreen.show();
+
+ window.setTimeout(function() {
+ SplashScreen.hide();
+ }, splashScreenDelay);
+ }
+}
+
+/**
+ * Tries to read config.xml and override default properties and then shows and hides splashscreen if it is enabled.
+ */
+(function initAndShow() {
+ configHelper.readConfig(function(config) {
+ readPreferencesFromCfg(config);
+ if (autoHideSplashScreen) {
+ showAndHide();
+ } else {
+ SplashScreen.show();
+ }
+
+ }, function(err) {
+ console.error(err);
+ });
+})();
+
+module.exports = SplashScreen;
+
+require("cordova/exec/proxy").add("SplashScreen", SplashScreen);
+
diff --git a/plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.h b/plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.h
new file mode 100644
index 0000000..dcc0d77
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.h
@@ -0,0 +1,46 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import
+#import
+
+typedef struct {
+ BOOL iPhone;
+ BOOL iPad;
+ BOOL iPhone4;
+ BOOL iPhone5;
+ BOOL iPhone6;
+ BOOL iPhone6Plus;
+ BOOL retina;
+ BOOL iPhoneX;
+
+} CDV_iOSDevice;
+
+@interface CDVSplashScreen : CDVPlugin {
+ UIActivityIndicatorView* _activityView;
+ UIImageView* _imageView;
+ NSString* _curImageName;
+ BOOL _visible;
+ BOOL _destroyed;
+}
+
+- (void)show:(CDVInvokedUrlCommand*)command;
+- (void)hide:(CDVInvokedUrlCommand*)command;
+
+@end
diff --git a/plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.m b/plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.m
new file mode 100644
index 0000000..9b04582
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/src/ios/CDVSplashScreen.m
@@ -0,0 +1,514 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVSplashScreen.h"
+#import
+#import
+#import "CDVViewController+SplashScreen.h"
+
+#define kSplashScreenDurationDefault 3000.0f
+#define kFadeDurationDefault 500.0f
+
+
+@implementation CDVSplashScreen
+
+- (void)pluginInitialize
+{
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pageDidLoad) name:CDVPageDidLoadNotification object:nil];
+
+ [self setVisible:YES];
+}
+
+- (void)show:(CDVInvokedUrlCommand*)command
+{
+ [self setVisible:YES];
+}
+
+- (void)hide:(CDVInvokedUrlCommand*)command
+{
+ [self setVisible:NO andForce:YES];
+}
+
+- (void)pageDidLoad
+{
+ id autoHideSplashScreenValue = [self.commandDelegate.settings objectForKey:[@"AutoHideSplashScreen" lowercaseString]];
+
+ // if value is missing, default to yes
+ if ((autoHideSplashScreenValue == nil) || [autoHideSplashScreenValue boolValue]) {
+ [self setVisible:NO];
+ }
+}
+
+- (void)observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object change:(NSDictionary*)change context:(void*)context
+{
+ [self updateImage];
+}
+
+- (void)createViews
+{
+ /*
+ * The Activity View is the top spinning throbber in the status/battery bar. We init it with the default Grey Style.
+ *
+ * whiteLarge = UIActivityIndicatorViewStyleWhiteLarge
+ * white = UIActivityIndicatorViewStyleWhite
+ * gray = UIActivityIndicatorViewStyleGray
+ *
+ */
+
+ // Determine whether rotation should be enabled for this device
+ // Per iOS HIG, landscape is only supported on iPad and iPhone 6+
+ CDV_iOSDevice device = [self getCurrentDevice];
+ BOOL autorotateValue = (device.iPad || device.iPhone6Plus || device.iPhoneX) ?
+ [(CDVViewController *)self.viewController shouldAutorotateDefaultValue] :
+ NO;
+
+ [(CDVViewController *)self.viewController setEnabledAutorotation:autorotateValue];
+
+ NSString* topActivityIndicator = [self.commandDelegate.settings objectForKey:[@"TopActivityIndicator" lowercaseString]];
+ UIActivityIndicatorViewStyle topActivityIndicatorStyle = UIActivityIndicatorViewStyleGray;
+
+ if ([topActivityIndicator isEqualToString:@"whiteLarge"])
+ {
+ topActivityIndicatorStyle = UIActivityIndicatorViewStyleWhiteLarge;
+ }
+ else if ([topActivityIndicator isEqualToString:@"white"])
+ {
+ topActivityIndicatorStyle = UIActivityIndicatorViewStyleWhite;
+ }
+ else if ([topActivityIndicator isEqualToString:@"gray"])
+ {
+ topActivityIndicatorStyle = UIActivityIndicatorViewStyleGray;
+ }
+
+ UIView* parentView = self.viewController.view;
+ parentView.userInteractionEnabled = NO; // disable user interaction while splashscreen is shown
+ _activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:topActivityIndicatorStyle];
+ _activityView.center = CGPointMake(parentView.bounds.size.width / 2, parentView.bounds.size.height / 2);
+ _activityView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin
+ | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin;
+ [_activityView startAnimating];
+
+ // Set the frame & image later.
+ _imageView = [[UIImageView alloc] init];
+ [parentView addSubview:_imageView];
+
+ id showSplashScreenSpinnerValue = [self.commandDelegate.settings objectForKey:[@"ShowSplashScreenSpinner" lowercaseString]];
+ // backwards compatibility - if key is missing, default to true
+ if ((showSplashScreenSpinnerValue == nil) || [showSplashScreenSpinnerValue boolValue])
+ {
+ [parentView addSubview:_activityView];
+ }
+
+ // Frame is required when launching in portrait mode.
+ // Bounds for landscape since it captures the rotation.
+ [parentView addObserver:self forKeyPath:@"frame" options:0 context:nil];
+ [parentView addObserver:self forKeyPath:@"bounds" options:0 context:nil];
+
+ [self updateImage];
+ _destroyed = NO;
+}
+
+- (void)hideViews
+{
+ [_imageView setAlpha:0];
+ [_activityView setAlpha:0];
+}
+
+- (void)destroyViews
+{
+ _destroyed = YES;
+ [(CDVViewController *)self.viewController setEnabledAutorotation:[(CDVViewController *)self.viewController shouldAutorotateDefaultValue]];
+
+ [_imageView removeFromSuperview];
+ [_activityView removeFromSuperview];
+ _imageView = nil;
+ _activityView = nil;
+ _curImageName = nil;
+
+ self.viewController.view.userInteractionEnabled = YES; // re-enable user interaction upon completion
+ @try {
+ [self.viewController.view removeObserver:self forKeyPath:@"frame"];
+ [self.viewController.view removeObserver:self forKeyPath:@"bounds"];
+ }
+ @catch (NSException *exception) {
+ // When reloading the page from a remotely connected Safari, there
+ // are no observers, so the removeObserver method throws an exception,
+ // that we can safely ignore.
+ // Alternatively we can check whether there are observers before calling removeObserver
+ }
+}
+
+- (CDV_iOSDevice) getCurrentDevice
+{
+ CDV_iOSDevice device;
+
+ UIScreen* mainScreen = [UIScreen mainScreen];
+ CGFloat mainScreenHeight = mainScreen.bounds.size.height;
+ CGFloat mainScreenWidth = mainScreen.bounds.size.width;
+
+ int limit = MAX(mainScreenHeight,mainScreenWidth);
+
+ device.iPad = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
+ device.iPhone = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone);
+ device.retina = ([mainScreen scale] == 2.0);
+ device.iPhone4 = (device.iPhone && limit == 480.0);
+ device.iPhone5 = (device.iPhone && limit == 568.0);
+ // note these below is not a true device detect, for example if you are on an
+ // iPhone 6/6+ but the app is scaled it will prob set iPhone5 as true, but
+ // this is appropriate for detecting the runtime screen environment
+ device.iPhone6 = (device.iPhone && limit == 667.0);
+ device.iPhone6Plus = (device.iPhone && limit == 736.0);
+ device.iPhoneX = (device.iPhone && limit == 812.0);
+
+ return device;
+}
+
+- (BOOL) isUsingCDVLaunchScreen {
+ NSString* launchStoryboardName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchStoryboardName"];
+ if (launchStoryboardName) {
+ return ([launchStoryboardName isEqualToString:@"CDVLaunchScreen"]);
+ } else {
+ return NO;
+ }
+}
+
+- (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(id)orientationDelegate device:(CDV_iOSDevice)device
+{
+ // Use UILaunchImageFile if specified in plist. Otherwise, use Default.
+ NSString* imageName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchImageFile"];
+
+ // detect if we are using CB-9762 Launch Storyboard; if so, return the associated image instead
+ if ([self isUsingCDVLaunchScreen]) {
+ imageName = @"LaunchStoryboard";
+ return imageName;
+ }
+
+ NSUInteger supportedOrientations = [orientationDelegate supportedInterfaceOrientations];
+
+ // Checks to see if the developer has locked the orientation to use only one of Portrait or Landscape
+ BOOL supportsLandscape = (supportedOrientations & UIInterfaceOrientationMaskLandscape);
+ BOOL supportsPortrait = (supportedOrientations & UIInterfaceOrientationMaskPortrait || supportedOrientations & UIInterfaceOrientationMaskPortraitUpsideDown);
+ // this means there are no mixed orientations in there
+ BOOL isOrientationLocked = !(supportsPortrait && supportsLandscape);
+
+ if (imageName)
+ {
+ imageName = [imageName stringByDeletingPathExtension];
+ }
+ else
+ {
+ imageName = @"Default";
+ }
+
+ // Add Asset Catalog specific prefixes
+ if ([imageName isEqualToString:@"LaunchImage"])
+ {
+ if (device.iPhone4 || device.iPhone5 || device.iPad) {
+ imageName = [imageName stringByAppendingString:@"-700"];
+ } else if(device.iPhone6) {
+ imageName = [imageName stringByAppendingString:@"-800"];
+ } else if(device.iPhone6Plus || device.iPhoneX ) {
+ if(device.iPhone6Plus) {
+ imageName = [imageName stringByAppendingString:@"-800"];
+ } else {
+ imageName = [imageName stringByAppendingString:@"-1100"];
+ }
+ if (currentOrientation == UIInterfaceOrientationPortrait || currentOrientation == UIInterfaceOrientationPortraitUpsideDown)
+ {
+ imageName = [imageName stringByAppendingString:@"-Portrait"];
+ }
+ }
+ }
+
+ if (device.iPhone5)
+ { // does not support landscape
+ imageName = [imageName stringByAppendingString:@"-568h"];
+ }
+ else if (device.iPhone6)
+ { // does not support landscape
+ imageName = [imageName stringByAppendingString:@"-667h"];
+ }
+ else if (device.iPhone6Plus || device.iPhoneX)
+ { // supports landscape
+ if (isOrientationLocked)
+ {
+ imageName = [imageName stringByAppendingString:(supportsLandscape ? @"-Landscape" : @"")];
+ }
+ else
+ {
+ switch (currentOrientation)
+ {
+ case UIInterfaceOrientationLandscapeLeft:
+ case UIInterfaceOrientationLandscapeRight:
+ imageName = [imageName stringByAppendingString:@"-Landscape"];
+ break;
+ default:
+ break;
+ }
+ }
+ if (device.iPhoneX) {
+ imageName = [imageName stringByAppendingString:@"-2436h"];
+ } else {
+ imageName = [imageName stringByAppendingString:@"-736h"];
+ }
+ }
+ else if (device.iPad)
+ { // supports landscape
+ if (isOrientationLocked)
+ {
+ imageName = [imageName stringByAppendingString:(supportsLandscape ? @"-Landscape" : @"-Portrait")];
+ }
+ else
+ {
+ switch (currentOrientation)
+ {
+ case UIInterfaceOrientationLandscapeLeft:
+ case UIInterfaceOrientationLandscapeRight:
+ imageName = [imageName stringByAppendingString:@"-Landscape"];
+ break;
+
+ case UIInterfaceOrientationPortrait:
+ case UIInterfaceOrientationPortraitUpsideDown:
+ default:
+ imageName = [imageName stringByAppendingString:@"-Portrait"];
+ break;
+ }
+ }
+ }
+
+ return imageName;
+}
+
+- (UIInterfaceOrientation)getCurrentOrientation
+{
+ UIInterfaceOrientation iOrientation = [UIApplication sharedApplication].statusBarOrientation;
+ UIDeviceOrientation dOrientation = [UIDevice currentDevice].orientation;
+
+ bool landscape;
+
+ if (dOrientation == UIDeviceOrientationUnknown || dOrientation == UIDeviceOrientationFaceUp || dOrientation == UIDeviceOrientationFaceDown) {
+ // If the device is laying down, use the UIInterfaceOrientation based on the status bar.
+ landscape = UIInterfaceOrientationIsLandscape(iOrientation);
+ } else {
+ // If the device is not laying down, use UIDeviceOrientation.
+ landscape = UIDeviceOrientationIsLandscape(dOrientation);
+
+ // There's a bug in iOS!!!! http://openradar.appspot.com/7216046
+ // So values needs to be reversed for landscape!
+ if (dOrientation == UIDeviceOrientationLandscapeLeft)
+ {
+ iOrientation = UIInterfaceOrientationLandscapeRight;
+ }
+ else if (dOrientation == UIDeviceOrientationLandscapeRight)
+ {
+ iOrientation = UIInterfaceOrientationLandscapeLeft;
+ }
+ else if (dOrientation == UIDeviceOrientationPortrait)
+ {
+ iOrientation = UIInterfaceOrientationPortrait;
+ }
+ else if (dOrientation == UIDeviceOrientationPortraitUpsideDown)
+ {
+ iOrientation = UIInterfaceOrientationPortraitUpsideDown;
+ }
+ }
+
+ return iOrientation;
+}
+
+// Sets the view's frame and image.
+- (void)updateImage
+{
+ NSString* imageName = [self getImageName:[self getCurrentOrientation] delegate:(id)self.viewController device:[self getCurrentDevice]];
+
+ if (![imageName isEqualToString:_curImageName])
+ {
+ UIImage* img = [UIImage imageNamed:imageName];
+ _imageView.image = img;
+ _curImageName = imageName;
+ }
+
+ // Check that splash screen's image exists before updating bounds
+ if (_imageView.image)
+ {
+ [self updateBounds];
+ }
+ else
+ {
+ NSLog(@"WARNING: The splashscreen image named %@ was not found", imageName);
+ }
+}
+
+- (void)updateBounds
+{
+ if ([self isUsingCDVLaunchScreen]) {
+ // CB-9762's launch screen expects the image to fill the screen and be scaled using AspectFill.
+ CGSize viewportSize = [UIApplication sharedApplication].delegate.window.bounds.size;
+ _imageView.frame = CGRectMake(0, 0, viewportSize.width, viewportSize.height);
+ _imageView.contentMode = UIViewContentModeScaleAspectFill;
+ return;
+ }
+
+ UIImage* img = _imageView.image;
+ CGRect imgBounds = (img) ? CGRectMake(0, 0, img.size.width, img.size.height) : CGRectZero;
+
+ CGSize screenSize = [self.viewController.view convertRect:[UIScreen mainScreen].bounds fromView:nil].size;
+ UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
+ CGAffineTransform imgTransform = CGAffineTransformIdentity;
+
+ /* If and only if an iPhone application is landscape-only as per
+ * UISupportedInterfaceOrientations, the view controller's orientation is
+ * landscape. In this case the image must be rotated in order to appear
+ * correctly.
+ */
+ CDV_iOSDevice device = [self getCurrentDevice];
+ if (UIInterfaceOrientationIsLandscape(orientation) && !device.iPhone6Plus && !device.iPad && !device.iPhoneX)
+ {
+ imgTransform = CGAffineTransformMakeRotation(M_PI / 2);
+ imgBounds.size = CGSizeMake(imgBounds.size.height, imgBounds.size.width);
+ }
+
+ // There's a special case when the image is the size of the screen.
+ if (CGSizeEqualToSize(screenSize, imgBounds.size))
+ {
+ CGRect statusFrame = [self.viewController.view convertRect:[UIApplication sharedApplication].statusBarFrame fromView:nil];
+ if (!(IsAtLeastiOSVersion(@"7.0")))
+ {
+ imgBounds.origin.y -= statusFrame.size.height;
+ }
+ }
+ else if (imgBounds.size.width > 0)
+ {
+ CGRect viewBounds = self.viewController.view.bounds;
+ CGFloat imgAspect = imgBounds.size.width / imgBounds.size.height;
+ CGFloat viewAspect = viewBounds.size.width / viewBounds.size.height;
+ // This matches the behaviour of the native splash screen.
+ CGFloat ratio;
+ if (viewAspect > imgAspect)
+ {
+ ratio = viewBounds.size.width / imgBounds.size.width;
+ }
+ else
+ {
+ ratio = viewBounds.size.height / imgBounds.size.height;
+ }
+ imgBounds.size.height *= ratio;
+ imgBounds.size.width *= ratio;
+ }
+
+ _imageView.transform = imgTransform;
+ _imageView.frame = imgBounds;
+}
+
+- (void)setVisible:(BOOL)visible
+{
+ [self setVisible:visible andForce:NO];
+}
+
+- (void)setVisible:(BOOL)visible andForce:(BOOL)force
+{
+ if (visible != _visible || force)
+ {
+ _visible = visible;
+
+ id fadeSplashScreenValue = [self.commandDelegate.settings objectForKey:[@"FadeSplashScreen" lowercaseString]];
+ id fadeSplashScreenDuration = [self.commandDelegate.settings objectForKey:[@"FadeSplashScreenDuration" lowercaseString]];
+
+ float fadeDuration = fadeSplashScreenDuration == nil ? kFadeDurationDefault : [fadeSplashScreenDuration floatValue];
+
+ id splashDurationString = [self.commandDelegate.settings objectForKey: [@"SplashScreenDelay" lowercaseString]];
+ float splashDuration = splashDurationString == nil ? kSplashScreenDurationDefault : [splashDurationString floatValue];
+
+ id autoHideSplashScreenValue = [self.commandDelegate.settings objectForKey:[@"AutoHideSplashScreen" lowercaseString]];
+ BOOL autoHideSplashScreen = true;
+
+ if (autoHideSplashScreenValue != nil) {
+ autoHideSplashScreen = [autoHideSplashScreenValue boolValue];
+ }
+
+ if (!autoHideSplashScreen) {
+ // CB-10412 SplashScreenDelay does not make sense if the splashscreen is hidden manually
+ splashDuration = 0;
+ }
+
+
+ if (fadeSplashScreenValue == nil)
+ {
+ fadeSplashScreenValue = @"true";
+ }
+
+ if (![fadeSplashScreenValue boolValue])
+ {
+ fadeDuration = 0;
+ }
+ else if (fadeDuration < 30)
+ {
+ // [CB-9750] This value used to be in decimal seconds, so we will assume that if someone specifies 10
+ // they mean 10 seconds, and not the meaningless 10ms
+ fadeDuration *= 1000;
+ }
+
+ if (_visible)
+ {
+ if (_imageView == nil)
+ {
+ [self createViews];
+ }
+ }
+ else if (fadeDuration == 0 && splashDuration == 0)
+ {
+ [self destroyViews];
+ }
+ else
+ {
+ __weak __typeof(self) weakSelf = self;
+ float effectiveSplashDuration;
+
+ // [CB-10562] AutoHideSplashScreen may be "true" but we should still be able to hide the splashscreen manually.
+ if (!autoHideSplashScreen || force) {
+ effectiveSplashDuration = (fadeDuration) / 1000;
+ } else {
+ effectiveSplashDuration = (splashDuration - fadeDuration) / 1000;
+ }
+
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (uint64_t) effectiveSplashDuration * NSEC_PER_SEC), dispatch_get_main_queue(), CFBridgingRelease(CFBridgingRetain(^(void) {
+ if (!_destroyed) {
+ [UIView transitionWithView:self.viewController.view
+ duration:(fadeDuration / 1000)
+ options:UIViewAnimationOptionTransitionNone
+ animations:^(void) {
+ [weakSelf hideViews];
+ }
+ completion:^(BOOL finished) {
+ // Always destroy views, otherwise you could have an
+ // invisible splashscreen that is overlayed over your active views
+ // which causes that no touch events are passed
+ if (!_destroyed) {
+ [weakSelf destroyViews];
+ // TODO: It might also be nice to have a js event happen here -jm
+ }
+ }
+ ];
+ }
+ })));
+ }
+ }
+}
+
+@end
diff --git a/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.h b/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.h
new file mode 100644
index 0000000..a948ea3
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.h
@@ -0,0 +1,28 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import
+
+@interface CDVViewController (SplashScreen)
+
+@property (nonatomic, assign) BOOL enabledAutorotation;
+@property (nonatomic, readonly) BOOL shouldAutorotateDefaultValue;
+
+
+@end
diff --git a/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.m b/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.m
new file mode 100644
index 0000000..e483def
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/src/ios/CDVViewController+SplashScreen.m
@@ -0,0 +1,89 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVViewController+SplashScreen.h"
+#import
+
+@implementation CDVViewController (SplashScreen)
+
+@dynamic enabledAutorotation;
+
+- (void)setEnabledAutorotation:(BOOL)value
+{
+ objc_setAssociatedObject(self,
+ @selector(enabledAutorotation),
+ [NSNumber numberWithBool:value],
+ OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+- (BOOL)enabledAutorotation
+{
+ NSNumber *number = (NSNumber *)objc_getAssociatedObject(self, @selector(enabledAutorotation));
+
+ // Defaulting to YES to correspond parent CDVViewController behavior
+ if (number == nil)
+ {
+ return YES;
+ }
+
+ return [number boolValue];
+}
+
++ (void)load
+{
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ Class class = [self class];
+
+ SEL originalSelector = @selector(shouldAutorotate);
+ SEL swizzledSelector = @selector(splash_shouldAutorotate);
+
+ Method originalMethod = class_getInstanceMethod(class, originalSelector);
+ Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector);
+
+ BOOL didAddMethod = class_addMethod(class,
+ originalSelector,
+ method_getImplementation(swizzledMethod),
+ method_getTypeEncoding(swizzledMethod));
+
+ if (didAddMethod) {
+ class_replaceMethod(class,
+ swizzledSelector,
+ method_getImplementation(originalMethod),
+ method_getTypeEncoding(originalMethod));
+ } else {
+ method_exchangeImplementations(originalMethod, swizzledMethod);
+ }
+ });
+}
+
+#pragma mark - Method Swizzling
+
+- (BOOL)splash_shouldAutorotate
+{
+ return self.enabledAutorotation;
+}
+
+
+- (BOOL)shouldAutorotateDefaultValue
+{
+ return [self splash_shouldAutorotate];
+}
+
+@end
diff --git a/plugins/cordova-plugin-splashscreen/src/wp/ResolutionHelper.cs b/plugins/cordova-plugin-splashscreen/src/wp/ResolutionHelper.cs
new file mode 100644
index 0000000..050c392
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/src/wp/ResolutionHelper.cs
@@ -0,0 +1,39 @@
+/*
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+using Microsoft.Phone.Info;
+using System;
+using System.Windows;
+
+namespace WPCordovaClassLib.Cordova.Commands
+{
+ public enum Resolutions { WVGA, WXGA, HD };
+
+ public static class ResolutionHelper
+ {
+ public static Resolutions CurrentResolution
+ {
+ get
+ {
+ switch (Application.Current.Host.Content.ScaleFactor)
+ {
+ case 100: return Resolutions.WVGA;
+ case 160: return Resolutions.WXGA;
+ case 150: return Resolutions.HD;
+ }
+ throw new InvalidOperationException("Unknown resolution");
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/plugins/cordova-plugin-splashscreen/src/wp/SplashScreen.cs b/plugins/cordova-plugin-splashscreen/src/wp/SplashScreen.cs
new file mode 100644
index 0000000..c56d4ad
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/src/wp/SplashScreen.cs
@@ -0,0 +1,255 @@
+/*
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+using System;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+using Microsoft.Phone.Info;
+using System.Windows.Controls.Primitives;
+using System.Diagnostics;
+using System.Windows.Media.Imaging;
+using System.Windows.Resources;
+using System.IO;
+using System.Xml.Linq;
+using System.Linq;
+using System.Windows.Threading;
+
+namespace WPCordovaClassLib.Cordova.Commands
+{
+ ///
+ /// Listens for changes to the state of the battery on the device.
+ /// Currently only the "isPlugged" parameter available via native APIs.
+ ///
+ public class SplashScreen : BaseCommand
+ {
+ private Popup popup;
+
+ // Time until we dismiss the splashscreen
+ private int prefDelay = 3000;
+
+ // Whether we hide it by default
+ private bool prefAutoHide = true;
+
+ // Path to image to use
+ private string prefImagePath = "SplashScreenImage.jpg";
+
+ // static because autodismiss is only ever applied once, at app launch
+ // subsequent page loads should not cause the SplashScreen to be shown.
+ private static bool WasShown = false;
+
+ public SplashScreen()
+ {
+ LoadConfigPrefs();
+
+ Image SplashScreen = new Image()
+ {
+ Height = Application.Current.Host.Content.ActualHeight,
+ Width = Application.Current.Host.Content.ActualWidth,
+ Stretch = Stretch.Fill
+ };
+
+ var imageResource = GetSplashScreenImageResource();
+ if (imageResource != null)
+ {
+ BitmapImage splash_image = new BitmapImage();
+ splash_image.SetSource(imageResource.Stream);
+ SplashScreen.Source = splash_image;
+ }
+
+ // Instansiate the popup and set the Child property of Popup to SplashScreen
+ popup = new Popup() { IsOpen = false,
+ Child = SplashScreen,
+ HorizontalAlignment = HorizontalAlignment.Stretch,
+ VerticalAlignment = VerticalAlignment.Center
+
+ };
+ }
+
+ public override void OnInit()
+ {
+ // we only want to autoload on the first page load.
+ // but OnInit is called for every page load.
+ if (!SplashScreen.WasShown)
+ {
+ SplashScreen.WasShown = true;
+ show();
+ }
+ }
+
+ private void LoadConfigPrefs()
+ {
+ StreamResourceInfo streamInfo = Application.GetResourceStream(new Uri("config.xml", UriKind.Relative));
+ if (streamInfo != null)
+ {
+ using (StreamReader sr = new StreamReader(streamInfo.Stream))
+ {
+ //This will Read Keys Collection for the xml file
+ XDocument configFile = XDocument.Parse(sr.ReadToEnd());
+
+ string configAutoHide = configFile.Descendants()
+ .Where(x => x.Name.LocalName == "preference")
+ .Where(x => (string)x.Attribute("name") == "AutoHideSplashScreen")
+ .Select(x => (string)x.Attribute("value"))
+ .FirstOrDefault();
+
+ bool bVal;
+ prefAutoHide = bool.TryParse(configAutoHide, out bVal) ? bVal : prefAutoHide;
+
+ string configDelay = configFile.Descendants()
+ .Where(x => x.Name.LocalName == "preference")
+ .Where(x => (string)x.Attribute("name") == "SplashScreenDelay")
+ .Select(x => (string)x.Attribute("value"))
+ .FirstOrDefault();
+ int nVal;
+ prefDelay = int.TryParse(configDelay, out nVal) ? nVal : prefDelay;
+
+ string configImage = configFile.Descendants()
+ .Where(x => x.Name.LocalName == "preference")
+ .Where(x => (string)x.Attribute("name") == "SplashScreen")
+ .Select(x => (string)x.Attribute("value"))
+ .FirstOrDefault();
+
+ if (!String.IsNullOrEmpty(configImage))
+ {
+ prefImagePath = configImage;
+ }
+ }
+ }
+ }
+
+ private StreamResourceInfo GetSplashScreenImageResource()
+ {
+ // Get the base filename for the splash screen images
+ string imageName = System.IO.Path.GetFileNameWithoutExtension(prefImagePath);
+ Uri imageUri = null;
+ StreamResourceInfo imageResource = null;
+
+ // First, try to get a resolution-specific splashscreen
+ try
+ {
+ // Determine the device's resolution
+ switch (ResolutionHelper.CurrentResolution)
+ {
+ case Resolutions.HD:
+ imageUri = new Uri(imageName + ".screen-720p.jpg", UriKind.Relative);
+ break;
+
+ case Resolutions.WVGA:
+ imageUri = new Uri(imageName + ".screen-WVGA.jpg", UriKind.Relative);
+ break;
+
+ case Resolutions.WXGA:
+ default:
+ imageUri = new Uri(imageName + ".screen-WXGA.jpg", UriKind.Relative);
+ break;
+ }
+
+ imageResource = Application.GetResourceStream(imageUri);
+ }
+ catch (Exception)
+ {
+ // It's OK if we didn't get a resolution-specific image
+ }
+
+ // Fallback to the default image name without decoration
+ if (imageResource == null)
+ {
+ imageUri = new Uri(prefImagePath, UriKind.Relative);
+ imageResource = Application.GetResourceStream(imageUri);
+ }
+
+ if (imageUri != null) Debug.WriteLine("INFO :: SplashScreen: using image {0}", imageUri.OriginalString);
+
+ return imageResource;
+ }
+
+ public void show(string options = null)
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ if (!popup.IsOpen)
+ {
+ popup.Child.Opacity = 0;
+
+ Storyboard story = new Storyboard();
+ DoubleAnimation animation = new DoubleAnimation()
+ {
+ From = 0.0,
+ To = 1.0,
+ Duration = new Duration(TimeSpan.FromSeconds(0.2))
+ };
+
+ Storyboard.SetTarget(animation, popup.Child);
+ Storyboard.SetTargetProperty(animation, new PropertyPath("Opacity"));
+ story.Children.Add(animation);
+
+ story.Begin();
+
+ popup.IsOpen = true;
+
+ if (prefAutoHide)
+ {
+ StartAutoHideTimer();
+ }
+ }
+ });
+ }
+
+ public void hide(string options = null)
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ if (popup.IsOpen)
+ {
+ popup.Child.Opacity = 1.0;
+
+ Storyboard story = new Storyboard();
+ DoubleAnimation animation = new DoubleAnimation()
+ {
+ From = 1.0,
+ To = 0.0,
+ Duration = new Duration(TimeSpan.FromSeconds(0.4))
+ };
+
+ Storyboard.SetTarget(animation, popup.Child);
+ Storyboard.SetTargetProperty(animation, new PropertyPath("Opacity"));
+ story.Children.Add(animation);
+ story.Completed += (object sender, EventArgs e) =>
+ {
+ popup.IsOpen = false;
+ };
+ story.Begin();
+ }
+ });
+ }
+
+ private void StartAutoHideTimer()
+ {
+ var timer = new DispatcherTimer() { Interval = TimeSpan.FromMilliseconds(prefDelay) };
+ timer.Tick += (object sender, EventArgs e) =>
+ {
+ hide();
+ timer.Stop();
+ };
+ timer.Start();
+ }
+ }
+}
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/contents.xcworkspacedata b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..2dd325a
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout
new file mode 100644
index 0000000..7e4cdb9
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout
@@ -0,0 +1,41 @@
+
+
+
+
+ IDESourceControlProjectFavoriteDictionaryKey
+
+ IDESourceControlProjectIdentifier
+ 6BE9AD73-1B9F-4362-98D7-DC631BEC6185
+ IDESourceControlProjectName
+ CDVSplashScreenTest
+ IDESourceControlProjectOriginsDictionary
+
+ BEF5A5D0FF64801E558286389440357A9233D7DB
+ https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git
+
+ IDESourceControlProjectPath
+ tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj
+ IDESourceControlProjectRelativeInstallPathDictionary
+
+ BEF5A5D0FF64801E558286389440357A9233D7DB
+ ../../../../..
+
+ IDESourceControlProjectURL
+ https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git
+ IDESourceControlProjectVersion
+ 111
+ IDESourceControlProjectWCCIdentifier
+ BEF5A5D0FF64801E558286389440357A9233D7DB
+ IDESourceControlProjectWCConfigurations
+
+
+ IDESourceControlRepositoryExtensionIdentifierKey
+ public.vcs.git
+ IDESourceControlWCCIdentifierKey
+ BEF5A5D0FF64801E558286389440357A9233D7DB
+ IDESourceControlWCCName
+ cordova-plugin-splashscreen
+
+
+
+
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme
new file mode 100644
index 0000000..13f9a15
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest.xcworkspace/xcshareddata/xcschemes/CordovaLib.xcscheme
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/.npmignore b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/.npmignore
new file mode 100644
index 0000000..c795b05
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/.npmignore
@@ -0,0 +1 @@
+build
\ No newline at end of file
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTest.m b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTest.m
new file mode 100644
index 0000000..1637d24
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTest.m
@@ -0,0 +1,702 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import
+#import
+#import
+#import "CDVSplashScreen.h"
+#import "ImageNameTestDelegates.h"
+
+const CDV_iOSDevice CDV_iOSDeviceZero = { 0, 0, 0, 0, 0, 0 };
+
+@interface ImageNameTest : XCTestCase
+
+@property (nonatomic, strong) CDVSplashScreen* plugin;
+
+@end
+
+@interface CDVSplashScreen ()
+
+// expose private interface
+- (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(id)orientationDelegate device:(CDV_iOSDevice)device;
+
+@end
+
+@implementation ImageNameTest
+
+- (void)setUp {
+ [super setUp];
+ // Put setup code here. This method is called before the invocation of each test method in the class.
+
+ self.plugin = [[CDVSplashScreen alloc] init];
+}
+
+- (void)tearDown {
+ // Put teardown code here. This method is called after the invocation of each test method in the class.
+ [super tearDown];
+}
+
+- (void) orientationHelper:(id)delegate expectedImageNameDictionary:(NSDictionary*)expectedImageNameDictionary device:(CDV_iOSDevice)device{
+
+ NSString* name = nil;
+ NSString* expectedImageName = nil;
+ UIInterfaceOrientation currentOrientation;
+ NSString* deviceName = device.iPad? @"iPad" : device.iPhone6Plus? @"iPhone6Plus": device.iPhone6? @"iPhone6": device.iPhone5? @"iPhone5" : @"iPhone";
+
+ // LandscapeLeft, should always return expectedImageName
+ currentOrientation = UIInterfaceOrientationLandscapeLeft;
+ name = [self.plugin getImageName:currentOrientation delegate:delegate device:device];
+ expectedImageName = [expectedImageNameDictionary objectForKey:@"landscapeLeft"];
+ XCTAssertTrue([expectedImageName isEqualToString:name], @"%@ - %@ failed (%@)", @"Landscape", deviceName, name);
+
+ // LandscapeRight - should always return expectedImageName
+ currentOrientation = UIInterfaceOrientationLandscapeRight;
+ name = [self.plugin getImageName:currentOrientation delegate:delegate device:device];
+ expectedImageName = [expectedImageNameDictionary objectForKey:@"landscapeRight"];
+ XCTAssertTrue([expectedImageName isEqualToString:name], @"%@ - %@ failed (%@)", @"Landscape", deviceName, name);
+
+ // Portrait - should always return expectedImageName
+ currentOrientation = UIInterfaceOrientationPortrait;
+ name = [self.plugin getImageName:currentOrientation delegate:delegate device:device];
+ expectedImageName = [expectedImageNameDictionary objectForKey:@"portrait"];
+ XCTAssertTrue([expectedImageName isEqualToString:name], @"%@ - %@ failed (%@)", @"Portrait", deviceName, name);
+
+ // PortraitUpsideDown - should always return expectedImageName
+ currentOrientation = UIInterfaceOrientationPortraitUpsideDown;
+ name = [self.plugin getImageName:currentOrientation delegate:delegate device:device];
+ expectedImageName = [expectedImageNameDictionary objectForKey:@"portraitUpsideDown"];
+ XCTAssertTrue([expectedImageName isEqualToString:name], @"%@ - %@ failed (%@)", @"Portrait", deviceName, name);
+}
+
+- (void)testiPadOrientation {
+
+ CDV_iOSDevice device = CDV_iOSDeviceZero;
+ device.iPad = YES;
+
+ // One orientation
+
+ PortraitOnly* delegate = [[PortraitOnly alloc] init];
+ [self orientationHelper:delegate expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Portrait",
+ @"landscapeRight" : @"Default-Portrait",
+ @"portrait" : @"Default-Portrait",
+ @"portraitUpsideDown" : @"Default-Portrait"
+ }
+ device:device];
+
+ PortraitUpsideDownOnly* delegate2 = [[PortraitUpsideDownOnly alloc] init];
+ [self orientationHelper:delegate2 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Portrait",
+ @"landscapeRight" : @"Default-Portrait",
+ @"portrait" : @"Default-Portrait",
+ @"portraitUpsideDown" : @"Default-Portrait"
+ }
+ device:device];
+
+ LandscapeLeftOnly* delegate3 = [[LandscapeLeftOnly alloc] init];
+ [self orientationHelper:delegate3 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Landscape",
+ @"landscapeRight" : @"Default-Landscape",
+ @"portrait" : @"Default-Landscape",
+ @"portraitUpsideDown" : @"Default-Landscape"
+ }
+ device:device];
+
+ LandscapeRightOnly* delegate4 = [[LandscapeRightOnly alloc] init];
+ [self orientationHelper:delegate4 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Landscape",
+ @"landscapeRight" : @"Default-Landscape",
+ @"portrait" : @"Default-Landscape",
+ @"portraitUpsideDown" : @"Default-Landscape"
+ }
+ device:device];
+
+ // All Portrait
+
+ AllPortraitOnly* delegate5 = [[AllPortraitOnly alloc] init];
+ [self orientationHelper:delegate5 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Portrait",
+ @"landscapeRight" : @"Default-Portrait",
+ @"portrait" : @"Default-Portrait",
+ @"portraitUpsideDown" : @"Default-Portrait"
+ }
+ device:device];
+
+ // All Landscape
+
+ AllLandscapeOnly* delegate6 = [[AllLandscapeOnly alloc] init];
+ [self orientationHelper:delegate6 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Landscape",
+ @"landscapeRight" : @"Default-Landscape",
+ @"portrait" : @"Default-Landscape",
+ @"portraitUpsideDown" : @"Default-Landscape"
+ }
+ device:device];
+
+
+ // All orientations
+
+ AllOrientations* delegate7 = [[AllOrientations alloc] init];
+ [self orientationHelper:delegate7 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Landscape",
+ @"landscapeRight" : @"Default-Landscape",
+ @"portrait" : @"Default-Portrait",
+ @"portraitUpsideDown" : @"Default-Portrait"
+ }
+ device:device];
+
+ // Portrait and Landscape Left
+
+ PortraitAndLandscapeLeftOnly* delegate8 = [[PortraitAndLandscapeLeftOnly alloc] init];
+ [self orientationHelper:delegate8 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Landscape",
+ @"landscapeRight" : @"Default-Landscape",
+ @"portrait" : @"Default-Portrait",
+ @"portraitUpsideDown" : @"Default-Portrait"
+ }
+ device:device];
+
+ // Portrait and Landscape Right
+
+ PortraitAndLandscapeRightOnly* delegate9 = [[PortraitAndLandscapeRightOnly alloc] init];
+ [self orientationHelper:delegate9 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Landscape",
+ @"landscapeRight" : @"Default-Landscape",
+ @"portrait" : @"Default-Portrait",
+ @"portraitUpsideDown" : @"Default-Portrait"
+ }
+ device:device];
+
+ // PortraitUpsideDown and Landscape Left
+
+ PortraitUpsideDownAndLandscapeLeftOnly* delegate10 = [[PortraitUpsideDownAndLandscapeLeftOnly alloc] init];
+ [self orientationHelper:delegate10 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Landscape",
+ @"landscapeRight" : @"Default-Landscape",
+ @"portrait" : @"Default-Portrait",
+ @"portraitUpsideDown" : @"Default-Portrait"
+ }
+ device:device];
+
+ // PortraitUpsideDown and Landscape Right
+
+ PortraitUpsideDownAndLandscapeRightOnly* delegate11 = [[PortraitUpsideDownAndLandscapeRightOnly alloc] init];
+ [self orientationHelper:delegate11 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Landscape",
+ @"landscapeRight" : @"Default-Landscape",
+ @"portrait" : @"Default-Portrait",
+ @"portraitUpsideDown" : @"Default-Portrait"
+ }
+ device:device];
+}
+
+- (void)testiPhoneOrientation {
+
+ CDV_iOSDevice device = CDV_iOSDeviceZero;
+ device.iPhone = YES;
+
+ // One orientation
+
+ PortraitOnly* delegate = [[PortraitOnly alloc] init];
+ [self orientationHelper:delegate expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default",
+ @"landscapeRight" : @"Default",
+ @"portrait" : @"Default",
+ @"portraitUpsideDown" : @"Default"
+ }
+ device:device];
+
+ PortraitUpsideDownOnly* delegate2 = [[PortraitUpsideDownOnly alloc] init];
+ [self orientationHelper:delegate2 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default",
+ @"landscapeRight" : @"Default",
+ @"portrait" : @"Default",
+ @"portraitUpsideDown" : @"Default"
+ }
+ device:device];
+
+ LandscapeLeftOnly* delegate3 = [[LandscapeLeftOnly alloc] init];
+ [self orientationHelper:delegate3 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default",
+ @"landscapeRight" : @"Default",
+ @"portrait" : @"Default",
+ @"portraitUpsideDown" : @"Default"
+ }
+ device:device];
+
+ LandscapeRightOnly* delegate4 = [[LandscapeRightOnly alloc] init];
+ [self orientationHelper:delegate4 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default",
+ @"landscapeRight" : @"Default",
+ @"portrait" : @"Default",
+ @"portraitUpsideDown" : @"Default"
+ }
+ device:device];
+
+ // All Portrait
+
+ AllPortraitOnly* delegate5 = [[AllPortraitOnly alloc] init];
+ [self orientationHelper:delegate5 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default",
+ @"landscapeRight" : @"Default",
+ @"portrait" : @"Default",
+ @"portraitUpsideDown" : @"Default"
+ }
+ device:device];
+
+ // All Landscape
+
+ AllLandscapeOnly* delegate6 = [[AllLandscapeOnly alloc] init];
+ [self orientationHelper:delegate6 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default",
+ @"landscapeRight" : @"Default",
+ @"portrait" : @"Default",
+ @"portraitUpsideDown" : @"Default"
+ }
+ device:device];
+
+
+ // All orientations
+
+ AllOrientations* delegate7 = [[AllOrientations alloc] init];
+ [self orientationHelper:delegate7 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default",
+ @"landscapeRight" : @"Default",
+ @"portrait" : @"Default",
+ @"portraitUpsideDown" : @"Default"
+ }
+ device:device];
+
+ // Portrait and Landscape Left
+
+ PortraitAndLandscapeLeftOnly* delegate8 = [[PortraitAndLandscapeLeftOnly alloc] init];
+ [self orientationHelper:delegate8 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default",
+ @"landscapeRight" : @"Default",
+ @"portrait" : @"Default",
+ @"portraitUpsideDown" : @"Default"
+ }
+ device:device];
+
+ // Portrait and Landscape Right
+
+ PortraitAndLandscapeRightOnly* delegate9 = [[PortraitAndLandscapeRightOnly alloc] init];
+ [self orientationHelper:delegate9 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default",
+ @"landscapeRight" : @"Default",
+ @"portrait" : @"Default",
+ @"portraitUpsideDown" : @"Default"
+ }
+ device:device];
+
+ // PortraitUpsideDown and Landscape Left
+
+ PortraitUpsideDownAndLandscapeLeftOnly* delegate10 = [[PortraitUpsideDownAndLandscapeLeftOnly alloc] init];
+ [self orientationHelper:delegate10 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default",
+ @"landscapeRight" : @"Default",
+ @"portrait" : @"Default",
+ @"portraitUpsideDown" : @"Default"
+ }
+ device:device];
+
+ // PortraitUpsideDown and Landscape Right
+
+ PortraitUpsideDownAndLandscapeRightOnly* delegate11 = [[PortraitUpsideDownAndLandscapeRightOnly alloc] init];
+ [self orientationHelper:delegate11 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default",
+ @"landscapeRight" : @"Default",
+ @"portrait" : @"Default",
+ @"portraitUpsideDown" : @"Default"
+ }
+ device:device];
+}
+
+- (void)testiPhone5Orientation {
+
+ CDV_iOSDevice device = CDV_iOSDeviceZero;
+ device.iPhone = YES;
+ device.iPhone5 = YES;
+
+ // One orientation
+
+ PortraitOnly* delegate = [[PortraitOnly alloc] init];
+ [self orientationHelper:delegate expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-568h",
+ @"landscapeRight" : @"Default-568h",
+ @"portrait" : @"Default-568h",
+ @"portraitUpsideDown" : @"Default-568h"
+ }
+ device:device];
+
+ PortraitUpsideDownOnly* delegate2 = [[PortraitUpsideDownOnly alloc] init];
+ [self orientationHelper:delegate2 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-568h",
+ @"landscapeRight" : @"Default-568h",
+ @"portrait" : @"Default-568h",
+ @"portraitUpsideDown" : @"Default-568h"
+ }
+ device:device];
+
+ LandscapeLeftOnly* delegate3 = [[LandscapeLeftOnly alloc] init];
+ [self orientationHelper:delegate3 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-568h",
+ @"landscapeRight" : @"Default-568h",
+ @"portrait" : @"Default-568h",
+ @"portraitUpsideDown" : @"Default-568h"
+ }
+ device:device];
+
+ LandscapeRightOnly* delegate4 = [[LandscapeRightOnly alloc] init];
+ [self orientationHelper:delegate4 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-568h",
+ @"landscapeRight" : @"Default-568h",
+ @"portrait" : @"Default-568h",
+ @"portraitUpsideDown" : @"Default-568h"
+ }
+ device:device];
+
+ // All Portrait
+
+ AllPortraitOnly* delegate5 = [[AllPortraitOnly alloc] init];
+ [self orientationHelper:delegate5 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-568h",
+ @"landscapeRight" : @"Default-568h",
+ @"portrait" : @"Default-568h",
+ @"portraitUpsideDown" : @"Default-568h"
+ }
+ device:device];
+
+ // All Landscape
+
+ AllLandscapeOnly* delegate6 = [[AllLandscapeOnly alloc] init];
+ [self orientationHelper:delegate6 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-568h",
+ @"landscapeRight" : @"Default-568h",
+ @"portrait" : @"Default-568h",
+ @"portraitUpsideDown" : @"Default-568h"
+ }
+ device:device];
+
+
+ // All orientations
+
+ AllOrientations* delegate7 = [[AllOrientations alloc] init];
+ [self orientationHelper:delegate7 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-568h",
+ @"landscapeRight" : @"Default-568h",
+ @"portrait" : @"Default-568h",
+ @"portraitUpsideDown" : @"Default-568h"
+ }
+ device:device];
+
+ // Portrait and Landscape Left
+
+ PortraitAndLandscapeLeftOnly* delegate8 = [[PortraitAndLandscapeLeftOnly alloc] init];
+ [self orientationHelper:delegate8 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-568h",
+ @"landscapeRight" : @"Default-568h",
+ @"portrait" : @"Default-568h",
+ @"portraitUpsideDown" : @"Default-568h"
+ }
+ device:device];
+
+ // Portrait and Landscape Right
+
+ PortraitAndLandscapeRightOnly* delegate9 = [[PortraitAndLandscapeRightOnly alloc] init];
+ [self orientationHelper:delegate9 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-568h",
+ @"landscapeRight" : @"Default-568h",
+ @"portrait" : @"Default-568h",
+ @"portraitUpsideDown" : @"Default-568h"
+ }
+ device:device];
+
+ // PortraitUpsideDown and Landscape Left
+
+ PortraitUpsideDownAndLandscapeLeftOnly* delegate10 = [[PortraitUpsideDownAndLandscapeLeftOnly alloc] init];
+ [self orientationHelper:delegate10 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-568h",
+ @"landscapeRight" : @"Default-568h",
+ @"portrait" : @"Default-568h",
+ @"portraitUpsideDown" : @"Default-568h"
+ }
+ device:device];
+
+ // PortraitUpsideDown and Landscape Right
+
+ PortraitUpsideDownAndLandscapeRightOnly* delegate11 = [[PortraitUpsideDownAndLandscapeRightOnly alloc] init];
+ [self orientationHelper:delegate11 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-568h",
+ @"landscapeRight" : @"Default-568h",
+ @"portrait" : @"Default-568h",
+ @"portraitUpsideDown" : @"Default-568h"
+ }
+ device:device];
+}
+
+- (void)testiPhone6Orientation {
+
+ CDV_iOSDevice device = CDV_iOSDeviceZero;
+ device.iPhone = YES;
+ device.iPhone6 = YES;
+
+ // One orientation
+
+ PortraitOnly* delegate = [[PortraitOnly alloc] init];
+ [self orientationHelper:delegate expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-667h",
+ @"landscapeRight" : @"Default-667h",
+ @"portrait" : @"Default-667h",
+ @"portraitUpsideDown" : @"Default-667h"
+ }
+ device:device];
+
+ PortraitUpsideDownOnly* delegate2 = [[PortraitUpsideDownOnly alloc] init];
+ [self orientationHelper:delegate2 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-667h",
+ @"landscapeRight" : @"Default-667h",
+ @"portrait" : @"Default-667h",
+ @"portraitUpsideDown" : @"Default-667h"
+ }
+ device:device];
+
+ LandscapeLeftOnly* delegate3 = [[LandscapeLeftOnly alloc] init];
+ [self orientationHelper:delegate3 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-667h",
+ @"landscapeRight" : @"Default-667h",
+ @"portrait" : @"Default-667h",
+ @"portraitUpsideDown" : @"Default-667h"
+ }
+ device:device];
+
+ LandscapeRightOnly* delegate4 = [[LandscapeRightOnly alloc] init];
+ [self orientationHelper:delegate4 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-667h",
+ @"landscapeRight" : @"Default-667h",
+ @"portrait" : @"Default-667h",
+ @"portraitUpsideDown" : @"Default-667h"
+ }
+ device:device];
+
+ // All Portrait
+
+ AllPortraitOnly* delegate5 = [[AllPortraitOnly alloc] init];
+ [self orientationHelper:delegate5 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-667h",
+ @"landscapeRight" : @"Default-667h",
+ @"portrait" : @"Default-667h",
+ @"portraitUpsideDown" : @"Default-667h"
+ }
+ device:device];
+
+ // All Landscape
+
+ AllLandscapeOnly* delegate6 = [[AllLandscapeOnly alloc] init];
+ [self orientationHelper:delegate6 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-667h",
+ @"landscapeRight" : @"Default-667h",
+ @"portrait" : @"Default-667h",
+ @"portraitUpsideDown" : @"Default-667h"
+ }
+ device:device];
+
+
+ // All orientations
+
+ AllOrientations* delegate7 = [[AllOrientations alloc] init];
+ [self orientationHelper:delegate7 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-667h",
+ @"landscapeRight" : @"Default-667h",
+ @"portrait" : @"Default-667h",
+ @"portraitUpsideDown" : @"Default-667h"
+ }
+ device:device];
+
+ // Portrait and Landscape Left
+
+ PortraitAndLandscapeLeftOnly* delegate8 = [[PortraitAndLandscapeLeftOnly alloc] init];
+ [self orientationHelper:delegate8 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-667h",
+ @"landscapeRight" : @"Default-667h",
+ @"portrait" : @"Default-667h",
+ @"portraitUpsideDown" : @"Default-667h"
+ }
+ device:device];
+
+ // Portrait and Landscape Right
+
+ PortraitAndLandscapeRightOnly* delegate9 = [[PortraitAndLandscapeRightOnly alloc] init];
+ [self orientationHelper:delegate9 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-667h",
+ @"landscapeRight" : @"Default-667h",
+ @"portrait" : @"Default-667h",
+ @"portraitUpsideDown" : @"Default-667h"
+ }
+ device:device];
+
+ // PortraitUpsideDown and Landscape Left
+
+ PortraitUpsideDownAndLandscapeLeftOnly* delegate10 = [[PortraitUpsideDownAndLandscapeLeftOnly alloc] init];
+ [self orientationHelper:delegate10 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-667h",
+ @"landscapeRight" : @"Default-667h",
+ @"portrait" : @"Default-667h",
+ @"portraitUpsideDown" : @"Default-667h"
+ }
+ device:device];
+
+ // PortraitUpsideDown and Landscape Right
+
+ PortraitUpsideDownAndLandscapeRightOnly* delegate11 = [[PortraitUpsideDownAndLandscapeRightOnly alloc] init];
+ [self orientationHelper:delegate11 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-667h",
+ @"landscapeRight" : @"Default-667h",
+ @"portrait" : @"Default-667h",
+ @"portraitUpsideDown" : @"Default-667h"
+ }
+ device:device];
+}
+
+- (void)testiPhone6PlusOrientation {
+
+ CDV_iOSDevice device = CDV_iOSDeviceZero;
+ device.iPhone = YES;
+ device.iPhone6Plus = YES;
+
+ // One orientation
+
+ PortraitOnly* delegate = [[PortraitOnly alloc] init];
+ [self orientationHelper:delegate expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-736h",
+ @"landscapeRight" : @"Default-736h",
+ @"portrait" : @"Default-736h",
+ @"portraitUpsideDown" : @"Default-736h"
+ }
+ device:device];
+
+ PortraitUpsideDownOnly* delegate2 = [[PortraitUpsideDownOnly alloc] init];
+ [self orientationHelper:delegate2 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-736h",
+ @"landscapeRight" : @"Default-736h",
+ @"portrait" : @"Default-736h",
+ @"portraitUpsideDown" : @"Default-736h"
+ }
+ device:device];
+
+ LandscapeLeftOnly* delegate3 = [[LandscapeLeftOnly alloc] init];
+ [self orientationHelper:delegate3 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Landscape-736h",
+ @"landscapeRight" : @"Default-Landscape-736h",
+ @"portrait" : @"Default-Landscape-736h",
+ @"portraitUpsideDown" : @"Default-Landscape-736h"
+ }
+ device:device];
+
+ LandscapeRightOnly* delegate4 = [[LandscapeRightOnly alloc] init];
+ [self orientationHelper:delegate4 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Landscape-736h",
+ @"landscapeRight" : @"Default-Landscape-736h",
+ @"portrait" : @"Default-Landscape-736h",
+ @"portraitUpsideDown" : @"Default-Landscape-736h"
+ }
+ device:device];
+
+ // All Portrait
+
+ AllPortraitOnly* delegate5 = [[AllPortraitOnly alloc] init];
+ [self orientationHelper:delegate5 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-736h",
+ @"landscapeRight" : @"Default-736h",
+ @"portrait" : @"Default-736h",
+ @"portraitUpsideDown" : @"Default-736h"
+ }
+ device:device];
+
+ // All Landscape
+
+ AllLandscapeOnly* delegate6 = [[AllLandscapeOnly alloc] init];
+ [self orientationHelper:delegate6 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Landscape-736h",
+ @"landscapeRight" : @"Default-Landscape-736h",
+ @"portrait" : @"Default-Landscape-736h",
+ @"portraitUpsideDown" : @"Default-Landscape-736h"
+ }
+ device:device];
+
+
+ // All orientations
+
+ AllOrientations* delegate7 = [[AllOrientations alloc] init];
+ [self orientationHelper:delegate7 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Landscape-736h",
+ @"landscapeRight" : @"Default-Landscape-736h",
+ @"portrait" : @"Default-736h",
+ @"portraitUpsideDown" : @"Default-736h"
+ }
+ device:device];
+
+ // Portrait and Landscape Left
+
+ PortraitAndLandscapeLeftOnly* delegate8 = [[PortraitAndLandscapeLeftOnly alloc] init];
+ [self orientationHelper:delegate8 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Landscape-736h",
+ @"landscapeRight" : @"Default-Landscape-736h",
+ @"portrait" : @"Default-736h",
+ @"portraitUpsideDown" : @"Default-736h"
+ }
+ device:device];
+
+ // Portrait and Landscape Right
+
+ PortraitAndLandscapeRightOnly* delegate9 = [[PortraitAndLandscapeRightOnly alloc] init];
+ [self orientationHelper:delegate9 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Landscape-736h",
+ @"landscapeRight" : @"Default-Landscape-736h",
+ @"portrait" : @"Default-736h",
+ @"portraitUpsideDown" : @"Default-736h"
+ }
+ device:device];
+
+ // PortraitUpsideDown and Landscape Left
+
+ PortraitUpsideDownAndLandscapeLeftOnly* delegate10 = [[PortraitUpsideDownAndLandscapeLeftOnly alloc] init];
+ [self orientationHelper:delegate10 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Landscape-736h",
+ @"landscapeRight" : @"Default-Landscape-736h",
+ @"portrait" : @"Default-736h",
+ @"portraitUpsideDown" : @"Default-736h"
+ }
+ device:device];
+
+ // PortraitUpsideDown and Landscape Right
+
+ PortraitUpsideDownAndLandscapeRightOnly* delegate11 = [[PortraitUpsideDownAndLandscapeRightOnly alloc] init];
+ [self orientationHelper:delegate11 expectedImageNameDictionary:@{
+ @"landscapeLeft" : @"Default-Landscape-736h",
+ @"landscapeRight" : @"Default-Landscape-736h",
+ @"portrait" : @"Default-736h",
+ @"portraitUpsideDown" : @"Default-736h"
+ }
+ device:device];
+}
+
+
+
+@end
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.h b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.h
new file mode 100644
index 0000000..be4a788
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.h
@@ -0,0 +1,57 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import
+#import
+
+@interface PortraitOnly : NSObject
+@end
+
+@interface PortraitUpsideDownOnly : NSObject
+@end
+
+@interface AllPortraitOnly : NSObject
+@end
+
+
+@interface LandscapeLeftOnly : NSObject
+@end
+
+@interface LandscapeRightOnly : NSObject
+@end
+
+@interface AllLandscapeOnly : NSObject
+@end
+
+
+@interface AllOrientations : NSObject
+@end
+
+@interface PortraitAndLandscapeLeftOnly : NSObject
+@end
+
+@interface PortraitAndLandscapeRightOnly : NSObject
+@end
+
+@interface PortraitUpsideDownAndLandscapeLeftOnly : NSObject
+@end
+
+@interface PortraitUpsideDownAndLandscapeRightOnly : NSObject
+@end
+
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.m b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.m
new file mode 100644
index 0000000..b5a1b23
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/ImageNameTestDelegates.m
@@ -0,0 +1,200 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import
+#import "ImageNameTestDelegates.h"
+
+@implementation PortraitOnly
+
+- (NSUInteger)supportedInterfaceOrientations {
+ return UIInterfaceOrientationMaskPortrait;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
+}
+
+- (BOOL)shouldAutorotate {
+ return YES;
+}
+
+@end
+
+@implementation PortraitUpsideDownOnly
+
+- (NSUInteger)supportedInterfaceOrientations {
+ return UIInterfaceOrientationMaskPortraitUpsideDown;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
+}
+
+- (BOOL)shouldAutorotate {
+ return YES;
+}
+
+@end
+
+@implementation AllPortraitOnly
+
+- (NSUInteger)supportedInterfaceOrientations {
+ return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
+}
+
+- (BOOL)shouldAutorotate {
+ return YES;
+}
+
+@end
+
+
+@implementation LandscapeLeftOnly
+
+- (NSUInteger)supportedInterfaceOrientations {
+ return UIInterfaceOrientationMaskLandscapeLeft;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
+}
+
+- (BOOL)shouldAutorotate {
+ return YES;
+}
+
+@end
+
+@implementation LandscapeRightOnly
+
+- (NSUInteger)supportedInterfaceOrientations {
+ return UIInterfaceOrientationMaskLandscapeRight;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
+}
+
+- (BOOL)shouldAutorotate {
+ return YES;
+}
+
+@end
+
+@implementation AllLandscapeOnly
+
+- (NSUInteger)supportedInterfaceOrientations {
+ return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
+}
+
+- (BOOL)shouldAutorotate {
+ return YES;
+}
+
+@end
+
+
+@implementation AllOrientations
+
+- (NSUInteger)supportedInterfaceOrientations {
+ return UIInterfaceOrientationMaskAll;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
+}
+
+- (BOOL)shouldAutorotate {
+ return YES;
+}
+
+@end
+
+@implementation PortraitAndLandscapeLeftOnly
+
+- (NSUInteger)supportedInterfaceOrientations {
+ return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
+}
+
+- (BOOL)shouldAutorotate {
+ return YES;
+}
+
+@end
+
+@implementation PortraitAndLandscapeRightOnly
+
+- (NSUInteger)supportedInterfaceOrientations {
+ return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeRight;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
+}
+
+- (BOOL)shouldAutorotate {
+ return YES;
+}
+
+@end
+
+@implementation PortraitUpsideDownAndLandscapeLeftOnly
+
+- (NSUInteger)supportedInterfaceOrientations {
+ return UIInterfaceOrientationMaskPortraitUpsideDown | UIInterfaceOrientationMaskLandscapeLeft;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
+}
+
+- (BOOL)shouldAutorotate {
+ return YES;
+}
+
+@end
+
+@implementation PortraitUpsideDownAndLandscapeRightOnly
+
+- (NSUInteger)supportedInterfaceOrientations {
+ return UIInterfaceOrientationMaskPortraitUpsideDown | UIInterfaceOrientationMaskLandscapeRight;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ return [self supportedInterfaceOrientations] & (1 << interfaceOrientation) ;
+}
+
+- (BOOL)shouldAutorotate {
+ return YES;
+}
+
+@end
+
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/Info.plist b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/Info.plist
new file mode 100644
index 0000000..95c8add
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenLibTests/Info.plist
@@ -0,0 +1,44 @@
+
+
+
+
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ org.apache.cordova.$(PRODUCT_NAME:rfc1034identifier)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ BNDL
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1
+
+
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.pbxproj b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..ce820d8
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.pbxproj
@@ -0,0 +1,505 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 7E9F51AB19DA10AE00DA31AC /* CDVSplashScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E9F51A919DA10AE00DA31AC /* CDVSplashScreen.m */; };
+ 7E9F51B119DA114400DA31AC /* ImageNameTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E9F51B019DA114400DA31AC /* ImageNameTest.m */; };
+ 7E9F51B319DA116500DA31AC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F51B219DA116500DA31AC /* Foundation.framework */; };
+ 7E9F51B519DA127E00DA31AC /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F51B419DA127E00DA31AC /* UIKit.framework */; };
+ 7E9F51B819DA14FD00DA31AC /* ImageNameTestDelegates.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E9F51B719DA14FD00DA31AC /* ImageNameTestDelegates.m */; };
+ 7E9F51B919DA1B1600DA31AC /* libCDVSplashScreenLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F519519DA102000DA31AC /* libCDVSplashScreenLib.a */; };
+ 7E9F51BA19DA1B2000DA31AC /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E9F519019DA0F8300DA31AC /* libCordova.a */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 7E9F518F19DA0F8300DA31AC /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = 68A32D7114102E1C006B237C;
+ remoteInfo = CordovaLib;
+ };
+ 7E9F51AC19DA10DE00DA31AC /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 7E9F517219DA09CE00DA31AC /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 7E9F519419DA102000DA31AC;
+ remoteInfo = CDVSplashScreenLib;
+ };
+ 7E9F51AE19DA10E100DA31AC /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = D2AAC07D0554694100DB518D;
+ remoteInfo = CordovaLib;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 7E9F519319DA102000DA31AC /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "include/$(PRODUCT_NAME)";
+ dstSubfolderSpec = 16;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CordovaLib.xcodeproj; path = "../node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj"; sourceTree = ""; };
+ 7E9F519519DA102000DA31AC /* libCDVSplashScreenLib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCDVSplashScreenLib.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 7E9F519F19DA102000DA31AC /* CDVSplashScreenLibTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CDVSplashScreenLibTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 7E9F51A219DA102000DA31AC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ 7E9F51A919DA10AE00DA31AC /* CDVSplashScreen.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVSplashScreen.m; path = ../../../src/ios/CDVSplashScreen.m; sourceTree = SOURCE_ROOT; };
+ 7E9F51AA19DA10AE00DA31AC /* CDVSplashScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVSplashScreen.h; path = ../../../src/ios/CDVSplashScreen.h; sourceTree = SOURCE_ROOT; };
+ 7E9F51B019DA114400DA31AC /* ImageNameTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageNameTest.m; sourceTree = ""; };
+ 7E9F51B219DA116500DA31AC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
+ 7E9F51B419DA127E00DA31AC /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
+ 7E9F51B619DA12C600DA31AC /* ImageNameTestDelegates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageNameTestDelegates.h; sourceTree = ""; };
+ 7E9F51B719DA14FD00DA31AC /* ImageNameTestDelegates.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageNameTestDelegates.m; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 7E9F519219DA102000DA31AC /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 7E9F519C19DA102000DA31AC /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 7E9F51BA19DA1B2000DA31AC /* libCordova.a in Frameworks */,
+ 7E9F51B919DA1B1600DA31AC /* libCDVSplashScreenLib.a in Frameworks */,
+ 7E9F51B519DA127E00DA31AC /* UIKit.framework in Frameworks */,
+ 7E9F51B319DA116500DA31AC /* Foundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 7E9F517119DA09CE00DA31AC = {
+ isa = PBXGroup;
+ children = (
+ 7E9F51B419DA127E00DA31AC /* UIKit.framework */,
+ 7E9F51B219DA116500DA31AC /* Foundation.framework */,
+ 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */,
+ 7E9F519619DA102000DA31AC /* CDVSplashScreenLib */,
+ 7E9F51A019DA102000DA31AC /* CDVSplashScreenLibTests */,
+ 7E9F517D19DA0A0A00DA31AC /* Products */,
+ );
+ sourceTree = "";
+ };
+ 7E9F517D19DA0A0A00DA31AC /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 7E9F519519DA102000DA31AC /* libCDVSplashScreenLib.a */,
+ 7E9F519F19DA102000DA31AC /* CDVSplashScreenLibTests.xctest */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 7E9F518C19DA0F8300DA31AC /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 7E9F519019DA0F8300DA31AC /* libCordova.a */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 7E9F519619DA102000DA31AC /* CDVSplashScreenLib */ = {
+ isa = PBXGroup;
+ children = (
+ 7E9F51A919DA10AE00DA31AC /* CDVSplashScreen.m */,
+ 7E9F51AA19DA10AE00DA31AC /* CDVSplashScreen.h */,
+ );
+ path = CDVSplashScreenLib;
+ sourceTree = SOURCE_ROOT;
+ };
+ 7E9F51A019DA102000DA31AC /* CDVSplashScreenLibTests */ = {
+ isa = PBXGroup;
+ children = (
+ 7E9F51A119DA102000DA31AC /* Supporting Files */,
+ 7E9F51B019DA114400DA31AC /* ImageNameTest.m */,
+ 7E9F51B619DA12C600DA31AC /* ImageNameTestDelegates.h */,
+ 7E9F51B719DA14FD00DA31AC /* ImageNameTestDelegates.m */,
+ );
+ path = CDVSplashScreenLibTests;
+ sourceTree = "";
+ };
+ 7E9F51A119DA102000DA31AC /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 7E9F51A219DA102000DA31AC /* Info.plist */,
+ );
+ name = "Supporting Files";
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 7E9F519419DA102000DA31AC /* CDVSplashScreenLib */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 7E9F51A319DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVSplashScreenLib" */;
+ buildPhases = (
+ 7E9F519119DA102000DA31AC /* Sources */,
+ 7E9F519219DA102000DA31AC /* Frameworks */,
+ 7E9F519319DA102000DA31AC /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = CDVSplashScreenLib;
+ productName = CDVSplashScreenLib;
+ productReference = 7E9F519519DA102000DA31AC /* libCDVSplashScreenLib.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ 7E9F519E19DA102000DA31AC /* CDVSplashScreenLibTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 7E9F51A619DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVSplashScreenLibTests" */;
+ buildPhases = (
+ 7E9F519B19DA102000DA31AC /* Sources */,
+ 7E9F519C19DA102000DA31AC /* Frameworks */,
+ 7E9F519D19DA102000DA31AC /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 7E9F51AF19DA10E100DA31AC /* PBXTargetDependency */,
+ 7E9F51AD19DA10DE00DA31AC /* PBXTargetDependency */,
+ );
+ name = CDVSplashScreenLibTests;
+ productName = CDVSplashScreenLibTests;
+ productReference = 7E9F519F19DA102000DA31AC /* CDVSplashScreenLibTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 7E9F517219DA09CE00DA31AC /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0600;
+ TargetAttributes = {
+ 7E9F519419DA102000DA31AC = {
+ CreatedOnToolsVersion = 6.0;
+ };
+ 7E9F519E19DA102000DA31AC = {
+ CreatedOnToolsVersion = 6.0;
+ };
+ };
+ };
+ buildConfigurationList = 7E9F517519DA09CE00DA31AC /* Build configuration list for PBXProject "CDVSplashScreenTest" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 7E9F517119DA09CE00DA31AC;
+ productRefGroup = 7E9F517D19DA0A0A00DA31AC /* Products */;
+ projectDirPath = "";
+ projectReferences = (
+ {
+ ProductGroup = 7E9F518C19DA0F8300DA31AC /* Products */;
+ ProjectRef = 7E9F518B19DA0F8300DA31AC /* CordovaLib.xcodeproj */;
+ },
+ );
+ projectRoot = "";
+ targets = (
+ 7E9F519419DA102000DA31AC /* CDVSplashScreenLib */,
+ 7E9F519E19DA102000DA31AC /* CDVSplashScreenLibTests */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXReferenceProxy section */
+ 7E9F519019DA0F8300DA31AC /* libCordova.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = libCordova.a;
+ remoteRef = 7E9F518F19DA0F8300DA31AC /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+/* End PBXReferenceProxy section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 7E9F519D19DA102000DA31AC /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 7E9F519119DA102000DA31AC /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 7E9F51AB19DA10AE00DA31AC /* CDVSplashScreen.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 7E9F519B19DA102000DA31AC /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 7E9F51B119DA114400DA31AC /* ImageNameTest.m in Sources */,
+ 7E9F51B819DA14FD00DA31AC /* ImageNameTestDelegates.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 7E9F51AD19DA10DE00DA31AC /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 7E9F519419DA102000DA31AC /* CDVSplashScreenLib */;
+ targetProxy = 7E9F51AC19DA10DE00DA31AC /* PBXContainerItemProxy */;
+ };
+ 7E9F51AF19DA10E100DA31AC /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = CordovaLib;
+ targetProxy = 7E9F51AE19DA10E100DA31AC /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+ 7E9F517619DA09CE00DA31AC /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ };
+ name = Debug;
+ };
+ 7E9F517719DA09CE00DA31AC /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ };
+ name = Release;
+ };
+ 7E9F51A419DA102000DA31AC /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(TARGET_BUILD_DIR)/usr/local/lib/include\"",
+ "\"$(OBJROOT)/UninstalledProducts/include\"",
+ "\"$(BUILT_PRODUCTS_DIR)\"",
+ );
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+ 7E9F51A519DA102000DA31AC /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = YES;
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(TARGET_BUILD_DIR)/usr/local/lib/include\"",
+ "\n\"$(OBJROOT)/UninstalledProducts/include\"\n\"$(BUILT_PRODUCTS_DIR)\"",
+ );
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = YES;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 7E9F51A719DA102000DA31AC /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(SDKROOT)/Developer/Library/Frameworks",
+ "$(inherited)",
+ );
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ INFOPLIST_FILE = CDVSplashScreenLibTests/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ };
+ name = Debug;
+ };
+ 7E9F51A819DA102000DA31AC /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = YES;
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(SDKROOT)/Developer/Library/Frameworks",
+ "$(inherited)",
+ );
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ INFOPLIST_FILE = CDVSplashScreenLibTests/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ MTL_ENABLE_DEBUG_INFO = NO;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = iphoneos;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 7E9F517519DA09CE00DA31AC /* Build configuration list for PBXProject "CDVSplashScreenTest" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 7E9F517619DA09CE00DA31AC /* Debug */,
+ 7E9F517719DA09CE00DA31AC /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 7E9F51A319DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVSplashScreenLib" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 7E9F51A419DA102000DA31AC /* Debug */,
+ 7E9F51A519DA102000DA31AC /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 7E9F51A619DA102000DA31AC /* Build configuration list for PBXNativeTarget "CDVSplashScreenLibTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 7E9F51A719DA102000DA31AC /* Debug */,
+ 7E9F51A819DA102000DA31AC /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 7E9F517219DA09CE00DA31AC /* Project object */;
+}
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..8f91278
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout
new file mode 100644
index 0000000..7e4cdb9
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/project.xcworkspace/xcshareddata/CDVSplashScreenTest.xccheckout
@@ -0,0 +1,41 @@
+
+
+
+
+ IDESourceControlProjectFavoriteDictionaryKey
+
+ IDESourceControlProjectIdentifier
+ 6BE9AD73-1B9F-4362-98D7-DC631BEC6185
+ IDESourceControlProjectName
+ CDVSplashScreenTest
+ IDESourceControlProjectOriginsDictionary
+
+ BEF5A5D0FF64801E558286389440357A9233D7DB
+ https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git
+
+ IDESourceControlProjectPath
+ tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj
+ IDESourceControlProjectRelativeInstallPathDictionary
+
+ BEF5A5D0FF64801E558286389440357A9233D7DB
+ ../../../../..
+
+ IDESourceControlProjectURL
+ https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git
+ IDESourceControlProjectVersion
+ 111
+ IDESourceControlProjectWCCIdentifier
+ BEF5A5D0FF64801E558286389440357A9233D7DB
+ IDESourceControlProjectWCConfigurations
+
+
+ IDESourceControlRepositoryExtensionIdentifierKey
+ public.vcs.git
+ IDESourceControlWCCIdentifierKey
+ BEF5A5D0FF64801E558286389440357A9233D7DB
+ IDESourceControlWCCName
+ cordova-plugin-splashscreen
+
+
+
+
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLib.xcscheme b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLib.xcscheme
new file mode 100644
index 0000000..b97b863
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLib.xcscheme
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLibTests.xcscheme b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLibTests.xcscheme
new file mode 100644
index 0000000..6a2a526
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/CDVSplashScreenTest/CDVSplashScreenTest.xcodeproj/xcshareddata/xcschemes/CDVSplashScreenLibTests.xcscheme
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/README.md
new file mode 100644
index 0000000..97ee9df
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/README.md
@@ -0,0 +1,40 @@
+
+
+# iOS Tests for CDVSplashScreen
+
+You need to install `node.js` to pull in `cordova-ios`.
+
+First install cordova-ios:
+
+ npm install
+
+... in the current folder.
+
+
+# Testing from Xcode
+
+1. Launch the `CDVSplashScreenTest.xcworkspace` file.
+2. Choose "CDVSplashScreenLibTests" from the scheme drop-down menu
+3. Click and hold on the `Play` button, and choose the `Wrench` icon to run the tests
+
+
+# Testing from the command line
+
+ npm test
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/de/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/de/README.md
new file mode 100644
index 0000000..9c7f0a4
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/de/README.md
@@ -0,0 +1,39 @@
+
+
+# iOS-Tests für CDVSplashScreen
+
+Sie müssen installieren `node.js` in `Cordova-Ios` zu ziehen.
+
+Installieren Sie Cordova-Ios zum ersten Mal:
+
+ npm install
+
+
+... im aktuellen Ordner.
+
+# Testen von Xcode
+
+ 1. Starten Sie die Datei `CDVSplashScreenTest.xcworkspace` .
+ 2. Wählen Sie im Dropdown-Schema "CDVSplashScreenLibTests"
+ 3. Klicken Sie und halten Sie auf den `Play` -Button und wählen Sie das `Schraubenschlüssel` -Symbol zum Ausführen der tests
+
+# Tests von der Befehlszeile aus
+
+ npm test
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/es/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/es/README.md
new file mode 100644
index 0000000..2176c92
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/es/README.md
@@ -0,0 +1,39 @@
+
+
+# Pruebas de iOS para CDVSplashScreen
+
+Necesita instalar `node.js` en `Córdoba-ios`.
+
+Primero instalar cordova-ios:
+
+ npm install
+
+
+... en la carpeta actual.
+
+# Prueba de Xcode
+
+ 1. Iniciar el archivo `CDVSplashScreenTest.xcworkspace` .
+ 2. Elija "CDVSplashScreenLibTests" en el menú de lista desplegable esquema
+ 3. Haga clic y mantenga el botón de `Play` y elegir el icono de `llave inglesa` para ejecutar las pruebas
+
+# Pruebas desde la línea de comandos
+
+ npm test
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/fr/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/fr/README.md
new file mode 100644
index 0000000..0dbbd0d
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/fr/README.md
@@ -0,0 +1,39 @@
+
+
+# Tests d'iOS pour CDVSplashScreen
+
+Vous devez installer `node.js` à `cordova-ios`.
+
+Commencez par installer cordova-ios :
+
+ npm install
+
+
+... dans le dossier actuel.
+
+# Tests de Xcode
+
+ 1. Lancez le fichier `CDVSplashScreenTest.xcworkspace` .
+ 2. Choisissez « CDVSplashScreenLibTests » dans le menu déroulant de régime
+ 3. Cliquez et maintenez sur la touche `Play` et cliquez sur l'icône de `clé` pour exécuter les tests
+
+# Test de la ligne de commande
+
+ npm test
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/it/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/it/README.md
new file mode 100644
index 0000000..2a42df6
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/it/README.md
@@ -0,0 +1,39 @@
+
+
+# Test di iOS per CDVSplashScreen
+
+È necessario installare `node. js` per tirare in `cordova-ios`.
+
+In primo luogo installare cordova-ios:
+
+ npm install
+
+
+... nella cartella corrente.
+
+# Test da Xcode
+
+ 1. Lanciare il file `CDVSplashScreenTest.xcworkspace` .
+ 2. Scegli "CDVSplashScreenLibTests" dal menu a discesa Schema
+ 3. Fare clic e tenere premuto il pulsante `Play` e scegliere l'icona della `chiave inglese` per eseguire i test
+
+# Test dalla riga di comando
+
+ npm test
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/ja/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/ja/README.md
new file mode 100644
index 0000000..011b824
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/ja/README.md
@@ -0,0 +1,39 @@
+
+
+# CDVSplashScreen の iOS のテスト
+
+`Node.js` `コルドバ`ios をプルするをインストールする必要があります。.
+
+コルドバ ios をインストールします。
+
+ npm install
+
+
+現在のフォルダーに.
+
+# Xcode からテスト
+
+ 1. `CDVSplashScreenTest.xcworkspace`ファイルを起動します。
+ 2. スキーム] ドロップダウン メニューから"CDVSplashScreenLibTests"を選択します。
+ 3. クリックし、`再生`ボタンを押し、テストを実行する`レンチ`のアイコンを選択
+
+# コマンドラインからテスト
+
+ npm test
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/ko/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/ko/README.md
new file mode 100644
index 0000000..6981207
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/ko/README.md
@@ -0,0 +1,39 @@
+
+
+# CDVSplashScreen에 대 한 iOS 테스트
+
+`Node.js` `코르도바` ios에서를 설치 해야.
+
+코르도바-ios를 설치 하는 첫번째는:
+
+ npm install
+
+
+현재 폴더에....
+
+# Xcode에서 테스트
+
+ 1. `CDVSplashScreenTest.xcworkspace` 파일을 시작 합니다.
+ 2. 구성표 드롭 다운 메뉴에서 "CDVSplashScreenLibTests"를 선택
+ 3. 클릭 하 고 `재생` 버튼에는 테스트를 실행 하려면 `공구 모양` 아이콘을 선택
+
+# 명령줄에서 테스트
+
+ npm test
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/pl/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/pl/README.md
new file mode 100644
index 0000000..f13828f
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/pl/README.md
@@ -0,0 +1,39 @@
+
+
+# iOS testy dla CDVSplashScreen
+
+Musisz zainstalować `node.js` ciągnąć w `cordova-ios`.
+
+Najpierw zainstalować cordova-ios:
+
+ npm install
+
+
+... w folderze bieżącym.
+
+# Badania z Xcode
+
+ 1. Uruchom plik `CDVSplashScreenTest.xcworkspace` .
+ 2. Wybierz z menu rozwijanego systemu "CDVSplashScreenLibTests"
+ 3. Kliknij i przytrzymaj przycisk `Play` i wybrać ikonę `klucz` do testów
+
+# Badania z wiersza polecenia
+
+ npm test
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/doc/zh/README.md b/plugins/cordova-plugin-splashscreen/tests/ios/doc/zh/README.md
new file mode 100644
index 0000000..3a04bcd
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/doc/zh/README.md
@@ -0,0 +1,39 @@
+
+
+# CDVSplashScreen 的 iOS 測試
+
+您需要安裝`node.js`拉`科爾多瓦 ios`中.
+
+第一次安裝科爾多瓦 ios:
+
+ npm install
+
+
+在當前資料夾中。
+
+# 從 Xcode 測試
+
+ 1. 啟動`CDVSplashScreenTest.xcworkspace`檔。
+ 2. 從方案下拉式功能表中選擇"CDVSplashScreenLibTests"
+ 3. 按一下並堅持`播放`按鈕,然後選擇要運行的測試的`扳手`圖示
+
+# 從命令列測試
+
+ npm test
diff --git a/plugins/cordova-plugin-splashscreen/tests/ios/package.json b/plugins/cordova-plugin-splashscreen/tests/ios/package.json
new file mode 100644
index 0000000..67f0edc
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/ios/package.json
@@ -0,0 +1,13 @@
+{
+ "name": "cordova-plugin-splashscreen-test-ios",
+ "version": "1.0.0",
+ "description": "iOS Unit Tests for Splashscreen Plugin",
+ "author": "Apache Software Foundation",
+ "license": "Apache Version 2.0",
+ "dependencies": {
+ "cordova-ios": "*"
+ },
+ "scripts": {
+ "test": "xcodebuild test -workspace CDVSplashScreenTest.xcworkspace -scheme CDVSplashScreenLibTests -destination 'platform=iOS Simulator,name=iPhone 5' CONFIGURATION_BUILD_DIR='/tmp' HEADER_SEARCH_PATHS='$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include'"
+ }
+}
diff --git a/plugins/cordova-plugin-splashscreen/tests/package.json b/plugins/cordova-plugin-splashscreen/tests/package.json
new file mode 100644
index 0000000..199a6f5
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "cordova-plugin-splashscreen-tests",
+ "version": "4.0.3-dev",
+ "description": "",
+ "cordova": {
+ "id": "cordova-plugin-splashscreen-tests",
+ "platforms": []
+ },
+ "keywords": [
+ "ecosystem:cordova"
+ ],
+ "author": "",
+ "license": "Apache 2.0"
+}
diff --git a/plugins/cordova-plugin-splashscreen/tests/plugin.xml b/plugins/cordova-plugin-splashscreen/tests/plugin.xml
new file mode 100644
index 0000000..60d7084
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/plugin.xml
@@ -0,0 +1,29 @@
+
+
+
+
+ Cordova Splashscreen Plugin Tests
+ Apache 2.0
+
+
+
+
diff --git a/plugins/cordova-plugin-splashscreen/tests/tests.js b/plugins/cordova-plugin-splashscreen/tests/tests.js
new file mode 100644
index 0000000..7b55a81
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/tests/tests.js
@@ -0,0 +1,64 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* jshint jasmine: true */
+
+exports.defineAutoTests = function () {
+ describe('Splashscreen (cordova)', function () {
+ it("splashscreen.spec.1 should exist", function () {
+ expect(navigator.splashscreen).toBeDefined();
+ });
+
+ it("splashscreen.spec.2 show method should exist", function () {
+ expect(navigator.splashscreen.show).toBeDefined();
+ expect(typeof navigator.splashscreen.show).toBe('function');
+ });
+
+ it("splashscreen.spec.3 hide method should exist", function () {
+ expect(navigator.splashscreen.hide).toBeDefined();
+ expect(typeof navigator.splashscreen.hide).toBe('function');
+ });
+ });
+};
+
+exports.defineManualTests = function (contentEl, createActionButton) {
+ function showFor(duration) {
+ navigator.splashscreen.show();
+ window.setTimeout(function () {
+ navigator.splashscreen.hide();
+ }, 1000 * duration);
+ }
+
+ contentEl.innerHTML = 'Splashscreen Tests
' +
+ 'Note for WP: AutoHideSplashScreen must be set to false in config.xml
' +
+ '' +
+ 'Expected result: Will show the Cordova splashscreen for 1 second' +
+ '
' +
+ 'Expected result: Will show the Cordova splashscreen for 5 seconds';
+
+ createActionButton('Show for 1 second', function () {
+ showFor(1);
+ }, 'show1');
+
+ createActionButton('Show for 5 seconds', function () {
+ showFor(5);
+ }, 'show5');
+};
diff --git a/plugins/cordova-plugin-splashscreen/types/index.d.ts b/plugins/cordova-plugin-splashscreen/types/index.d.ts
new file mode 100644
index 0000000..968b340
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/types/index.d.ts
@@ -0,0 +1,17 @@
+// Type definitions for Apache Cordova Splashscreen plugin
+// Project: https://github.com/apache/cordova-plugin-splashscreen
+// Definitions by: Microsoft Open Technologies Inc
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+//
+// Copyright (c) Microsoft Open Technologies Inc
+// Licensed under the MIT license.
+
+interface Navigator {
+ /** This plugin displays and hides a splash screen during application launch. */
+ splashscreen: {
+ /** Dismiss the splash screen. */
+ hide(): void;
+ /** Displays the splash screen. */
+ show(): void;
+ }
+}
\ No newline at end of file
diff --git a/plugins/cordova-plugin-splashscreen/www/splashscreen.js b/plugins/cordova-plugin-splashscreen/www/splashscreen.js
new file mode 100644
index 0000000..7cb48bd
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/www/splashscreen.js
@@ -0,0 +1,33 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+var exec = require('cordova/exec');
+
+var splashscreen = {
+ show:function() {
+ exec(null, null, "SplashScreen", "show", []);
+ },
+ hide:function() {
+ exec(null, null, "SplashScreen", "hide", []);
+ }
+};
+
+module.exports = splashscreen;
diff --git a/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js b/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js
new file mode 100644
index 0000000..1003f06
--- /dev/null
+++ b/plugins/cordova-plugin-splashscreen/www/windows/SplashScreenProxy.js
@@ -0,0 +1,37 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/*jslint sloppy:true */
+
+var splash = require('cordova/splashscreen');
+
+var SplashScreen = {
+ show: function () {
+ splash.show();
+ },
+ hide: function () {
+ splash.hide();
+ }
+};
+
+module.exports = SplashScreen;
+
+require("cordova/exec/proxy").add("SplashScreen", SplashScreen);
diff --git a/plugins/cordova-plugin-statusbar/.appveyor.yml b/plugins/cordova-plugin-statusbar/.appveyor.yml
new file mode 100644
index 0000000..a7b2426
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/.appveyor.yml
@@ -0,0 +1,28 @@
+# appveyor file
+# http://www.appveyor.com/docs/appveyor-yml
+
+max_jobs: 1
+
+shallow_clone: true
+
+init:
+ - git config --global core.autocrlf true
+
+image:
+ - Visual Studio 2017
+
+environment:
+ nodejs_version: "4"
+ matrix:
+ - PLATFORM: windows-10-store
+ JUST_BUILD: --justBuild
+install:
+ - npm cache clean -f
+ - node --version
+ - npm install -g cordova-paramedic@https://github.com/apache/cordova-paramedic.git
+ - npm install -g cordova
+
+build: off
+
+test_script:
+ - cordova-paramedic --config pr\%PLATFORM% --plugin . %JUST_BUILD%
diff --git a/plugins/cordova-plugin-statusbar/.github/PULL_REQUEST_TEMPLATE.md b/plugins/cordova-plugin-statusbar/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..91582f4
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,22 @@
+
+
+### Platforms affected
+
+
+### What does this PR do?
+
+
+### What testing has been done on this change?
+
+
+### Checklist
+- [ ] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
+- [ ] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
+- [ ] Added automated test coverage as appropriate for this change.
diff --git a/plugins/cordova-plugin-statusbar/.jshintrc b/plugins/cordova-plugin-statusbar/.jshintrc
new file mode 100644
index 0000000..cf48aac
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/.jshintrc
@@ -0,0 +1,16 @@
+{
+ "browser": true
+ , "devel": true
+ , "bitwise": true
+ , "undef": true
+ , "trailing": true
+ , "quotmark": false
+ , "indent": 4
+ , "unused": "vars"
+ , "latedef": "nofunc"
+ , "globals": {
+ "module": false,
+ "exports": false,
+ "require": false
+ }
+}
diff --git a/plugins/cordova-plugin-statusbar/.npmignore b/plugins/cordova-plugin-statusbar/.npmignore
new file mode 100644
index 0000000..2209f42
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/.npmignore
@@ -0,0 +1,24 @@
+#If ignorance is bliss, then somebody knock the smile off my face
+
+*.csproj.user
+*.suo
+*.cache
+Thumbs.db
+*.DS_Store
+
+*.bak
+*.cache
+*.log
+*.swp
+*.user
+
+node_modules
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugins/cordova-plugin-statusbar/.travis.yml b/plugins/cordova-plugin-statusbar/.travis.yml
new file mode 100644
index 0000000..838b021
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/.travis.yml
@@ -0,0 +1,86 @@
+sudo: false
+addons:
+ jwt:
+ secure: Rd/wGSUWGWbc0Y/vqPgI29nybq+j/zWilEIOCBJeRQVwfubdbJNZUIb5DFlSSVzMEavkxZ0PYJ45h21iXyWo3aOoxUJwhkO7QZNzW2MsYzy9qpiKK1jOESXMrpboRWoxg+BL85YbaDF3u1XRy+Xm1nraStT6mDfx5LlUG1Lac6A=
+env:
+ global:
+ - SAUCE_USERNAME=snay
+ - TRAVIS_NODE_VERSION="4.2"
+matrix:
+ include:
+ - env: PLATFORM=browser-chrome
+ os: linux
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=browser-firefox
+ os: linux
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=browser-safari
+ os: linux
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=browser-edge
+ os: linux
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=ios-9.3
+ os: osx
+ osx_image: xcode7.3
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=ios-10.0
+ os: osx
+ osx_image: xcode7.3
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=android-4.4
+ os: linux
+ language: android
+ jdk: oraclejdk8
+ android:
+ components:
+ - tools
+ - build-tools-26.0.2
+ - env: PLATFORM=android-5.1
+ os: linux
+ language: android
+ jdk: oraclejdk8
+ android:
+ components:
+ - tools
+ - build-tools-26.0.2
+ - env: PLATFORM=android-6.0
+ os: linux
+ language: android
+ jdk: oraclejdk8
+ android:
+ components:
+ - tools
+ - build-tools-26.0.2
+ - env: PLATFORM=android-7.0
+ os: linux
+ language: android
+ jdk: oraclejdk8
+ android:
+ components:
+ - tools
+ - build-tools-26.0.2
+before_install:
+- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm
+ && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm
+ install $TRAVIS_NODE_VERSION
+- node --version
+- if [[ "$PLATFORM" =~ android ]]; then gradle --version; fi
+- if [[ "$PLATFORM" =~ ios ]]; then npm install -g ios-deploy; fi
+- if [[ "$PLATFORM" =~ android ]]; then echo y | android update sdk -u --filter android-22,android-23,android-24,android-25,android-26;
+ fi
+- git clone https://github.com/apache/cordova-paramedic /tmp/paramedic && pushd /tmp/paramedic
+ && npm install && popd
+- npm install -g cordova
+install:
+- npm install
+script:
+- npm test
+- node /tmp/paramedic/main.js --config pr/$PLATFORM --plugin $(pwd) --shouldUseSauce
+ --buildName travis-plugin-statusbar-$TRAVIS_JOB_NUMBER
\ No newline at end of file
diff --git a/plugins/cordova-plugin-statusbar/CONTRIBUTING.md b/plugins/cordova-plugin-statusbar/CONTRIBUTING.md
new file mode 100644
index 0000000..4c8e6a5
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/CONTRIBUTING.md
@@ -0,0 +1,37 @@
+
+
+# Contributing to Apache Cordova
+
+Anyone can contribute to Cordova. And we need your contributions.
+
+There are multiple ways to contribute: report bugs, improve the docs, and
+contribute code.
+
+For instructions on this, start with the
+[contribution overview](http://cordova.apache.org/contribute/).
+
+The details are explained there, but the important items are:
+ - Sign and submit an Apache ICLA (Contributor License Agreement).
+ - Have a Jira issue open that corresponds to your contribution.
+ - Run the tests so your patch doesn't break existing functionality.
+
+We look forward to your contributions!
diff --git a/plugins/cordova-plugin-statusbar/LICENSE b/plugins/cordova-plugin-statusbar/LICENSE
new file mode 100644
index 0000000..7a4a3ea
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-statusbar/NOTICE b/plugins/cordova-plugin-statusbar/NOTICE
new file mode 100644
index 0000000..8ec56a5
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/NOTICE
@@ -0,0 +1,5 @@
+Apache Cordova
+Copyright 2012 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
diff --git a/plugins/cordova-plugin-statusbar/README.md b/plugins/cordova-plugin-statusbar/README.md
new file mode 100644
index 0000000..d6bf29c
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/README.md
@@ -0,0 +1,332 @@
+---
+title: Statusbar
+description: Control the device status bar.
+---
+
+
+|AppVeyor|Travis CI|
+|:-:|:-:|
+|[](https://ci.appveyor.com/project/ApacheSoftwareFoundation/cordova-plugin-statusbar)|[](https://travis-ci.org/apache/cordova-plugin-statusbar)|
+
+# cordova-plugin-statusbar
+
+StatusBar
+======
+
+> The `StatusBar` object provides some functions to customize the iOS and Android StatusBar.
+
+:warning: Report issues on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened)%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22cordova-plugin-statusbar%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC)
+
+
+## Installation
+
+This installation method requires cordova 5.0+
+
+ cordova plugin add cordova-plugin-statusbar
+Older versions of cordova can still install via the __deprecated__ id
+
+ cordova plugin add org.apache.cordova.statusbar
+It is also possible to install via repo url directly ( unstable )
+
+ cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git
+
+
+Preferences
+-----------
+
+#### config.xml
+
+- __StatusBarOverlaysWebView__ (boolean, defaults to true). On iOS 7, make the statusbar overlay or not overlay the WebView at startup.
+
+
+
+- __StatusBarBackgroundColor__ (color hex string, no default value). On iOS 7, set the background color of the statusbar by a hex string (#RRGGBB) at startup. If this value is not set, the background color will be transparent.
+
+
+
+- __StatusBarStyle__ (status bar style, defaults to lightcontent). On iOS 7, set the status bar style. Available options default, lightcontent, blacktranslucent, blackopaque.
+
+
+
+- __StatusBarDefaultScrollToTop__ (boolean, defaults to false). On iOS 7, allows the Cordova WebView to use default scroll-to-top behavior. Defaults to false so you can listen to the "statusTap" event (described below) and customize the behavior instead.
+
+
+
+### Android Quirks
+The Android 5+ guidelines specify using a different color for the statusbar than your main app color (unlike the uniform statusbar color of many iOS 7+ apps), so you may want to set the statusbar color at runtime instead via `StatusBar.backgroundColorByHexString` or `StatusBar.backgroundColorByName`. One way to do that would be:
+```js
+if (cordova.platformId == 'android') {
+ StatusBar.backgroundColorByHexString("#333");
+}
+```
+
+Hiding at startup
+-----------
+
+During runtime you can use the StatusBar.hide function below, but if you want the StatusBar to be hidden at app startup, you must modify your app's Info.plist file.
+
+Add/edit these two attributes if not present. Set **"Status bar is initially hidden"** to **"YES"** and set **"View controller-based status bar appearance"** to **"NO"**. If you edit it manually without Xcode, the keys and values are:
+
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+Methods
+-------
+This plugin defines global `StatusBar` object.
+
+Although in the global scope, it is not available until after the `deviceready` event.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(StatusBar);
+ }
+
+- StatusBar.overlaysWebView
+- StatusBar.styleDefault
+- StatusBar.styleLightContent
+- StatusBar.styleBlackTranslucent
+- StatusBar.styleBlackOpaque
+- StatusBar.backgroundColorByName
+- StatusBar.backgroundColorByHexString
+- StatusBar.hide
+- StatusBar.show
+
+Properties
+--------
+
+- StatusBar.isVisible
+
+Events
+------
+
+- statusTap
+
+StatusBar.overlaysWebView
+=================
+
+On iOS 7, make the statusbar overlay or not overlay the WebView.
+
+ StatusBar.overlaysWebView(true);
+
+Description
+-----------
+
+On iOS 7, set to false to make the statusbar appear like iOS 6. Set the style and background color to suit using the other functions.
+
+
+Supported Platforms
+-------------------
+
+- iOS
+
+Quick Example
+-------------
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+StatusBar.styleDefault
+=================
+
+Use the default statusbar (dark text, for light backgrounds).
+
+ StatusBar.styleDefault();
+
+
+Supported Platforms
+-------------------
+
+- iOS
+- Android 6+
+- Windows Phone 7
+- Windows Phone 8
+- Windows Phone 8.1
+
+StatusBar.styleLightContent
+=================
+
+Use the lightContent statusbar (light text, for dark backgrounds).
+
+ StatusBar.styleLightContent();
+
+
+Supported Platforms
+-------------------
+
+- iOS
+- Android 6+
+- Windows Phone 7
+- Windows Phone 8
+- Windows Phone 8.1
+
+StatusBar.styleBlackTranslucent
+=================
+
+Use the blackTranslucent statusbar (light text, for dark backgrounds).
+
+ StatusBar.styleBlackTranslucent();
+
+
+Supported Platforms
+-------------------
+
+- iOS
+- Android 6+
+- Windows Phone 7
+- Windows Phone 8
+- Windows Phone 8.1
+
+StatusBar.styleBlackOpaque
+=================
+
+Use the blackOpaque statusbar (light text, for dark backgrounds).
+
+ StatusBar.styleBlackOpaque();
+
+
+Supported Platforms
+-------------------
+
+- iOS
+- Android 6+
+- Windows Phone 7
+- Windows Phone 8
+- Windows Phone 8.1
+
+
+StatusBar.backgroundColorByName
+=================
+
+On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by color name.
+
+ StatusBar.backgroundColorByName("red");
+
+Supported color names are:
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+Supported Platforms
+-------------------
+
+- iOS
+- Android 5+
+- Windows Phone 7
+- Windows Phone 8
+- Windows Phone 8.1
+
+StatusBar.backgroundColorByHexString
+=================
+
+Sets the background color of the statusbar by a hex string.
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+CSS shorthand properties are also supported.
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by a hex string (#RRGGBB).
+
+On WP7 and WP8 you can also specify values as #AARRGGBB, where AA is an alpha value
+
+Supported Platforms
+-------------------
+
+- iOS
+- Android 5+
+- Windows Phone 7
+- Windows Phone 8
+- Windows Phone 8.1
+
+StatusBar.hide
+=================
+
+Hide the statusbar.
+
+ StatusBar.hide();
+
+
+Supported Platforms
+-------------------
+
+- iOS
+- Android
+- Windows Phone 7
+- Windows Phone 8
+- Windows Phone 8.1
+
+StatusBar.show
+=================
+
+Shows the statusbar.
+
+ StatusBar.show();
+
+
+Supported Platforms
+-------------------
+
+- iOS
+- Android
+- Windows Phone 7
+- Windows Phone 8
+- Windows Phone 8.1
+
+
+StatusBar.isVisible
+=================
+
+Read this property to see if the statusbar is visible or not.
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+Supported Platforms
+-------------------
+
+- iOS
+- Android
+- Windows Phone 7
+- Windows Phone 8
+- Windows Phone 8.1
+
+
+statusTap
+=========
+
+Listen for this event to know if the statusbar was tapped.
+
+ window.addEventListener('statusTap', function() {
+ // scroll-up with document.body.scrollTop = 0; or do whatever you want
+ });
+
+
+Supported Platforms
+-------------------
+
+- iOS
diff --git a/plugins/cordova-plugin-statusbar/RELEASENOTES.md b/plugins/cordova-plugin-statusbar/RELEASENOTES.md
new file mode 100644
index 0000000..e79187c
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/RELEASENOTES.md
@@ -0,0 +1,172 @@
+
+# Release Notes
+
+### 2.4.2 (Apr 12, 2018)
+* [CB-12679](https://issues.apache.org/jira/browse/CB-12679) Remove Permissions section
+
+### 2.4.1 (Dec 27, 2017)
+* [CB-13712](https://issues.apache.org/jira/browse/CB-13712) (iOS): fix overlaysWebView reset on rotation (#92)
+
+### 2.4.0 (Dec 15, 2017)
+* [CB-13623](https://issues.apache.org/jira/browse/CB-13623) (iOS): Remove **iOS** 6-7 code
+
+### 2.3.0 (Nov 06, 2017)
+* [CB-13476](https://issues.apache.org/jira/browse/CB-13476) (iOS): handle double size statusbar on SDK 10 for **iOS 11**
+* [CB-13394](https://issues.apache.org/jira/browse/CB-13394) (iOS): fix `iPhone X` StatusBar rendering in landscape
+* [CB-11858](https://issues.apache.org/jira/browse/CB-11858) (android) Add `StatusBarStyle` feature support for **Android M+**
+* [CB-13311](https://issues.apache.org/jira/browse/CB-13311) (iOS) Statusbar does not overlay correctly on `iPhone X`
+* [CB-13028](https://issues.apache.org/jira/browse/CB-13028) (CI) **Browser** builds on Travis and AppVeyor
+* [CB-12812](https://issues.apache.org/jira/browse/CB-12812) (browser) Fix statusbar plugin with **Browser** platform
+* [CB-12847](https://issues.apache.org/jira/browse/CB-12847) added `bugs` entry to `package.json`.
+
+### 2.2.3 (Apr 27, 2017)
+* [CB-12622](https://issues.apache.org/jira/browse/CB-12622) Added **Android 6.0** build badge to `README`
+* [CB-10879](https://issues.apache.org/jira/browse/CB-10879) Enable overlaysWebView on **Android** API 21+
+* [CB-12685](https://issues.apache.org/jira/browse/CB-12685) added `package.json` to tests folder
+
+### 2.2.2 (Feb 28, 2017)
+* [CB-12188](https://issues.apache.org/jira/browse/CB-12188) Status Bar is not changing in some specific **Android** phone (Red MI 3s Prime)
+* [CB-12369](https://issues.apache.org/jira/browse/CB-12369) Add plugin typings from `DefinitelyTyped`
+* [CB-12363](https://issues.apache.org/jira/browse/CB-12363) Added build badges for **iOS 9.3** and **iOS 10.0**
+* [CB-12196](https://issues.apache.org/jira/browse/CB-12196) **iOS** fix Status Bar Not Hiding
+* [CB-12141](https://issues.apache.org/jira/browse/CB-12141) **iOS** fix white app screen after camera overlay shown on iPad
+* [CB-12230](https://issues.apache.org/jira/browse/CB-12230) Removed **Windows 8.1** build badges
+
+### 2.2.1 (Dec 07, 2016)
+* [CB-12224](https://issues.apache.org/jira/browse/CB-12224) Updated version and RELEASENOTES.md for release 2.2.1
+* [CB-10288](https://issues.apache.org/jira/browse/CB-10288) statusbar plugin interaction with iOS multitasking
+* [CB-10158](https://issues.apache.org/jira/browse/CB-10158) (ios) fix StatusBar issue when recovering from fullscreen video
+* [CB-10341](https://issues.apache.org/jira/browse/CB-10341) ios, document statusTap event
+* [CB-11191](https://issues.apache.org/jira/browse/CB-11191) Statusbar plugin causing issues with webview size
+* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…"
+* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version.
+
+### 2.2.0 (Sep 08, 2016)
+* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies
+* Handle extended status bar on **iOS**
+* Plugin uses `Android Log class` and not `Cordova LOG class`
+* [CB-11287](https://issues.apache.org/jira/browse/CB-11287) (**ios**) - fix webview resize after modal on **iPhones**
+* [CB-11485](https://issues.apache.org/jira/browse/CB-11485) fix resize on rotation with popover
+* Add badges for paramedic builds on Jenkins
+* [CB-11197](https://issues.apache.org/jira/browse/CB-11197) Keep status bar hidden when keyboard pops up
+* Add pull request template.
+* [CB-10866](https://issues.apache.org/jira/browse/CB-10866) Adding engine info to `package.json`
+* patched missing `_ready` method, and changed the way the proxy is installed
+* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to `README.md`
+
+### 2.1.3 (Apr 15, 2016)
+* [CB-11018](https://issues.apache.org/jira/browse/CB-11018) Fix statusbar with `inappbrowser` causing incorrect orientation on **iOS8**
+* [CB-10884](https://issues.apache.org/jira/browse/CB-10884) `Inappbrowser` breaks UI while Screen orientation changes from landscape to portrait on **iOS**
+
+### 2.1.2 (Mar 09, 2016)
+* [CB-10752](https://issues.apache.org/jira/browse/CB-10752) for for status bar overlays the webview on **iOS** 6 in some cases
+* [CB-10683](https://issues.apache.org/jira/browse/CB-10683) Fix wrong StatusBar.isVisible initial value on **Windows**
+* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add JSHint for plugins
+* [CB-10047](https://issues.apache.org/jira/browse/CB-10047) fix **iOS** 8 deprecated warnings
+
+### 2.1.1 (Feb 09, 2016)
+* [CB-10102](https://issues.apache.org/jira/browse/CB-10102) The removeObserver code was wrong and it might crash on plugin deallocation
+
+### 2.1.0 (Jan 15, 2016)
+* [CB-9513](https://issues.apache.org/jira/browse/CB-9513) Allow to show/hide status bar in fullscreen mode.
+* [CB-8720](https://issues.apache.org/jira/browse/CB-8720) Fix status bar position when app started upside down on **iOS 7**.
+* [CB-10118](https://issues.apache.org/jira/browse/CB-10118) Fixes plugin loading error for **Browser** platform
+
+### 2.0.0 (Nov 18, 2015)
+* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
+* Added `weakSelf` reference for block use
+* Fixes [CB-4712](https://issues.apache.org/jira/browse/CB-4712), [CB-5439](https://issues.apache.org/jira/browse/CB-5439) statusbar issues
+* Fixing contribute link.
+* [CB-7965](https://issues.apache.org/jira/browse/CB-7965) Add cordova-plugin-statusbar support for **Browser** platform
+* Don't use `IsAtLeastiOSVersion` macro to determine height
+* Use correct statusbar height for landscape orientation in iOS >= 8
+* remove travis-ci
+* [CB-9202](https://issues.apache.org/jira/browse/CB-9202) updated repo url to github mirror in package.json
+* Added verbose install text for users on < cordova 5.0
+* update docs for `StatusBarBackgroundColor`
+
+### 1.0.1 (Jun 17, 2015)
+* add auto-tests for basic api
+* [CB-9180](https://issues.apache.org/jira/browse/CB-9180) Add correct supported check for **Windows 8.1** desktop
+* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-statusbar documentation translation: cordova-plugin-statusbar
+* fix npm md issue
+
+### 1.0.0 (Apr 15, 2015)
+* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
+* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
+* Use TRAVIS_BUILD_DIR, install paramedic by npm
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
+* - Use StatusBarBackgroundColor instead of AndroidStatusBarBackgroundColor, and added a quirk to the readme.
+* - Add support for StatusBar.backgroundColorByHexString (and StatusBar.backgroundColorByName) on Android 5 and up
+* Allow setting the statusbar backgroundcolor on Android
+* [CB-8575](https://issues.apache.org/jira/browse/CB-8575) Integrate TravisCI
+* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-statusbar documentation translation: cordova-plugin-statusbar
+* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
+
+### 0.1.10 (Feb 04, 2015)
+* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use argumentForIndex rather than NSArray extension
+
+### 0.1.9 (Dec 02, 2014)
+* Fix onload attribute within to be a
+* [CB-8010](https://issues.apache.org/jira/browse/CB-8010) - Statusbar colour does not change to orange
+* added checks for running on windows when StatusBar is NOT available
+* [CB-7986](https://issues.apache.org/jira/browse/CB-7986) Add cordova-plugin-statusbar support for **Windows Phone 8.1**
+* [CB-7977](https://issues.apache.org/jira/browse/CB-7977) Mention `deviceready` in plugin docs
+* [CB-7979](https://issues.apache.org/jira/browse/CB-7979) Each plugin doc should have a ## Installation section
+* Inserting leading space after # for consistency
+* [CB-7549](https://issues.apache.org/jira/browse/CB-7549) - (Re-fix) `StatusBar` **iOS 8** Landscape issue (closes #15)
+* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-statusbar documentation translation: cordova-plugin-statusbar
+* [CB-7571](https://issues.apache.org/jira/browse/CB-7571) Bump version of nested plugin to match parent plugin
+
+### 0.1.8 (Sep 17, 2014)
+* [CB-7549](https://issues.apache.org/jira/browse/CB-7549) [StatusBar][iOS 8] Landscape issue
+* [CB-7486](https://issues.apache.org/jira/browse/CB-7486) Remove StatusBarBackgroundColor intial preference (black background) so background will be initially transparent
+* Renamed test dir, added nested plugin.xml
+* added documentation for manual tests, moved background color test below overlay test
+* [CB-7195](https://issues.apache.org/jira/browse/CB-7195) ported statusbar tests to framework
+
+### 0.1.7 (Aug 06, 2014)
+* Add LICENSE and NOTICE
+* Update statusbar.js
+* Update backgroundColorByHexString function
+* ios: Use a persistent callbackId instead of calling sendJs
+* [CB-6626](https://issues.apache.org/jira/browse/CB-6626) ios: Add a JS event for tapping on statusbar
+* ios: Fix hide to adjust webview's frame only when status bar is not overlaying webview
+* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
+* android: Fix StatusBar.initialize() not running on UI thread
+
+### 0.1.6 (Jun 05, 2014)
+* [CB-6783](https://issues.apache.org/jira/browse/CB-6783) - added StatusBarStyle config preference, updated docs (closes #9)
+* [CB-6812](https://issues.apache.org/jira/browse/CB-6812) Add license
+* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
+* [CB-6264](https://issues.apache.org/jira/browse/CB-6264) minor formatting issue
+* Update docs with recent WP changes, remove 'clear' from the loist of named colors in documentation
+* [CB-6513](https://issues.apache.org/jira/browse/CB-6513) - Statusbar plugin for Android is not compiling
+
+### 0.1.5 (Apr 17, 2014) (First release as a core Cordova Plugin)
+* [CB-6316](https://issues.apache.org/jira/browse/CB-6316): Added README.md which point to the new location for docs
+* [CB-6316](https://issues.apache.org/jira/browse/CB-6316): Added license header to the documentation. Added README.md which point to the new location for docs
+* [CB-6316](https://issues.apache.org/jira/browse/CB-6316): Moved StatusBar plugin documentation to docs folder
+* [CB-6314](https://issues.apache.org/jira/browse/CB-6314): [android] Add StatusBar.isVisible support to Android
+* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
diff --git a/plugins/cordova-plugin-statusbar/doc/de/README.md b/plugins/cordova-plugin-statusbar/doc/de/README.md
new file mode 100644
index 0000000..9247598
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/de/README.md
@@ -0,0 +1,276 @@
+
+
+# cordova-plugin-statusbar
+
+[](https://travis-ci.org/apache/cordova-plugin-statusbar)
+
+# StatusBar
+
+> Das `StatusBar` Objekt stellt einige Funktionen zum Anpassen des iOS und Android StatusBar.
+
+## Installation
+
+ cordova plugin add cordova-plugin-statusbar
+
+
+## "Einstellungen"
+
+#### "config.xml"
+
+ * **StatusBarOverlaysWebView** (Boolean, der Standardwert ist True). Stellen Sie auf iOS 7 die Statusbar-Overlay oder keine Überlagerung der WebView beim Start.
+
+
+
+
+ * **StatusBarBackgroundColor** (Farbe hex String, Standardwert ist #000000). Auf iOS legen 7 und Android 5, Sie die Hintergrundfarbe der Statusbar von eine hexadezimale Zeichenfolge (#RRGGBB) beim Start.
+
+
+
+
+ * **StatusBarStyle** (Status Bar-Stil, der Standardwert ist Lightcontent). Legen Sie auf iOS 7 den Status-Bar-Stil. Verfügbaren Optionen Standard, Lightcontent, Blacktranslucent, Blackopaque.
+
+
+
+
+### Android Eigenarten
+
+Die Android 5 + Leitlinien angeben, verwenden eine andere Farbe für die Statusbar als Ihre Hauptanwendung Farbe (anders als die einheitliche Statusbar Farbe viele iOS 7 + apps), so Sie die Statusbar Farbe zur Laufzeit statt über `StatusBar.backgroundColorByHexString` oder `StatusBar.backgroundColorByName`festzulegen möchten vielleicht. Eine Möglichkeit dazu wäre:
+
+```js
+if (cordova.platformId == 'android') {
+ StatusBar.backgroundColorByHexString("#333");
+}
+```
+
+## Beim Start ausblenden
+
+Während der Laufzeit können Sie die StatusBar.hide-Funktion unten, aber die StatusBar beim Start der app versteckt werden soll, müssen Sie Ihre app Info.plist Datei ändern.
+
+Diese beiden Attribute hinzufügen/bearbeiten, wenn nicht vorhanden. Legen Sie **"Statusleiste ist anfangs ausgeblendet"** auf **"YES"** und **"View Controller-basierte Status Bar aussehen"** auf **"NO"**. Wenn Sie es manuell ohne Xcode bearbeiten, werden die Schlüssel und Werte:
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+## Methoden
+
+Dieses Plugin wird globales `StatusBar`-Objekt definiert.
+
+Obwohl im globalen Gültigkeitsbereich, steht es nicht bis nach dem `deviceready`-Ereignis.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(StatusBar);
+ }
+
+
+ * StatusBar.overlaysWebView
+ * StatusBar.styleDefault
+ * StatusBar.styleLightContent
+ * StatusBar.styleBlackTranslucent
+ * StatusBar.styleBlackOpaque
+ * StatusBar.backgroundColorByName
+ * StatusBar.backgroundColorByHexString
+ * StatusBar.hide
+ * StatusBar.show
+
+## Eigenschaften
+
+ * StatusBar.isVisible
+
+## Berechtigungen
+
+#### "config.xml"
+
+
+
+
+
+
+# StatusBar.overlaysWebView
+
+Stellen Sie auf iOS 7 Statusbar überlagern oder nicht überlagert die WebView.
+
+ StatusBar.overlaysWebView(true);
+
+
+## Beschreibung
+
+Auf iOS 7 zu der Statusbar wie iOS 6 erscheinen auf False festgelegt. Legen Sie die Stil und Hintergrund Farbe entsprechend mit den anderen Funktionen.
+
+## Unterstützte Plattformen
+
+ * iOS
+
+## Kurzes Beispiel
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+Verwenden Sie die Standard-Statusbar (dunkle Text, für helle Hintergründe).
+
+ StatusBar.styleDefault();
+
+
+## Unterstützte Plattformen
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone-8.1
+
+# StatusBar.styleLightContent
+
+Verwenden Sie die LightContent-Statusbar (heller Text, für dunkle Hintergründe).
+
+ StatusBar.styleLightContent();
+
+
+## Unterstützte Plattformen
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone-8.1
+
+# StatusBar.styleBlackTranslucent
+
+Verwenden Sie die BlackTranslucent-Statusbar (heller Text, für dunkle Hintergründe).
+
+ StatusBar.styleBlackTranslucent();
+
+
+## Unterstützte Plattformen
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone-8.1
+
+# StatusBar.styleBlackOpaque
+
+Verwenden Sie die BlackOpaque-Statusbar (heller Text, für dunkle Hintergründe).
+
+ StatusBar.styleBlackOpaque();
+
+
+## Unterstützte Plattformen
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone-8.1
+
+# StatusBar.backgroundColorByName
+
+Auf iOS 7 Wenn Sie StatusBar.statusBarOverlaysWebView auf False festlegen, können Sie die Hintergrundfarbe der Statusbar von Farbnamen festlegen.
+
+ StatusBar.backgroundColorByName("red");
+
+
+Unterstützte Farbnamen sind:
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+## Unterstützte Plattformen
+
+ * iOS
+ * Android 5+
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone-8.1
+
+# StatusBar.backgroundColorByHexString
+
+Legt die Hintergrundfarbe der Statusbar von eine hexadezimale Zeichenfolge fest.
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+CSS-Kurzschrift-Eigenschaften werden ebenfalls unterstützt.
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+
+Auf iOS 7 Wenn Sie StatusBar.statusBarOverlaysWebView auf False festlegen, können Sie die Hintergrundfarbe der Statusbar von eine hexadezimale Zeichenfolge (#RRGGBB) festlegen.
+
+Auf WP7 und WP8 können Sie auch Werte wie #AARRGGBB, angeben wo AA einen alpha-Wert ist
+
+## Unterstützte Plattformen
+
+ * iOS
+ * Android 5+
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone-8.1
+
+# StatusBar.hide
+
+Ausblenden der Statusleiste.
+
+ StatusBar.hide();
+
+
+## Unterstützte Plattformen
+
+ * iOS
+ * Android
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone-8.1
+
+# StatusBar.show
+
+Zeigt die Statusleiste.
+
+ StatusBar.show();
+
+
+## Unterstützte Plattformen
+
+ * iOS
+ * Android
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone-8.1
+
+# StatusBar.isVisible
+
+Lesen Sie diese Eigenschaft, um festzustellen, ob die Statusbar sichtbar oder nicht ist.
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+## Unterstützte Plattformen
+
+ * iOS
+ * Android
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone-8.1
\ No newline at end of file
diff --git a/plugins/cordova-plugin-statusbar/doc/de/index.md b/plugins/cordova-plugin-statusbar/doc/de/index.md
new file mode 100644
index 0000000..9f913c5
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/de/index.md
@@ -0,0 +1,262 @@
+
+
+# cordova-plugin-statusbar
+
+# StatusBar
+
+> Das `StatusBar` Objekt stellt einige Funktionen zum Anpassen des iOS und Android StatusBar.
+
+## Installation
+
+ cordova plugin add cordova-plugin-statusbar
+
+
+## "Einstellungen"
+
+#### config.xml
+
+* **StatusBarOverlaysWebView** (Boolean, der Standardwert ist True). Stellen Sie auf iOS 7 die Statusbar-Overlay oder keine Überlagerung der WebView beim Start.
+
+
+
+
+* **StatusBarBackgroundColor** (Farbe hex String, der Standardwert ist #000000). Legen Sie auf iOS 7 die Hintergrundfarbe der Statusbar von eine hexadezimale Zeichenfolge (#RRGGBB) beim Start.
+
+
+
+
+* **StatusBarStyle** (Status Bar-Stil, der Standardwert ist Lightcontent). Legen Sie auf iOS 7 den Status-Bar-Stil. Verfügbaren Optionen Standard, Lightcontent, Blacktranslucent, Blackopaque.
+
+
+
+
+## Beim Start ausblenden
+
+Während der Laufzeit können Sie die StatusBar.hide-Funktion unten, aber die StatusBar beim Start der app versteckt werden soll, müssen Sie Ihre app Info.plist Datei ändern.
+
+Diese beiden Attribute hinzufügen/bearbeiten, wenn nicht vorhanden. Legen Sie **"Statusleiste ist anfangs ausgeblendet"** auf **"YES"** und **"View Controller-basierte Status Bar aussehen"** auf **"NO"**. Wenn Sie es manuell ohne Xcode bearbeiten, werden die Schlüssel und Werte:
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+## Methoden
+
+Dieses Plugin wird globales `StatusBar`-Objekt definiert.
+
+Obwohl im globalen Gültigkeitsbereich, steht es nicht bis nach dem `deviceready`-Ereignis.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(StatusBar);
+ }
+
+
+* StatusBar.overlaysWebView
+* StatusBar.styleDefault
+* StatusBar.styleLightContent
+* StatusBar.styleBlackTranslucent
+* StatusBar.styleBlackOpaque
+* StatusBar.backgroundColorByName
+* StatusBar.backgroundColorByHexString
+* StatusBar.hide
+* StatusBar.show
+
+## Eigenschaften
+
+* StatusBar.isVisible
+
+## Berechtigungen
+
+#### config.xml
+
+
+
+
+
+
+# StatusBar.overlaysWebView
+
+Stellen Sie auf iOS 7 Statusbar überlagern oder nicht überlagert die WebView.
+
+ StatusBar.overlaysWebView(true);
+
+
+## Beschreibung
+
+Auf iOS 7 zu der Statusbar wie iOS 6 erscheinen auf False festgelegt. Legen Sie die Stil und Hintergrund Farbe entsprechend mit den anderen Funktionen.
+
+## Unterstützte Plattformen
+
+* iOS
+
+## Kurzes Beispiel
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+Verwenden Sie die Standard-Statusbar (dunkle Text, für helle Hintergründe).
+
+ StatusBar.styleDefault();
+
+
+## Unterstützte Plattformen
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone-8.1
+
+# StatusBar.styleLightContent
+
+Verwenden Sie die LightContent-Statusbar (heller Text, für dunkle Hintergründe).
+
+ StatusBar.styleLightContent();
+
+
+## Unterstützte Plattformen
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone-8.1
+
+# StatusBar.styleBlackTranslucent
+
+Verwenden Sie die BlackTranslucent-Statusbar (heller Text, für dunkle Hintergründe).
+
+ StatusBar.styleBlackTranslucent();
+
+
+## Unterstützte Plattformen
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone-8.1
+
+# StatusBar.styleBlackOpaque
+
+Verwenden Sie die BlackOpaque-Statusbar (heller Text, für dunkle Hintergründe).
+
+ StatusBar.styleBlackOpaque();
+
+
+## Unterstützte Plattformen
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone-8.1
+
+# StatusBar.backgroundColorByName
+
+Auf iOS 7 Wenn Sie StatusBar.statusBarOverlaysWebView auf False festlegen, können Sie die Hintergrundfarbe der Statusbar von Farbnamen festlegen.
+
+ StatusBar.backgroundColorByName("red");
+
+
+Unterstützte Farbnamen sind:
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+## Unterstützte Plattformen
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone-8.1
+
+# StatusBar.backgroundColorByHexString
+
+Legt die Hintergrundfarbe der Statusbar von eine hexadezimale Zeichenfolge fest.
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+CSS-Kurzschrift-Eigenschaften werden ebenfalls unterstützt.
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+
+Auf iOS 7 Wenn Sie StatusBar.statusBarOverlaysWebView auf False festlegen, können Sie die Hintergrundfarbe der Statusbar von eine hexadezimale Zeichenfolge (#RRGGBB) festlegen.
+
+Auf WP7 und WP8 können Sie auch Werte wie #AARRGGBB, angeben wo AA einen alpha-Wert ist
+
+## Unterstützte Plattformen
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone-8.1
+
+# StatusBar.hide
+
+Ausblenden der Statusleiste.
+
+ StatusBar.hide();
+
+
+## Unterstützte Plattformen
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone-8.1
+
+# StatusBar.show
+
+Zeigt die Statusleiste.
+
+ StatusBar.show();
+
+
+## Unterstützte Plattformen
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone-8.1
+
+# StatusBar.isVisible
+
+Lesen Sie diese Eigenschaft, um festzustellen, ob die Statusbar sichtbar oder nicht ist.
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+## Unterstützte Plattformen
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone-8.1
diff --git a/plugins/cordova-plugin-statusbar/doc/es/README.md b/plugins/cordova-plugin-statusbar/doc/es/README.md
new file mode 100644
index 0000000..8be769d
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/es/README.md
@@ -0,0 +1,276 @@
+
+
+# cordova-plugin-statusbar
+
+[](https://travis-ci.org/apache/cordova-plugin-statusbar)
+
+# StatusBar
+
+> El `StatusBar` objeto proporciona algunas funciones para personalizar el iOS y Android StatusBar.
+
+## Instalación
+
+ cordova plugin add cordova-plugin-statusbar
+
+
+## Preferencias
+
+#### config.xml
+
+ * **StatusBarOverlaysWebView** (boolean, true por defecto). En iOS 7, hacer la superposición statusbar o no superponer la WebView al inicio.
+
+
+
+
+ * **StatusBarBackgroundColor** (color hex string por defecto #000000). IOS 7 y 5 Android, configurar el color de fondo de la barra de estado por una cadena hexadecimal (#RRGGBB) en el arranque.
+
+
+
+
+ * **StatusBarStyle** (status bar estilo por defecto lightcontent). En iOS 7, definir el estilo de barra de estado. Por defecto las opciones disponibles, lightcontent, blacktranslucent, blackopaque.
+
+
+
+
+### Rarezas Android
+
+Android 5 + pautas especifican utilizando un color diferente para la barra de estado que la aplicación principal de color (a diferencia del color de barra de estado uniforme de muchas apps de iOS 7 +), por lo que puede establecer el color de la barra de estado en tiempo de ejecución en su lugar a través de `StatusBar.backgroundColorByHexString` o `StatusBar.backgroundColorByName`. Una forma de hacerlo sería:
+
+```js
+if (cordova.platformId == 'android') {
+ StatusBar.backgroundColorByHexString("#333");
+}
+```
+
+## Escondido en el arranque
+
+Durante el tiempo de ejecución puede utilizar la función StatusBar.hide abajo, pero si quieres la barra de estado que está escondido en el inicio de la aplicación, se debe modificar el archivo Info.plist de su aplicación.
+
+Agregar/editar estos dos atributos si no está presente. Defina **"inicialmente se esconde la barra de estado"** a **"YES"** y **"Aparición de vista basado en controlador estatus bar"** a **"NO"**. Si se edita manualmente sin Xcode, las claves y valores son:
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+## Métodos
+
+Este plugin define global `StatusBar` objeto.
+
+Aunque en el ámbito global, no estará disponible hasta después de la `deviceready` evento.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(StatusBar);
+ }
+
+
+ * StatusBar.overlaysWebView
+ * StatusBar.styleDefault
+ * StatusBar.styleLightContent
+ * StatusBar.styleBlackTranslucent
+ * StatusBar.styleBlackOpaque
+ * StatusBar.backgroundColorByName
+ * StatusBar.backgroundColorByHexString
+ * StatusBar.hide
+ * StatusBar.show
+
+## Propiedades
+
+ * StatusBar.isVisible
+
+## Permisos
+
+#### config.xml
+
+
+
+
+
+
+# StatusBar.overlaysWebView
+
+En iOS 7, hacer la barra de estado superposición o no superponer la vista Web.
+
+ StatusBar.overlaysWebView(true);
+
+
+## Descripción
+
+En iOS 7, establecida en false para que la barra de estado aparezca como iOS 6. Establece el color de fondo y estilo para utilizar las otras funciones.
+
+## Plataformas soportadas
+
+ * iOS
+
+## Ejemplo rápido
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+Utilice la barra de estado por defecto (texto oscuro, para fondos de luz).
+
+ StatusBar.styleDefault();
+
+
+## Plataformas soportadas
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleLightContent
+
+Utilice la barra de estado lightContent (texto ligero, para fondos oscuros).
+
+ StatusBar.styleLightContent();
+
+
+## Plataformas soportadas
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleBlackTranslucent
+
+Utilice la barra de estado blackTranslucent (texto ligero, para fondos oscuros).
+
+ StatusBar.styleBlackTranslucent();
+
+
+## Plataformas soportadas
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleBlackOpaque
+
+Utilice la barra de estado blackOpaque (texto ligero, para fondos oscuros).
+
+ StatusBar.styleBlackOpaque();
+
+
+## Plataformas soportadas
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.backgroundColorByName
+
+En iOS 7, al establecer StatusBar.statusBarOverlaysWebView a false, se puede establecer el color de fondo de la barra de estado nombre del color.
+
+ StatusBar.backgroundColorByName("red");
+
+
+Nombres de los colores admitidos son:
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+## Plataformas soportadas
+
+ * iOS
+ * Android 5+
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.backgroundColorByHexString
+
+Establece el color de fondo de la barra de estado por una cadena hexadecimal.
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+Propiedades CSS abreviada también son compatibles.
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+
+En iOS 7, cuando se establece StatusBar.statusBarOverlaysWebView en false, se puede establecer el color de fondo de la barra de estado una cadena hexadecimal (#RRGGBB).
+
+En WP7 y WP8 también puede especificar valores como #AARRGGBB, donde AA es un valor alfa
+
+## Plataformas soportadas
+
+ * iOS
+ * Android 5+
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.hide
+
+Ocultar la barra de estado.
+
+ StatusBar.hide();
+
+
+## Plataformas soportadas
+
+ * iOS
+ * Android
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.show
+
+Muestra la barra de estado.
+
+ StatusBar.show();
+
+
+## Plataformas soportadas
+
+ * iOS
+ * Android
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.isVisible
+
+Lea esta propiedad para ver si la barra de estado es visible o no.
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+## Plataformas soportadas
+
+ * iOS
+ * Android
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
\ No newline at end of file
diff --git a/plugins/cordova-plugin-statusbar/doc/es/index.md b/plugins/cordova-plugin-statusbar/doc/es/index.md
new file mode 100644
index 0000000..fa4ba67
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/es/index.md
@@ -0,0 +1,252 @@
+
+
+# cordova-plugin-statusbar
+
+# StatusBar
+
+> El `StatusBar` objeto proporciona algunas funciones para personalizar el iOS y Android StatusBar.
+
+## Instalación
+
+ Cordova plugin agregar cordova-plugin-statusbar
+
+
+## Preferencias
+
+#### config.xml
+
+* **StatusBarOverlaysWebView** (boolean, true por defecto). En iOS 7, hacer la superposición statusbar o no superponer la WebView al inicio.
+
+
+
+
+* **StatusBarBackgroundColor** (cadena hexadecimal color, #000000 por defecto). En iOS 7, establecer el color de fondo de la barra de estado por una cadena hexadecimal (#RRGGBB) en el arranque.
+
+
+
+
+* **StatusBarStyle** (status bar estilo por defecto lightcontent). En iOS 7, definir el estilo de barra de estado. Por defecto las opciones disponibles, lightcontent, blacktranslucent, blackopaque.
+
+
+
+
+## Escondido en el arranque
+
+Durante el tiempo de ejecución puede utilizar la función StatusBar.hide abajo, pero si quieres la barra de estado que está escondido en el inicio de la aplicación, se debe modificar el archivo Info.plist de su aplicación.
+
+Agregar/editar estos dos atributos si no está presente. Defina **"inicialmente se esconde la barra de estado"** a **"YES"** y **"Aparición de vista basado en controlador estatus bar"** a **"NO"**. Si se edita manualmente sin Xcode, las claves y valores son:
+
+ < llave > UIStatusBarHidden < / key >< verdadero / >< llave > UIViewControllerBasedStatusBarAppearance < / key >< falso / >
+
+
+## Métodos
+
+Este plugin define global `StatusBar` objeto.
+
+Aunque en el ámbito global, no estará disponible hasta después de la `deviceready` evento.
+
+ document.addEventListener ("deviceready", onDeviceReady, false);
+ function onDeviceReady() {console.log(StatusBar)};
+
+
+* StatusBar.overlaysWebView
+* StatusBar.styleDefault
+* StatusBar.styleLightContent
+* StatusBar.styleBlackTranslucent
+* StatusBar.styleBlackOpaque
+* StatusBar.backgroundColorByName
+* StatusBar.backgroundColorByHexString
+* StatusBar.hide
+* StatusBar.show
+
+## Propiedades
+
+* StatusBar.isVisible
+
+## Permisos
+
+#### config.xml
+
+ < nombre de la función = "StatusBar" >< nombre param = "ios-paquete" value = "CDVStatusBar" onload = "true" / >< / característica >
+
+
+# StatusBar.overlaysWebView
+
+En iOS 7, hacer la barra de estado superposición o no superponer la vista Web.
+
+ StatusBar.overlaysWebView(true);
+
+
+## Descripción
+
+En iOS 7, establecida en false para que la barra de estado aparezca como iOS 6. Establece el color de fondo y estilo para utilizar las otras funciones.
+
+## Plataformas soportadas
+
+* iOS
+
+## Ejemplo rápido
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+Utilice la barra de estado por defecto (texto oscuro, para fondos de luz).
+
+ StatusBar.styleDefault();
+
+
+## Plataformas soportadas
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleLightContent
+
+Utilice la barra de estado lightContent (texto ligero, para fondos oscuros).
+
+ StatusBar.styleLightContent();
+
+
+## Plataformas soportadas
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleBlackTranslucent
+
+Utilice la barra de estado blackTranslucent (texto ligero, para fondos oscuros).
+
+ StatusBar.styleBlackTranslucent();
+
+
+## Plataformas soportadas
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleBlackOpaque
+
+Utilice la barra de estado blackOpaque (texto ligero, para fondos oscuros).
+
+ StatusBar.styleBlackOpaque();
+
+
+## Plataformas soportadas
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.backgroundColorByName
+
+En iOS 7, al establecer StatusBar.statusBarOverlaysWebView a false, se puede establecer el color de fondo de la barra de estado nombre del color.
+
+ StatusBar.backgroundColorByName("red");
+
+
+Nombres de los colores admitidos son:
+
+ negro, gris oscuro, lightGray, blanco, gris, rojo, verde, azul, cian, amarillo, magenta, naranja, púrpura, marrón
+
+
+## Plataformas soportadas
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.backgroundColorByHexString
+
+Establece el color de fondo de la barra de estado por una cadena hexadecimal.
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+Propiedades CSS abreviada también son compatibles.
+
+ StatusBar.backgroundColorByHexString("#333"); = > StatusBar.backgroundColorByHexString("#FAB") #333333; = > #FFAABB
+
+
+En iOS 7, cuando se establece StatusBar.statusBarOverlaysWebView en false, se puede establecer el color de fondo de la barra de estado una cadena hexadecimal (#RRGGBB).
+
+En WP7 y WP8 también puede especificar valores como #AARRGGBB, donde AA es un valor alfa
+
+## Plataformas soportadas
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.hide
+
+Ocultar la barra de estado.
+
+ StatusBar.hide();
+
+
+## Plataformas soportadas
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.show
+
+Muestra la barra de estado.
+
+ StatusBar.show();
+
+
+## Plataformas soportadas
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.isVisible
+
+Lea esta propiedad para ver si la barra de estado es visible o no.
+
+ Si (StatusBar.isVisible) {/ / hacer algo}
+
+
+## Plataformas soportadas
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
diff --git a/plugins/cordova-plugin-statusbar/doc/fr/README.md b/plugins/cordova-plugin-statusbar/doc/fr/README.md
new file mode 100644
index 0000000..6f7f9bf
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/fr/README.md
@@ -0,0 +1,276 @@
+
+
+# cordova-plugin-statusbar
+
+[](https://travis-ci.org/apache/cordova-plugin-statusbar)
+
+# StatusBar
+
+> Le `StatusBar` objet fournit quelques fonctions pour personnaliser les iOS et Android StatusBar.
+
+## Installation
+
+ cordova plugin add cordova-plugin-statusbar
+
+
+## Préférences
+
+#### config.Xml
+
+ * **StatusBarOverlaysWebView** (boolean, la valeur par défaut true). Sur iOS 7, faire la superposition de statusbar ou pas superposition le WebView au démarrage.
+
+
+
+
+ * **StatusBarBackgroundColor** (chaîne hexadécimale de couleur, par défaut, #000000). Sur iOS 7 et 5 Android, définir la couleur d'arrière-plan de la barre d'État par une chaîne hexadécimale (#RRGGBB) au démarrage.
+
+
+
+
+ * **StatusBarStyle** (style de barre de statut, par défaut, lightcontent). Sur iOS 7, définir le style de barre de statut. Par défaut les options disponibles, lightcontent, blacktranslucent, blackopaque.
+
+
+
+
+### Quirks Android
+
+Les lignes directrices 5 + Android spécifient à l'aide d'une couleur différente pour la barre d'État à votre application principale couleur (contrairement à la couleur uniforme statusbar de nombreuses applications iOS 7 +), donc vous pouvez définir la couleur de la barre d'état lors de l'exécution au lieu de cela via `StatusBar.backgroundColorByHexString` ou `StatusBar.backgroundColorByName`. Une façon de le faire serait :
+
+```js
+if (cordova.platformId == 'android') {
+ StatusBar.backgroundColorByHexString("#333");
+}
+```
+
+## Cacher au démarrage
+
+Pendant l'exécution, vous pouvez utiliser la fonction StatusBar.hide en bas, mais si vous souhaitez que la barre d'État pour être caché au démarrage de l'application, vous devez modifier le fichier Info.plist de votre application.
+
+Ajouter/modifier ces deux attributs si n'est pas présent. **"Barre d'État est initialement masqué"** la valeur **"** Yes" et **"À l'apparence vue sur contrôleur statut bar"** la valeur **"Non"**. Si vous modifiez manuellement sans Xcode, les clés et les valeurs sont :
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+## Méthodes
+
+Ce plugin définit objet `StatusBar` global.
+
+Bien que dans la portée globale, il n'est pas disponible jusqu'après la `deviceready` événement.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(StatusBar);
+ }
+
+
+ * StatusBar.overlaysWebView
+ * StatusBar.styleDefault
+ * StatusBar.styleLightContent
+ * StatusBar.styleBlackTranslucent
+ * StatusBar.styleBlackOpaque
+ * StatusBar.backgroundColorByName
+ * StatusBar.backgroundColorByHexString
+ * StatusBar.hide
+ * StatusBar.show
+
+## Propriétés
+
+ * StatusBar.isVisible
+
+## Autorisations
+
+#### config.Xml
+
+
+
+
+
+
+# StatusBar.overlaysWebView
+
+Sur iOS 7, faire la statusbar superposition ou pas superposer le WebView.
+
+ StatusBar.overlaysWebView(true);
+
+
+## Description
+
+Sur iOS 7, la valeur false pour afficher la barre d'État comme iOS 6. Définissez la couleur de style et d'arrière-plan en fonction de l'utilisation des autres fonctions.
+
+## Plates-formes supportées
+
+ * iOS
+
+## Exemple court
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+Utilisez la barre de statut par défaut (texte sombre, pour les arrière-plans lumineux).
+
+ StatusBar.styleDefault();
+
+
+## Plates-formes supportées
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleLightContent
+
+Utilisez la barre d'État lightContent (texte clair, des arrière-plans sombres).
+
+ StatusBar.styleLightContent();
+
+
+## Plates-formes supportées
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleBlackTranslucent
+
+Utilisez la barre d'État blackTranslucent (texte clair, des arrière-plans sombres).
+
+ StatusBar.styleBlackTranslucent();
+
+
+## Plates-formes supportées
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleBlackOpaque
+
+Utilisez la barre d'État blackOpaque (texte clair, des arrière-plans sombres).
+
+ StatusBar.styleBlackOpaque();
+
+
+## Plates-formes supportées
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.backgroundColorByName
+
+Sur iOS 7, lorsque vous définissez StatusBar.statusBarOverlaysWebView sur false, vous pouvez définir la couleur d'arrière-plan de la barre d'État par nom de couleur.
+
+ StatusBar.backgroundColorByName("red");
+
+
+Les noms de couleurs prises en charge sont :
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+## Plates-formes supportées
+
+ * iOS
+ * Android 5+
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.backgroundColorByHexString
+
+Définit la couleur d'arrière-plan de la barre d'État par une chaîne hexadécimale.
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+Propriétés de raccourci CSS sont également pris en charge.
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+
+Sur iOS 7, lorsque vous définissez StatusBar.statusBarOverlaysWebView sur false, vous pouvez définir la couleur d'arrière-plan de la barre d'État par une chaîne hexadécimale (#RRGGBB).
+
+Sur WP7 et WP8, vous pouvez également spécifier des valeurs comme #AARRGGBB, où AA représente une valeur alpha
+
+## Plates-formes supportées
+
+ * iOS
+ * Android 5+
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.hide
+
+Masquer la barre d'État.
+
+ StatusBar.hide();
+
+
+## Plates-formes supportées
+
+ * iOS
+ * Android
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.show
+
+Affiche la barre d'État.
+
+ StatusBar.show();
+
+
+## Plates-formes supportées
+
+ * iOS
+ * Android
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.isVisible
+
+Lire cette propriété afin de voir si la barre d'État est visible ou non.
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+## Plates-formes supportées
+
+ * iOS
+ * Android
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
\ No newline at end of file
diff --git a/plugins/cordova-plugin-statusbar/doc/fr/index.md b/plugins/cordova-plugin-statusbar/doc/fr/index.md
new file mode 100644
index 0000000..816f3df
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/fr/index.md
@@ -0,0 +1,262 @@
+
+
+# cordova-plugin-statusbar
+
+# StatusBar
+
+> Le `StatusBar` objet fournit quelques fonctions pour personnaliser les iOS et Android StatusBar.
+
+## Installation
+
+ cordova plugin add cordova-plugin-statusbar
+
+
+## Préférences
+
+#### config.xml
+
+* **StatusBarOverlaysWebView** (boolean, la valeur par défaut true). Sur iOS 7, faire la superposition de statusbar ou pas superposition le WebView au démarrage.
+
+
+
+
+* **StatusBarBackgroundColor** (chaîne hexadécimale de couleur, par défaut, #000000). Sur iOS 7, définir la couleur d'arrière-plan de la barre d'État par une chaîne hexadécimale (#RRGGBB) au démarrage.
+
+
+
+
+* **StatusBarStyle** (style de barre de statut, par défaut, lightcontent). Sur iOS 7, définir le style de barre de statut. Par défaut les options disponibles, lightcontent, blacktranslucent, blackopaque.
+
+
+
+
+## Cacher au démarrage
+
+Pendant l'exécution, vous pouvez utiliser la fonction StatusBar.hide en bas, mais si vous souhaitez que la barre d'État pour être caché au démarrage de l'application, vous devez modifier le fichier Info.plist de votre application.
+
+Ajouter/modifier ces deux attributs si n'est pas présent. **"Barre d'État est initialement masqué"** la valeur **"** Yes" et **"À l'apparence vue sur contrôleur statut bar"** la valeur **"Non"**. Si vous modifiez manuellement sans Xcode, les clés et les valeurs sont :
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+## Méthodes
+
+Ce plugin définit objet `StatusBar` global.
+
+Bien que dans la portée globale, il n'est pas disponible jusqu'après la `deviceready` événement.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(StatusBar);
+ }
+
+
+* StatusBar.overlaysWebView
+* StatusBar.styleDefault
+* StatusBar.styleLightContent
+* StatusBar.styleBlackTranslucent
+* StatusBar.styleBlackOpaque
+* StatusBar.backgroundColorByName
+* StatusBar.backgroundColorByHexString
+* StatusBar.hide
+* StatusBar.show
+
+## Propriétés
+
+* StatusBar.isVisible
+
+## Autorisations
+
+#### config.xml
+
+
+
+
+
+
+# StatusBar.overlaysWebView
+
+Sur iOS 7, faire la statusbar superposition ou pas superposer le WebView.
+
+ StatusBar.overlaysWebView(true);
+
+
+## Description
+
+Sur iOS 7, la valeur false pour afficher la barre d'État comme iOS 6. Définissez la couleur de style et d'arrière-plan en fonction de l'utilisation des autres fonctions.
+
+## Plates-formes supportées
+
+* iOS
+
+## Exemple court
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+Utilisez la barre de statut par défaut (texte sombre, pour les arrière-plans lumineux).
+
+ StatusBar.styleDefault();
+
+
+## Plates-formes prises en charge
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleLightContent
+
+Utilisez la barre d'État lightContent (texte clair, des arrière-plans sombres).
+
+ StatusBar.styleLightContent();
+
+
+## Plates-formes prises en charge
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleBlackTranslucent
+
+Utilisez la barre d'État blackTranslucent (texte clair, des arrière-plans sombres).
+
+ StatusBar.styleBlackTranslucent();
+
+
+## Plates-formes prises en charge
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleBlackOpaque
+
+Utilisez la barre d'État blackOpaque (texte clair, des arrière-plans sombres).
+
+ StatusBar.styleBlackOpaque();
+
+
+## Plates-formes prises en charge
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.backgroundColorByName
+
+Sur iOS 7, lorsque vous définissez StatusBar.statusBarOverlaysWebView sur false, vous pouvez définir la couleur d'arrière-plan de la barre d'État par nom de couleur.
+
+ StatusBar.backgroundColorByName("red");
+
+
+Les noms de couleurs prises en charge sont :
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+## Plates-formes prises en charge
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.backgroundColorByHexString
+
+Définit la couleur d'arrière-plan de la barre d'État par une chaîne hexadécimale.
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+Propriétés de raccourci CSS sont également pris en charge.
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+
+Sur iOS 7, lorsque vous définissez StatusBar.statusBarOverlaysWebView sur false, vous pouvez définir la couleur d'arrière-plan de la barre d'État par une chaîne hexadécimale (#RRGGBB).
+
+Sur WP7 et WP8, vous pouvez également spécifier des valeurs comme #AARRGGBB, où AA représente une valeur alpha
+
+## Plates-formes prises en charge
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.hide
+
+Masquer la barre d'État.
+
+ StatusBar.hide();
+
+
+## Plates-formes prises en charge
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.show
+
+Affiche la barre d'État.
+
+ StatusBar.show();
+
+
+## Plates-formes prises en charge
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.isVisible
+
+Lire cette propriété afin de voir si la barre d'État est visible ou non.
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+## Plates-formes supportées
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
diff --git a/plugins/cordova-plugin-statusbar/doc/it/README.md b/plugins/cordova-plugin-statusbar/doc/it/README.md
new file mode 100644
index 0000000..cf3f844
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/it/README.md
@@ -0,0 +1,276 @@
+
+
+# cordova-plugin-statusbar
+
+[](https://travis-ci.org/apache/cordova-plugin-statusbar)
+
+# StatusBar
+
+> Il `StatusBar` oggetto fornisce alcune funzioni per personalizzare l'iOS e Android StatusBar.
+
+## Installazione
+
+ cordova plugin add cordova-plugin-statusbar
+
+
+## Preferenze
+
+#### config. XML
+
+ * **StatusBarOverlaysWebView** (boolean, default è true). IOS 7, rendono la statusbar sovrapposizione o la non sovrapposizione WebView all'avvio.
+
+
+
+
+ * **StatusBarBackgroundColor** (stringa esadecimale di colore, il valore predefinito è #000000). Su iOS 7 e 5 Android, è possibile impostare il colore di sfondo della barra di stato di una stringa esadecimale (#RRGGBB) all'avvio.
+
+
+
+
+ * **StatusBarStyle** (status bar in stile, default è lightcontent). IOS 7, impostare lo stile di barra di stato. Predefinita di opzioni disponibili, lightcontent, blacktranslucent, blackopaque.
+
+
+
+
+### Stranezze Android
+
+Le linee 5 + Android Guida specificano utilizzando un colore diverso per la barra di stato che l'app principale di colore (a differenza di colore uniforme statusbar di molte applicazioni di iOS 7 +), quindi si consiglia di impostare il colore della barra di stato in fase di esecuzione invece tramite `StatusBar.backgroundColorByHexString` o `StatusBar.backgroundColorByName`. Un modo per farlo sarebbe:
+
+```js
+if (cordova.platformId == 'android') {
+ StatusBar.backgroundColorByHexString("#333");
+}
+```
+
+## Nascondendo all'avvio
+
+In fase di esecuzione è possibile utilizzare la funzione di StatusBar.hide qui sotto, ma se si desidera che la barra di stato venga nascosta all'avvio di app, è necessario modificare il file info. plist dell'app.
+
+Aggiungere o modificare questi due attributi, se non presente. Impostare la **"barra di stato è inizialmente nascosto"** a **"YES"** e **"Aspetto di vista basati su controller status bar"** a **"NO"**. Se si modifica manualmente senza Xcode, le chiavi e i valori sono:
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+## Metodi
+
+Questo plugin definisce globale oggetto `StatusBar`.
+
+Anche se in ambito globale, non è disponibile fino a dopo l'evento `deviceready`.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(StatusBar);
+ }
+
+
+ * StatusBar.overlaysWebView
+ * StatusBar.styleDefault
+ * StatusBar.styleLightContent
+ * StatusBar.styleBlackTranslucent
+ * StatusBar.styleBlackOpaque
+ * StatusBar.backgroundColorByName
+ * StatusBar.backgroundColorByHexString
+ * StatusBar.hide
+ * StatusBar.show
+
+## Proprietà
+
+ * StatusBar.isVisible
+
+## Autorizzazioni
+
+#### config. XML
+
+
+
+
+
+
+# StatusBar.overlaysWebView
+
+IOS 7, rendono la statusbar sovrapposizione o non sovrapporre WebView.
+
+ StatusBar.overlaysWebView(true);
+
+
+## Descrizione
+
+IOS 7, impostato su false per rendere la barra di stato vengono visualizzati come iOS 6. Impostare il colore di sfondo e stile per soddisfare utilizzando altre funzioni.
+
+## Piattaforme supportate
+
+ * iOS
+
+## Esempio rapido
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+Utilizzare la barra di stato predefinito (testo scuro, per sfondi di luce).
+
+ StatusBar.styleDefault();
+
+
+## Piattaforme supportate
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleLightContent
+
+Utilizzare la barra di stato lightContent (testo in chiaro, per sfondi scuri).
+
+ StatusBar.styleLightContent();
+
+
+## Piattaforme supportate
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleBlackTranslucent
+
+Utilizzare la barra di stato blackTranslucent (testo in chiaro, per sfondi scuri).
+
+ StatusBar.styleBlackTranslucent();
+
+
+## Piattaforme supportate
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleBlackOpaque
+
+Utilizzare la barra di stato blackOpaque (testo in chiaro, per sfondi scuri).
+
+ StatusBar.styleBlackOpaque();
+
+
+## Piattaforme supportate
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.backgroundColorByName
+
+IOS 7, quando StatusBar.statusBarOverlaysWebView è impostata su false, è possibile impostare il colore di sfondo della barra di stato con il nome di colore.
+
+ StatusBar.backgroundColorByName("red");
+
+
+Nomi di colore supportati sono:
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+## Piattaforme supportate
+
+ * iOS
+ * Android 5+
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.backgroundColorByHexString
+
+Imposta il colore di sfondo della barra di stato di una stringa esadecimale.
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+Proprietà di scrittura stenografica CSS sono supportati anche.
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+
+IOS 7, quando StatusBar.statusBarOverlaysWebView è impostata su false, è possibile impostare il colore di sfondo della barra di stato di una stringa esadecimale (#RRGGBB).
+
+Su WP7 e WP8 è inoltre possibile specificare i valori come #AARRGGBB, dove AA è un valore alfa
+
+## Piattaforme supportate
+
+ * iOS
+ * Android 5+
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.hide
+
+Nascondere la barra di stato.
+
+ StatusBar.hide();
+
+
+## Piattaforme supportate
+
+ * iOS
+ * Android
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.show
+
+Mostra la barra di stato.
+
+ StatusBar.show();
+
+
+## Piattaforme supportate
+
+ * iOS
+ * Android
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.isVisible
+
+Leggere questa proprietà per vedere se la barra di stato è visibile o no.
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+## Piattaforme supportate
+
+ * iOS
+ * Android
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
\ No newline at end of file
diff --git a/plugins/cordova-plugin-statusbar/doc/it/index.md b/plugins/cordova-plugin-statusbar/doc/it/index.md
new file mode 100644
index 0000000..73ddcd4
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/it/index.md
@@ -0,0 +1,262 @@
+
+
+# cordova-plugin-statusbar
+
+# StatusBar
+
+> Il `StatusBar` oggetto fornisce alcune funzioni per personalizzare l'iOS e Android StatusBar.
+
+## Installazione
+
+ cordova plugin add cordova-plugin-statusbar
+
+
+## Preferenze
+
+#### config.xml
+
+* **StatusBarOverlaysWebView** (boolean, default è true). IOS 7, rendono la statusbar sovrapposizione o la non sovrapposizione WebView all'avvio.
+
+
+
+
+* **StatusBarBackgroundColor** (stringa esadecimale colore, predefinito è #000000). IOS 7, impostare il colore di sfondo della barra di stato di una stringa esadecimale (#RRGGBB) all'avvio.
+
+
+
+
+* **StatusBarStyle** (status bar in stile, default è lightcontent). IOS 7, impostare lo stile di barra di stato. Predefinita di opzioni disponibili, lightcontent, blacktranslucent, blackopaque.
+
+
+
+
+## Nascondendo all'avvio
+
+In fase di esecuzione è possibile utilizzare la funzione di StatusBar.hide qui sotto, ma se si desidera che la barra di stato venga nascosta all'avvio di app, è necessario modificare il file info. plist dell'app.
+
+Aggiungere o modificare questi due attributi, se non presente. Impostare la **"barra di stato è inizialmente nascosto"** a **"YES"** e **"Aspetto di vista basati su controller status bar"** a **"NO"**. Se si modifica manualmente senza Xcode, le chiavi e i valori sono:
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+## Metodi
+
+Questo plugin definisce globale oggetto `StatusBar`.
+
+Anche se in ambito globale, non è disponibile fino a dopo l'evento `deviceready`.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(StatusBar);
+ }
+
+
+* StatusBar.overlaysWebView
+* StatusBar.styleDefault
+* StatusBar.styleLightContent
+* StatusBar.styleBlackTranslucent
+* StatusBar.styleBlackOpaque
+* StatusBar.backgroundColorByName
+* StatusBar.backgroundColorByHexString
+* StatusBar.hide
+* StatusBar.show
+
+## Proprietà
+
+* StatusBar.isVisible
+
+## Autorizzazioni
+
+#### config.xml
+
+
+
+
+
+
+# StatusBar.overlaysWebView
+
+IOS 7, rendono la statusbar sovrapposizione o non sovrapporre WebView.
+
+ StatusBar.overlaysWebView(true);
+
+
+## Descrizione
+
+IOS 7, impostato su false per rendere la barra di stato vengono visualizzati come iOS 6. Impostare il colore di sfondo e stile per soddisfare utilizzando altre funzioni.
+
+## Piattaforme supportate
+
+* iOS
+
+## Esempio rapido
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+Utilizzare la barra di stato predefinito (testo scuro, per sfondi di luce).
+
+ StatusBar.styleDefault();
+
+
+## Piattaforme supportate
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleLightContent
+
+Utilizzare la barra di stato lightContent (testo in chiaro, per sfondi scuri).
+
+ StatusBar.styleLightContent();
+
+
+## Piattaforme supportate
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleBlackTranslucent
+
+Utilizzare la barra di stato blackTranslucent (testo in chiaro, per sfondi scuri).
+
+ StatusBar.styleBlackTranslucent();
+
+
+## Piattaforme supportate
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleBlackOpaque
+
+Utilizzare la barra di stato blackOpaque (testo in chiaro, per sfondi scuri).
+
+ StatusBar.styleBlackOpaque();
+
+
+## Piattaforme supportate
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.backgroundColorByName
+
+IOS 7, quando StatusBar.statusBarOverlaysWebView è impostata su false, è possibile impostare il colore di sfondo della barra di stato con il nome di colore.
+
+ StatusBar.backgroundColorByName("red");
+
+
+Nomi di colore supportati sono:
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+## Piattaforme supportate
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.backgroundColorByHexString
+
+Imposta il colore di sfondo della barra di stato di una stringa esadecimale.
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+Proprietà di scrittura stenografica CSS sono supportati anche.
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+
+IOS 7, quando StatusBar.statusBarOverlaysWebView è impostata su false, è possibile impostare il colore di sfondo della barra di stato di una stringa esadecimale (#RRGGBB).
+
+Su WP7 e WP8 è inoltre possibile specificare i valori come #AARRGGBB, dove AA è un valore alfa
+
+## Piattaforme supportate
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.hide
+
+Nascondere la barra di stato.
+
+ StatusBar.hide();
+
+
+## Piattaforme supportate
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.show
+
+Mostra la barra di stato.
+
+ StatusBar.show();
+
+
+## Piattaforme supportate
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.isVisible
+
+Leggere questa proprietà per vedere se la barra di stato è visibile o no.
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+## Piattaforme supportate
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
diff --git a/plugins/cordova-plugin-statusbar/doc/ja/README.md b/plugins/cordova-plugin-statusbar/doc/ja/README.md
new file mode 100644
index 0000000..fc8b59a
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/ja/README.md
@@ -0,0 +1,276 @@
+
+
+# cordova-plugin-statusbar
+
+[](https://travis-ci.org/apache/cordova-plugin-statusbar)
+
+# StatusBar
+
+> `StatusBar`オブジェクトは、iOS と Android ステータス バーをカスタマイズするいくつかの機能を提供します。
+
+## インストール
+
+ cordova plugin add cordova-plugin-statusbar
+
+
+## 基本設定
+
+#### config.xml
+
+ * **StatusBarOverlaysWebView**(ブール値、デフォルトは true)。IOS 7、起動時にステータスバー オーバーレイまたはないオーバーレイ、WebView を作る。
+
+
+
+
+ * **StatusBarBackgroundColor**(カラー 16 進文字列、既定値は #000000)。IOS 7 とアンドロイド 5、16 進文字列 (#RRGGBB) 起動時にステータスバーの背景色を設定します。
+
+
+
+
+ * **StatusBarStyle**(ステータス バーのスタイル、既定値は lightcontent)。Ios 7、ステータス バーのスタイルを設定します。使用可能なオプションのデフォルト、lightcontent、blacktranslucent、blackopaque。
+
+
+
+
+### Android の癖
+
+Android のガイドライン 5 + 指定メイン アプリよりもステータスバーの異なる色を使用して`StatusBar.backgroundColorByHexString`または`StatusBar.backgroundColorByName`経由で代わりに実行時にステータス バーの色を設定する場合がありますので (とは違って制服ステータスバー色多くの iOS 7 + アプリの) 色します。 それを行う方法の 1 つになります。
+
+```js
+if (cordova.platformId == 'android') {
+ StatusBar.backgroundColorByHexString("#333");
+}
+```
+
+## 起動時に非表示
+
+実行時に下に、StatusBar.hide 関数を使用できますが、StatusBar アプリ起動時に非表示にする場合は、アプリの Info.plist ファイルを変更する必要があります。
+
+これら 2 つの属性の追加/編集存在しない場合。 **「ステータス バーが非表示最初」** **"YES"**を設定し、 **「ビュー コント ローラー ベースのステータス バーの外観」** **"NO"**にします。 Xcode せず手動で編集する、キーと値は。
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+## メソッド
+
+このプラグインでは、グローバル `StatusBar` オブジェクトを定義します。
+
+グローバル スコープではあるがそれがないまで `deviceready` イベントの後です。
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(StatusBar);
+ }
+
+
+ * StatusBar.overlaysWebView
+ * StatusBar.styleDefault
+ * StatusBar.styleLightContent
+ * StatusBar.styleBlackTranslucent
+ * StatusBar.styleBlackOpaque
+ * StatusBar.backgroundColorByName
+ * StatusBar.backgroundColorByHexString
+ * StatusBar.hide
+ * StatusBar.show
+
+## プロパティ
+
+ * StatusBar.isVisible
+
+## アクセス許可
+
+#### config.xml
+
+
+
+
+
+
+# StatusBar.overlaysWebView
+
+IOS 7、statusbar オーバーレイまたはない WebView をオーバーレイします。
+
+ StatusBar.overlaysWebView(true);
+
+
+## 解説
+
+IOS 7、iOS の 6 のように表示されるステータスバーを false に設定します。他の関数の使用に合わせてスタイルや背景色を設定します。
+
+## サポートされているプラットフォーム
+
+ * iOS
+
+## 簡単な例
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+既定ステータス バー (暗いテキスト、淡色の背景) を使用します。
+
+ StatusBar.styleDefault();
+
+
+## サポートされているプラットフォーム
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleLightContent
+
+LightContent ステータスバー (暗い背景の明るいテキスト) を使用します。
+
+ StatusBar.styleLightContent();
+
+
+## サポートされているプラットフォーム
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleBlackTranslucent
+
+BlackTranslucent ステータスバー (暗い背景の明るいテキスト) を使用します。
+
+ StatusBar.styleBlackTranslucent();
+
+
+## サポートされているプラットフォーム
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleBlackOpaque
+
+BlackOpaque ステータスバー (暗い背景の明るいテキスト) を使用します。
+
+ StatusBar.styleBlackOpaque();
+
+
+## サポートされているプラットフォーム
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.backgroundColorByName
+
+Ios 7、StatusBar.statusBarOverlaysWebView を false に設定する場合はステータスバーの背景色の色の名前によって設定できます。
+
+ StatusBar.backgroundColorByName("red");
+
+
+サポートされている色の名前は次のとおりです。
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+## サポートされているプラットフォーム
+
+ * iOS
+ * Android 5+
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.backgroundColorByHexString
+
+16 進文字列をステータス バーの背景色を設定します。
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+速記の CSS プロパティもサポートされています。
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+
+Ios 7、StatusBar.statusBarOverlaysWebView を false に設定する場合はステータスバーの背景色を 16 進文字列 (#RRGGBB) で設定できます。
+
+WP7 と WP8 も指定できます値 #AARRGGBB, AA は、アルファ値として
+
+## サポートされているプラットフォーム
+
+ * iOS
+ * Android 5+
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.hide
+
+ステータスバーを隠します。
+
+ StatusBar.hide();
+
+
+## サポートされているプラットフォーム
+
+ * iOS
+ * アンドロイド
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.show
+
+ステータス バーが表示されます。
+
+ StatusBar.show();
+
+
+## サポートされているプラットフォーム
+
+ * iOS
+ * アンドロイド
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.isVisible
+
+このプロパティ、ステータスバーが表示されるかどうかをお読みください。
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+## サポートされているプラットフォーム
+
+ * iOS
+ * アンドロイド
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
\ No newline at end of file
diff --git a/plugins/cordova-plugin-statusbar/doc/ja/index.md b/plugins/cordova-plugin-statusbar/doc/ja/index.md
new file mode 100644
index 0000000..79705f2
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/ja/index.md
@@ -0,0 +1,262 @@
+
+
+# cordova-plugin-statusbar
+
+# StatusBar
+
+> `StatusBar`オブジェクトは、iOS と Android ステータス バーをカスタマイズするいくつかの機能を提供します。
+
+## インストール
+
+ cordova plugin add cordova-plugin-statusbar
+
+
+## 基本設定
+
+#### config.xml
+
+* **StatusBarOverlaysWebView**(ブール値、デフォルトは true)。IOS 7、起動時にステータスバー オーバーレイまたはないオーバーレイ、WebView を作る。
+
+
+
+
+* **StatusBarBackgroundColor**(色 16 進文字列、デフォルトは # 000000)。Ios 7、起動時に 16 進文字列 (#RRGGBB) でステータス バーの背景色を設定します。
+
+
+
+
+* **StatusBarStyle**(ステータス バーのスタイル、既定値は lightcontent)。Ios 7、ステータス バーのスタイルを設定します。使用可能なオプションのデフォルト、lightcontent、blacktranslucent、blackopaque。
+
+
+
+
+## 起動時に非表示
+
+実行時に下に、StatusBar.hide 関数を使用できますが、StatusBar アプリ起動時に非表示にする場合は、アプリの Info.plist ファイルを変更する必要があります。
+
+これら 2 つの属性の追加/編集存在しない場合。 **「ステータス バーが非表示最初」** **"YES"**を設定し、 **「ビュー コント ローラー ベースのステータス バーの外観」** **"NO"**にします。 Xcode せず手動で編集する、キーと値は。
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+## メソッド
+
+このプラグインでは、グローバル `StatusBar` オブジェクトを定義します。
+
+グローバル スコープではあるがそれがないまで `deviceready` イベントの後です。
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(StatusBar);
+ }
+
+
+* StatusBar.overlaysWebView
+* StatusBar.styleDefault
+* StatusBar.styleLightContent
+* StatusBar.styleBlackTranslucent
+* StatusBar.styleBlackOpaque
+* StatusBar.backgroundColorByName
+* StatusBar.backgroundColorByHexString
+* StatusBar.hide
+* StatusBar.show
+
+## プロパティ
+
+* StatusBar.isVisible
+
+## アクセス許可
+
+#### config.xml
+
+
+
+
+
+
+# StatusBar.overlaysWebView
+
+IOS 7、statusbar オーバーレイまたはない WebView をオーバーレイします。
+
+ StatusBar.overlaysWebView(true);
+
+
+## 解説
+
+IOS 7、iOS の 6 のように表示されるステータスバーを false に設定します。他の関数の使用に合わせてスタイルや背景色を設定します。
+
+## サポートされているプラットフォーム
+
+* iOS
+
+## 簡単な例
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+既定ステータス バー (暗いテキスト、淡色の背景) を使用します。
+
+ StatusBar.styleDefault();
+
+
+## サポートされているプラットフォーム
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleLightContent
+
+LightContent ステータスバー (暗い背景の明るいテキスト) を使用します。
+
+ StatusBar.styleLightContent();
+
+
+## サポートされているプラットフォーム
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleBlackTranslucent
+
+BlackTranslucent ステータスバー (暗い背景の明るいテキスト) を使用します。
+
+ StatusBar.styleBlackTranslucent();
+
+
+## サポートされているプラットフォーム
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleBlackOpaque
+
+BlackOpaque ステータスバー (暗い背景の明るいテキスト) を使用します。
+
+ StatusBar.styleBlackOpaque();
+
+
+## サポートされているプラットフォーム
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.backgroundColorByName
+
+Ios 7、StatusBar.statusBarOverlaysWebView を false に設定する場合はステータスバーの背景色の色の名前によって設定できます。
+
+ StatusBar.backgroundColorByName("red");
+
+
+サポートされている色の名前は次のとおりです。
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+## サポートされているプラットフォーム
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.backgroundColorByHexString
+
+16 進文字列をステータス バーの背景色を設定します。
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+速記の CSS プロパティもサポートされています。
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+
+Ios 7、StatusBar.statusBarOverlaysWebView を false に設定する場合はステータスバーの背景色を 16 進文字列 (#RRGGBB) で設定できます。
+
+WP7 と WP8 も指定できます値 #AARRGGBB, AA は、アルファ値として
+
+## サポートされているプラットフォーム
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.hide
+
+ステータスバーを隠します。
+
+ StatusBar.hide();
+
+
+## サポートされているプラットフォーム
+
+* iOS
+* アンドロイド
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.show
+
+ステータス バーが表示されます。
+
+ StatusBar.show();
+
+
+## サポートされているプラットフォーム
+
+* iOS
+* アンドロイド
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.isVisible
+
+このプロパティ、ステータスバーが表示されるかどうかをお読みください。
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+## サポートされているプラットフォーム
+
+* iOS
+* アンドロイド
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
diff --git a/plugins/cordova-plugin-statusbar/doc/ko/README.md b/plugins/cordova-plugin-statusbar/doc/ko/README.md
new file mode 100644
index 0000000..f76ac3e
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/ko/README.md
@@ -0,0 +1,276 @@
+
+
+# cordova-plugin-statusbar
+
+[](https://travis-ci.org/apache/cordova-plugin-statusbar)
+
+# StatusBar
+
+> `StatusBar`개체 iOS와 안 드 로이드 상태 표시줄을 사용자 지정 하려면 몇 가지 기능을 제공 합니다.
+
+## 설치
+
+ cordova plugin add cordova-plugin-statusbar
+
+
+## 환경 설정
+
+#### config.xml
+
+ * **StatusBarOverlaysWebView** (boolean, 기본값: true)입니다. IOS 7, 시작 시 상태 표시줄 오버레이 또는 WebView 중첩 되지 확인 합니다.
+
+
+
+
+ * **StatusBarBackgroundColor** (색상 16 진수 문자열 기본값: #000000). IOS에서 7과 안 드 로이드 5 시작 시 16 진수 문자열 (#RRGGBB) 상태 표시줄의 배경색을 설정 합니다.
+
+
+
+
+ * **StatusBarStyle** (상태 표시줄 스타일, 기본값: lightcontent). Ios 7, 상태 표시줄 스타일을 설정 합니다. 사용 가능한 옵션 기본, lightcontent, blacktranslucent, blackopaque.
+
+
+
+
+### 안 드 로이드 단점
+
+안 드 로이드 5 + 지침 보다 귀하의 주요 응용 프로그램 상태 표시줄에 대 한 다른 색을 사용 하 여 지정한 색상 (와 달리 균일 한 상태 표시줄의 색상 많은 iOS 7 + 애플 리 케이 션), `StatusBar.backgroundColorByHexString` 또는 `StatusBar.backgroundColorByName`를 통해 대신 런타임에 상태 표시줄 색을 설정 하고자 할 수 있습니다. 한 가지 방법은 일 것입니다.
+
+```js
+if (cordova.platformId == 'android') {
+ StatusBar.backgroundColorByHexString("#333");
+}
+```
+
+## 시작 시 숨기기
+
+런타임 동안 아래의 StatusBar.hide 함수를 사용할 수 있습니다 하지만 당신이 원하는 응용 프로그램 시작 시 숨겨진 상태 표시줄, 응용 프로그램의 Info.plist 파일 수정 해야 합니다.
+
+추가 편집이 두 특성이 없는 경우. **"상태 표시줄 처음 숨겨진"** **"YES"** 로 설정 하 고 **"뷰 컨트롤러 기반 상태 표시줄 모양"** **"NO"**로 설정 합니다. Xcode, 열쇠 없이 수동으로 편집 하는 경우 값은:
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+## 메서드
+
+이 플러그인 글로벌 `StatusBar` 개체를 정의합니다.
+
+전역 범위에 있지만 그것은 불가능까지 `deviceready` 이벤트 후.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(StatusBar);
+ }
+
+
+ * StatusBar.overlaysWebView
+ * StatusBar.styleDefault
+ * StatusBar.styleLightContent
+ * StatusBar.styleBlackTranslucent
+ * StatusBar.styleBlackOpaque
+ * StatusBar.backgroundColorByName
+ * StatusBar.backgroundColorByHexString
+ * StatusBar.hide
+ * StatusBar.show
+
+## 속성
+
+ * StatusBar.isVisible
+
+## 사용 권한
+
+#### config.xml
+
+
+
+
+
+
+# StatusBar.overlaysWebView
+
+IOS 7, 오버레이 또는 하지 WebView 중첩 상태 표시줄을 확인 합니다.
+
+ StatusBar.overlaysWebView(true);
+
+
+## 설명
+
+7 iOS, iOS 6 처럼 나타나는 상태 표시줄을 false로 설정 합니다. 다른 함수를 사용 하 여에 맞게 스타일과 배경 색상을 설정 합니다.
+
+## 지원 되는 플랫폼
+
+ * iOS
+
+## 빠른 예제
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+기본 상태 표시줄 (어두운 텍스트, 밝은 배경에 대 한)를 사용 합니다.
+
+ StatusBar.styleDefault();
+
+
+## 지원 되는 플랫폼
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleLightContent
+
+LightContent 상태 표시줄 (어두운 배경에 대 한 가벼운 텍스트)을 사용 합니다.
+
+ StatusBar.styleLightContent();
+
+
+## 지원 되는 플랫폼
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleBlackTranslucent
+
+BlackTranslucent 상태 표시줄 (어두운 배경에 대 한 가벼운 텍스트)을 사용 합니다.
+
+ StatusBar.styleBlackTranslucent();
+
+
+## 지원 되는 플랫폼
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleBlackOpaque
+
+BlackOpaque 상태 표시줄 (어두운 배경에 대 한 가벼운 텍스트)을 사용 합니다.
+
+ StatusBar.styleBlackOpaque();
+
+
+## 지원 되는 플랫폼
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.backgroundColorByName
+
+Ios 7, StatusBar.statusBarOverlaysWebView을 false로 설정 하면 설정할 수 있는 상태 표시줄의 배경색 색상 이름으로.
+
+ StatusBar.backgroundColorByName("red");
+
+
+지원 되는 색 이름입니다.
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+## 지원 되는 플랫폼
+
+ * iOS
+ * Android 5+
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.backgroundColorByHexString
+
+16 진수 문자열 상태 표시줄의 배경색을 설정합니다.
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+CSS 대표 속성 지원 됩니다.
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+
+Ios 7, StatusBar.statusBarOverlaysWebView을 false로 설정 하면 설정할 수 있는 상태 표시줄의 배경색 16 진수 문자열 (#RRGGBB)에 의해.
+
+WP7 및 WP8에 당신은 또한 #AARRGGBB, AA는 알파 값으로 값을 지정할 수 있습니다.
+
+## 지원 되는 플랫폼
+
+ * iOS
+ * Android 5+
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.hide
+
+숨기기 상태 표시줄.
+
+ StatusBar.hide();
+
+
+## 지원 되는 플랫폼
+
+ * iOS
+ * 안 드 로이드
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.show
+
+상태 표시줄을 표시합니다.
+
+ StatusBar.show();
+
+
+## 지원 되는 플랫폼
+
+ * iOS
+ * 안 드 로이드
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.isVisible
+
+이 속성을 상태 표시줄 표시 되는 경우 읽기.
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+## 지원 되는 플랫폼
+
+ * iOS
+ * 안 드 로이드
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
\ No newline at end of file
diff --git a/plugins/cordova-plugin-statusbar/doc/ko/index.md b/plugins/cordova-plugin-statusbar/doc/ko/index.md
new file mode 100644
index 0000000..44de75b
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/ko/index.md
@@ -0,0 +1,262 @@
+
+
+# cordova-plugin-statusbar
+
+# StatusBar
+
+> `StatusBar`개체 iOS와 안 드 로이드 상태 표시줄을 사용자 지정 하려면 몇 가지 기능을 제공 합니다.
+
+## 설치
+
+ cordova plugin add cordova-plugin-statusbar
+
+
+## 환경 설정
+
+#### config.xml
+
+* **StatusBarOverlaysWebView** (boolean, 기본값: true)입니다. IOS 7, 시작 시 상태 표시줄 오버레이 또는 WebView 중첩 되지 확인 합니다.
+
+
+
+
+* **StatusBarBackgroundColor** (색상 16 진수 문자열 기본값: #000000). Ios 7, 시작 시 16 진수 문자열 (#RRGGBB) 상태 표시줄의 배경색을 설정 합니다.
+
+
+
+
+* **StatusBarStyle** (상태 표시줄 스타일, 기본값: lightcontent). Ios 7, 상태 표시줄 스타일을 설정 합니다. 사용 가능한 옵션 기본, lightcontent, blacktranslucent, blackopaque.
+
+
+
+
+## 시작 시 숨기기
+
+런타임 동안 아래의 StatusBar.hide 함수를 사용할 수 있습니다 하지만 당신이 원하는 응용 프로그램 시작 시 숨겨진 상태 표시줄, 응용 프로그램의 Info.plist 파일 수정 해야 합니다.
+
+추가 편집이 두 특성이 없는 경우. **"상태 표시줄 처음 숨겨진"** **"YES"** 로 설정 하 고 **"뷰 컨트롤러 기반 상태 표시줄 모양"** **"NO"**로 설정 합니다. Xcode, 열쇠 없이 수동으로 편집 하는 경우 값은:
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+## 메서드
+
+이 플러그인 글로벌 `StatusBar` 개체를 정의합니다.
+
+전역 범위에 있지만 그것은 불가능까지 `deviceready` 이벤트 후.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(StatusBar);
+ }
+
+
+* StatusBar.overlaysWebView
+* StatusBar.styleDefault
+* StatusBar.styleLightContent
+* StatusBar.styleBlackTranslucent
+* StatusBar.styleBlackOpaque
+* StatusBar.backgroundColorByName
+* StatusBar.backgroundColorByHexString
+* StatusBar.hide
+* StatusBar.show
+
+## 속성
+
+* StatusBar.isVisible
+
+## 사용 권한
+
+#### config.xml
+
+
+
+
+
+
+# StatusBar.overlaysWebView
+
+IOS 7, 오버레이 또는 하지 WebView 중첩 상태 표시줄을 확인 합니다.
+
+ StatusBar.overlaysWebView(true);
+
+
+## 설명
+
+7 iOS, iOS 6 처럼 나타나는 상태 표시줄을 false로 설정 합니다. 다른 함수를 사용 하 여에 맞게 스타일과 배경 색상을 설정 합니다.
+
+## 지원 되는 플랫폼
+
+* iOS
+
+## 빠른 예제
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+기본 상태 표시줄 (어두운 텍스트, 밝은 배경에 대 한)를 사용 합니다.
+
+ StatusBar.styleDefault();
+
+
+## 지원 되는 플랫폼
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleLightContent
+
+LightContent 상태 표시줄 (어두운 배경에 대 한 가벼운 텍스트)을 사용 합니다.
+
+ StatusBar.styleLightContent();
+
+
+## 지원 되는 플랫폼
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleBlackTranslucent
+
+BlackTranslucent 상태 표시줄 (어두운 배경에 대 한 가벼운 텍스트)을 사용 합니다.
+
+ StatusBar.styleBlackTranslucent();
+
+
+## 지원 되는 플랫폼
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleBlackOpaque
+
+BlackOpaque 상태 표시줄 (어두운 배경에 대 한 가벼운 텍스트)을 사용 합니다.
+
+ StatusBar.styleBlackOpaque();
+
+
+## 지원 되는 플랫폼
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.backgroundColorByName
+
+Ios 7, StatusBar.statusBarOverlaysWebView을 false로 설정 하면 설정할 수 있는 상태 표시줄의 배경색 색상 이름으로.
+
+ StatusBar.backgroundColorByName("red");
+
+
+지원 되는 색 이름입니다.
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+## 지원 되는 플랫폼
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.backgroundColorByHexString
+
+16 진수 문자열 상태 표시줄의 배경색을 설정합니다.
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+CSS 대표 속성 지원 됩니다.
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+
+Ios 7, StatusBar.statusBarOverlaysWebView을 false로 설정 하면 설정할 수 있는 상태 표시줄의 배경색 16 진수 문자열 (#RRGGBB)에 의해.
+
+WP7 및 WP8에 당신은 또한 #AARRGGBB, AA는 알파 값으로 값을 지정할 수 있습니다.
+
+## 지원 되는 플랫폼
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.hide
+
+숨기기 상태 표시줄.
+
+ StatusBar.hide();
+
+
+## 지원 되는 플랫폼
+
+* iOS
+* 안 드 로이드
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.show
+
+상태 표시줄을 표시합니다.
+
+ StatusBar.show();
+
+
+## 지원 되는 플랫폼
+
+* iOS
+* 안 드 로이드
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.isVisible
+
+이 속성을 상태 표시줄 표시 되는 경우 읽기.
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+## 지원 되는 플랫폼
+
+* iOS
+* 안 드 로이드
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
diff --git a/plugins/cordova-plugin-statusbar/doc/pl/README.md b/plugins/cordova-plugin-statusbar/doc/pl/README.md
new file mode 100644
index 0000000..1b116cc
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/pl/README.md
@@ -0,0 +1,276 @@
+
+
+# cordova-plugin-statusbar
+
+[](https://travis-ci.org/apache/cordova-plugin-statusbar)
+
+# StatusBar
+
+> `StatusBar`Obiekt zawiera kilka funkcji, aby dostosować iOS i Android StatusBar.
+
+## Instalacja
+
+ cordova plugin add cordova-plugin-statusbar
+
+
+## Preferencje
+
+#### config.xml
+
+ * **StatusBarOverlaysWebView** (boolean, domyślnie na wartość true). Na iOS 7 zrobić nakładki stanu lub nie nakładki widoku sieci Web podczas uruchamiania.
+
+
+
+
+ * **StatusBarBackgroundColor** (kolor ciąg szesnastkowy, domyślnie #000000). Na iOS 7 i Android 5 kolor tła stanu przez ciąg szesnastkowy (#RRGGBB) przy starcie systemu.
+
+
+
+
+ * **StatusBarStyle** (stan styl paska, domyślnie lightcontent.) Na iOS 7 ustawić styl paska stanu. Dostępne opcje domyślne, lightcontent, blacktranslucent, blackopaque.
+
+
+
+
+### Dziwactwa Androida
+
+Android 5 + wytyczne określają przy użyciu różnych kolorów statusbar niż główne aplikacji kolor (w przeciwieństwie do stanu jednolitych kolorów wiele aplikacje iOS 7 +), więc może chcesz ustawić kolor pasek stanu w czasie wykonywania zamiast za pośrednictwem `StatusBar.backgroundColorByHexString` lub `StatusBar.backgroundColorByName`. Jednym sposobem na to byłoby:
+
+```js
+if (cordova.platformId == 'android') {
+ StatusBar.backgroundColorByHexString("#333");
+}
+```
+
+## Przy starcie
+
+Podczas uruchamiania można użyć funkcji StatusBar.hide poniżej, ale jeśli chcesz StatusBar ukryty w uruchamiania aplikacji, należy zmodyfikować plik Info.plist Twojej aplikacji.
+
+Dodawanie/edycja tych dwóch atrybutów jeśli nie obecny. Ustawianie **"pasek stanu jest początkowo ukryte"** na **"Tak"** i **"Oparte na kontroler stanu paska wygląd"** na **"Nie"**. Jeśli możesz go edytować ręcznie bez Xcode, kluczy i wartości są:
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+## Metody
+
+Ten plugin definiuje obiekt globalny `StatusBar`.
+
+Chociaż w globalnym zasięgu, to nie dostępne dopiero po `deviceready` imprezie.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(StatusBar);
+ }
+
+
+ * StatusBar.overlaysWebView
+ * StatusBar.styleDefault
+ * StatusBar.styleLightContent
+ * StatusBar.styleBlackTranslucent
+ * StatusBar.styleBlackOpaque
+ * StatusBar.backgroundColorByName
+ * StatusBar.backgroundColorByHexString
+ * StatusBar.hide
+ * StatusBar.show
+
+## Właściwości
+
+ * StatusBar.isVisible
+
+## Uprawnienia
+
+#### config.xml
+
+
+
+
+
+
+# StatusBar.overlaysWebView
+
+Na iOS 7 zrobić statusbar nakładki lub nie nakładka widoku sieci Web.
+
+ StatusBar.overlaysWebView(true);
+
+
+## Opis
+
+Na iOS 7 zestaw do false, aby na pasku stanu pojawia się jak iOS 6. Ustaw kolor tła i styl do korzystania z innych funkcji.
+
+## Obsługiwane platformy
+
+ * iOS
+
+## Szybki przykład
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+Użyj domyślnego stanu (ciemny tekst, teł światła).
+
+ StatusBar.styleDefault();
+
+
+## Obsługiwane platformy
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleLightContent
+
+Użyj lightContent stanu (światło tekst, ciemne tło).
+
+ StatusBar.styleLightContent();
+
+
+## Obsługiwane platformy
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleBlackTranslucent
+
+Użyj blackTranslucent stanu (światło tekst, ciemne tło).
+
+ StatusBar.styleBlackTranslucent();
+
+
+## Obsługiwane platformy
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleBlackOpaque
+
+Użyj blackOpaque stanu (światło tekst, ciemne tło).
+
+ StatusBar.styleBlackOpaque();
+
+
+## Obsługiwane platformy
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.backgroundColorByName
+
+Na iOS 7 gdy zostanie ustawiona wartość false, StatusBar.statusBarOverlaysWebView można ustawić kolor tła stanu przez nazwę koloru.
+
+ StatusBar.backgroundColorByName("red");
+
+
+Nazwy kolorów obsługiwane są:
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+## Obsługiwane platformy
+
+ * iOS
+ * Android 5+
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.backgroundColorByHexString
+
+Ustawia kolor tła stanu przez ciąg szesnastkowy.
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+Obsługiwane są również właściwości CSS.
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+
+Na iOS 7 gdy zostanie ustawiona wartość false, StatusBar.statusBarOverlaysWebView można ustawić kolor tła stanu przez ciąg szesnastkowy (#RRGGBB).
+
+Na WP7 i WP8 można również określić wartości jako #AARRGGBB, gdzie AA jest wartością alfa
+
+## Obsługiwane platformy
+
+ * iOS
+ * Android 5+
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.hide
+
+Ukryj pasek stanu.
+
+ StatusBar.hide();
+
+
+## Obsługiwane platformy
+
+ * iOS
+ * Android
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.show
+
+Pokazuje pasek stanu.
+
+ StatusBar.show();
+
+
+## Obsługiwane platformy
+
+ * iOS
+ * Android
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.isVisible
+
+Czytać tej właściwość, aby sprawdzić, czy stanu jest widoczne lub nie.
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+## Obsługiwane platformy
+
+ * iOS
+ * Android
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
\ No newline at end of file
diff --git a/plugins/cordova-plugin-statusbar/doc/pl/index.md b/plugins/cordova-plugin-statusbar/doc/pl/index.md
new file mode 100644
index 0000000..4f13a37
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/pl/index.md
@@ -0,0 +1,262 @@
+
+
+# cordova-plugin-statusbar
+
+# StatusBar
+
+> `StatusBar`Obiekt zawiera kilka funkcji, aby dostosować iOS i Android StatusBar.
+
+## Instalacja
+
+ cordova plugin add cordova-plugin-statusbar
+
+
+## Preferencje
+
+#### config.xml
+
+* **StatusBarOverlaysWebView** (boolean, domyślnie na wartość true). Na iOS 7 zrobić nakładki stanu lub nie nakładki widoku sieci Web podczas uruchamiania.
+
+
+
+
+* **StatusBarBackgroundColor** (kolor szesnastkowy ciąg, domyślnie #000000). Na iOS 7 ustawić kolor tła stanu przez ciąg szesnastkowy (#RRGGBB) przy starcie systemu.
+
+
+
+
+* **StatusBarStyle** (stan styl paska, domyślnie lightcontent.) Na iOS 7 ustawić styl paska stanu. Dostępne opcje domyślne, lightcontent, blacktranslucent, blackopaque.
+
+
+
+
+## Przy starcie
+
+Podczas uruchamiania można użyć funkcji StatusBar.hide poniżej, ale jeśli chcesz StatusBar ukryty w uruchamiania aplikacji, należy zmodyfikować plik Info.plist Twojej aplikacji.
+
+Dodawanie/edycja tych dwóch atrybutów jeśli nie obecny. Ustawianie **"pasek stanu jest początkowo ukryte"** na **"Tak"** i **"Oparte na kontroler stanu paska wygląd"** na **"Nie"**. Jeśli możesz go edytować ręcznie bez Xcode, kluczy i wartości są:
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+## Metody
+
+Ten plugin definiuje obiekt globalny `StatusBar`.
+
+Chociaż w globalnym zasięgu, to nie dostępne dopiero po `deviceready` imprezie.
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(StatusBar);
+ }
+
+
+* StatusBar.overlaysWebView
+* StatusBar.styleDefault
+* StatusBar.styleLightContent
+* StatusBar.styleBlackTranslucent
+* StatusBar.styleBlackOpaque
+* StatusBar.backgroundColorByName
+* StatusBar.backgroundColorByHexString
+* StatusBar.hide
+* StatusBar.show
+
+## Właściwości
+
+* StatusBar.isVisible
+
+## Uprawnienia
+
+#### config.xml
+
+
+
+
+
+
+# StatusBar.overlaysWebView
+
+Na iOS 7 zrobić statusbar nakładki lub nie nakładka widoku sieci Web.
+
+ StatusBar.overlaysWebView(true);
+
+
+## Opis
+
+Na iOS 7 zestaw do false, aby na pasku stanu pojawia się jak iOS 6. Ustaw kolor tła i styl do korzystania z innych funkcji.
+
+## Obsługiwane platformy
+
+* iOS
+
+## Szybki przykład
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+Użyj domyślnego stanu (ciemny tekst, teł światła).
+
+ StatusBar.styleDefault();
+
+
+## Obsługiwane platformy
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleLightContent
+
+Użyj lightContent stanu (światło tekst, ciemne tło).
+
+ StatusBar.styleLightContent();
+
+
+## Obsługiwane platformy
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleBlackTranslucent
+
+Użyj blackTranslucent stanu (światło tekst, ciemne tło).
+
+ StatusBar.styleBlackTranslucent();
+
+
+## Obsługiwane platformy
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleBlackOpaque
+
+Użyj blackOpaque stanu (światło tekst, ciemne tło).
+
+ StatusBar.styleBlackOpaque();
+
+
+## Obsługiwane platformy
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.backgroundColorByName
+
+Na iOS 7 gdy zostanie ustawiona wartość false, StatusBar.statusBarOverlaysWebView można ustawić kolor tła stanu przez nazwę koloru.
+
+ StatusBar.backgroundColorByName("red");
+
+
+Nazwy kolorów obsługiwane są:
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+## Obsługiwane platformy
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.backgroundColorByHexString
+
+Ustawia kolor tła stanu przez ciąg szesnastkowy.
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+Obsługiwane są również właściwości CSS.
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+
+Na iOS 7 gdy zostanie ustawiona wartość false, StatusBar.statusBarOverlaysWebView można ustawić kolor tła stanu przez ciąg szesnastkowy (#RRGGBB).
+
+Na WP7 i WP8 można również określić wartości jako #AARRGGBB, gdzie AA jest wartością alfa
+
+## Obsługiwane platformy
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.hide
+
+Ukryj pasek stanu.
+
+ StatusBar.hide();
+
+
+## Obsługiwane platformy
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.show
+
+Pokazuje pasek stanu.
+
+ StatusBar.show();
+
+
+## Obsługiwane platformy
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.isVisible
+
+Czytać tej właściwość, aby sprawdzić, czy stanu jest widoczne lub nie.
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+## Obsługiwane platformy
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
diff --git a/plugins/cordova-plugin-statusbar/doc/ru/index.md b/plugins/cordova-plugin-statusbar/doc/ru/index.md
new file mode 100644
index 0000000..fdb95ee
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/ru/index.md
@@ -0,0 +1,238 @@
+
+
+# cordova-plugin-statusbar
+
+# StatusBar
+
+> Объект `StatusBar` предоставляет некоторые функции для настройки статусной панели на iOS и Android.
+
+## Настройки
+
+#### config.xml
+
+* **StatusBarOverlaysWebView** (логическое значение, по умолчанию true). В iOS 7 определяет необходимо ли сделать наложение статусной панели на WebView при запуске или нет.
+
+
+
+
+* **StatusBarBackgroundColor** (шестнадцатеричная строка цвета, значения по умолчанию #000000). На iOS 7 установит цвет фона статусной панели при запуске, на основании шестнадцатеричной строки цвета (#RRGGBB).
+
+
+
+
+* **StatusBarStyle** (статус бар стиль, по умолчанию lightcontent). На iOS 7 установите стиль строки состояния. Доступные параметры по умолчанию, lightcontent, blacktranslucent, blackopaque.
+
+
+
+
+## Скрытие при запуске
+
+Во время выполнения можно использовать функцию StatusBar.hide ниже, но если вы хотите StatusBar быть скрыты при запуске приложения, необходимо изменить файл Info.plist вашего приложения.
+
+Добавьте/измените эти два атрибута, если они не присутствуют или отличаются от нижеуказанных значений. Установите значение **«Status bar is initially hidden»** равное **«YES»** и установите значение **«View controller-based status bar appearance»** на **«NO»**. Если вы измените его вручную без Xcode, ключи и значения являются следующими:
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+## Методы
+
+* StatusBar.overlaysWebView
+* StatusBar.styleDefault
+* StatusBar.styleLightContent
+* StatusBar.styleBlackTranslucent
+* StatusBar.styleBlackOpaque
+* StatusBar.backgroundColorByName
+* StatusBar.backgroundColorByHexString
+* StatusBar.hide
+* StatusBar.show
+
+## Параметры
+
+* StatusBar.isVisible
+
+## Разрешения
+
+#### config.xml
+
+
+
+
+
+
+# StatusBar.overlaysWebView
+
+На iOS 7 Сделайте statusbar overlay или не поверх WebView.
+
+ StatusBar.overlaysWebView(true);
+
+
+## Описание
+
+На iOS 7 Установите значение false чтобы сделать statusbar появляются как iOS 6. Задайте стиль и цвет фона в соответствии с использованием других функций.
+
+## Поддерживаемые платформы
+
+* iOS
+
+## Краткий пример
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+Используйте по умолчанию statusbar (темный текст, для легких стола).
+
+ StatusBar.styleDefault();
+
+
+## Поддерживаемые платформы
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+
+# StatusBar.styleLightContent
+
+Используйте lightContent statusbar (светлый текст, на темном фоне).
+
+ StatusBar.styleLightContent();
+
+
+## Поддерживаемые платформы
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+
+# StatusBar.styleBlackTranslucent
+
+Используйте blackTranslucent statusbar (светлый текст, на темном фоне).
+
+ StatusBar.styleBlackTranslucent();
+
+
+## Поддерживаемые платформы
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+
+# StatusBar.styleBlackOpaque
+
+Используйте blackOpaque statusbar (светлый текст, на темном фоне).
+
+ StatusBar.styleBlackOpaque();
+
+
+## Поддерживаемые платформы
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+
+# StatusBar.backgroundColorByName
+
+На iOS 7 когда StatusBar.statusBarOverlaysWebView присвоено значение false, можно задать цвет фона для объекта statusbar по имени цвета.
+
+ StatusBar.backgroundColorByName("red");
+
+
+Имена поддерживаемых цветов являются:
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+## Поддерживаемые платформы
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+
+# StatusBar.backgroundColorByHexString
+
+Задает цвет фона для объекта statusbar, шестнадцатеричная строка.
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+Также поддерживаются свойства CSS стенографию.
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+
+На iOS 7 когда StatusBar.statusBarOverlaysWebView присвоено значение false, можно задать цвет фона для объекта statusbar, шестнадцатеричная строка (#RRGGBB).
+
+На WP7 и WP8 также можно указать значения как #AARRGGBB, где AA — это альфа-значение
+
+## Поддерживаемые платформы
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+
+# StatusBar.hide
+
+Скройте строку состояния statusbar.
+
+ StatusBar.hide();
+
+
+## Поддерживаемые платформы
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+
+# StatusBar.show
+
+Показывает строку состояния statusbar.
+
+ StatusBar.show();
+
+
+## Поддерживаемые платформы
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
+
+# StatusBar.isVisible
+
+Чтение это свойство, чтобы увидеть, если statusbar является видимым или нет.
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+## Поддерживаемые платформы
+
+* iOS
+* Android
+* Windows Phone 7
+* Windows Phone 8
diff --git a/plugins/cordova-plugin-statusbar/doc/zh/README.md b/plugins/cordova-plugin-statusbar/doc/zh/README.md
new file mode 100644
index 0000000..8a63699
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/zh/README.md
@@ -0,0 +1,276 @@
+
+
+# cordova-plugin-statusbar
+
+[](https://travis-ci.org/apache/cordova-plugin-statusbar)
+
+# StatusBar
+
+> `StatusBar`物件提供了一些功能,自訂的 iOS 和 Android 狀態列。
+
+## 安裝
+
+ cordova plugin add cordova-plugin-statusbar
+
+
+## 首選項
+
+#### config.xml
+
+ * **StatusBarOverlaysWebView**(布林值,預設值為 true)。在 iOS 7,使狀態列覆蓋或不覆蓋 web 視圖在啟動時。
+
+
+
+
+ * **StatusBarBackgroundColor**(顏色十六進位字串,預設值為 #000000)。IOS 7 和 Android 5,由十六進位字串 (#RRGGBB) 在啟動時設置狀態列的背景色。
+
+
+
+
+ * **狀態列**(狀態列樣式,預設值為 lightcontent)。在 iOS 7,設置的狀態橫條圖樣式。可用的選項預設,lightcontent,blacktranslucent,blackopaque。
+
+
+
+
+### Android 的怪癖
+
+Android 的 5 + 準則指定使用不同的顏色比您主要的應用程式狀態欄顏色 (不像很多 iOS 7 + 應用程式的統一狀態列顏色),所以你可能想要設置在運行時顯示狀態列顏色而不是通過`StatusBar.backgroundColorByHexString`或`StatusBar.backgroundColorByName`。 一個的方式做到這一點將是:
+
+```js
+if (cordova.platformId == 'android') {
+ StatusBar.backgroundColorByHexString("#333");
+}
+```
+
+## 在啟動時隱藏
+
+在運行時期間,你可以使用 StatusBar.hide 函數下面,但如果你想要顯示狀態列隱藏在應用程式啟動時,你必須修改你的應用程式的 Info.plist 檔。
+
+添加編輯這兩個屬性,如果不存在。 將**"狀態列最初隱藏"**設置為**"YES"**和**"視圖基於控制器的狀態列外觀"**設置為**"否"**。 如果您手動編輯它沒有 Xcode,鍵和值是:
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+## 方法
+
+這個外掛程式定義全域 `StatusBar` 物件。
+
+雖然在全球範圍內,它不可用直到 `deviceready` 事件之後。
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(StatusBar);
+ }
+
+
+ * StatusBar.overlaysWebView
+ * StatusBar.styleDefault
+ * StatusBar.styleLightContent
+ * StatusBar.styleBlackTranslucent
+ * StatusBar.styleBlackOpaque
+ * StatusBar.backgroundColorByName
+ * StatusBar.backgroundColorByHexString
+ * StatusBar.hide
+ * StatusBar.show
+
+## 屬性
+
+ * StatusBar.isVisible
+
+## 許可權
+
+#### config.xml
+
+
+
+
+
+
+# StatusBar.overlaysWebView
+
+在 iOS 7,使狀態列覆蓋或不覆蓋 web 視圖。
+
+ StatusBar.overlaysWebView(true);
+
+
+## 說明
+
+在 iOS 7,設置為 false,使狀態列出現像 iOS 6。設置樣式和背景顏色,適合使用其他函數。
+
+## 支援的平臺
+
+ * iOS
+
+## 快速的示例
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+使用預設狀態列 (淺色背景深色文本)。
+
+ StatusBar.styleDefault();
+
+
+## 支援的平臺
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleLightContent
+
+使用 lightContent 狀態列 (深色背景光文本)。
+
+ StatusBar.styleLightContent();
+
+
+## 支援的平臺
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleBlackTranslucent
+
+使用 blackTranslucent 狀態列 (深色背景光文本)。
+
+ StatusBar.styleBlackTranslucent();
+
+
+## 支援的平臺
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.styleBlackOpaque
+
+使用 blackOpaque 狀態列 (深色背景光文本)。
+
+ StatusBar.styleBlackOpaque();
+
+
+## 支援的平臺
+
+ * iOS
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.backgroundColorByName
+
+在 iOS 7,當您將 StatusBar.statusBarOverlaysWebView 設置為 false,你可以設置狀態列的背景色的顏色名稱。
+
+ StatusBar.backgroundColorByName("red");
+
+
+支援的顏色名稱是:
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+## 支援的平臺
+
+ * iOS
+ * Android 5+
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.backgroundColorByHexString
+
+由十六進位字串設置狀態列的背景色。
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+此外支援 CSS 速記屬性。
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+
+在 iOS 7,當將 StatusBar.statusBarOverlaysWebView 設置為 false,您可以設置狀態列的背景色由十六進位字串 (#RRGGBB)。
+
+WP7 和 WP8 您還可以指定值為 #AARRGGBB,其中 AA 是 Alpha 值
+
+## 支援的平臺
+
+ * iOS
+ * Android 5+
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.hide
+
+隱藏狀態列。
+
+ StatusBar.hide();
+
+
+## 支援的平臺
+
+ * iOS
+ * Android 系統
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.show
+
+顯示狀態列。
+
+ StatusBar.show();
+
+
+## 支援的平臺
+
+ * iOS
+ * Android 系統
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
+
+# StatusBar.isVisible
+
+讀取此屬性,以查看狀態列是否可見。
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+## 支援的平臺
+
+ * iOS
+ * Android 系統
+ * Windows Phone 7
+ * Windows Phone 8
+ * Windows Phone 8.1
\ No newline at end of file
diff --git a/plugins/cordova-plugin-statusbar/doc/zh/index.md b/plugins/cordova-plugin-statusbar/doc/zh/index.md
new file mode 100644
index 0000000..a8805da
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/doc/zh/index.md
@@ -0,0 +1,262 @@
+
+
+# cordova-plugin-statusbar
+
+# StatusBar
+
+> `StatusBar`物件提供了一些功能,自訂的 iOS 和 Android 狀態列。
+
+## 安裝
+
+ cordova plugin add cordova-plugin-statusbar
+
+
+## 首選項
+
+#### config.xml
+
+* **StatusBarOverlaysWebView**(布林值,預設值為 true)。在 iOS 7,使狀態列覆蓋或不覆蓋 web 視圖在啟動時。
+
+
+
+
+* **StatusBarBackgroundColor**(顏色十六進位字串,預設值為 #000000)。在 iOS 7,通過一個十六進位字串 (#RRGGBB) 在啟動時設置狀態列的背景色。
+
+
+
+
+* **狀態列**(狀態列樣式,預設值為 lightcontent)。在 iOS 7,設置的狀態橫條圖樣式。可用的選項預設,lightcontent,blacktranslucent,blackopaque。
+
+
+
+
+## 在啟動時隱藏
+
+在運行時期間,你可以使用 StatusBar.hide 函數下面,但如果你想要顯示狀態列隱藏在應用程式啟動時,你必須修改你的應用程式的 Info.plist 檔。
+
+添加編輯這兩個屬性,如果不存在。 將**"狀態列最初隱藏"**設置為**"YES"**和**"視圖基於控制器的狀態列外觀"**設置為**"否"**。 如果您手動編輯它沒有 Xcode,鍵和值是:
+
+ UIStatusBarHidden
+
+ UIViewControllerBasedStatusBarAppearance
+
+
+
+## 方法
+
+這個外掛程式定義全域 `StatusBar` 物件。
+
+雖然在全球範圍內,它不可用直到 `deviceready` 事件之後。
+
+ document.addEventListener("deviceready", onDeviceReady, false);
+ function onDeviceReady() {
+ console.log(StatusBar);
+ }
+
+
+* StatusBar.overlaysWebView
+* StatusBar.styleDefault
+* StatusBar.styleLightContent
+* StatusBar.styleBlackTranslucent
+* StatusBar.styleBlackOpaque
+* StatusBar.backgroundColorByName
+* StatusBar.backgroundColorByHexString
+* StatusBar.hide
+* StatusBar.show
+
+## 屬性
+
+* StatusBar.isVisible
+
+## 許可權
+
+#### config.xml
+
+
+
+
+
+
+# StatusBar.overlaysWebView
+
+在 iOS 7,使狀態列覆蓋或不覆蓋 web 視圖。
+
+ StatusBar.overlaysWebView(true);
+
+
+## 說明
+
+在 iOS 7,設置為 false,使狀態列出現像 iOS 6。設置樣式和背景顏色,適合使用其他函數。
+
+## 支援的平臺
+
+* iOS
+
+## 快速的示例
+
+ StatusBar.overlaysWebView(true);
+ StatusBar.overlaysWebView(false);
+
+
+# StatusBar.styleDefault
+
+使用預設狀態列 (淺色背景深色文本)。
+
+ StatusBar.styleDefault();
+
+
+## 支援的平臺
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleLightContent
+
+使用 lightContent 狀態列 (深色背景光文本)。
+
+ StatusBar.styleLightContent();
+
+
+## 支援的平臺
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleBlackTranslucent
+
+使用 blackTranslucent 狀態列 (深色背景光文本)。
+
+ StatusBar.styleBlackTranslucent();
+
+
+## 支援的平臺
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.styleBlackOpaque
+
+使用 blackOpaque 狀態列 (深色背景光文本)。
+
+ StatusBar.styleBlackOpaque();
+
+
+## 支援的平臺
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.backgroundColorByName
+
+在 iOS 7,當您將 StatusBar.statusBarOverlaysWebView 設置為 false,你可以設置狀態列的背景色的顏色名稱。
+
+ StatusBar.backgroundColorByName("red");
+
+
+支援的顏色名稱是:
+
+ black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+
+
+## 支援的平臺
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.backgroundColorByHexString
+
+由十六進位字串設置狀態列的背景色。
+
+ StatusBar.backgroundColorByHexString("#C0C0C0");
+
+
+此外支援 CSS 速記屬性。
+
+ StatusBar.backgroundColorByHexString("#333"); // => #333333
+ StatusBar.backgroundColorByHexString("#FAB"); // => #FFAABB
+
+
+在 iOS 7,當將 StatusBar.statusBarOverlaysWebView 設置為 false,您可以設置狀態列的背景色由十六進位字串 (#RRGGBB)。
+
+WP7 和 WP8 您還可以指定值為 #AARRGGBB,其中 AA 是 Alpha 值
+
+## 支援的平臺
+
+* iOS
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.hide
+
+隱藏狀態列。
+
+ StatusBar.hide();
+
+
+## 支援的平臺
+
+* iOS
+* 安卓系統
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.show
+
+顯示狀態列。
+
+ StatusBar.show();
+
+
+## 支援的平臺
+
+* iOS
+* 安卓系統
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
+
+# StatusBar.isVisible
+
+讀取此屬性,以查看狀態列是否可見。
+
+ if (StatusBar.isVisible) {
+ // do something
+ }
+
+
+## 支援的平臺
+
+* iOS
+* 安卓系統
+* Windows Phone 7
+* Windows Phone 8
+* Windows Phone 8.1
diff --git a/plugins/cordova-plugin-statusbar/package.json b/plugins/cordova-plugin-statusbar/package.json
new file mode 100644
index 0000000..475e205
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/package.json
@@ -0,0 +1,81 @@
+{
+ "_from": "cordova-plugin-statusbar@2.4.2",
+ "_id": "cordova-plugin-statusbar@2.4.2",
+ "_inBundle": false,
+ "_integrity": "sha1-/B+9wNjXAzp+jh8ff/FnrJvU+vY=",
+ "_location": "/cordova-plugin-statusbar",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "cordova-plugin-statusbar@2.4.2",
+ "name": "cordova-plugin-statusbar",
+ "escapedName": "cordova-plugin-statusbar",
+ "rawSpec": "2.4.2",
+ "saveSpec": null,
+ "fetchSpec": "2.4.2"
+ },
+ "_requiredBy": [
+ "#DEV:/",
+ "#USER"
+ ],
+ "_resolved": "https://registry.npmjs.org/cordova-plugin-statusbar/-/cordova-plugin-statusbar-2.4.2.tgz",
+ "_shasum": "fc1fbdc0d8d7033a7e8e1f1f7ff167ac9bd4faf6",
+ "_spec": "cordova-plugin-statusbar@2.4.2",
+ "_where": "/home/saherelm/Documents/My Projects/xFrameworkTest",
+ "author": {
+ "name": "Apache Software Foundation"
+ },
+ "bugs": {
+ "url": "https://issues.apache.org/jira/browse/CB"
+ },
+ "bundleDependencies": false,
+ "cordova": {
+ "id": "cordova-plugin-statusbar",
+ "platforms": [
+ "android",
+ "ios",
+ "wp7",
+ "wp8",
+ "windows"
+ ]
+ },
+ "deprecated": false,
+ "description": "Cordova StatusBar Plugin",
+ "devDependencies": {
+ "jshint": "^2.6.0"
+ },
+ "engines": {
+ "cordovaDependencies": {
+ "0.1.0": {
+ "cordova": ">=3.0.0"
+ },
+ "3.0.0": {
+ "cordova": ">100"
+ }
+ }
+ },
+ "homepage": "https://github.com/apache/cordova-plugin-statusbar#readme",
+ "keywords": [
+ "cordova",
+ "statusbar",
+ "ecosystem:cordova",
+ "cordova-android",
+ "cordova-ios",
+ "cordova-wp7",
+ "cordova-wp8",
+ "cordova-windows"
+ ],
+ "license": "Apache-2.0",
+ "name": "cordova-plugin-statusbar",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/apache/cordova-plugin-statusbar.git"
+ },
+ "scripts": {
+ "jshint": "node node_modules/jshint/bin/jshint www && node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint tests",
+ "test": "npm run jshint"
+ },
+ "types": "./types/index.d.ts",
+ "version": "2.4.2"
+}
diff --git a/plugins/cordova-plugin-statusbar/plugin.xml b/plugins/cordova-plugin-statusbar/plugin.xml
new file mode 100644
index 0000000..04d6c18
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/plugin.xml
@@ -0,0 +1,99 @@
+
+
+
+
+ StatusBar
+ Cordova StatusBar Plugin
+ Apache 2.0
+ cordova,statusbar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/cordova-plugin-statusbar/src/android/StatusBar.java b/plugins/cordova-plugin-statusbar/src/android/StatusBar.java
new file mode 100644
index 0000000..714c30e
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/src/android/StatusBar.java
@@ -0,0 +1,276 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.cordova.statusbar;
+
+import android.app.Activity;
+import android.graphics.Color;
+import android.os.Build;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+
+import org.apache.cordova.CallbackContext;
+import org.apache.cordova.CordovaArgs;
+import org.apache.cordova.CordovaInterface;
+import org.apache.cordova.CordovaPlugin;
+import org.apache.cordova.CordovaWebView;
+import org.apache.cordova.LOG;
+import org.apache.cordova.PluginResult;
+import org.json.JSONException;
+import java.util.Arrays;
+
+public class StatusBar extends CordovaPlugin {
+ private static final String TAG = "StatusBar";
+
+ /**
+ * Sets the context of the Command. This can then be used to do things like
+ * get file paths associated with the Activity.
+ *
+ * @param cordova The context of the main Activity.
+ * @param webView The CordovaWebView Cordova is running in.
+ */
+ @Override
+ public void initialize(final CordovaInterface cordova, CordovaWebView webView) {
+ LOG.v(TAG, "StatusBar: initialization");
+ super.initialize(cordova, webView);
+
+ this.cordova.getActivity().runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ // Clear flag FLAG_FORCE_NOT_FULLSCREEN which is set initially
+ // by the Cordova.
+ Window window = cordova.getActivity().getWindow();
+ window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
+
+ // Read 'StatusBarBackgroundColor' from config.xml, default is #000000.
+ setStatusBarBackgroundColor(preferences.getString("StatusBarBackgroundColor", "#000000"));
+
+ // Read 'StatusBarStyle' from config.xml, default is 'lightcontent'.
+ setStatusBarStyle(preferences.getString("StatusBarStyle", "lightcontent"));
+ }
+ });
+ }
+
+ /**
+ * Executes the request and returns PluginResult.
+ *
+ * @param action The action to execute.
+ * @param args JSONArry of arguments for the plugin.
+ * @param callbackContext The callback id used when calling back into JavaScript.
+ * @return True if the action was valid, false otherwise.
+ */
+ @Override
+ public boolean execute(final String action, final CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
+ LOG.v(TAG, "Executing action: " + action);
+ final Activity activity = this.cordova.getActivity();
+ final Window window = activity.getWindow();
+
+ if ("_ready".equals(action)) {
+ boolean statusBarVisible = (window.getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) == 0;
+ callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, statusBarVisible));
+ return true;
+ }
+
+ if ("show".equals(action)) {
+ this.cordova.getActivity().runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ // SYSTEM_UI_FLAG_FULLSCREEN is available since JellyBean, but we
+ // use KitKat here to be aligned with "Fullscreen" preference
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ int uiOptions = window.getDecorView().getSystemUiVisibility();
+ uiOptions &= ~View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;
+ uiOptions &= ~View.SYSTEM_UI_FLAG_FULLSCREEN;
+
+ window.getDecorView().setSystemUiVisibility(uiOptions);
+ }
+
+ // CB-11197 We still need to update LayoutParams to force status bar
+ // to be hidden when entering e.g. text fields
+ window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ }
+ });
+ return true;
+ }
+
+ if ("hide".equals(action)) {
+ this.cordova.getActivity().runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ // SYSTEM_UI_FLAG_FULLSCREEN is available since JellyBean, but we
+ // use KitKat here to be aligned with "Fullscreen" preference
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ int uiOptions = window.getDecorView().getSystemUiVisibility()
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_FULLSCREEN;
+
+ window.getDecorView().setSystemUiVisibility(uiOptions);
+ }
+
+ // CB-11197 We still need to update LayoutParams to force status bar
+ // to be hidden when entering e.g. text fields
+ window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ }
+ });
+ return true;
+ }
+
+ if ("backgroundColorByHexString".equals(action)) {
+ this.cordova.getActivity().runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ setStatusBarBackgroundColor(args.getString(0));
+ } catch (JSONException ignore) {
+ LOG.e(TAG, "Invalid hexString argument, use f.i. '#777777'");
+ }
+ }
+ });
+ return true;
+ }
+
+ if ("overlaysWebView".equals(action)) {
+ if (Build.VERSION.SDK_INT >= 21) {
+ this.cordova.getActivity().runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ setStatusBarTransparent(args.getBoolean(0));
+ } catch (JSONException ignore) {
+ LOG.e(TAG, "Invalid boolean argument");
+ }
+ }
+ });
+ return true;
+ }
+ else return args.getBoolean(0) == false;
+ }
+
+ if ("styleDefault".equals(action)) {
+ this.cordova.getActivity().runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ setStatusBarStyle("default");
+ }
+ });
+ return true;
+ }
+
+ if ("styleLightContent".equals(action)) {
+ this.cordova.getActivity().runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ setStatusBarStyle("lightcontent");
+ }
+ });
+ return true;
+ }
+
+ if ("styleBlackTranslucent".equals(action)) {
+ this.cordova.getActivity().runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ setStatusBarStyle("blacktranslucent");
+ }
+ });
+ return true;
+ }
+
+ if ("styleBlackOpaque".equals(action)) {
+ this.cordova.getActivity().runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ setStatusBarStyle("blackopaque");
+ }
+ });
+ return true;
+ }
+
+ return false;
+ }
+
+ private void setStatusBarBackgroundColor(final String colorPref) {
+ if (Build.VERSION.SDK_INT >= 21) {
+ if (colorPref != null && !colorPref.isEmpty()) {
+ final Window window = cordova.getActivity().getWindow();
+ // Method and constants not available on all SDKs but we want to be able to compile this code with any SDK
+ window.clearFlags(0x04000000); // SDK 19: WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+ window.addFlags(0x80000000); // SDK 21: WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+ try {
+ // Using reflection makes sure any 5.0+ device will work without having to compile with SDK level 21
+ window.getClass().getMethod("setStatusBarColor", int.class).invoke(window, Color.parseColor(colorPref));
+ } catch (IllegalArgumentException ignore) {
+ LOG.e(TAG, "Invalid hexString argument, use f.i. '#999999'");
+ } catch (Exception ignore) {
+ // this should not happen, only in case Android removes this method in a version > 21
+ LOG.w(TAG, "Method window.setStatusBarColor not found for SDK level " + Build.VERSION.SDK_INT);
+ }
+ }
+ }
+ }
+
+ private void setStatusBarTransparent(final boolean transparent) {
+ if (Build.VERSION.SDK_INT >= 21) {
+ final Window window = cordova.getActivity().getWindow();
+ if (transparent) {
+ window.getDecorView().setSystemUiVisibility(
+ View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
+ window.setStatusBarColor(Color.TRANSPARENT);
+ }
+ else {
+ window.getDecorView().setSystemUiVisibility(
+ View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+ | View.SYSTEM_UI_FLAG_VISIBLE);
+ }
+ }
+ }
+
+ private void setStatusBarStyle(final String style) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ if (style != null && !style.isEmpty()) {
+ View decorView = cordova.getActivity().getWindow().getDecorView();
+ int uiOptions = decorView.getSystemUiVisibility();
+
+ String[] darkContentStyles = {
+ "default",
+ };
+
+ String[] lightContentStyles = {
+ "lightcontent",
+ "blacktranslucent",
+ "blackopaque",
+ };
+
+ if (Arrays.asList(darkContentStyles).contains(style.toLowerCase())) {
+ decorView.setSystemUiVisibility(uiOptions | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
+ return;
+ }
+
+ if (Arrays.asList(lightContentStyles).contains(style.toLowerCase())) {
+ decorView.setSystemUiVisibility(uiOptions & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
+ return;
+ }
+
+ LOG.e(TAG, "Invalid style, must be either 'default', 'lightcontent' or the deprecated 'blacktranslucent' and 'blackopaque'");
+ }
+ }
+ }
+}
diff --git a/plugins/cordova-plugin-statusbar/src/browser/StatusBarProxy.js b/plugins/cordova-plugin-statusbar/src/browser/StatusBarProxy.js
new file mode 100644
index 0000000..3290d58
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/src/browser/StatusBarProxy.js
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+function notSupported(win,fail) {
+ //
+ console.log('StatusBar is not supported');
+ setTimeout(function(){
+ if (win) {
+ win();
+ }
+ // note that while it is not explicitly supported, it does not fail
+ // this is really just here to allow developers to test their code in the browser
+ // and if we fail, then their app might as well. -jm
+ },0);
+}
+
+module.exports = {
+ isVisible: false,
+ styleBlackTranslucent:notSupported,
+ styleDefault:notSupported,
+ styleLightContent:notSupported,
+ styleBlackOpaque:notSupported,
+ overlaysWebView:notSupported,
+ styleLightContect: notSupported,
+ backgroundColorByName: notSupported,
+ backgroundColorByHexString: notSupported,
+ hide: notSupported,
+ show: notSupported,
+ _ready:notSupported
+};
+
+require("cordova/exec/proxy").add("StatusBar", module.exports);
+
diff --git a/plugins/cordova-plugin-statusbar/src/ios/CDVStatusBar.h b/plugins/cordova-plugin-statusbar/src/ios/CDVStatusBar.h
new file mode 100644
index 0000000..0be08cc
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/src/ios/CDVStatusBar.h
@@ -0,0 +1,50 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import
+#import
+
+@interface CDVStatusBar : CDVPlugin {
+ @protected
+ BOOL _statusBarOverlaysWebView;
+ UIView* _statusBarBackgroundView;
+ BOOL _uiviewControllerBasedStatusBarAppearance;
+ UIColor* _statusBarBackgroundColor;
+ NSString* _eventsCallbackId;
+}
+
+@property (atomic, assign) BOOL statusBarOverlaysWebView;
+@property (atomic, assign) BOOL statusBarVisible;
+
+- (void) overlaysWebView:(CDVInvokedUrlCommand*)command;
+
+- (void) styleDefault:(CDVInvokedUrlCommand*)command;
+- (void) styleLightContent:(CDVInvokedUrlCommand*)command;
+- (void) styleBlackTranslucent:(CDVInvokedUrlCommand*)command;
+- (void) styleBlackOpaque:(CDVInvokedUrlCommand*)command;
+
+- (void) backgroundColorByName:(CDVInvokedUrlCommand*)command;
+- (void) backgroundColorByHexString:(CDVInvokedUrlCommand*)command;
+
+- (void) hide:(CDVInvokedUrlCommand*)command;
+- (void) show:(CDVInvokedUrlCommand*)command;
+
+- (void) _ready:(CDVInvokedUrlCommand*)command;
+
+@end
diff --git a/plugins/cordova-plugin-statusbar/src/ios/CDVStatusBar.m b/plugins/cordova-plugin-statusbar/src/ios/CDVStatusBar.m
new file mode 100644
index 0000000..c67f137
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/src/ios/CDVStatusBar.m
@@ -0,0 +1,479 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+/*
+ NOTE: plugman/cordova cli should have already installed this,
+ but you need the value UIViewControllerBasedStatusBarAppearance
+ in your Info.plist as well to set the styles in iOS 7
+ */
+
+#import "CDVStatusBar.h"
+#import
+#import
+
+static const void *kHideStatusBar = &kHideStatusBar;
+static const void *kStatusBarStyle = &kStatusBarStyle;
+
+@interface CDVViewController (StatusBar)
+
+@property (nonatomic, retain) id sb_hideStatusBar;
+@property (nonatomic, retain) id sb_statusBarStyle;
+
+@end
+
+@implementation CDVViewController (StatusBar)
+
+@dynamic sb_hideStatusBar;
+@dynamic sb_statusBarStyle;
+
+- (id)sb_hideStatusBar {
+ return objc_getAssociatedObject(self, kHideStatusBar);
+}
+
+- (void)setSb_hideStatusBar:(id)newHideStatusBar {
+ objc_setAssociatedObject(self, kHideStatusBar, newHideStatusBar, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+- (id)sb_statusBarStyle {
+ return objc_getAssociatedObject(self, kStatusBarStyle);
+}
+
+- (void)setSb_statusBarStyle:(id)newStatusBarStyle {
+ objc_setAssociatedObject(self, kStatusBarStyle, newStatusBarStyle, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+- (BOOL) prefersStatusBarHidden {
+ return [self.sb_hideStatusBar boolValue];
+}
+
+- (UIStatusBarStyle)preferredStatusBarStyle
+{
+ return (UIStatusBarStyle)[self.sb_statusBarStyle intValue];
+}
+
+@end
+
+
+@interface CDVStatusBar ()
+- (void)fireTappedEvent;
+- (void)updateIsVisible:(BOOL)visible;
+@end
+
+@implementation CDVStatusBar
+
+- (id)settingForKey:(NSString*)key
+{
+ return [self.commandDelegate.settings objectForKey:[key lowercaseString]];
+}
+
+- (void)observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object change:(NSDictionary*)change context:(void*)context
+{
+ if ([keyPath isEqual:@"statusBarHidden"]) {
+ NSNumber* newValue = [change objectForKey:NSKeyValueChangeNewKey];
+ [self updateIsVisible:![newValue boolValue]];
+ }
+}
+
+-(void)cordovaViewWillAppear:(NSNotification*)notification
+{
+ [self resizeWebView];
+}
+
+-(void)statusBarDidChangeFrame:(NSNotification*)notification
+{
+ //add a small delay ( 0.1 seconds ) or statusbar size will be wrong
+ __weak CDVStatusBar* weakSelf = self;
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
+ [weakSelf resizeStatusBarBackgroundView];
+ [weakSelf resizeWebView];
+ });
+}
+
+- (void)pluginInitialize
+{
+ // init
+ NSNumber* uiviewControllerBasedStatusBarAppearance = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIViewControllerBasedStatusBarAppearance"];
+ _uiviewControllerBasedStatusBarAppearance = (uiviewControllerBasedStatusBarAppearance == nil || [uiviewControllerBasedStatusBarAppearance boolValue]);
+
+ // observe the statusBarHidden property
+ [[UIApplication sharedApplication] addObserver:self forKeyPath:@"statusBarHidden" options:NSKeyValueObservingOptionNew context:NULL];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(statusBarDidChangeFrame:) name: UIApplicationDidChangeStatusBarFrameNotification object:nil];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(cordovaViewWillAppear:) name: @"CDVViewWillAppearNotification" object:nil];
+
+ _statusBarOverlaysWebView = YES; // default
+
+ [self initializeStatusBarBackgroundView];
+
+ self.viewController.view.autoresizesSubviews = YES;
+
+ NSString* setting;
+
+ setting = @"StatusBarBackgroundColor";
+ if ([self settingForKey:setting]) {
+ [self _backgroundColorByHexString:[self settingForKey:setting]];
+ }
+
+ setting = @"StatusBarStyle";
+ if ([self settingForKey:setting]) {
+ [self setStatusBarStyle:[self settingForKey:setting]];
+ }
+
+ setting = @"StatusBarDefaultScrollToTop";
+ if ([self settingForKey:setting]) {
+ self.webView.scrollView.scrollsToTop = [(NSNumber*)[self settingForKey:setting] boolValue];
+ } else {
+ self.webView.scrollView.scrollsToTop = NO;
+ }
+
+ // blank scroll view to intercept status bar taps
+ UIScrollView *fakeScrollView = [[UIScrollView alloc] initWithFrame:UIScreen.mainScreen.bounds];
+ fakeScrollView.delegate = self;
+ fakeScrollView.scrollsToTop = YES;
+ [self.viewController.view addSubview:fakeScrollView]; // Add scrollview to the view heirarchy so that it will begin accepting status bar taps
+ [self.viewController.view sendSubviewToBack:fakeScrollView]; // Send it to the very back of the view heirarchy
+ fakeScrollView.contentSize = CGSizeMake(UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height * 2.0f); // Make the scroll view longer than the screen itself
+ fakeScrollView.contentOffset = CGPointMake(0.0f, UIScreen.mainScreen.bounds.size.height); // Scroll down so a tap will take scroll view back to the top
+
+ _statusBarVisible = ![UIApplication sharedApplication].isStatusBarHidden;
+}
+
+- (void)onReset {
+ _eventsCallbackId = nil;
+}
+
+- (void)fireTappedEvent {
+ if (_eventsCallbackId == nil) {
+ return;
+ }
+ NSDictionary* payload = @{@"type": @"tap"};
+ CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:payload];
+ [result setKeepCallbackAsBool:YES];
+ [self.commandDelegate sendPluginResult:result callbackId:_eventsCallbackId];
+}
+
+- (void)updateIsVisible:(BOOL)visible {
+ if (_eventsCallbackId == nil) {
+ return;
+ }
+ CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:visible];
+ [result setKeepCallbackAsBool:YES];
+ [self.commandDelegate sendPluginResult:result callbackId:_eventsCallbackId];
+}
+
+- (void) _ready:(CDVInvokedUrlCommand*)command
+{
+ _eventsCallbackId = command.callbackId;
+ [self updateIsVisible:![UIApplication sharedApplication].statusBarHidden];
+ NSString* setting = @"StatusBarOverlaysWebView";
+ if ([self settingForKey:setting]) {
+ self.statusBarOverlaysWebView = [(NSNumber*)[self settingForKey:setting] boolValue];
+ if (self.statusBarOverlaysWebView) {
+ [self resizeWebView];
+ }
+ }
+}
+
+- (void) initializeStatusBarBackgroundView
+{
+ CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
+
+ if ([[UIApplication sharedApplication]statusBarOrientation] == UIInterfaceOrientationPortraitUpsideDown &&
+ statusBarFrame.size.height + statusBarFrame.origin.y == [self.viewController.view.window bounds].size.height) {
+
+ // When started in upside-down orientation on iOS 7, status bar will be bound to lower edge of the
+ // screen (statusBarFrame.origin.y will be somewhere around screen height). In this case we need to
+ // correct frame's coordinates
+ statusBarFrame.origin.y = 0;
+ }
+
+ _statusBarBackgroundView = [[UIView alloc] initWithFrame:statusBarFrame];
+ _statusBarBackgroundView.backgroundColor = _statusBarBackgroundColor;
+ _statusBarBackgroundView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin);
+ _statusBarBackgroundView.autoresizesSubviews = YES;
+}
+
+- (void) setStatusBarOverlaysWebView:(BOOL)statusBarOverlaysWebView
+{
+ // we only care about the latest iOS version or a change in setting
+ if (statusBarOverlaysWebView == _statusBarOverlaysWebView) {
+ return;
+ }
+
+ _statusBarOverlaysWebView = statusBarOverlaysWebView;
+
+ [self resizeWebView];
+
+ if (statusBarOverlaysWebView) {
+
+ [_statusBarBackgroundView removeFromSuperview];
+
+ } else {
+
+ [self initializeStatusBarBackgroundView];
+ [self.webView.superview addSubview:_statusBarBackgroundView];
+
+ }
+
+}
+
+- (BOOL) statusBarOverlaysWebView
+{
+ return _statusBarOverlaysWebView;
+}
+
+- (void) overlaysWebView:(CDVInvokedUrlCommand*)command
+{
+ id value = [command argumentAtIndex:0];
+ if (!([value isKindOfClass:[NSNumber class]])) {
+ value = [NSNumber numberWithBool:YES];
+ }
+
+ self.statusBarOverlaysWebView = [value boolValue];
+}
+
+- (void) refreshStatusBarAppearance
+{
+ SEL sel = NSSelectorFromString(@"setNeedsStatusBarAppearanceUpdate");
+ if ([self.viewController respondsToSelector:sel]) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
+ [self.viewController performSelector:sel withObject:nil];
+#pragma clang diagnostic pop
+ }
+}
+
+- (void) setStyleForStatusBar:(UIStatusBarStyle)style
+{
+ if (_uiviewControllerBasedStatusBarAppearance) {
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+ vc.sb_statusBarStyle = [NSNumber numberWithInt:style];
+ [self refreshStatusBarAppearance];
+
+ } else {
+ [[UIApplication sharedApplication] setStatusBarStyle:style];
+ }
+}
+
+- (void) setStatusBarStyle:(NSString*)statusBarStyle
+{
+ // default, lightContent, blackTranslucent, blackOpaque
+ NSString* lcStatusBarStyle = [statusBarStyle lowercaseString];
+
+ if ([lcStatusBarStyle isEqualToString:@"default"]) {
+ [self styleDefault:nil];
+ } else if ([lcStatusBarStyle isEqualToString:@"lightcontent"]) {
+ [self styleLightContent:nil];
+ } else if ([lcStatusBarStyle isEqualToString:@"blacktranslucent"]) {
+ [self styleBlackTranslucent:nil];
+ } else if ([lcStatusBarStyle isEqualToString:@"blackopaque"]) {
+ [self styleBlackOpaque:nil];
+ }
+}
+
+- (void) styleDefault:(CDVInvokedUrlCommand*)command
+{
+ [self setStyleForStatusBar:UIStatusBarStyleDefault];
+}
+
+- (void) styleLightContent:(CDVInvokedUrlCommand*)command
+{
+ [self setStyleForStatusBar:UIStatusBarStyleLightContent];
+}
+
+- (void) styleBlackTranslucent:(CDVInvokedUrlCommand*)command
+{
+ [self setStyleForStatusBar:UIStatusBarStyleLightContent];
+}
+
+- (void) styleBlackOpaque:(CDVInvokedUrlCommand*)command
+{
+ [self setStyleForStatusBar:UIStatusBarStyleLightContent];
+}
+
+- (void) backgroundColorByName:(CDVInvokedUrlCommand*)command
+{
+ id value = [command argumentAtIndex:0];
+ if (!([value isKindOfClass:[NSString class]])) {
+ value = @"black";
+ }
+
+ SEL selector = NSSelectorFromString([value stringByAppendingString:@"Color"]);
+ if ([UIColor respondsToSelector:selector]) {
+ _statusBarBackgroundView.backgroundColor = [UIColor performSelector:selector];
+ }
+}
+
+- (void) _backgroundColorByHexString:(NSString*)hexString
+{
+ unsigned int rgbValue = 0;
+ NSScanner* scanner = [NSScanner scannerWithString:hexString];
+ [scanner setScanLocation:1];
+ [scanner scanHexInt:&rgbValue];
+
+ _statusBarBackgroundColor = [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 green:((rgbValue & 0xFF00) >> 8)/255.0 blue:(rgbValue & 0xFF)/255.0 alpha:1.0];
+ _statusBarBackgroundView.backgroundColor = _statusBarBackgroundColor;
+}
+
+- (void) backgroundColorByHexString:(CDVInvokedUrlCommand*)command
+{
+ NSString* value = [command argumentAtIndex:0];
+ if (!([value isKindOfClass:[NSString class]])) {
+ value = @"#000000";
+ }
+
+ if (![value hasPrefix:@"#"] || [value length] < 7) {
+ return;
+ }
+
+ [self _backgroundColorByHexString:value];
+}
+
+- (void) hideStatusBar
+{
+ if (_uiviewControllerBasedStatusBarAppearance) {
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+ vc.sb_hideStatusBar = [NSNumber numberWithBool:YES];
+ [self refreshStatusBarAppearance];
+
+ } else {
+ UIApplication* app = [UIApplication sharedApplication];
+ [app setStatusBarHidden:YES];
+ }
+}
+
+- (void) hide:(CDVInvokedUrlCommand*)command
+{
+ _statusBarVisible = NO;
+ UIApplication* app = [UIApplication sharedApplication];
+
+ if (!app.isStatusBarHidden)
+ {
+
+ [self hideStatusBar];
+
+ [_statusBarBackgroundView removeFromSuperview];
+
+ [self resizeWebView];
+
+ _statusBarBackgroundView.hidden = YES;
+ }
+}
+
+- (void) showStatusBar
+{
+ if (_uiviewControllerBasedStatusBarAppearance) {
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+ vc.sb_hideStatusBar = [NSNumber numberWithBool:NO];
+ [self refreshStatusBarAppearance];
+
+ } else {
+ UIApplication* app = [UIApplication sharedApplication];
+ [app setStatusBarHidden:NO];
+ }
+}
+
+- (void) show:(CDVInvokedUrlCommand*)command
+{
+ _statusBarVisible = YES;
+ UIApplication* app = [UIApplication sharedApplication];
+
+ if (app.isStatusBarHidden)
+ {
+ [self showStatusBar];
+ [self resizeWebView];
+
+ if (!self.statusBarOverlaysWebView) {
+
+ // there is a possibility that when the statusbar was hidden, it was in a different orientation
+ // from the current one. Therefore we need to expand the statusBarBackgroundView as well to the
+ // statusBar's current size
+ [self resizeStatusBarBackgroundView];
+ [self.webView.superview addSubview:_statusBarBackgroundView];
+
+ }
+
+ _statusBarBackgroundView.hidden = NO;
+ }
+}
+
+-(void)resizeStatusBarBackgroundView {
+ CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
+ CGRect sbBgFrame = _statusBarBackgroundView.frame;
+ sbBgFrame.size = statusBarFrame.size;
+ _statusBarBackgroundView.frame = sbBgFrame;
+}
+
+-(void)resizeWebView
+{
+ BOOL isIOS11 = (IsAtLeastiOSVersion(@"11.0"));
+
+ CGRect bounds = [self.viewController.view.window bounds];
+ if (CGRectEqualToRect(bounds, CGRectZero)) {
+ bounds = [[UIScreen mainScreen] bounds];
+ }
+
+ self.viewController.view.frame = bounds;
+
+ self.webView.frame = bounds;
+
+ CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
+ CGRect frame = self.webView.frame;
+ CGFloat height = statusBarFrame.size.height;
+
+ if (!self.statusBarOverlaysWebView) {
+ frame.origin.y = height;
+ } else {
+ frame.origin.y = height >= 20 ? height - 20 : 0;
+ if (isIOS11) {
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
+ if (@available(iOS 11.0, *)) {
+ float safeAreaTop = self.webView.safeAreaInsets.top;
+ if (height >= safeAreaTop && safeAreaTop >0) {
+ // Sometimes when in-call/recording/hotspot larger status bar is present, the safeAreaTop is 40 but we want frame.origin.y to be 20
+ frame.origin.y = safeAreaTop == 40 ? 20 : height - safeAreaTop;
+ } else {
+ frame.origin.y = 0;
+ }
+ }
+#endif
+ }
+ }
+ frame.size.height -= frame.origin.y;
+ self.webView.frame = frame;
+
+}
+
+- (void) dealloc
+{
+ [[UIApplication sharedApplication] removeObserver:self forKeyPath:@"statusBarHidden"];
+ [[NSNotificationCenter defaultCenter]removeObserver:self name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
+}
+
+
+#pragma mark - UIScrollViewDelegate
+
+- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView
+{
+ [self fireTappedEvent];
+ return NO;
+}
+
+@end
diff --git a/plugins/cordova-plugin-statusbar/src/windows/StatusBarProxy.js b/plugins/cordova-plugin-statusbar/src/windows/StatusBarProxy.js
new file mode 100644
index 0000000..3929ff0
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/src/windows/StatusBarProxy.js
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+/* global Windows */
+
+var _supported = null; // set to null so we can check first time
+
+function isSupported() {
+ // if not checked before, run check
+ if (_supported === null) {
+ var viewMan = Windows.UI.ViewManagement;
+ _supported = (viewMan.StatusBar && viewMan.StatusBar.getForCurrentView);
+ }
+ return _supported;
+}
+
+function getViewStatusBar() {
+ if (!isSupported()) {
+ throw new Error("Status bar is not supported");
+ }
+ return Windows.UI.ViewManagement.StatusBar.getForCurrentView();
+}
+
+function hexToRgb(hex) {
+ // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
+ var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
+ hex = hex.replace(shorthandRegex, function (m, r, g, b) {
+ return r + r + g + g + b + b;
+ });
+
+ var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
+ return result ? {
+ r: parseInt(result[1], 16),
+ g: parseInt(result[2], 16),
+ b: parseInt(result[3], 16)
+ } : null;
+}
+
+module.exports = {
+ _ready: function(win, fail) {
+ if(isSupported()) {
+ var statusBar = getViewStatusBar();
+ win(statusBar.occludedRect.height !== 0);
+ }
+ },
+ overlaysWebView: function () {
+ // not supported
+ },
+
+ styleDefault: function () {
+ // dark text ( to be used on a light background )
+ if (isSupported()) {
+ getViewStatusBar().foregroundColor = { a: 0, r: 0, g: 0, b: 0 };
+ }
+ },
+
+ styleLightContent: function () {
+ // light text ( to be used on a dark background )
+ if (isSupported()) {
+ getViewStatusBar().foregroundColor = { a: 0, r: 255, g: 255, b: 255 };
+ }
+ },
+
+ styleBlackTranslucent: function () {
+ // #88000000 ? Apple says to use lightContent instead
+ return module.exports.styleLightContent();
+ },
+
+ styleBlackOpaque: function () {
+ // #FF000000 ? Apple says to use lightContent instead
+ return module.exports.styleLightContent();
+ },
+
+ backgroundColorByHexString: function (win, fail, args) {
+ var rgb = hexToRgb(args[0]);
+ if(isSupported()) {
+ var statusBar = getViewStatusBar();
+ statusBar.backgroundColor = { a: 0, r: rgb.r, g: rgb.g, b: rgb.b };
+ statusBar.backgroundOpacity = 1;
+ }
+ },
+
+ show: function (win, fail) {
+ // added support check so no error thrown, when calling this method
+ if (isSupported()) {
+ getViewStatusBar().showAsync().done(win, fail);
+ }
+ },
+
+ hide: function (win, fail) {
+ // added support check so no error thrown, when calling this method
+ if (isSupported()) {
+ getViewStatusBar().hideAsync().done(win, fail);
+ }
+ }
+};
+require("cordova/exec/proxy").add("StatusBar", module.exports);
\ No newline at end of file
diff --git a/plugins/cordova-plugin-statusbar/src/wp/StatusBar.cs b/plugins/cordova-plugin-statusbar/src/wp/StatusBar.cs
new file mode 100644
index 0000000..ec83ca8
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/src/wp/StatusBar.cs
@@ -0,0 +1,141 @@
+/*
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+
+using Microsoft.Phone.Shell;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+using System.Threading;
+using System.Windows;
+using System.Windows.Media;
+using System.Windows.Threading;
+
+
+/*
+ * http://www.idev101.com/code/User_Interface/StatusBar.html
+ * https://developer.apple.com/library/ios/documentation/userexperience/conceptual/transitionguide/Bars.html
+ * https://developer.apple.com/library/ios/documentation/uikit/reference/UIApplication_Class/Reference/Reference.html#//apple_ref/c/econst/UIStatusBarStyleDefault
+ * */
+
+
+namespace WPCordovaClassLib.Cordova.Commands
+{
+ public class StatusBar : BaseCommand
+ {
+
+ // returns an argb value, if the hex is only rgb, it will be full opacity
+ protected Color ColorFromHex(string hexString)
+ {
+ string cleanHex = hexString.Replace("#", "").Replace("0x", "");
+ // turn #FFF into #FFFFFF
+ if (cleanHex.Length == 3)
+ {
+ cleanHex = "" + cleanHex[0] + cleanHex[0] + cleanHex[1] + cleanHex[1] + cleanHex[2] + cleanHex[2];
+ }
+ // add an alpha 100% if it is missing
+ if (cleanHex.Length == 6)
+ {
+ cleanHex = "FF" + cleanHex;
+ }
+ int argb = Int32.Parse(cleanHex, NumberStyles.HexNumber);
+ Color clr = Color.FromArgb((byte)((argb & 0xff000000) >> 0x18),
+ (byte)((argb & 0xff0000) >> 0x10),
+ (byte)((argb & 0xff00) >> 8),
+ (byte)(argb & 0xff));
+ return clr;
+ }
+
+ public void _ready(string options)
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ bool isVis = SystemTray.IsVisible;
+ // TODO: pass this to JS
+ //Debug.WriteLine("Result::" + res);
+ DispatchCommandResult(new PluginResult(PluginResult.Status.OK, isVis));
+ });
+ }
+
+ public void overlaysWebView(string options)
+ { //exec(null, null, "StatusBar", "overlaysWebView", [doOverlay]);
+ // string arg = JSON.JsonHelper.Deserialize(options)[0];
+ }
+
+ public void styleDefault(string options)
+ { //exec(null, null, "StatusBar", "styleDefault", []);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ SystemTray.ForegroundColor = Colors.Black;
+ });
+ }
+
+ public void styleLightContent(string options)
+ { //exec(null, null, "StatusBar", "styleLightContent", []);
+
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ SystemTray.ForegroundColor = Colors.White;
+ });
+ }
+
+ public void styleBlackTranslucent(string options)
+ { //exec(null, null, "StatusBar", "styleBlackTranslucent", []);
+ styleLightContent(options);
+ }
+
+ public void styleBlackOpaque(string options)
+ { //exec(null, null, "StatusBar", "styleBlackOpaque", []);
+ styleLightContent(options);
+ }
+
+ public void backgroundColorByName(string options)
+ { //exec(null, null, "StatusBar", "backgroundColorByName", [colorname]);
+ // this should NOT be called, js should now be using/converting color names to hex
+ }
+
+ public void backgroundColorByHexString(string options)
+ { //exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]);
+ string argb = JSON.JsonHelper.Deserialize(options)[0];
+
+ Color clr = ColorFromHex(argb);
+
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ SystemTray.Opacity = clr.A / 255.0d;
+ SystemTray.BackgroundColor = clr;
+
+ });
+ }
+
+ public void hide(string options)
+ { //exec(null, null, "StatusBar", "hide", []);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ SystemTray.IsVisible = false;
+ });
+
+ }
+
+ public void show(string options)
+ { //exec(null, null, "StatusBar", "show", []);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ SystemTray.IsVisible = true;
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/plugins/cordova-plugin-statusbar/tests/package.json b/plugins/cordova-plugin-statusbar/tests/package.json
new file mode 100644
index 0000000..5e2ba47
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/tests/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "cordova-plugin-statusbar-tests",
+ "version": "2.2.3-dev",
+ "description": "",
+ "cordova": {
+ "id": "cordova-plugin-statusbar-tests",
+ "platforms": []
+ },
+ "keywords": [
+ "ecosystem:cordova"
+ ],
+ "author": "",
+ "license": "Apache 2.0"
+}
diff --git a/plugins/cordova-plugin-statusbar/tests/plugin.xml b/plugins/cordova-plugin-statusbar/tests/plugin.xml
new file mode 100644
index 0000000..af142ae
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/tests/plugin.xml
@@ -0,0 +1,31 @@
+
+
+
+
+ Cordova StatusBar Plugin Tests
+ Apache 2.0
+
+
+
+
diff --git a/plugins/cordova-plugin-statusbar/tests/tests.js b/plugins/cordova-plugin-statusbar/tests/tests.js
new file mode 100644
index 0000000..5a8fe39
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/tests/tests.js
@@ -0,0 +1,151 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* jshint jasmine: true */
+/* global StatusBar */
+
+exports.defineAutoTests = function () {
+ describe("StatusBar", function () {
+ it("statusbar.spec.1 should exist", function() {
+ expect(window.StatusBar).toBeDefined();
+ });
+
+ it("statusbar.spec.2 should have show|hide methods", function() {
+ expect(window.StatusBar.show).toBeDefined();
+ expect(typeof window.StatusBar.show).toBe("function");
+
+ expect(window.StatusBar.hide).toBeDefined();
+ expect(typeof window.StatusBar.hide).toBe("function");
+ });
+
+ it("statusbar.spec.3 should have set backgroundColor methods", function() {
+ expect(window.StatusBar.backgroundColorByName).toBeDefined();
+ expect(typeof window.StatusBar.backgroundColorByName).toBe("function");
+
+ expect(window.StatusBar.backgroundColorByHexString).toBeDefined();
+ expect(typeof window.StatusBar.backgroundColorByHexString).toBe("function");
+ });
+
+ it("statusbar.spec.4 should have set style methods", function() {
+ expect(window.StatusBar.styleBlackTranslucent).toBeDefined();
+ expect(typeof window.StatusBar.styleBlackTranslucent).toBe("function");
+
+ expect(window.StatusBar.styleDefault).toBeDefined();
+ expect(typeof window.StatusBar.styleDefault).toBe("function");
+
+ expect(window.StatusBar.styleLightContent).toBeDefined();
+ expect(typeof window.StatusBar.styleLightContent).toBe("function");
+
+ expect(window.StatusBar.styleBlackOpaque).toBeDefined();
+ expect(typeof window.StatusBar.styleBlackOpaque).toBe("function");
+
+ expect(window.StatusBar.overlaysWebView).toBeDefined();
+ expect(typeof window.StatusBar.overlaysWebView).toBe("function");
+ });
+ });
+};
+
+exports.defineManualTests = function (contentEl, createActionButton) {
+ function log(msg) {
+ var el = document.getElementById("info");
+ var logLine = document.createElement('div');
+ logLine.innerHTML = msg;
+ el.appendChild(logLine);
+ }
+
+ function doShow() {
+ StatusBar.show();
+ log('StatusBar.isVisible=' + StatusBar.isVisible);
+ }
+
+ function doHide() {
+ StatusBar.hide();
+ log('StatusBar.isVisible=' + StatusBar.isVisible);
+ }
+
+ function doColor1() {
+ log('set color=red');
+ StatusBar.backgroundColorByName('red');
+ }
+
+ function doColor2() {
+ log('set style=translucent black');
+ StatusBar.styleBlackTranslucent();
+ }
+
+ function doColor3() {
+ log('set style=default');
+ StatusBar.styleDefault();
+ }
+
+ var showOverlay = true;
+ function doOverlay() {
+ showOverlay = !showOverlay;
+ StatusBar.overlaysWebView(showOverlay);
+ log('Set overlay=' + showOverlay);
+ }
+
+ /******************************************************************************/
+
+ contentEl.innerHTML = '' +
+ 'Also: tapping bar on iOS should emit a log.' +
+ '' +
+ 'Expected result: Status bar will be visible' +
+ '
' +
+ 'Expected result: Status bar will be hidden' +
+ '
' +
+ 'Expected result: Status bar text will be a light (white) color' +
+ ' ' +
+ 'Expected result: Status bar text will be a dark (black) color' +
+ ' ' +
+ 'Expected result:
Overlay true = status bar will lay on top of web view content
Overlay false = status bar will be separate from web view and will not cover content' +
+ ' ' +
+ 'Expected result: If overlay false, background color for status bar will be red';
+
+ log('StatusBar.isVisible=' + StatusBar.isVisible);
+ window.addEventListener('statusTap', function () {
+ log('tap!');
+ }, false);
+
+ createActionButton("Show", function () {
+ doShow();
+ }, 'action-show');
+
+ createActionButton("Hide", function () {
+ doHide();
+ }, 'action-hide');
+
+ createActionButton("Style=red (background)", function () {
+ doColor1();
+ }, 'action-color1');
+
+ createActionButton("Style=translucent black", function () {
+ doColor2();
+ }, 'action-color2');
+
+ createActionButton("Style=default", function () {
+ doColor3();
+ }, 'action-color3');
+
+ createActionButton("Toggle Overlays", function () {
+ doOverlay();
+ }, 'action-overlays');
+};
diff --git a/plugins/cordova-plugin-statusbar/types/index.d.ts b/plugins/cordova-plugin-statusbar/types/index.d.ts
new file mode 100644
index 0000000..87df2e7
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/types/index.d.ts
@@ -0,0 +1,77 @@
+// Type definitions for Apache Cordova StatusBar plugin
+// Project: https://github.com/apache/cordova-plugin-statusbar
+// Definitions by: Xinkai Chen
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+/**
+* Global object StatusBar.
+*/
+interface Window {
+ StatusBar: StatusBar;
+}
+
+
+/**
+* The StatusBar object provides some functions to customize the iOS and Android StatusBar.
+*/
+interface StatusBar {
+ /**
+ * On iOS 7, make the statusbar overlay or not overlay the WebView.
+ * @param isOverlay On iOS 7, set to false to make the statusbar appear like iOS 6.
+ * Set the style and background color to suit using the other functions.
+ */
+ overlaysWebView: (isOverlay: boolean) => void;
+
+ /**
+ * Use the default statusbar (dark text, for light backgrounds).
+ */
+ styleDefault: () => void;
+
+ /**
+ * Use the lightContent statusbar (light text, for dark backgrounds).
+ */
+ styleLightContent: () => void;
+
+ /**
+ * Use the blackTranslucent statusbar (light text, for dark backgrounds).
+ */
+ styleBlackTranslucent: () => void;
+
+ /**
+ * Use the blackOpaque statusbar (light text, for dark backgrounds).
+ */
+ styleBlackOpaque: () => void;
+
+ /**
+ * On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false,
+ * you can set the background color of the statusbar by color name.
+ * @param color Supported color names are:
+ * black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
+ */
+ backgroundColorByName: (color: string) => void;
+
+ /**
+ * Sets the background color of the statusbar by a hex string.
+ * @param color CSS shorthand properties are also supported.
+ * On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by a hex string (#RRGGBB).
+ * On WP7 and WP8 you can also specify values as #AARRGGBB, where AA is an alpha value
+ */
+ backgroundColorByHexString: (color: string) => void;
+
+ /**
+ * Hide the statusbar.
+ */
+ hide: () => void;
+
+ /**
+ * Show the statusbar.
+ */
+ show: () => void;
+
+ /**
+ * Read this property to see if the statusbar is visible or not.
+ */
+ isVisible: boolean;
+}
+
+declare var StatusBar: StatusBar;
\ No newline at end of file
diff --git a/plugins/cordova-plugin-statusbar/www/statusbar.js b/plugins/cordova-plugin-statusbar/www/statusbar.js
new file mode 100644
index 0000000..d9d0ea5
--- /dev/null
+++ b/plugins/cordova-plugin-statusbar/www/statusbar.js
@@ -0,0 +1,113 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* global cordova */
+
+var exec = require('cordova/exec');
+
+var namedColors = {
+ "black": "#000000",
+ "darkGray": "#A9A9A9",
+ "lightGray": "#D3D3D3",
+ "white": "#FFFFFF",
+ "gray": "#808080",
+ "red": "#FF0000",
+ "green": "#00FF00",
+ "blue": "#0000FF",
+ "cyan": "#00FFFF",
+ "yellow": "#FFFF00",
+ "magenta": "#FF00FF",
+ "orange": "#FFA500",
+ "purple": "#800080",
+ "brown": "#A52A2A"
+};
+
+var StatusBar = {
+
+ isVisible: true,
+
+ overlaysWebView: function (doOverlay) {
+ exec(null, null, "StatusBar", "overlaysWebView", [doOverlay]);
+ },
+
+ styleDefault: function () {
+ // dark text ( to be used on a light background )
+ exec(null, null, "StatusBar", "styleDefault", []);
+ },
+
+ styleLightContent: function () {
+ // light text ( to be used on a dark background )
+ exec(null, null, "StatusBar", "styleLightContent", []);
+ },
+
+ styleBlackTranslucent: function () {
+ // #88000000 ? Apple says to use lightContent instead
+ exec(null, null, "StatusBar", "styleBlackTranslucent", []);
+ },
+
+ styleBlackOpaque: function () {
+ // #FF000000 ? Apple says to use lightContent instead
+ exec(null, null, "StatusBar", "styleBlackOpaque", []);
+ },
+
+ backgroundColorByName: function (colorname) {
+ return StatusBar.backgroundColorByHexString(namedColors[colorname]);
+ },
+
+ backgroundColorByHexString: function (hexString) {
+ if (hexString.charAt(0) !== "#") {
+ hexString = "#" + hexString;
+ }
+
+ if (hexString.length === 4) {
+ var split = hexString.split("");
+ hexString = "#" + split[1] + split[1] + split[2] + split[2] + split[3] + split[3];
+ }
+
+ exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]);
+ },
+
+ hide: function () {
+ exec(null, null, "StatusBar", "hide", []);
+ StatusBar.isVisible = false;
+ },
+
+ show: function () {
+ exec(null, null, "StatusBar", "show", []);
+ StatusBar.isVisible = true;
+ }
+
+};
+
+// prime it. setTimeout so that proxy gets time to init
+window.setTimeout(function () {
+ exec(function (res) {
+ if (typeof res == 'object') {
+ if (res.type == 'tap') {
+ cordova.fireWindowEvent('statusTap');
+ }
+ } else {
+ StatusBar.isVisible = res;
+ }
+ }, null, "StatusBar", "_ready", []);
+}, 0);
+
+module.exports = StatusBar;
diff --git a/plugins/cordova-plugin-whitelist/.github/PULL_REQUEST_TEMPLATE.md b/plugins/cordova-plugin-whitelist/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..91582f4
--- /dev/null
+++ b/plugins/cordova-plugin-whitelist/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,22 @@
+
+
+### Platforms affected
+
+
+### What does this PR do?
+
+
+### What testing has been done on this change?
+
+
+### Checklist
+- [ ] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
+- [ ] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
+- [ ] Added automated test coverage as appropriate for this change.
diff --git a/plugins/cordova-plugin-whitelist/CONTRIBUTING.md b/plugins/cordova-plugin-whitelist/CONTRIBUTING.md
new file mode 100644
index 0000000..7de4c64
--- /dev/null
+++ b/plugins/cordova-plugin-whitelist/CONTRIBUTING.md
@@ -0,0 +1,37 @@
+
+
+# Contributing to Apache Cordova
+
+Anyone can contribute to Cordova. And we need your contributions.
+
+There are multiple ways to contribute: report bugs, improve the docs, and
+contribute code.
+
+For instructions on this, start with the
+[contribution overview](http://cordova.apache.org/contribute/).
+
+The details are explained there, but the important items are:
+ - Sign and submit an Apache ICLA (Contributor License Agreement).
+ - Have a Jira issue open that corresponds to your contribution.
+ - Run the tests so your patch doesn't break existing functionality.
+
+We look forward to your contributions!
diff --git a/plugins/cordova-plugin-whitelist/LICENSE b/plugins/cordova-plugin-whitelist/LICENSE
new file mode 100644
index 0000000..7a4a3ea
--- /dev/null
+++ b/plugins/cordova-plugin-whitelist/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/plugins/cordova-plugin-whitelist/NOTICE b/plugins/cordova-plugin-whitelist/NOTICE
new file mode 100644
index 0000000..8ec56a5
--- /dev/null
+++ b/plugins/cordova-plugin-whitelist/NOTICE
@@ -0,0 +1,5 @@
+Apache Cordova
+Copyright 2012 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
diff --git a/plugins/cordova-plugin-whitelist/README.md b/plugins/cordova-plugin-whitelist/README.md
new file mode 100644
index 0000000..e19d230
--- /dev/null
+++ b/plugins/cordova-plugin-whitelist/README.md
@@ -0,0 +1,163 @@
+---
+title: Whitelist
+description: Whitelist external content accessible by your app.
+---
+
+
+# cordova-plugin-whitelist
+
+This plugin implements a whitelist policy for navigating the application webview on Cordova 4.0
+
+:warning: Report issues on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Whitelist%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC)
+
+## Installation
+
+You can install whitelist plugin with Cordova CLI, from npm:
+
+```
+$ cordova plugin add cordova-plugin-whitelist
+$ cordova prepare
+```
+
+## Supported Cordova Platforms
+
+* Android 4.0.0 or above
+
+## Navigation Whitelist
+Controls which URLs the WebView itself can be navigated to. Applies to
+top-level navigations only.
+
+Quirks: on Android it also applies to iframes for non-http(s) schemes.
+
+By default, navigations only to `file://` URLs, are allowed. To allow others URLs, you must add `` tags to your `config.xml`:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Intent Whitelist
+Controls which URLs the app is allowed to ask the system to open.
+By default, no external URLs are allowed.
+
+On Android, this equates to sending an intent of type BROWSEABLE.
+
+This whitelist does not apply to plugins, only hyperlinks and calls to `window.open()`.
+
+In `config.xml`, add `` tags, like this:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Network Request Whitelist
+Controls which network requests (images, XHRs, etc) are allowed to be made (via cordova native hooks).
+
+Note: We suggest you use a Content Security Policy (see below), which is more secure. This whitelist is mostly historical for webviews which do not support CSP.
+
+In `config.xml`, add `` tags, like this:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Without any `` tags, only requests to `file://` URLs are allowed. However, the default Cordova application includes `` by default.
+
+
+Note: Whitelist cannot block network redirects from a whitelisted remote website (i.e. http or https) to a non-whitelisted website. Use CSP rules to mitigate redirects to non-whitelisted websites for webviews that support CSP.
+
+Quirk: Android also allows requests to https://ssl.gstatic.com/accessibility/javascript/android/ by default, since this is required for TalkBack to function properly.
+
+### Content Security Policy
+Controls which network requests (images, XHRs, etc) are allowed to be made (via webview directly).
+
+On Android and iOS, the network request whitelist (see above) is not able to filter all types of requests (e.g. `