diff --git a/.babelrc b/.babelrc
new file mode 100644
index 0000000..9b88dae
--- /dev/null
+++ b/.babelrc
@@ -0,0 +1,17 @@
+{
+ "presets": [
+ ["env", {
+ "targets": {
+ "browsers": ["last 2 versions"]
+ }
+ }]
+ ],
+ "plugins": [
+ [
+ "transform-react-jsx",
+ {
+ "pragma": "preact.h"
+ }
+ ]
+ ]
+}
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..8283c52
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,10 @@
+root = true
+
+[*]
+indent_style = space
+indent_size = 4
+charset = utf-8
+insert_final_newline = true
+end_of_line = lf
+# editorconfig-tools is unable to ignore longs strings or urls
+max_line_length = null
diff --git a/.eslintrc b/.eslintrc
new file mode 100644
index 0000000..d083bfb
--- /dev/null
+++ b/.eslintrc
@@ -0,0 +1,34 @@
+{
+ "extends": "airbnb",
+ "env": {
+ "browser": true
+ },
+ "rules": {
+ "func-names": [
+ "error",
+ "never"
+ ],
+ "indent": ["error", 4],
+ "react/jsx-indent": [1, 4],
+ "react/jsx-indent-props": [1, 4],
+ "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
+ "react/react-in-jsx-scope": "off",
+ "react/no-array-index-key": "off",
+ "class-methods-use-this": "off",
+ "jsx-a11y/no-static-element-interactions": "off",
+ "import/no-dynamic-require": "off",
+ "comma-dangle": "off",
+ "global-require": "off",
+ "eqeqeq": "off",
+ "max-len": "off",
+ "no-new": "off",
+ "no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false, "varsIgnorePattern": "preact" }],
+ "react/no-unknown-property": [2, { "ignore": ["stroke-linecap", "stroke-linejoin", "stop-color"] }]
+ },
+ "globals": {
+ "vars": true,
+ "breadcrumbs": true,
+ "device": true,
+ "cordova": true
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d95596e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,28 @@
+*.com
+*.class
+*.dll
+*.exe
+*.o
+*.so
+*.7z
+*.dmg
+*.gz
+*.iso
+*.jar
+*.rar
+*.tar
+*.zip
+*.log
+*.sql
+*.sqlite
+build
+build.zip
+node_modules
+app/www
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+ehthumbs.db
+Thumbs.db
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 0000000..1dab4ed
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1 @@
+save-exact = true
diff --git a/.nvmrc b/.nvmrc
new file mode 100644
index 0000000..f628d2e
--- /dev/null
+++ b/.nvmrc
@@ -0,0 +1 @@
+11.3.0
diff --git a/app/config.xml b/app/config.xml
new file mode 100644
index 0000000..1585f13
--- /dev/null
+++ b/app/config.xml
@@ -0,0 +1,121 @@
+
+
+
+ App Name
+ App Description
+ Author Name
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/hooks/README.md b/app/hooks/README.md
new file mode 100644
index 0000000..574ad4c
--- /dev/null
+++ b/app/hooks/README.md
@@ -0,0 +1,23 @@
+
+# Cordova Hooks
+
+Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system to customize cordova commands. See Hooks Guide for more details: http://cordova.apache.org/docs/en/edge/guide_appdev_hooks_index.md.html#Hooks%20Guide.
diff --git a/app/platforms/browser/browser.json b/app/platforms/browser/browser.json
new file mode 100644
index 0000000..690a30d
--- /dev/null
+++ b/app/platforms/browser/browser.json
@@ -0,0 +1,336 @@
+{
+ "prepare_queue": {
+ "installed": [],
+ "uninstalled": []
+ },
+ "config_munge": {
+ "files": {
+ "config.xml": {
+ "parents": {
+ "/*": [
+ {
+ "xml": "",
+ "count": 1
+ }
+ ]
+ }
+ }
+ }
+ },
+ "installed_plugins": {
+ "cordova-plugin-device": {
+ "PACKAGE_NAME": "com.website.app"
+ },
+ "cordova-plugin-whitelist": {
+ "PACKAGE_NAME": "com.website.app"
+ },
+ "cordova-plugin-statusbar": {
+ "PACKAGE_NAME": "com.website.app"
+ },
+ "cordova-plugin-network-information": {
+ "PACKAGE_NAME": "com.website.app"
+ },
+ "cordova-plugin-inappbrowser": {
+ "PACKAGE_NAME": "com.website.app"
+ },
+ "cordova-plugin-app-version": {
+ "PACKAGE_NAME": "com.website.app"
+ },
+ "cordova-plugin-file": {
+ "PACKAGE_NAME": "com.website.app"
+ },
+ "cordova-plugin-file-transfer": {
+ "PACKAGE_NAME": "com.website.app"
+ }
+ },
+ "dependent_plugins": {},
+ "modules": [
+ {
+ "file": "plugins/cordova-plugin-device/www/device.js",
+ "id": "cordova-plugin-device.device",
+ "pluginId": "cordova-plugin-device",
+ "clobbers": [
+ "device"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-device/src/browser/DeviceProxy.js",
+ "id": "cordova-plugin-device.DeviceProxy",
+ "pluginId": "cordova-plugin-device",
+ "runs": true
+ },
+ {
+ "file": "plugins/cordova-plugin-statusbar/www/statusbar.js",
+ "id": "cordova-plugin-statusbar.statusbar",
+ "pluginId": "cordova-plugin-statusbar",
+ "clobbers": [
+ "window.StatusBar"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-statusbar/src/browser/StatusBarProxy.js",
+ "id": "cordova-plugin-statusbar.StatusBarProxy",
+ "pluginId": "cordova-plugin-statusbar",
+ "runs": true
+ },
+ {
+ "file": "plugins/cordova-plugin-network-information/www/network.js",
+ "id": "cordova-plugin-network-information.network",
+ "pluginId": "cordova-plugin-network-information",
+ "clobbers": [
+ "navigator.connection",
+ "navigator.network.connection"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-network-information/www/Connection.js",
+ "id": "cordova-plugin-network-information.Connection",
+ "pluginId": "cordova-plugin-network-information",
+ "clobbers": [
+ "Connection"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-network-information/src/browser/network.js",
+ "id": "cordova-plugin-network-information.NetworkInfoProxy",
+ "pluginId": "cordova-plugin-network-information",
+ "runs": true
+ },
+ {
+ "file": "plugins/cordova-plugin-inappbrowser/www/inappbrowser.js",
+ "id": "cordova-plugin-inappbrowser.inappbrowser",
+ "pluginId": "cordova-plugin-inappbrowser",
+ "clobbers": [
+ "cordova.InAppBrowser.open",
+ "window.open"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-inappbrowser/src/browser/InAppBrowserProxy.js",
+ "id": "cordova-plugin-inappbrowser.InAppBrowserProxy",
+ "pluginId": "cordova-plugin-inappbrowser",
+ "runs": true
+ },
+ {
+ "file": "plugins/cordova-plugin-app-version/www/AppVersionPlugin.js",
+ "id": "cordova-plugin-app-version.AppVersionPlugin",
+ "pluginId": "cordova-plugin-app-version",
+ "clobbers": [
+ "cordova.getAppVersion"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
+ "id": "cordova-plugin-file.DirectoryEntry",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.DirectoryEntry"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/DirectoryReader.js",
+ "id": "cordova-plugin-file.DirectoryReader",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.DirectoryReader"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/Entry.js",
+ "id": "cordova-plugin-file.Entry",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.Entry"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/File.js",
+ "id": "cordova-plugin-file.File",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.File"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/FileEntry.js",
+ "id": "cordova-plugin-file.FileEntry",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileEntry"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/FileError.js",
+ "id": "cordova-plugin-file.FileError",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileError"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/FileReader.js",
+ "id": "cordova-plugin-file.FileReader",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileReader"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/FileSystem.js",
+ "id": "cordova-plugin-file.FileSystem",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileSystem"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/FileUploadOptions.js",
+ "id": "cordova-plugin-file.FileUploadOptions",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileUploadOptions"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/FileUploadResult.js",
+ "id": "cordova-plugin-file.FileUploadResult",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileUploadResult"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/FileWriter.js",
+ "id": "cordova-plugin-file.FileWriter",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.FileWriter"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/Flags.js",
+ "id": "cordova-plugin-file.Flags",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.Flags"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/LocalFileSystem.js",
+ "id": "cordova-plugin-file.LocalFileSystem",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.LocalFileSystem"
+ ],
+ "merges": [
+ "window"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/Metadata.js",
+ "id": "cordova-plugin-file.Metadata",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.Metadata"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/ProgressEvent.js",
+ "id": "cordova-plugin-file.ProgressEvent",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.ProgressEvent"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/fileSystems.js",
+ "id": "cordova-plugin-file.fileSystems",
+ "pluginId": "cordova-plugin-file"
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/requestFileSystem.js",
+ "id": "cordova-plugin-file.requestFileSystem",
+ "pluginId": "cordova-plugin-file",
+ "clobbers": [
+ "window.requestFileSystem"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js",
+ "id": "cordova-plugin-file.resolveLocalFileSystemURI",
+ "pluginId": "cordova-plugin-file",
+ "merges": [
+ "window"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/browser/isChrome.js",
+ "id": "cordova-plugin-file.isChrome",
+ "pluginId": "cordova-plugin-file",
+ "runs": true
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/browser/Preparing.js",
+ "id": "cordova-plugin-file.Preparing",
+ "pluginId": "cordova-plugin-file",
+ "runs": true
+ },
+ {
+ "file": "plugins/cordova-plugin-file/src/browser/FileProxy.js",
+ "id": "cordova-plugin-file.browserFileProxy",
+ "pluginId": "cordova-plugin-file",
+ "runs": true
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/fileSystemPaths.js",
+ "id": "cordova-plugin-file.fileSystemPaths",
+ "pluginId": "cordova-plugin-file",
+ "merges": [
+ "cordova"
+ ],
+ "runs": true
+ },
+ {
+ "file": "plugins/cordova-plugin-file/www/browser/FileSystem.js",
+ "id": "cordova-plugin-file.firefoxFileSystem",
+ "pluginId": "cordova-plugin-file",
+ "merges": [
+ "window.FileSystem"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file-transfer/www/FileTransferError.js",
+ "id": "cordova-plugin-file-transfer.FileTransferError",
+ "pluginId": "cordova-plugin-file-transfer",
+ "clobbers": [
+ "window.FileTransferError"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file-transfer/www/FileTransfer.js",
+ "id": "cordova-plugin-file-transfer.FileTransfer",
+ "pluginId": "cordova-plugin-file-transfer",
+ "clobbers": [
+ "window.FileTransfer"
+ ]
+ },
+ {
+ "file": "plugins/cordova-plugin-file-transfer/www/browser/FileTransfer.js",
+ "id": "cordova-plugin-file-transfer.BrowserFileTransfer",
+ "pluginId": "cordova-plugin-file-transfer",
+ "clobbers": [
+ "window.FileTransfer"
+ ]
+ }
+ ],
+ "plugin_metadata": {
+ "cordova-plugin-device": "1.1.7",
+ "cordova-plugin-whitelist": "1.3.3",
+ "cordova-plugin-statusbar": "2.3.0",
+ "cordova-plugin-network-information": "1.3.4",
+ "cordova-plugin-inappbrowser": "1.7.2",
+ "cordova-plugin-app-version": "0.1.9",
+ "cordova-plugin-file": "6.0.1",
+ "cordova-plugin-file-transfer": "1.7.0"
+ }
+}
\ No newline at end of file
diff --git a/app/platforms/browser/config.xml b/app/platforms/browser/config.xml
new file mode 100644
index 0000000..cfb03a6
--- /dev/null
+++ b/app/platforms/browser/config.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+ Arilly
+ Find local bakers, make-up artists, photographers and other professionals
+ Arilly Limited
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/platforms/browser/cordova/build.bat b/app/platforms/browser/cordova/build.bat
new file mode 100644
index 0000000..02641bc
--- /dev/null
+++ b/app/platforms/browser/cordova/build.bat
@@ -0,0 +1,26 @@
+:: 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.
+
+@ECHO OFF
+SET script_path="%~dp0build"
+IF EXIST %script_path% (
+ node %script_path% %*
+) ELSE (
+ ECHO.
+ ECHO ERROR: Could not find 'build' script in 'cordova' folder, aborting...>&2
+ EXIT /B 1
+)
diff --git a/app/platforms/browser/cordova/clean b/app/platforms/browser/cordova/clean
new file mode 100644
index 0000000..da21bc7
--- /dev/null
+++ b/app/platforms/browser/cordova/clean
@@ -0,0 +1,37 @@
+#!/usr/bin/env node
+
+/*
+ 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 path = require('path'),
+ clean = require('./lib/clean'),
+ reqs = require('./lib/check_reqs'),
+ args = process.argv;
+
+// Support basic help commands
+if ( args.length > 2
+ || args[2] == '--help' || args[2] == '/?' || args[2] == '-h' ||
+ args[2] == 'help' || args[2] == '-help' || args[2] == '/help') {
+ console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'clean')) );
+ process.exit(0);
+} else {
+ clean.cleanProject();
+}
+
diff --git a/app/platforms/browser/cordova/defaults.xml b/app/platforms/browser/cordova/defaults.xml
new file mode 100644
index 0000000..a7b31c0
--- /dev/null
+++ b/app/platforms/browser/cordova/defaults.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
diff --git a/app/platforms/browser/cordova/lib/build.js b/app/platforms/browser/cordova/lib/build.js
new file mode 100644
index 0000000..fde7519
--- /dev/null
+++ b/app/platforms/browser/cordova/lib/build.js
@@ -0,0 +1,65 @@
+#!/usr/bin/env node
+
+/*
+ * 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 path = require('path'),
+ fs = require('fs'),
+ shjs = require('shelljs'),
+ zip = require('adm-zip'),
+ Q = require('q'),
+ clean = require('./clean'),
+ check_reqs = require('./check_reqs'),
+ platformWwwDir = path.join('platforms', 'browser', 'www'),
+ platformBuildDir = path.join('platforms', 'browser', 'build'),
+ packageFile = path.join(platformBuildDir, 'package.zip');
+
+/**
+ * run
+ * Creates a zip file int platform/build folder
+ */
+module.exports.run = function(){
+
+ return check_reqs.run()
+ .then(function(){
+ return clean.cleanProject();
+ },
+ function checkReqsError(err){
+ console.error('Please make sure you meet the software requirements in order to build a browser cordova project');
+ })
+ .then(function(){
+
+ if (!fs.existsSync(platformBuildDir)) {
+ fs.mkdirSync(platformBuildDir);
+ }
+
+ // add the project to a zipfile
+ var zipFile = zip();
+ zipFile.addLocalFolder(platformWwwDir, '.');
+ zipFile.writeZip(packageFile);
+
+ return Q.resolve();
+
+ });
+};
+
+module.exports.help = function() {
+ console.log('Usage: cordova build browser');
+ console.log('Build will create the packaged app in \''+platformBuildDir+'\'.');
+};
diff --git a/app/platforms/browser/cordova/lib/check_reqs.js b/app/platforms/browser/cordova/lib/check_reqs.js
new file mode 100644
index 0000000..720d7aa
--- /dev/null
+++ b/app/platforms/browser/cordova/lib/check_reqs.js
@@ -0,0 +1,28 @@
+#!/usr/bin/env node
+
+/*
+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.
+*/
+
+//add methods as we determine what are the requirements
+
+var Q = require('q');
+
+module.exports.run = function() {
+ return Q.resolve();
+};
diff --git a/app/platforms/browser/cordova/lib/clean.js b/app/platforms/browser/cordova/lib/clean.js
new file mode 100644
index 0000000..2e4367d
--- /dev/null
+++ b/app/platforms/browser/cordova/lib/clean.js
@@ -0,0 +1,46 @@
+#!/usr/bin/env node
+
+/*
+ * 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 fs = require('fs'),
+ shjs = require('shelljs'),
+ path = require('path'),
+ check_reqs = require('./check_reqs'),
+ platformBuildDir = path.join('platforms', 'browser', 'build');
+
+exports.cleanProject = function(){
+
+ // Check that requirements are (stil) met
+ if (!check_reqs.run()) {
+ console.error('Please make sure you meet the software requirements in order to clean an browser cordova project');
+ process.exit(2);
+ }
+
+ console.log('Cleaning Browser project');
+ try {
+ if (fs.existsSync(platformBuildDir)) {
+ shjs.rm('-r', platformBuildDir);
+ }
+ }
+ catch(err) {
+ console.log('could not remove '+platformBuildDir+' : '+err.message);
+ }
+};
+
diff --git a/app/platforms/browser/cordova/run b/app/platforms/browser/cordova/run
new file mode 100644
index 0000000..d4c690b
--- /dev/null
+++ b/app/platforms/browser/cordova/run
@@ -0,0 +1,70 @@
+#!/usr/bin/env node
+
+/*
+ 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 fs = require('fs'),
+ path = require('path'),
+ nopt = require('nopt'),
+ url = require('url'),
+ cordovaServe = require('cordova-serve');
+
+var args = process.argv;
+
+start(args);
+
+function start(argv) {
+ var args = nopt({'help': Boolean, 'target': String, 'port': Number}, {'help': ['/?', '-h', 'help', '-help', '/help']}, argv);
+ if(args.help) {
+ help();
+ }
+
+ // defaults
+ args.port = args.port || 8000;
+ args.target = args.target || "chrome";
+
+ var root = path.join(__dirname, '../'),
+ configFile = path.resolve(path.join(root, 'config.xml')),
+ configXML = fs.readFileSync(configFile, 'utf8'),
+ sourceFile = / ] [ --port= ]");
+ console.log(" --target= : Launches the specified browser. Chrome is default.");
+ console.log(" --port= : Http server uses specified port number.");
+ console.log("Examples:");
+ console.log(" run");
+ console.log(" run -- --target=ie");
+ console.log(" run -- --target=chrome --port=8000");
+ console.log("");
+ process.exit(0);
+}
diff --git a/app/platforms/browser/cordova/run.bat b/app/platforms/browser/cordova/run.bat
new file mode 100644
index 0000000..b9c4402
--- /dev/null
+++ b/app/platforms/browser/cordova/run.bat
@@ -0,0 +1,26 @@
+:: 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.
+
+@ECHO OFF
+SET script_path="%~dp0run"
+IF EXIST %script_path% (
+ node %script_path% %*
+) ELSE (
+ ECHO.
+ ECHO ERROR: Could not find 'run' script in 'cordova' folder, aborting...>&2
+ EXIT /B 1
+)
diff --git a/app/platforms/browser/cordova/version b/app/platforms/browser/cordova/version
new file mode 100644
index 0000000..8a13bae
--- /dev/null
+++ b/app/platforms/browser/cordova/version
@@ -0,0 +1,25 @@
+#!/usr/bin/env node
+
+/*
+ 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.
+*/
+
+// Coho updates this line:
+var VERSION = "4.1.0";
+
+console.log(VERSION);
diff --git a/app/platforms/browser/cordova/version.bat b/app/platforms/browser/cordova/version.bat
new file mode 100644
index 0000000..3610c17
--- /dev/null
+++ b/app/platforms/browser/cordova/version.bat
@@ -0,0 +1,26 @@
+:: 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.
+
+@ECHO OFF
+SET script_path="%~dp0version"
+IF EXIST %script_path% (
+ node %script_path% %*
+) ELSE (
+ ECHO.
+ ECHO ERROR: Could not find 'version' script in 'cordova' folder, aborting...>&2
+ EXIT /B 1
+)
diff --git a/app/platforms/browser/css/index.css b/app/platforms/browser/css/index.css
new file mode 100644
index 0000000..51daa79
--- /dev/null
+++ b/app/platforms/browser/css/index.css
@@ -0,0 +1,115 @@
+/*
+ * 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.
+ */
+* {
+ -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
+}
+
+body {
+ -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
+ -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
+ -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
+ background-color:#E4E4E4;
+ background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+ background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+ background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+ background-image:-webkit-gradient(
+ linear,
+ left top,
+ left bottom,
+ color-stop(0, #A7A7A7),
+ color-stop(0.51, #E4E4E4)
+ );
+ background-attachment:fixed;
+ font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
+ font-size:12px;
+ height:100%;
+ margin:0px;
+ padding:0px;
+ text-transform:uppercase;
+ width:100%;
+}
+
+/* Portrait layout (default) */
+.app {
+ background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
+ position:absolute; /* position in the center of the screen */
+ left:50%;
+ top:50%;
+ height:50px; /* text area height */
+ width:225px; /* text area width */
+ text-align:center;
+ padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */
+ margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */
+ /* offset horizontal: half of text area width */
+}
+
+/* Landscape layout (with min-width) */
+@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
+ .app {
+ background-position:left center;
+ padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */
+ margin:-90px 0px 0px -198px; /* offset vertical: half of image height */
+ /* offset horizontal: half of image width and text area width */
+ }
+}
+
+h1 {
+ font-size:24px;
+ font-weight:normal;
+ margin:0px;
+ overflow:visible;
+ padding:0px;
+ text-align:center;
+}
+
+.event {
+ border-radius:4px;
+ -webkit-border-radius:4px;
+ color:#FFFFFF;
+ font-size:12px;
+ margin:0px 30px;
+ padding:2px 0px;
+}
+
+.event.listening {
+ background-color:#333333;
+ display:block;
+}
+
+.event.received {
+ background-color:#4B946A;
+ display:none;
+}
+
+@keyframes fade {
+ from { opacity: 1.0; }
+ 50% { opacity: 0.4; }
+ to { opacity: 1.0; }
+}
+
+@-webkit-keyframes fade {
+ from { opacity: 1.0; }
+ 50% { opacity: 0.4; }
+ to { opacity: 1.0; }
+}
+
+.blink {
+ animation:fade 3000ms infinite;
+ -webkit-animation:fade 3000ms infinite;
+}
diff --git a/app/platforms/browser/img/logo.png b/app/platforms/browser/img/logo.png
new file mode 100644
index 0000000..9519e7d
Binary files /dev/null and b/app/platforms/browser/img/logo.png differ
diff --git a/app/platforms/browser/index.html b/app/platforms/browser/index.html
new file mode 100644
index 0000000..bde5741
--- /dev/null
+++ b/app/platforms/browser/index.html
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+ Hello World
+
+
+
+
Apache Cordova
+
+
Connecting to Device
+
Device is Ready
+
+
+
+
+
+
+
diff --git a/app/platforms/browser/js/index.js b/app/platforms/browser/js/index.js
new file mode 100644
index 0000000..31d9064
--- /dev/null
+++ b/app/platforms/browser/js/index.js
@@ -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.
+ */
+var app = {
+ // Application Constructor
+ initialize: function() {
+ this.bindEvents();
+ },
+ // Bind Event Listeners
+ //
+ // Bind any events that are required on startup. Common events are:
+ // 'load', 'deviceready', 'offline', and 'online'.
+ bindEvents: function() {
+ document.addEventListener('deviceready', this.onDeviceReady, false);
+ },
+ // deviceready Event Handler
+ //
+ // The scope of 'this' is the event. In order to call the 'receivedEvent'
+ // function, we must explicity call 'app.receivedEvent(...);'
+ onDeviceReady: function() {
+ app.receivedEvent('deviceready');
+ },
+ // Update DOM on a Received Event
+ receivedEvent: function(id) {
+ var parentElement = document.getElementById(id);
+ var listeningElement = parentElement.querySelector('.listening');
+ var receivedElement = parentElement.querySelector('.received');
+
+ listeningElement.setAttribute('style', 'display:none;');
+ receivedElement.setAttribute('style', 'display:block;');
+
+ console.log('Received Event: ' + id);
+ }
+};
diff --git a/app/platforms/browser/manifest.webapp b/app/platforms/browser/manifest.webapp
new file mode 100644
index 0000000..f24deb8
--- /dev/null
+++ b/app/platforms/browser/manifest.webapp
@@ -0,0 +1,10 @@
+{
+ "name": "My App",
+ "description": "Description of your app",
+ "launch_path": "/index.html",
+ "icons": {
+ "128": "/img/logo.png"
+ },
+ "default_locale": "en",
+ "type": "privileged"
+}
\ No newline at end of file
diff --git a/app/platforms/browser/platform_www/confighelper.js b/app/platforms/browser/platform_www/confighelper.js
new file mode 100644
index 0000000..b6d606e
--- /dev/null
+++ b/app/platforms/browser/platform_www/confighelper.js
@@ -0,0 +1,95 @@
+/*
+ *
+ * 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 config;
+
+function Config(xhr) {
+ function loadPreferences(xhr) {
+ var parser = new DOMParser();
+ var doc = parser.parseFromString(xhr.responseText, "application/xml");
+
+ var preferences = doc.getElementsByTagName("preference");
+ return Array.prototype.slice.call(preferences);
+ }
+
+ this.xhr = xhr;
+ this.preferences = loadPreferences(this.xhr);
+}
+
+function readConfig(success, error) {
+ var xhr;
+
+ if(typeof config != 'undefined') {
+ success(config);
+ }
+
+ function fail(msg) {
+ console.error(msg);
+
+ if(error) {
+ error(msg);
+ }
+ }
+
+ var xhrStatusChangeHandler = function() {
+ if (xhr.readyState == 4) {
+ if (xhr.status == 200 || xhr.status == 304 || xhr.status === 0 /* file:// */) {
+ config = new Config(xhr);
+ success(config);
+ }
+ else {
+ fail('[Browser][cordova.js][xhrStatusChangeHandler] Could not XHR config.xml: ' + xhr.statusText);
+ }
+ }
+ };
+
+ if ("ActiveXObject" in window) {
+ // Needed for XHR-ing via file:// protocol in IE
+ xhr = new window.ActiveXObject("MSXML2.XMLHTTP");
+ xhr.onreadystatechange = xhrStatusChangeHandler;
+ } else {
+ xhr = new XMLHttpRequest();
+ xhr.addEventListener("load", xhrStatusChangeHandler);
+ }
+
+ try {
+ xhr.open("get", "/config.xml", true);
+ xhr.send();
+ } catch(e) {
+ fail('[Browser][cordova.js][readConfig] Could not XHR config.xml: ' + JSON.stringify(e));
+ }
+}
+
+/**
+ * Reads a preference value from config.xml.
+ * Returns preference value or undefined if it does not exist.
+ * @param {String} preferenceName Preference name to read */
+Config.prototype.getPreferenceValue = function getPreferenceValue(preferenceName) {
+ var preferenceItem = this.preferences && this.preferences.filter(function(item) {
+ return item.attributes.name && item.attributes.name.value === preferenceName;
+ });
+
+ if(preferenceItem && preferenceItem[0] && preferenceItem[0].attributes && preferenceItem[0].attributes.value) {
+ return preferenceItem[0].attributes.value.value;
+ }
+};
+
+exports.readConfig = readConfig;
diff --git a/app/platforms/browser/platform_www/cordova-js-src/confighelper.js b/app/platforms/browser/platform_www/cordova-js-src/confighelper.js
new file mode 100644
index 0000000..b6d606e
--- /dev/null
+++ b/app/platforms/browser/platform_www/cordova-js-src/confighelper.js
@@ -0,0 +1,95 @@
+/*
+ *
+ * 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 config;
+
+function Config(xhr) {
+ function loadPreferences(xhr) {
+ var parser = new DOMParser();
+ var doc = parser.parseFromString(xhr.responseText, "application/xml");
+
+ var preferences = doc.getElementsByTagName("preference");
+ return Array.prototype.slice.call(preferences);
+ }
+
+ this.xhr = xhr;
+ this.preferences = loadPreferences(this.xhr);
+}
+
+function readConfig(success, error) {
+ var xhr;
+
+ if(typeof config != 'undefined') {
+ success(config);
+ }
+
+ function fail(msg) {
+ console.error(msg);
+
+ if(error) {
+ error(msg);
+ }
+ }
+
+ var xhrStatusChangeHandler = function() {
+ if (xhr.readyState == 4) {
+ if (xhr.status == 200 || xhr.status == 304 || xhr.status === 0 /* file:// */) {
+ config = new Config(xhr);
+ success(config);
+ }
+ else {
+ fail('[Browser][cordova.js][xhrStatusChangeHandler] Could not XHR config.xml: ' + xhr.statusText);
+ }
+ }
+ };
+
+ if ("ActiveXObject" in window) {
+ // Needed for XHR-ing via file:// protocol in IE
+ xhr = new window.ActiveXObject("MSXML2.XMLHTTP");
+ xhr.onreadystatechange = xhrStatusChangeHandler;
+ } else {
+ xhr = new XMLHttpRequest();
+ xhr.addEventListener("load", xhrStatusChangeHandler);
+ }
+
+ try {
+ xhr.open("get", "/config.xml", true);
+ xhr.send();
+ } catch(e) {
+ fail('[Browser][cordova.js][readConfig] Could not XHR config.xml: ' + JSON.stringify(e));
+ }
+}
+
+/**
+ * Reads a preference value from config.xml.
+ * Returns preference value or undefined if it does not exist.
+ * @param {String} preferenceName Preference name to read */
+Config.prototype.getPreferenceValue = function getPreferenceValue(preferenceName) {
+ var preferenceItem = this.preferences && this.preferences.filter(function(item) {
+ return item.attributes.name && item.attributes.name.value === preferenceName;
+ });
+
+ if(preferenceItem && preferenceItem[0] && preferenceItem[0].attributes && preferenceItem[0].attributes.value) {
+ return preferenceItem[0].attributes.value.value;
+ }
+};
+
+exports.readConfig = readConfig;
diff --git a/app/platforms/browser/platform_www/cordova-js-src/exec.js b/app/platforms/browser/platform_www/cordova-js-src/exec.js
new file mode 100644
index 0000000..97f736a
--- /dev/null
+++ b/app/platforms/browser/platform_www/cordova-js-src/exec.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.
+ *
+*/
+
+/*jslint sloppy:true, plusplus:true*/
+/*global require, module, console */
+
+var cordova = require('cordova');
+var execProxy = require('cordova/exec/proxy');
+
+/**
+ * Execute a cordova command. It is up to the native side whether this action
+ * is synchronous or asynchronous. The native side can return:
+ * Synchronous: PluginResult object as a JSON string
+ * Asynchronous: Empty string ""
+ * If async, the native side will cordova.callbackSuccess or cordova.callbackError,
+ * depending upon the result of the action.
+ *
+ * @param {Function} success The success callback
+ * @param {Function} fail The fail callback
+ * @param {String} service The name of the service to use
+ * @param {String} action Action to be run in cordova
+ * @param {String[]} [args] Zero or more arguments to pass to the method
+ */
+module.exports = function (success, fail, service, action, args) {
+
+ var proxy = execProxy.get(service, action);
+
+ args = args || [];
+
+ if (proxy) {
+
+ var callbackId = service + cordova.callbackId++;
+
+ if (typeof success === "function" || typeof fail === "function") {
+ cordova.callbacks[callbackId] = {success: success, fail: fail};
+ }
+ try {
+
+
+
+ // callbackOptions param represents additional optional parameters command could pass back, like keepCallback or
+ // custom callbackId, for example {callbackId: id, keepCallback: true, status: cordova.callbackStatus.JSON_EXCEPTION }
+ var onSuccess = function (result, callbackOptions) {
+ callbackOptions = callbackOptions || {};
+ var callbackStatus;
+ // covering both undefined and null.
+ // strict null comparison was causing callbackStatus to be undefined
+ // and then no callback was called because of the check in cordova.callbackFromNative
+ // see CB-8996 Mobilespec app hang on windows
+ if (callbackOptions.status !== undefined && callbackOptions.status !== null) {
+ callbackStatus = callbackOptions.status;
+ }
+ else {
+ callbackStatus = cordova.callbackStatus.OK;
+ }
+ cordova.callbackSuccess(callbackOptions.callbackId || callbackId,
+ {
+ status: callbackStatus,
+ message: result,
+ keepCallback: callbackOptions.keepCallback || false
+ });
+ };
+ var onError = function (err, callbackOptions) {
+ callbackOptions = callbackOptions || {};
+ var callbackStatus;
+ // covering both undefined and null.
+ // strict null comparison was causing callbackStatus to be undefined
+ // and then no callback was called because of the check in cordova.callbackFromNative
+ // note: status can be 0
+ if (callbackOptions.status !== undefined && callbackOptions.status !== null) {
+ callbackStatus = callbackOptions.status;
+ }
+ else {
+ callbackStatus = cordova.callbackStatus.OK;
+ }
+ cordova.callbackError(callbackOptions.callbackId || callbackId,
+ {
+ status: callbackStatus,
+ message: err,
+ keepCallback: callbackOptions.keepCallback || false
+ });
+ };
+ proxy(onSuccess, onError, args);
+
+ } catch (e) {
+ console.log("Exception calling native with command :: " + service + " :: " + action + " ::exception=" + e);
+ }
+ } else {
+
+ console.log("Error: exec proxy not found for :: " + service + " :: " + action);
+
+ if(typeof fail === "function" ) {
+ fail("Missing Command Error");
+ }
+ }
+};
diff --git a/app/platforms/browser/platform_www/cordova-js-src/platform.js b/app/platforms/browser/platform_www/cordova-js-src/platform.js
new file mode 100644
index 0000000..0514059
--- /dev/null
+++ b/app/platforms/browser/platform_www/cordova-js-src/platform.js
@@ -0,0 +1,48 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+module.exports = {
+ id: 'browser',
+ cordovaVersion: '3.4.0',
+
+ bootstrap: function() {
+
+ var modulemapper = require('cordova/modulemapper');
+ var channel = require('cordova/channel');
+
+ modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy');
+
+ channel.onNativeReady.fire();
+
+ // FIXME is this the right place to clobber pause/resume? I am guessing not
+ // FIXME pause/resume should be deprecated IN CORDOVA for pagevisiblity api
+ document.addEventListener('webkitvisibilitychange', function() {
+ if (document.webkitHidden) {
+ channel.onPause.fire();
+ }
+ else {
+ channel.onResume.fire();
+ }
+ }, false);
+
+ // End of bootstrap
+ }
+};
diff --git a/app/platforms/browser/platform_www/cordova.js b/app/platforms/browser/platform_www/cordova.js
new file mode 100644
index 0000000..80ad302
--- /dev/null
+++ b/app/platforms/browser/platform_www/cordova.js
@@ -0,0 +1,1863 @@
+// Platform: browser
+// c517ca811b4948b630e0b74dbae6c9637939da24
+/*
+ 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() {
+var PLATFORM_VERSION_BUILD_LABEL = '4.1.0';
+// file: src/scripts/require.js
+
+/*jshint -W079 */
+/*jshint -W020 */
+
+var require,
+ define;
+
+(function () {
+ var modules = {},
+ // Stack of moduleIds currently being built.
+ requireStack = [],
+ // Map of module ID -> index into requireStack of modules currently being built.
+ inProgressModules = {},
+ SEPARATOR = ".";
+
+
+
+ function build(module) {
+ var factory = module.factory,
+ localRequire = function (id) {
+ var resultantId = id;
+ //Its a relative path, so lop off the last portion and add the id (minus "./")
+ if (id.charAt(0) === ".") {
+ resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2);
+ }
+ return require(resultantId);
+ };
+ module.exports = {};
+ delete module.factory;
+ factory(localRequire, module.exports, module);
+ return module.exports;
+ }
+
+ require = function (id) {
+ if (!modules[id]) {
+ throw "module " + id + " not found";
+ } else if (id in inProgressModules) {
+ var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id;
+ throw "Cycle in require graph: " + cycle;
+ }
+ if (modules[id].factory) {
+ try {
+ inProgressModules[id] = requireStack.length;
+ requireStack.push(id);
+ return build(modules[id]);
+ } finally {
+ delete inProgressModules[id];
+ requireStack.pop();
+ }
+ }
+ return modules[id].exports;
+ };
+
+ define = function (id, factory) {
+ if (modules[id]) {
+ throw "module " + id + " already defined";
+ }
+
+ modules[id] = {
+ id: id,
+ factory: factory
+ };
+ };
+
+ define.remove = function (id) {
+ delete modules[id];
+ };
+
+ define.moduleMap = modules;
+})();
+
+//Export for use in node
+if (typeof module === "object" && typeof require === "function") {
+ module.exports.require = require;
+ module.exports.define = define;
+}
+
+// file: src/cordova.js
+define("cordova", function(require, exports, module) {
+
+// Workaround for Windows 10 in hosted environment case
+// http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object
+if (window.cordova && !(window.cordova instanceof HTMLElement)) {
+ throw new Error("cordova already defined");
+}
+
+
+var channel = require('cordova/channel');
+var platform = require('cordova/platform');
+
+
+/**
+ * Intercept calls to addEventListener + removeEventListener and handle deviceready,
+ * resume, and pause events.
+ */
+var m_document_addEventListener = document.addEventListener;
+var m_document_removeEventListener = document.removeEventListener;
+var m_window_addEventListener = window.addEventListener;
+var m_window_removeEventListener = window.removeEventListener;
+
+/**
+ * Houses custom event handlers to intercept on document + window event listeners.
+ */
+var documentEventHandlers = {},
+ windowEventHandlers = {};
+
+document.addEventListener = function(evt, handler, capture) {
+ var e = evt.toLowerCase();
+ if (typeof documentEventHandlers[e] != 'undefined') {
+ documentEventHandlers[e].subscribe(handler);
+ } else {
+ m_document_addEventListener.call(document, evt, handler, capture);
+ }
+};
+
+window.addEventListener = function(evt, handler, capture) {
+ var e = evt.toLowerCase();
+ if (typeof windowEventHandlers[e] != 'undefined') {
+ windowEventHandlers[e].subscribe(handler);
+ } else {
+ m_window_addEventListener.call(window, evt, handler, capture);
+ }
+};
+
+document.removeEventListener = function(evt, handler, capture) {
+ var e = evt.toLowerCase();
+ // If unsubscribing from an event that is handled by a plugin
+ if (typeof documentEventHandlers[e] != "undefined") {
+ documentEventHandlers[e].unsubscribe(handler);
+ } else {
+ m_document_removeEventListener.call(document, evt, handler, capture);
+ }
+};
+
+window.removeEventListener = function(evt, handler, capture) {
+ var e = evt.toLowerCase();
+ // If unsubscribing from an event that is handled by a plugin
+ if (typeof windowEventHandlers[e] != "undefined") {
+ windowEventHandlers[e].unsubscribe(handler);
+ } else {
+ m_window_removeEventListener.call(window, evt, handler, capture);
+ }
+};
+
+function createEvent(type, data) {
+ var event = document.createEvent('Events');
+ event.initEvent(type, false, false);
+ if (data) {
+ for (var i in data) {
+ if (data.hasOwnProperty(i)) {
+ event[i] = data[i];
+ }
+ }
+ }
+ return event;
+}
+
+
+var cordova = {
+ define:define,
+ require:require,
+ version:PLATFORM_VERSION_BUILD_LABEL,
+ platformVersion:PLATFORM_VERSION_BUILD_LABEL,
+ platformId:platform.id,
+ /**
+ * Methods to add/remove your own addEventListener hijacking on document + window.
+ */
+ addWindowEventHandler:function(event) {
+ return (windowEventHandlers[event] = channel.create(event));
+ },
+ addStickyDocumentEventHandler:function(event) {
+ return (documentEventHandlers[event] = channel.createSticky(event));
+ },
+ addDocumentEventHandler:function(event) {
+ return (documentEventHandlers[event] = channel.create(event));
+ },
+ removeWindowEventHandler:function(event) {
+ delete windowEventHandlers[event];
+ },
+ removeDocumentEventHandler:function(event) {
+ delete documentEventHandlers[event];
+ },
+ /**
+ * Retrieve original event handlers that were replaced by Cordova
+ *
+ * @return object
+ */
+ getOriginalHandlers: function() {
+ return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener},
+ 'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}};
+ },
+ /**
+ * Method to fire event from native code
+ * bNoDetach is required for events which cause an exception which needs to be caught in native code
+ */
+ fireDocumentEvent: function(type, data, bNoDetach) {
+ var evt = createEvent(type, data);
+ if (typeof documentEventHandlers[type] != 'undefined') {
+ if( bNoDetach ) {
+ documentEventHandlers[type].fire(evt);
+ }
+ else {
+ setTimeout(function() {
+ // Fire deviceready on listeners that were registered before cordova.js was loaded.
+ if (type == 'deviceready') {
+ document.dispatchEvent(evt);
+ }
+ documentEventHandlers[type].fire(evt);
+ }, 0);
+ }
+ } else {
+ document.dispatchEvent(evt);
+ }
+ },
+ fireWindowEvent: function(type, data) {
+ var evt = createEvent(type,data);
+ if (typeof windowEventHandlers[type] != 'undefined') {
+ setTimeout(function() {
+ windowEventHandlers[type].fire(evt);
+ }, 0);
+ } else {
+ window.dispatchEvent(evt);
+ }
+ },
+
+ /**
+ * Plugin callback mechanism.
+ */
+ // Randomize the starting callbackId to avoid collisions after refreshing or navigating.
+ // This way, it's very unlikely that any new callback would get the same callbackId as an old callback.
+ callbackId: Math.floor(Math.random() * 2000000000),
+ callbacks: {},
+ callbackStatus: {
+ NO_RESULT: 0,
+ OK: 1,
+ CLASS_NOT_FOUND_EXCEPTION: 2,
+ ILLEGAL_ACCESS_EXCEPTION: 3,
+ INSTANTIATION_EXCEPTION: 4,
+ MALFORMED_URL_EXCEPTION: 5,
+ IO_EXCEPTION: 6,
+ INVALID_ACTION: 7,
+ JSON_EXCEPTION: 8,
+ ERROR: 9
+ },
+
+ /**
+ * Called by native code when returning successful result from an action.
+ */
+ callbackSuccess: function(callbackId, args) {
+ cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback);
+ },
+
+ /**
+ * Called by native code when returning error result from an action.
+ */
+ callbackError: function(callbackId, args) {
+ // TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative.
+ // Derive success from status.
+ cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback);
+ },
+
+ /**
+ * Called by native code when returning the result from an action.
+ */
+ callbackFromNative: function(callbackId, isSuccess, status, args, keepCallback) {
+ try {
+ var callback = cordova.callbacks[callbackId];
+ if (callback) {
+ if (isSuccess && status == cordova.callbackStatus.OK) {
+ callback.success && callback.success.apply(null, args);
+ } else if (!isSuccess) {
+ callback.fail && callback.fail.apply(null, args);
+ }
+ /*
+ else
+ Note, this case is intentionally not caught.
+ this can happen if isSuccess is true, but callbackStatus is NO_RESULT
+ which is used to remove a callback from the list without calling the callbacks
+ typically keepCallback is false in this case
+ */
+ // Clear callback if not expecting any more results
+ if (!keepCallback) {
+ delete cordova.callbacks[callbackId];
+ }
+ }
+ }
+ catch (err) {
+ var msg = "Error in " + (isSuccess ? "Success" : "Error") + " callbackId: " + callbackId + " : " + err;
+ console && console.log && console.log(msg);
+ cordova.fireWindowEvent("cordovacallbackerror", { 'message': msg });
+ throw err;
+ }
+ },
+ addConstructor: function(func) {
+ channel.onCordovaReady.subscribe(function() {
+ try {
+ func();
+ } catch(e) {
+ console.log("Failed to run constructor: " + e);
+ }
+ });
+ }
+};
+
+
+module.exports = cordova;
+
+});
+
+// file: src/common/argscheck.js
+define("cordova/argscheck", function(require, exports, module) {
+
+var utils = require('cordova/utils');
+
+var moduleExports = module.exports;
+
+var typeMap = {
+ 'A': 'Array',
+ 'D': 'Date',
+ 'N': 'Number',
+ 'S': 'String',
+ 'F': 'Function',
+ 'O': 'Object'
+};
+
+function extractParamName(callee, argIndex) {
+ return (/.*?\((.*?)\)/).exec(callee)[1].split(', ')[argIndex];
+}
+
+function checkArgs(spec, functionName, args, opt_callee) {
+ if (!moduleExports.enableChecks) {
+ return;
+ }
+ var errMsg = null;
+ var typeName;
+ for (var i = 0; i < spec.length; ++i) {
+ var c = spec.charAt(i),
+ cUpper = c.toUpperCase(),
+ arg = args[i];
+ // Asterix means allow anything.
+ if (c == '*') {
+ continue;
+ }
+ typeName = utils.typeName(arg);
+ if ((arg === null || arg === undefined) && c == cUpper) {
+ continue;
+ }
+ if (typeName != typeMap[cUpper]) {
+ errMsg = 'Expected ' + typeMap[cUpper];
+ break;
+ }
+ }
+ if (errMsg) {
+ errMsg += ', but got ' + typeName + '.';
+ errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg;
+ // Don't log when running unit tests.
+ if (typeof jasmine == 'undefined') {
+ console.error(errMsg);
+ }
+ throw TypeError(errMsg);
+ }
+}
+
+function getValue(value, defaultValue) {
+ return value === undefined ? defaultValue : value;
+}
+
+moduleExports.checkArgs = checkArgs;
+moduleExports.getValue = getValue;
+moduleExports.enableChecks = true;
+
+
+});
+
+// file: src/common/base64.js
+define("cordova/base64", function(require, exports, module) {
+
+var base64 = exports;
+
+base64.fromArrayBuffer = function(arrayBuffer) {
+ var array = new Uint8Array(arrayBuffer);
+ return uint8ToBase64(array);
+};
+
+base64.toArrayBuffer = function(str) {
+ var decodedStr = typeof atob != 'undefined' ? atob(str) : new Buffer(str,'base64').toString('binary');
+ var arrayBuffer = new ArrayBuffer(decodedStr.length);
+ var array = new Uint8Array(arrayBuffer);
+ for (var i=0, len=decodedStr.length; i < len; i++) {
+ array[i] = decodedStr.charCodeAt(i);
+ }
+ return arrayBuffer;
+};
+
+//------------------------------------------------------------------------------
+
+/* This code is based on the performance tests at http://jsperf.com/b64tests
+ * This 12-bit-at-a-time algorithm was the best performing version on all
+ * platforms tested.
+ */
+
+var b64_6bit = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+var b64_12bit;
+
+var b64_12bitTable = function() {
+ b64_12bit = [];
+ for (var i=0; i<64; i++) {
+ for (var j=0; j<64; j++) {
+ b64_12bit[i*64+j] = b64_6bit[i] + b64_6bit[j];
+ }
+ }
+ b64_12bitTable = function() { return b64_12bit; };
+ return b64_12bit;
+};
+
+function uint8ToBase64(rawData) {
+ var numBytes = rawData.byteLength;
+ var output="";
+ var segment;
+ var table = b64_12bitTable();
+ for (var i=0;i> 12];
+ output += table[segment & 0xfff];
+ }
+ if (numBytes - i == 2) {
+ segment = (rawData[i] << 16) + (rawData[i+1] << 8);
+ output += table[segment >> 12];
+ output += b64_6bit[(segment & 0xfff) >> 6];
+ output += '=';
+ } else if (numBytes - i == 1) {
+ segment = (rawData[i] << 16);
+ output += table[segment >> 12];
+ output += '==';
+ }
+ return output;
+}
+
+});
+
+// file: src/common/builder.js
+define("cordova/builder", function(require, exports, module) {
+
+var utils = require('cordova/utils');
+
+function each(objects, func, context) {
+ for (var prop in objects) {
+ if (objects.hasOwnProperty(prop)) {
+ func.apply(context, [objects[prop], prop]);
+ }
+ }
+}
+
+function clobber(obj, key, value) {
+ exports.replaceHookForTesting(obj, key);
+ var needsProperty = false;
+ try {
+ obj[key] = value;
+ } catch (e) {
+ needsProperty = true;
+ }
+ // Getters can only be overridden by getters.
+ if (needsProperty || obj[key] !== value) {
+ utils.defineGetter(obj, key, function() {
+ return value;
+ });
+ }
+}
+
+function assignOrWrapInDeprecateGetter(obj, key, value, message) {
+ if (message) {
+ utils.defineGetter(obj, key, function() {
+ console.log(message);
+ delete obj[key];
+ clobber(obj, key, value);
+ return value;
+ });
+ } else {
+ clobber(obj, key, value);
+ }
+}
+
+function include(parent, objects, clobber, merge) {
+ each(objects, function (obj, key) {
+ try {
+ var result = obj.path ? require(obj.path) : {};
+
+ if (clobber) {
+ // Clobber if it doesn't exist.
+ if (typeof parent[key] === 'undefined') {
+ assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
+ } else if (typeof obj.path !== 'undefined') {
+ // If merging, merge properties onto parent, otherwise, clobber.
+ if (merge) {
+ recursiveMerge(parent[key], result);
+ } else {
+ assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
+ }
+ }
+ result = parent[key];
+ } else {
+ // Overwrite if not currently defined.
+ if (typeof parent[key] == 'undefined') {
+ assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
+ } else {
+ // Set result to what already exists, so we can build children into it if they exist.
+ result = parent[key];
+ }
+ }
+
+ if (obj.children) {
+ include(result, obj.children, clobber, merge);
+ }
+ } catch(e) {
+ utils.alert('Exception building Cordova JS globals: ' + e + ' for key "' + key + '"');
+ }
+ });
+}
+
+/**
+ * Merge properties from one object onto another recursively. Properties from
+ * the src object will overwrite existing target property.
+ *
+ * @param target Object to merge properties into.
+ * @param src Object to merge properties from.
+ */
+function recursiveMerge(target, src) {
+ for (var prop in src) {
+ if (src.hasOwnProperty(prop)) {
+ if (target.prototype && target.prototype.constructor === target) {
+ // If the target object is a constructor override off prototype.
+ clobber(target.prototype, prop, src[prop]);
+ } else {
+ if (typeof src[prop] === 'object' && typeof target[prop] === 'object') {
+ recursiveMerge(target[prop], src[prop]);
+ } else {
+ clobber(target, prop, src[prop]);
+ }
+ }
+ }
+ }
+}
+
+exports.buildIntoButDoNotClobber = function(objects, target) {
+ include(target, objects, false, false);
+};
+exports.buildIntoAndClobber = function(objects, target) {
+ include(target, objects, true, false);
+};
+exports.buildIntoAndMerge = function(objects, target) {
+ include(target, objects, true, true);
+};
+exports.recursiveMerge = recursiveMerge;
+exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter;
+exports.replaceHookForTesting = function() {};
+
+});
+
+// file: src/common/channel.js
+define("cordova/channel", function(require, exports, module) {
+
+var utils = require('cordova/utils'),
+ nextGuid = 1;
+
+/**
+ * Custom pub-sub "channel" that can have functions subscribed to it
+ * This object is used to define and control firing of events for
+ * cordova initialization, as well as for custom events thereafter.
+ *
+ * The order of events during page load and Cordova startup is as follows:
+ *
+ * onDOMContentLoaded* Internal event that is received when the web page is loaded and parsed.
+ * onNativeReady* Internal event that indicates the Cordova native side is ready.
+ * onCordovaReady* Internal event fired when all Cordova JavaScript objects have been created.
+ * onDeviceReady* User event fired to indicate that Cordova is ready
+ * onResume User event fired to indicate a start/resume lifecycle event
+ * onPause User event fired to indicate a pause lifecycle event
+ *
+ * The events marked with an * are sticky. Once they have fired, they will stay in the fired state.
+ * All listeners that subscribe after the event is fired will be executed right away.
+ *
+ * The only Cordova events that user code should register for are:
+ * deviceready Cordova native code is initialized and Cordova APIs can be called from JavaScript
+ * pause App has moved to background
+ * resume App has returned to foreground
+ *
+ * Listeners can be registered as:
+ * document.addEventListener("deviceready", myDeviceReadyListener, false);
+ * document.addEventListener("resume", myResumeListener, false);
+ * document.addEventListener("pause", myPauseListener, false);
+ *
+ * The DOM lifecycle events should be used for saving and restoring state
+ * window.onload
+ * window.onunload
+ *
+ */
+
+/**
+ * Channel
+ * @constructor
+ * @param type String the channel name
+ */
+var Channel = function(type, sticky) {
+ this.type = type;
+ // Map of guid -> function.
+ this.handlers = {};
+ // 0 = Non-sticky, 1 = Sticky non-fired, 2 = Sticky fired.
+ this.state = sticky ? 1 : 0;
+ // Used in sticky mode to remember args passed to fire().
+ this.fireArgs = null;
+ // Used by onHasSubscribersChange to know if there are any listeners.
+ this.numHandlers = 0;
+ // Function that is called when the first listener is subscribed, or when
+ // the last listener is unsubscribed.
+ this.onHasSubscribersChange = null;
+},
+ channel = {
+ /**
+ * Calls the provided function only after all of the channels specified
+ * have been fired. All channels must be sticky channels.
+ */
+ join: function(h, c) {
+ var len = c.length,
+ i = len,
+ f = function() {
+ if (!(--i)) h();
+ };
+ for (var j=0; j
+ if (strategy == 'r') {
+ continue;
+ }
+ var symbolPath = symbolList[i + 2];
+ var lastDot = symbolPath.lastIndexOf('.');
+ var namespace = symbolPath.substr(0, lastDot);
+ var lastName = symbolPath.substr(lastDot + 1);
+
+ var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
+ var parentObj = prepareNamespace(namespace, context);
+ var target = parentObj[lastName];
+
+ if (strategy == 'm' && target) {
+ builder.recursiveMerge(target, module);
+ } else if ((strategy == 'd' && !target) || (strategy != 'd')) {
+ if (!(symbolPath in origSymbols)) {
+ origSymbols[symbolPath] = target;
+ }
+ builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
+ }
+ }
+};
+
+exports.getOriginalSymbol = function(context, symbolPath) {
+ var origSymbols = context.CDV_origSymbols;
+ if (origSymbols && (symbolPath in origSymbols)) {
+ return origSymbols[symbolPath];
+ }
+ var parts = symbolPath.split('.');
+ var obj = context;
+ for (var i = 0; i < parts.length; ++i) {
+ obj = obj && obj[parts[i]];
+ }
+ return obj;
+};
+
+exports.reset();
+
+
+});
+
+// file: src/common/modulemapper_b.js
+define("cordova/modulemapper_b", function(require, exports, module) {
+
+var builder = require('cordova/builder'),
+ symbolList = [],
+ deprecationMap;
+
+exports.reset = function() {
+ symbolList = [];
+ deprecationMap = {};
+};
+
+function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) {
+ symbolList.push(strategy, moduleName, symbolPath);
+ if (opt_deprecationMessage) {
+ deprecationMap[symbolPath] = opt_deprecationMessage;
+ }
+}
+
+// Note: Android 2.3 does have Function.bind().
+exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.runs = function(moduleName) {
+ addEntry('r', moduleName, null);
+};
+
+function prepareNamespace(symbolPath, context) {
+ if (!symbolPath) {
+ return context;
+ }
+ var parts = symbolPath.split('.');
+ var cur = context;
+ for (var i = 0, part; part = parts[i]; ++i) {
+ cur = cur[part] = cur[part] || {};
+ }
+ return cur;
+}
+
+exports.mapModules = function(context) {
+ var origSymbols = {};
+ context.CDV_origSymbols = origSymbols;
+ for (var i = 0, len = symbolList.length; i < len; i += 3) {
+ var strategy = symbolList[i];
+ var moduleName = symbolList[i + 1];
+ var module = require(moduleName);
+ //
+ if (strategy == 'r') {
+ continue;
+ }
+ var symbolPath = symbolList[i + 2];
+ var lastDot = symbolPath.lastIndexOf('.');
+ var namespace = symbolPath.substr(0, lastDot);
+ var lastName = symbolPath.substr(lastDot + 1);
+
+ var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
+ var parentObj = prepareNamespace(namespace, context);
+ var target = parentObj[lastName];
+
+ if (strategy == 'm' && target) {
+ builder.recursiveMerge(target, module);
+ } else if ((strategy == 'd' && !target) || (strategy != 'd')) {
+ if (!(symbolPath in origSymbols)) {
+ origSymbols[symbolPath] = target;
+ }
+ builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
+ }
+ }
+};
+
+exports.getOriginalSymbol = function(context, symbolPath) {
+ var origSymbols = context.CDV_origSymbols;
+ if (origSymbols && (symbolPath in origSymbols)) {
+ return origSymbols[symbolPath];
+ }
+ var parts = symbolPath.split('.');
+ var obj = context;
+ for (var i = 0; i < parts.length; ++i) {
+ obj = obj && obj[parts[i]];
+ }
+ return obj;
+};
+
+exports.reset();
+
+
+});
+
+// file: e:/cordova/cordova-browser/cordova-js-src/platform.js
+define("cordova/platform", function(require, exports, module) {
+
+module.exports = {
+ id: 'browser',
+ cordovaVersion: '3.4.0',
+
+ bootstrap: function() {
+
+ var modulemapper = require('cordova/modulemapper');
+ var channel = require('cordova/channel');
+
+ modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy');
+
+ channel.onNativeReady.fire();
+
+ // FIXME is this the right place to clobber pause/resume? I am guessing not
+ // FIXME pause/resume should be deprecated IN CORDOVA for pagevisiblity api
+ document.addEventListener('webkitvisibilitychange', function() {
+ if (document.webkitHidden) {
+ channel.onPause.fire();
+ }
+ else {
+ channel.onResume.fire();
+ }
+ }, false);
+
+ // End of bootstrap
+ }
+};
+
+});
+
+// file: src/common/pluginloader.js
+define("cordova/pluginloader", function(require, exports, module) {
+
+var modulemapper = require('cordova/modulemapper');
+var urlutil = require('cordova/urlutil');
+
+// Helper function to inject a
+
+