Alexainc commited on
Commit ·
459c2fd
0
Parent(s):
VILLAGE FESTIVAL 2026: Telegram Integration & Leaderboards
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .env.example +8 -0
- .gitattributes +3 -0
- .gitignore +8 -0
- Dockerfile +18 -0
- apk_tree.txt +0 -0
- assets/www/c2runtime.js +0 -0
- assets/www/cordova-js-src/android/nativeapiprovider.js +36 -0
- assets/www/cordova-js-src/android/promptbasednativeapi.js +35 -0
- assets/www/cordova-js-src/exec.js +286 -0
- assets/www/cordova-js-src/platform.js +125 -0
- assets/www/cordova-js-src/plugin/android/app.js +108 -0
- assets/www/cordova.js +1935 -0
- assets/www/cordova_plugins.js +202 -0
- assets/www/data.js +0 -0
- assets/www/icon-144.png +3 -0
- assets/www/icon-192.png +3 -0
- assets/www/icon-36.png +3 -0
- assets/www/icon-48.png +3 -0
- assets/www/icon-72.png +3 -0
- assets/www/icon-96.png +3 -0
- assets/www/images/aliahamark-sheet0.png +3 -0
- assets/www/images/bar-sheet0.png +3 -0
- assets/www/images/blackboard-sheet0.png +3 -0
- assets/www/images/blackscreen-sheet0.png +3 -0
- assets/www/images/brnlangsi-sheet0.png +3 -0
- assets/www/images/btnattack-sheet0.png +3 -0
- assets/www/images/btnbethigh-sheet0.png +3 -0
- assets/www/images/btnbethighsi-sheet0.png +3 -0
- assets/www/images/btnbetlow-sheet0.png +3 -0
- assets/www/images/btnbetlowsi-sheet0.png +3 -0
- assets/www/images/btncontinue-sheet0.png +3 -0
- assets/www/images/btncontinuesi-sheet0.png +3 -0
- assets/www/images/btncover-sheet0.png +3 -0
- assets/www/images/btneasy-sheet0.png +3 -0
- assets/www/images/btneasysi-sheet0.png +3 -0
- assets/www/images/btnendgame-sheet0.png +3 -0
- assets/www/images/btnfacebook-sheet0.png +3 -0
- assets/www/images/btnfbdontshare-sheet0.png +3 -0
- assets/www/images/btnfbshare-sheet0.png +3 -0
- assets/www/images/btnguess-sheet0.png +3 -0
- assets/www/images/btnguesssi-sheet0.png +3 -0
- assets/www/images/btnhard-sheet0.png +3 -0
- assets/www/images/btnhardsi-sheet0.png +3 -0
- assets/www/images/btnlangen-sheet0.png +3 -0
- assets/www/images/btnletsplay-sheet0.png +3 -0
- assets/www/images/btnletsplaysi-sheet0.png +3 -0
- assets/www/images/btnmathcombat-sheet0.png +3 -0
- assets/www/images/btnpause-sheet0.png +3 -0
- assets/www/images/btnplay-sheet0.png +3 -0
- assets/www/images/btnpullen-sheet0.png +3 -0
.env.example
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Telegram Bot Token
|
| 2 |
+
BOT_TOKEN=7844002660:AAH8N_0z6qZ9vW... # Replace with your actual token
|
| 3 |
+
|
| 4 |
+
# App URL (usually your Hugging Face space URL)
|
| 5 |
+
APP_URL=https://alexainc-aurudu-krida.hf.space
|
| 6 |
+
|
| 7 |
+
# Port (optional, defaults to 7860)
|
| 8 |
+
PORT=7860
|
.gitattributes
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.apk filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.ogg filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
node_modules/
|
| 2 |
+
.env
|
| 3 |
+
.env.local
|
| 4 |
+
db.json
|
| 5 |
+
*.log
|
| 6 |
+
.DS_Store
|
| 7 |
+
dist/
|
| 8 |
+
build/
|
Dockerfile
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Node.js latest LTS
|
| 2 |
+
FROM node:20-slim
|
| 3 |
+
|
| 4 |
+
# Create and define the application's working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Copy package files and install dependencies
|
| 8 |
+
COPY package*.json ./
|
| 9 |
+
RUN npm install --production
|
| 10 |
+
|
| 11 |
+
# Copy the rest of the application code
|
| 12 |
+
COPY . .
|
| 13 |
+
|
| 14 |
+
# Expose the default Hugging Face Spaces port
|
| 15 |
+
EXPOSE 7860
|
| 16 |
+
|
| 17 |
+
# Start the application
|
| 18 |
+
CMD ["node", "server/index.js"]
|
apk_tree.txt
ADDED
|
Binary file (16.7 kB). View file
|
|
|
assets/www/c2runtime.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/www/cordova-js-src/android/nativeapiprovider.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Licensed to the Apache Software Foundation (ASF) under one
|
| 3 |
+
* or more contributor license agreements. See the NOTICE file
|
| 4 |
+
* distributed with this work for additional information
|
| 5 |
+
* regarding copyright ownership. The ASF licenses this file
|
| 6 |
+
* to you under the Apache License, Version 2.0 (the
|
| 7 |
+
* "License"); you may not use this file except in compliance
|
| 8 |
+
* with the License. You may obtain a copy of the License at
|
| 9 |
+
*
|
| 10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 11 |
+
*
|
| 12 |
+
* Unless required by applicable law or agreed to in writing,
|
| 13 |
+
* software distributed under the License is distributed on an
|
| 14 |
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
| 15 |
+
* KIND, either express or implied. See the License for the
|
| 16 |
+
* specific language governing permissions and limitations
|
| 17 |
+
* under the License.
|
| 18 |
+
*/
|
| 19 |
+
|
| 20 |
+
/**
|
| 21 |
+
* Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi.
|
| 22 |
+
*/
|
| 23 |
+
|
| 24 |
+
var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi');
|
| 25 |
+
var currentApi = nativeApi;
|
| 26 |
+
|
| 27 |
+
module.exports = {
|
| 28 |
+
get: function() { return currentApi; },
|
| 29 |
+
setPreferPrompt: function(value) {
|
| 30 |
+
currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi;
|
| 31 |
+
},
|
| 32 |
+
// Used only by tests.
|
| 33 |
+
set: function(value) {
|
| 34 |
+
currentApi = value;
|
| 35 |
+
}
|
| 36 |
+
};
|
assets/www/cordova-js-src/android/promptbasednativeapi.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Licensed to the Apache Software Foundation (ASF) under one
|
| 3 |
+
* or more contributor license agreements. See the NOTICE file
|
| 4 |
+
* distributed with this work for additional information
|
| 5 |
+
* regarding copyright ownership. The ASF licenses this file
|
| 6 |
+
* to you under the Apache License, Version 2.0 (the
|
| 7 |
+
* "License"); you may not use this file except in compliance
|
| 8 |
+
* with the License. You may obtain a copy of the License at
|
| 9 |
+
*
|
| 10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 11 |
+
*
|
| 12 |
+
* Unless required by applicable law or agreed to in writing,
|
| 13 |
+
* software distributed under the License is distributed on an
|
| 14 |
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
| 15 |
+
* KIND, either express or implied. See the License for the
|
| 16 |
+
* specific language governing permissions and limitations
|
| 17 |
+
* under the License.
|
| 18 |
+
*/
|
| 19 |
+
|
| 20 |
+
/**
|
| 21 |
+
* Implements the API of ExposedJsApi.java, but uses prompt() to communicate.
|
| 22 |
+
* This is used pre-JellyBean, where addJavascriptInterface() is disabled.
|
| 23 |
+
*/
|
| 24 |
+
|
| 25 |
+
module.exports = {
|
| 26 |
+
exec: function(bridgeSecret, service, action, callbackId, argsJson) {
|
| 27 |
+
return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId]));
|
| 28 |
+
},
|
| 29 |
+
setNativeToJsBridgeMode: function(bridgeSecret, value) {
|
| 30 |
+
prompt(value, 'gap_bridge_mode:' + bridgeSecret);
|
| 31 |
+
},
|
| 32 |
+
retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) {
|
| 33 |
+
return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret);
|
| 34 |
+
}
|
| 35 |
+
};
|
assets/www/cordova-js-src/exec.js
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
*
|
| 3 |
+
* Licensed to the Apache Software Foundation (ASF) under one
|
| 4 |
+
* or more contributor license agreements. See the NOTICE file
|
| 5 |
+
* distributed with this work for additional information
|
| 6 |
+
* regarding copyright ownership. The ASF licenses this file
|
| 7 |
+
* to you under the Apache License, Version 2.0 (the
|
| 8 |
+
* "License"); you may not use this file except in compliance
|
| 9 |
+
* with the License. You may obtain a copy of the License at
|
| 10 |
+
*
|
| 11 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
*
|
| 13 |
+
* Unless required by applicable law or agreed to in writing,
|
| 14 |
+
* software distributed under the License is distributed on an
|
| 15 |
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
| 16 |
+
* KIND, either express or implied. See the License for the
|
| 17 |
+
* specific language governing permissions and limitations
|
| 18 |
+
* under the License.
|
| 19 |
+
*
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* Execute a cordova command. It is up to the native side whether this action
|
| 24 |
+
* is synchronous or asynchronous. The native side can return:
|
| 25 |
+
* Synchronous: PluginResult object as a JSON string
|
| 26 |
+
* Asynchronous: Empty string ""
|
| 27 |
+
* If async, the native side will cordova.callbackSuccess or cordova.callbackError,
|
| 28 |
+
* depending upon the result of the action.
|
| 29 |
+
*
|
| 30 |
+
* @param {Function} success The success callback
|
| 31 |
+
* @param {Function} fail The fail callback
|
| 32 |
+
* @param {String} service The name of the service to use
|
| 33 |
+
* @param {String} action Action to be run in cordova
|
| 34 |
+
* @param {String[]} [args] Zero or more arguments to pass to the method
|
| 35 |
+
*/
|
| 36 |
+
var cordova = require('cordova'),
|
| 37 |
+
nativeApiProvider = require('cordova/android/nativeapiprovider'),
|
| 38 |
+
utils = require('cordova/utils'),
|
| 39 |
+
base64 = require('cordova/base64'),
|
| 40 |
+
channel = require('cordova/channel'),
|
| 41 |
+
jsToNativeModes = {
|
| 42 |
+
PROMPT: 0,
|
| 43 |
+
JS_OBJECT: 1
|
| 44 |
+
},
|
| 45 |
+
nativeToJsModes = {
|
| 46 |
+
// Polls for messages using the JS->Native bridge.
|
| 47 |
+
POLLING: 0,
|
| 48 |
+
// For LOAD_URL to be viable, it would need to have a work-around for
|
| 49 |
+
// the bug where the soft-keyboard gets dismissed when a message is sent.
|
| 50 |
+
LOAD_URL: 1,
|
| 51 |
+
// For the ONLINE_EVENT to be viable, it would need to intercept all event
|
| 52 |
+
// listeners (both through addEventListener and window.ononline) as well
|
| 53 |
+
// as set the navigator property itself.
|
| 54 |
+
ONLINE_EVENT: 2,
|
| 55 |
+
EVAL_BRIDGE: 3
|
| 56 |
+
},
|
| 57 |
+
jsToNativeBridgeMode, // Set lazily.
|
| 58 |
+
nativeToJsBridgeMode = nativeToJsModes.EVAL_BRIDGE,
|
| 59 |
+
pollEnabled = false,
|
| 60 |
+
bridgeSecret = -1;
|
| 61 |
+
|
| 62 |
+
var messagesFromNative = [];
|
| 63 |
+
var isProcessing = false;
|
| 64 |
+
var resolvedPromise = typeof Promise == 'undefined' ? null : Promise.resolve();
|
| 65 |
+
var nextTick = resolvedPromise ? function(fn) { resolvedPromise.then(fn); } : function(fn) { setTimeout(fn); };
|
| 66 |
+
|
| 67 |
+
function androidExec(success, fail, service, action, args) {
|
| 68 |
+
if (bridgeSecret < 0) {
|
| 69 |
+
// If we ever catch this firing, we'll need to queue up exec()s
|
| 70 |
+
// and fire them once we get a secret. For now, I don't think
|
| 71 |
+
// it's possible for exec() to be called since plugins are parsed but
|
| 72 |
+
// not run until until after onNativeReady.
|
| 73 |
+
throw new Error('exec() called without bridgeSecret');
|
| 74 |
+
}
|
| 75 |
+
// Set default bridge modes if they have not already been set.
|
| 76 |
+
// By default, we use the failsafe, since addJavascriptInterface breaks too often
|
| 77 |
+
if (jsToNativeBridgeMode === undefined) {
|
| 78 |
+
androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
// If args is not provided, default to an empty array
|
| 82 |
+
args = args || [];
|
| 83 |
+
|
| 84 |
+
// Process any ArrayBuffers in the args into a string.
|
| 85 |
+
for (var i = 0; i < args.length; i++) {
|
| 86 |
+
if (utils.typeName(args[i]) == 'ArrayBuffer') {
|
| 87 |
+
args[i] = base64.fromArrayBuffer(args[i]);
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
var callbackId = service + cordova.callbackId++,
|
| 92 |
+
argsJson = JSON.stringify(args);
|
| 93 |
+
if (success || fail) {
|
| 94 |
+
cordova.callbacks[callbackId] = {success:success, fail:fail};
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
var msgs = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson);
|
| 98 |
+
// If argsJson was received by Java as null, try again with the PROMPT bridge mode.
|
| 99 |
+
// This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2. See CB-2666.
|
| 100 |
+
if (jsToNativeBridgeMode == jsToNativeModes.JS_OBJECT && msgs === "@Null arguments.") {
|
| 101 |
+
androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT);
|
| 102 |
+
androidExec(success, fail, service, action, args);
|
| 103 |
+
androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
|
| 104 |
+
} else if (msgs) {
|
| 105 |
+
messagesFromNative.push(msgs);
|
| 106 |
+
// Always process async to avoid exceptions messing up stack.
|
| 107 |
+
nextTick(processMessages);
|
| 108 |
+
}
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
androidExec.init = function() {
|
| 112 |
+
bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode);
|
| 113 |
+
channel.onNativeReady.fire();
|
| 114 |
+
};
|
| 115 |
+
|
| 116 |
+
function pollOnceFromOnlineEvent() {
|
| 117 |
+
pollOnce(true);
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
function pollOnce(opt_fromOnlineEvent) {
|
| 121 |
+
if (bridgeSecret < 0) {
|
| 122 |
+
// This can happen when the NativeToJsMessageQueue resets the online state on page transitions.
|
| 123 |
+
// We know there's nothing to retrieve, so no need to poll.
|
| 124 |
+
return;
|
| 125 |
+
}
|
| 126 |
+
var msgs = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent);
|
| 127 |
+
if (msgs) {
|
| 128 |
+
messagesFromNative.push(msgs);
|
| 129 |
+
// Process sync since we know we're already top-of-stack.
|
| 130 |
+
processMessages();
|
| 131 |
+
}
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
function pollingTimerFunc() {
|
| 135 |
+
if (pollEnabled) {
|
| 136 |
+
pollOnce();
|
| 137 |
+
setTimeout(pollingTimerFunc, 50);
|
| 138 |
+
}
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
function hookOnlineApis() {
|
| 142 |
+
function proxyEvent(e) {
|
| 143 |
+
cordova.fireWindowEvent(e.type);
|
| 144 |
+
}
|
| 145 |
+
// The network module takes care of firing online and offline events.
|
| 146 |
+
// It currently fires them only on document though, so we bridge them
|
| 147 |
+
// to window here (while first listening for exec()-releated online/offline
|
| 148 |
+
// events).
|
| 149 |
+
window.addEventListener('online', pollOnceFromOnlineEvent, false);
|
| 150 |
+
window.addEventListener('offline', pollOnceFromOnlineEvent, false);
|
| 151 |
+
cordova.addWindowEventHandler('online');
|
| 152 |
+
cordova.addWindowEventHandler('offline');
|
| 153 |
+
document.addEventListener('online', proxyEvent, false);
|
| 154 |
+
document.addEventListener('offline', proxyEvent, false);
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
hookOnlineApis();
|
| 158 |
+
|
| 159 |
+
androidExec.jsToNativeModes = jsToNativeModes;
|
| 160 |
+
androidExec.nativeToJsModes = nativeToJsModes;
|
| 161 |
+
|
| 162 |
+
androidExec.setJsToNativeBridgeMode = function(mode) {
|
| 163 |
+
if (mode == jsToNativeModes.JS_OBJECT && !window._cordovaNative) {
|
| 164 |
+
mode = jsToNativeModes.PROMPT;
|
| 165 |
+
}
|
| 166 |
+
nativeApiProvider.setPreferPrompt(mode == jsToNativeModes.PROMPT);
|
| 167 |
+
jsToNativeBridgeMode = mode;
|
| 168 |
+
};
|
| 169 |
+
|
| 170 |
+
androidExec.setNativeToJsBridgeMode = function(mode) {
|
| 171 |
+
if (mode == nativeToJsBridgeMode) {
|
| 172 |
+
return;
|
| 173 |
+
}
|
| 174 |
+
if (nativeToJsBridgeMode == nativeToJsModes.POLLING) {
|
| 175 |
+
pollEnabled = false;
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
nativeToJsBridgeMode = mode;
|
| 179 |
+
// Tell the native side to switch modes.
|
| 180 |
+
// Otherwise, it will be set by androidExec.init()
|
| 181 |
+
if (bridgeSecret >= 0) {
|
| 182 |
+
nativeApiProvider.get().setNativeToJsBridgeMode(bridgeSecret, mode);
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
if (mode == nativeToJsModes.POLLING) {
|
| 186 |
+
pollEnabled = true;
|
| 187 |
+
setTimeout(pollingTimerFunc, 1);
|
| 188 |
+
}
|
| 189 |
+
};
|
| 190 |
+
|
| 191 |
+
function buildPayload(payload, message) {
|
| 192 |
+
var payloadKind = message.charAt(0);
|
| 193 |
+
if (payloadKind == 's') {
|
| 194 |
+
payload.push(message.slice(1));
|
| 195 |
+
} else if (payloadKind == 't') {
|
| 196 |
+
payload.push(true);
|
| 197 |
+
} else if (payloadKind == 'f') {
|
| 198 |
+
payload.push(false);
|
| 199 |
+
} else if (payloadKind == 'N') {
|
| 200 |
+
payload.push(null);
|
| 201 |
+
} else if (payloadKind == 'n') {
|
| 202 |
+
payload.push(+message.slice(1));
|
| 203 |
+
} else if (payloadKind == 'A') {
|
| 204 |
+
var data = message.slice(1);
|
| 205 |
+
payload.push(base64.toArrayBuffer(data));
|
| 206 |
+
} else if (payloadKind == 'S') {
|
| 207 |
+
payload.push(window.atob(message.slice(1)));
|
| 208 |
+
} else if (payloadKind == 'M') {
|
| 209 |
+
var multipartMessages = message.slice(1);
|
| 210 |
+
while (multipartMessages !== "") {
|
| 211 |
+
var spaceIdx = multipartMessages.indexOf(' ');
|
| 212 |
+
var msgLen = +multipartMessages.slice(0, spaceIdx);
|
| 213 |
+
var multipartMessage = multipartMessages.substr(spaceIdx + 1, msgLen);
|
| 214 |
+
multipartMessages = multipartMessages.slice(spaceIdx + msgLen + 1);
|
| 215 |
+
buildPayload(payload, multipartMessage);
|
| 216 |
+
}
|
| 217 |
+
} else {
|
| 218 |
+
payload.push(JSON.parse(message));
|
| 219 |
+
}
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
// Processes a single message, as encoded by NativeToJsMessageQueue.java.
|
| 223 |
+
function processMessage(message) {
|
| 224 |
+
var firstChar = message.charAt(0);
|
| 225 |
+
if (firstChar == 'J') {
|
| 226 |
+
// This is deprecated on the .java side. It doesn't work with CSP enabled.
|
| 227 |
+
eval(message.slice(1));
|
| 228 |
+
} else if (firstChar == 'S' || firstChar == 'F') {
|
| 229 |
+
var success = firstChar == 'S';
|
| 230 |
+
var keepCallback = message.charAt(1) == '1';
|
| 231 |
+
var spaceIdx = message.indexOf(' ', 2);
|
| 232 |
+
var status = +message.slice(2, spaceIdx);
|
| 233 |
+
var nextSpaceIdx = message.indexOf(' ', spaceIdx + 1);
|
| 234 |
+
var callbackId = message.slice(spaceIdx + 1, nextSpaceIdx);
|
| 235 |
+
var payloadMessage = message.slice(nextSpaceIdx + 1);
|
| 236 |
+
var payload = [];
|
| 237 |
+
buildPayload(payload, payloadMessage);
|
| 238 |
+
cordova.callbackFromNative(callbackId, success, status, payload, keepCallback);
|
| 239 |
+
} else {
|
| 240 |
+
console.log("processMessage failed: invalid message: " + JSON.stringify(message));
|
| 241 |
+
}
|
| 242 |
+
}
|
| 243 |
+
|
| 244 |
+
function processMessages() {
|
| 245 |
+
// Check for the reentrant case.
|
| 246 |
+
if (isProcessing) {
|
| 247 |
+
return;
|
| 248 |
+
}
|
| 249 |
+
if (messagesFromNative.length === 0) {
|
| 250 |
+
return;
|
| 251 |
+
}
|
| 252 |
+
isProcessing = true;
|
| 253 |
+
try {
|
| 254 |
+
var msg = popMessageFromQueue();
|
| 255 |
+
// The Java side can send a * message to indicate that it
|
| 256 |
+
// still has messages waiting to be retrieved.
|
| 257 |
+
if (msg == '*' && messagesFromNative.length === 0) {
|
| 258 |
+
nextTick(pollOnce);
|
| 259 |
+
return;
|
| 260 |
+
}
|
| 261 |
+
processMessage(msg);
|
| 262 |
+
} finally {
|
| 263 |
+
isProcessing = false;
|
| 264 |
+
if (messagesFromNative.length > 0) {
|
| 265 |
+
nextTick(processMessages);
|
| 266 |
+
}
|
| 267 |
+
}
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
function popMessageFromQueue() {
|
| 271 |
+
var messageBatch = messagesFromNative.shift();
|
| 272 |
+
if (messageBatch == '*') {
|
| 273 |
+
return '*';
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
var spaceIdx = messageBatch.indexOf(' ');
|
| 277 |
+
var msgLen = +messageBatch.slice(0, spaceIdx);
|
| 278 |
+
var message = messageBatch.substr(spaceIdx + 1, msgLen);
|
| 279 |
+
messageBatch = messageBatch.slice(spaceIdx + msgLen + 1);
|
| 280 |
+
if (messageBatch) {
|
| 281 |
+
messagesFromNative.unshift(messageBatch);
|
| 282 |
+
}
|
| 283 |
+
return message;
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
module.exports = androidExec;
|
assets/www/cordova-js-src/platform.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
*
|
| 3 |
+
* Licensed to the Apache Software Foundation (ASF) under one
|
| 4 |
+
* or more contributor license agreements. See the NOTICE file
|
| 5 |
+
* distributed with this work for additional information
|
| 6 |
+
* regarding copyright ownership. The ASF licenses this file
|
| 7 |
+
* to you under the Apache License, Version 2.0 (the
|
| 8 |
+
* "License"); you may not use this file except in compliance
|
| 9 |
+
* with the License. You may obtain a copy of the License at
|
| 10 |
+
*
|
| 11 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
*
|
| 13 |
+
* Unless required by applicable law or agreed to in writing,
|
| 14 |
+
* software distributed under the License is distributed on an
|
| 15 |
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
| 16 |
+
* KIND, either express or implied. See the License for the
|
| 17 |
+
* specific language governing permissions and limitations
|
| 18 |
+
* under the License.
|
| 19 |
+
*
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
// The last resume event that was received that had the result of a plugin call.
|
| 23 |
+
var lastResumeEvent = null;
|
| 24 |
+
|
| 25 |
+
module.exports = {
|
| 26 |
+
id: 'android',
|
| 27 |
+
bootstrap: function() {
|
| 28 |
+
var channel = require('cordova/channel'),
|
| 29 |
+
cordova = require('cordova'),
|
| 30 |
+
exec = require('cordova/exec'),
|
| 31 |
+
modulemapper = require('cordova/modulemapper');
|
| 32 |
+
|
| 33 |
+
// Get the shared secret needed to use the bridge.
|
| 34 |
+
exec.init();
|
| 35 |
+
|
| 36 |
+
// TODO: Extract this as a proper plugin.
|
| 37 |
+
modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app');
|
| 38 |
+
|
| 39 |
+
var APP_PLUGIN_NAME = Number(cordova.platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
|
| 40 |
+
|
| 41 |
+
// Inject a listener for the backbutton on the document.
|
| 42 |
+
var backButtonChannel = cordova.addDocumentEventHandler('backbutton');
|
| 43 |
+
backButtonChannel.onHasSubscribersChange = function() {
|
| 44 |
+
// If we just attached the first handler or detached the last handler,
|
| 45 |
+
// let native know we need to override the back button.
|
| 46 |
+
exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [this.numHandlers == 1]);
|
| 47 |
+
};
|
| 48 |
+
|
| 49 |
+
// Add hardware MENU and SEARCH button handlers
|
| 50 |
+
cordova.addDocumentEventHandler('menubutton');
|
| 51 |
+
cordova.addDocumentEventHandler('searchbutton');
|
| 52 |
+
|
| 53 |
+
function bindButtonChannel(buttonName) {
|
| 54 |
+
// generic button bind used for volumeup/volumedown buttons
|
| 55 |
+
var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button');
|
| 56 |
+
volumeButtonChannel.onHasSubscribersChange = function() {
|
| 57 |
+
exec(null, null, APP_PLUGIN_NAME, "overrideButton", [buttonName, this.numHandlers == 1]);
|
| 58 |
+
};
|
| 59 |
+
}
|
| 60 |
+
// Inject a listener for the volume buttons on the document.
|
| 61 |
+
bindButtonChannel('volumeup');
|
| 62 |
+
bindButtonChannel('volumedown');
|
| 63 |
+
|
| 64 |
+
// The resume event is not "sticky", but it is possible that the event
|
| 65 |
+
// will contain the result of a plugin call. We need to ensure that the
|
| 66 |
+
// plugin result is delivered even after the event is fired (CB-10498)
|
| 67 |
+
var cordovaAddEventListener = document.addEventListener;
|
| 68 |
+
|
| 69 |
+
document.addEventListener = function(evt, handler, capture) {
|
| 70 |
+
cordovaAddEventListener(evt, handler, capture);
|
| 71 |
+
|
| 72 |
+
if (evt === 'resume' && lastResumeEvent) {
|
| 73 |
+
handler(lastResumeEvent);
|
| 74 |
+
}
|
| 75 |
+
};
|
| 76 |
+
|
| 77 |
+
// Let native code know we are all done on the JS side.
|
| 78 |
+
// Native code will then un-hide the WebView.
|
| 79 |
+
channel.onCordovaReady.subscribe(function() {
|
| 80 |
+
exec(onMessageFromNative, null, APP_PLUGIN_NAME, 'messageChannel', []);
|
| 81 |
+
exec(null, null, APP_PLUGIN_NAME, "show", []);
|
| 82 |
+
});
|
| 83 |
+
}
|
| 84 |
+
};
|
| 85 |
+
|
| 86 |
+
function onMessageFromNative(msg) {
|
| 87 |
+
var cordova = require('cordova');
|
| 88 |
+
var action = msg.action;
|
| 89 |
+
|
| 90 |
+
switch (action)
|
| 91 |
+
{
|
| 92 |
+
// Button events
|
| 93 |
+
case 'backbutton':
|
| 94 |
+
case 'menubutton':
|
| 95 |
+
case 'searchbutton':
|
| 96 |
+
// App life cycle events
|
| 97 |
+
case 'pause':
|
| 98 |
+
// Volume events
|
| 99 |
+
case 'volumedownbutton':
|
| 100 |
+
case 'volumeupbutton':
|
| 101 |
+
cordova.fireDocumentEvent(action);
|
| 102 |
+
break;
|
| 103 |
+
case 'resume':
|
| 104 |
+
if(arguments.length > 1 && msg.pendingResult) {
|
| 105 |
+
if(arguments.length === 2) {
|
| 106 |
+
msg.pendingResult.result = arguments[1];
|
| 107 |
+
} else {
|
| 108 |
+
// The plugin returned a multipart message
|
| 109 |
+
var res = [];
|
| 110 |
+
for(var i = 1; i < arguments.length; i++) {
|
| 111 |
+
res.push(arguments[i]);
|
| 112 |
+
}
|
| 113 |
+
msg.pendingResult.result = res;
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
// Save the plugin result so that it can be delivered to the js
|
| 117 |
+
// even if they miss the initial firing of the event
|
| 118 |
+
lastResumeEvent = msg;
|
| 119 |
+
}
|
| 120 |
+
cordova.fireDocumentEvent(action, msg);
|
| 121 |
+
break;
|
| 122 |
+
default:
|
| 123 |
+
throw new Error('Unknown event action ' + action);
|
| 124 |
+
}
|
| 125 |
+
}
|
assets/www/cordova-js-src/plugin/android/app.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
*
|
| 3 |
+
* Licensed to the Apache Software Foundation (ASF) under one
|
| 4 |
+
* or more contributor license agreements. See the NOTICE file
|
| 5 |
+
* distributed with this work for additional information
|
| 6 |
+
* regarding copyright ownership. The ASF licenses this file
|
| 7 |
+
* to you under the Apache License, Version 2.0 (the
|
| 8 |
+
* "License"); you may not use this file except in compliance
|
| 9 |
+
* with the License. You may obtain a copy of the License at
|
| 10 |
+
*
|
| 11 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
*
|
| 13 |
+
* Unless required by applicable law or agreed to in writing,
|
| 14 |
+
* software distributed under the License is distributed on an
|
| 15 |
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
| 16 |
+
* KIND, either express or implied. See the License for the
|
| 17 |
+
* specific language governing permissions and limitations
|
| 18 |
+
* under the License.
|
| 19 |
+
*
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
var exec = require('cordova/exec');
|
| 23 |
+
var APP_PLUGIN_NAME = Number(require('cordova').platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
|
| 24 |
+
|
| 25 |
+
module.exports = {
|
| 26 |
+
/**
|
| 27 |
+
* Clear the resource cache.
|
| 28 |
+
*/
|
| 29 |
+
clearCache:function() {
|
| 30 |
+
exec(null, null, APP_PLUGIN_NAME, "clearCache", []);
|
| 31 |
+
},
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* Load the url into the webview or into new browser instance.
|
| 35 |
+
*
|
| 36 |
+
* @param url The URL to load
|
| 37 |
+
* @param props Properties that can be passed in to the activity:
|
| 38 |
+
* wait: int => wait msec before loading URL
|
| 39 |
+
* loadingDialog: "Title,Message" => display a native loading dialog
|
| 40 |
+
* loadUrlTimeoutValue: int => time in msec to wait before triggering a timeout error
|
| 41 |
+
* clearHistory: boolean => clear webview history (default=false)
|
| 42 |
+
* openExternal: boolean => open in a new browser (default=false)
|
| 43 |
+
*
|
| 44 |
+
* Example:
|
| 45 |
+
* navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000});
|
| 46 |
+
*/
|
| 47 |
+
loadUrl:function(url, props) {
|
| 48 |
+
exec(null, null, APP_PLUGIN_NAME, "loadUrl", [url, props]);
|
| 49 |
+
},
|
| 50 |
+
|
| 51 |
+
/**
|
| 52 |
+
* Cancel loadUrl that is waiting to be loaded.
|
| 53 |
+
*/
|
| 54 |
+
cancelLoadUrl:function() {
|
| 55 |
+
exec(null, null, APP_PLUGIN_NAME, "cancelLoadUrl", []);
|
| 56 |
+
},
|
| 57 |
+
|
| 58 |
+
/**
|
| 59 |
+
* Clear web history in this web view.
|
| 60 |
+
* Instead of BACK button loading the previous web page, it will exit the app.
|
| 61 |
+
*/
|
| 62 |
+
clearHistory:function() {
|
| 63 |
+
exec(null, null, APP_PLUGIN_NAME, "clearHistory", []);
|
| 64 |
+
},
|
| 65 |
+
|
| 66 |
+
/**
|
| 67 |
+
* Go to previous page displayed.
|
| 68 |
+
* This is the same as pressing the backbutton on Android device.
|
| 69 |
+
*/
|
| 70 |
+
backHistory:function() {
|
| 71 |
+
exec(null, null, APP_PLUGIN_NAME, "backHistory", []);
|
| 72 |
+
},
|
| 73 |
+
|
| 74 |
+
/**
|
| 75 |
+
* Override the default behavior of the Android back button.
|
| 76 |
+
* If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired.
|
| 77 |
+
*
|
| 78 |
+
* Note: The user should not have to call this method. Instead, when the user
|
| 79 |
+
* registers for the "backbutton" event, this is automatically done.
|
| 80 |
+
*
|
| 81 |
+
* @param override T=override, F=cancel override
|
| 82 |
+
*/
|
| 83 |
+
overrideBackbutton:function(override) {
|
| 84 |
+
exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [override]);
|
| 85 |
+
},
|
| 86 |
+
|
| 87 |
+
/**
|
| 88 |
+
* Override the default behavior of the Android volume button.
|
| 89 |
+
* If overridden, when the volume button is pressed, the "volume[up|down]button"
|
| 90 |
+
* JavaScript event will be fired.
|
| 91 |
+
*
|
| 92 |
+
* Note: The user should not have to call this method. Instead, when the user
|
| 93 |
+
* registers for the "volume[up|down]button" event, this is automatically done.
|
| 94 |
+
*
|
| 95 |
+
* @param button volumeup, volumedown
|
| 96 |
+
* @param override T=override, F=cancel override
|
| 97 |
+
*/
|
| 98 |
+
overrideButton:function(button, override) {
|
| 99 |
+
exec(null, null, APP_PLUGIN_NAME, "overrideButton", [button, override]);
|
| 100 |
+
},
|
| 101 |
+
|
| 102 |
+
/**
|
| 103 |
+
* Exit and terminate the application.
|
| 104 |
+
*/
|
| 105 |
+
exitApp:function() {
|
| 106 |
+
return exec(null, null, APP_PLUGIN_NAME, "exitApp", []);
|
| 107 |
+
}
|
| 108 |
+
};
|
assets/www/cordova.js
ADDED
|
@@ -0,0 +1,1935 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Platform: android
|
| 2 |
+
// 74fdba8b327b2a13b4366dd141b52def96d4cb56
|
| 3 |
+
/*
|
| 4 |
+
Licensed to the Apache Software Foundation (ASF) under one
|
| 5 |
+
or more contributor license agreements. See the NOTICE file
|
| 6 |
+
distributed with this work for additional information
|
| 7 |
+
regarding copyright ownership. The ASF licenses this file
|
| 8 |
+
to you under the Apache License, Version 2.0 (the
|
| 9 |
+
"License"); you may not use this file except in compliance
|
| 10 |
+
with the License. You may obtain a copy of the License at
|
| 11 |
+
|
| 12 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 13 |
+
|
| 14 |
+
Unless required by applicable law or agreed to in writing,
|
| 15 |
+
software distributed under the License is distributed on an
|
| 16 |
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
| 17 |
+
KIND, either express or implied. See the License for the
|
| 18 |
+
specific language governing permissions and limitations
|
| 19 |
+
under the License.
|
| 20 |
+
*/
|
| 21 |
+
;(function() {
|
| 22 |
+
var PLATFORM_VERSION_BUILD_LABEL = '8.1.0';
|
| 23 |
+
// file: src/scripts/require.js
|
| 24 |
+
var require;
|
| 25 |
+
var define;
|
| 26 |
+
|
| 27 |
+
(function () {
|
| 28 |
+
var modules = {};
|
| 29 |
+
// Stack of moduleIds currently being built.
|
| 30 |
+
var requireStack = [];
|
| 31 |
+
// Map of module ID -> index into requireStack of modules currently being built.
|
| 32 |
+
var inProgressModules = {};
|
| 33 |
+
var SEPARATOR = '.';
|
| 34 |
+
|
| 35 |
+
function build (module) {
|
| 36 |
+
var factory = module.factory;
|
| 37 |
+
var localRequire = function (id) {
|
| 38 |
+
var resultantId = id;
|
| 39 |
+
// Its a relative path, so lop off the last portion and add the id (minus "./")
|
| 40 |
+
if (id.charAt(0) === '.') {
|
| 41 |
+
resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2);
|
| 42 |
+
}
|
| 43 |
+
return require(resultantId);
|
| 44 |
+
};
|
| 45 |
+
module.exports = {};
|
| 46 |
+
delete module.factory;
|
| 47 |
+
factory(localRequire, module.exports, module);
|
| 48 |
+
return module.exports;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
require = function (id) {
|
| 52 |
+
if (!modules[id]) {
|
| 53 |
+
throw 'module ' + id + ' not found';
|
| 54 |
+
} else if (id in inProgressModules) {
|
| 55 |
+
var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id;
|
| 56 |
+
throw 'Cycle in require graph: ' + cycle;
|
| 57 |
+
}
|
| 58 |
+
if (modules[id].factory) {
|
| 59 |
+
try {
|
| 60 |
+
inProgressModules[id] = requireStack.length;
|
| 61 |
+
requireStack.push(id);
|
| 62 |
+
return build(modules[id]);
|
| 63 |
+
} finally {
|
| 64 |
+
delete inProgressModules[id];
|
| 65 |
+
requireStack.pop();
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
return modules[id].exports;
|
| 69 |
+
};
|
| 70 |
+
|
| 71 |
+
define = function (id, factory) {
|
| 72 |
+
if (Object.prototype.hasOwnProperty.call(modules, id)) {
|
| 73 |
+
throw 'module ' + id + ' already defined';
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
modules[id] = {
|
| 77 |
+
id: id,
|
| 78 |
+
factory: factory
|
| 79 |
+
};
|
| 80 |
+
};
|
| 81 |
+
|
| 82 |
+
define.remove = function (id) {
|
| 83 |
+
delete modules[id];
|
| 84 |
+
};
|
| 85 |
+
|
| 86 |
+
define.moduleMap = modules;
|
| 87 |
+
})();
|
| 88 |
+
|
| 89 |
+
// Export for use in node
|
| 90 |
+
if (typeof module === 'object' && typeof require === 'function') {
|
| 91 |
+
module.exports.require = require;
|
| 92 |
+
module.exports.define = define;
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
// file: src/cordova.js
|
| 96 |
+
define("cordova", function(require, exports, module) {
|
| 97 |
+
|
| 98 |
+
// Workaround for Windows 10 in hosted environment case
|
| 99 |
+
// http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object
|
| 100 |
+
if (window.cordova && !(window.cordova instanceof HTMLElement)) { // eslint-disable-line no-undef
|
| 101 |
+
throw new Error('cordova already defined');
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
var channel = require('cordova/channel');
|
| 105 |
+
var platform = require('cordova/platform');
|
| 106 |
+
|
| 107 |
+
/**
|
| 108 |
+
* Intercept calls to addEventListener + removeEventListener and handle deviceready,
|
| 109 |
+
* resume, and pause events.
|
| 110 |
+
*/
|
| 111 |
+
var m_document_addEventListener = document.addEventListener;
|
| 112 |
+
var m_document_removeEventListener = document.removeEventListener;
|
| 113 |
+
var m_window_addEventListener = window.addEventListener;
|
| 114 |
+
var m_window_removeEventListener = window.removeEventListener;
|
| 115 |
+
|
| 116 |
+
/**
|
| 117 |
+
* Houses custom event handlers to intercept on document + window event listeners.
|
| 118 |
+
*/
|
| 119 |
+
var documentEventHandlers = {};
|
| 120 |
+
var windowEventHandlers = {};
|
| 121 |
+
|
| 122 |
+
document.addEventListener = function (evt, handler, capture) {
|
| 123 |
+
var e = evt.toLowerCase();
|
| 124 |
+
if (typeof documentEventHandlers[e] !== 'undefined') {
|
| 125 |
+
documentEventHandlers[e].subscribe(handler);
|
| 126 |
+
} else {
|
| 127 |
+
m_document_addEventListener.call(document, evt, handler, capture);
|
| 128 |
+
}
|
| 129 |
+
};
|
| 130 |
+
|
| 131 |
+
window.addEventListener = function (evt, handler, capture) {
|
| 132 |
+
var e = evt.toLowerCase();
|
| 133 |
+
if (typeof windowEventHandlers[e] !== 'undefined') {
|
| 134 |
+
windowEventHandlers[e].subscribe(handler);
|
| 135 |
+
} else {
|
| 136 |
+
m_window_addEventListener.call(window, evt, handler, capture);
|
| 137 |
+
}
|
| 138 |
+
};
|
| 139 |
+
|
| 140 |
+
document.removeEventListener = function (evt, handler, capture) {
|
| 141 |
+
var e = evt.toLowerCase();
|
| 142 |
+
// If unsubscribing from an event that is handled by a plugin
|
| 143 |
+
if (typeof documentEventHandlers[e] !== 'undefined') {
|
| 144 |
+
documentEventHandlers[e].unsubscribe(handler);
|
| 145 |
+
} else {
|
| 146 |
+
m_document_removeEventListener.call(document, evt, handler, capture);
|
| 147 |
+
}
|
| 148 |
+
};
|
| 149 |
+
|
| 150 |
+
window.removeEventListener = function (evt, handler, capture) {
|
| 151 |
+
var e = evt.toLowerCase();
|
| 152 |
+
// If unsubscribing from an event that is handled by a plugin
|
| 153 |
+
if (typeof windowEventHandlers[e] !== 'undefined') {
|
| 154 |
+
windowEventHandlers[e].unsubscribe(handler);
|
| 155 |
+
} else {
|
| 156 |
+
m_window_removeEventListener.call(window, evt, handler, capture);
|
| 157 |
+
}
|
| 158 |
+
};
|
| 159 |
+
|
| 160 |
+
function createEvent (type, data) {
|
| 161 |
+
var event = document.createEvent('Events');
|
| 162 |
+
event.initEvent(type, false, false);
|
| 163 |
+
if (data) {
|
| 164 |
+
for (var i in data) {
|
| 165 |
+
if (data.hasOwnProperty(i)) {
|
| 166 |
+
event[i] = data[i];
|
| 167 |
+
}
|
| 168 |
+
}
|
| 169 |
+
}
|
| 170 |
+
return event;
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
/* eslint-disable no-undef */
|
| 174 |
+
var cordova = {
|
| 175 |
+
define: define,
|
| 176 |
+
require: require,
|
| 177 |
+
version: PLATFORM_VERSION_BUILD_LABEL,
|
| 178 |
+
platformVersion: PLATFORM_VERSION_BUILD_LABEL,
|
| 179 |
+
platformId: platform.id,
|
| 180 |
+
|
| 181 |
+
/* eslint-enable no-undef */
|
| 182 |
+
|
| 183 |
+
/**
|
| 184 |
+
* Methods to add/remove your own addEventListener hijacking on document + window.
|
| 185 |
+
*/
|
| 186 |
+
addWindowEventHandler: function (event) {
|
| 187 |
+
return (windowEventHandlers[event] = channel.create(event));
|
| 188 |
+
},
|
| 189 |
+
addStickyDocumentEventHandler: function (event) {
|
| 190 |
+
return (documentEventHandlers[event] = channel.createSticky(event));
|
| 191 |
+
},
|
| 192 |
+
addDocumentEventHandler: function (event) {
|
| 193 |
+
return (documentEventHandlers[event] = channel.create(event));
|
| 194 |
+
},
|
| 195 |
+
removeWindowEventHandler: function (event) {
|
| 196 |
+
delete windowEventHandlers[event];
|
| 197 |
+
},
|
| 198 |
+
removeDocumentEventHandler: function (event) {
|
| 199 |
+
delete documentEventHandlers[event];
|
| 200 |
+
},
|
| 201 |
+
/**
|
| 202 |
+
* Retrieve original event handlers that were replaced by Cordova
|
| 203 |
+
*
|
| 204 |
+
* @return object
|
| 205 |
+
*/
|
| 206 |
+
getOriginalHandlers: function () {
|
| 207 |
+
return { 'document': { 'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener },
|
| 208 |
+
'window': { 'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener } };
|
| 209 |
+
},
|
| 210 |
+
/**
|
| 211 |
+
* Method to fire event from native code
|
| 212 |
+
* bNoDetach is required for events which cause an exception which needs to be caught in native code
|
| 213 |
+
*/
|
| 214 |
+
fireDocumentEvent: function (type, data, bNoDetach) {
|
| 215 |
+
var evt = createEvent(type, data);
|
| 216 |
+
if (typeof documentEventHandlers[type] !== 'undefined') {
|
| 217 |
+
if (bNoDetach) {
|
| 218 |
+
documentEventHandlers[type].fire(evt);
|
| 219 |
+
} else {
|
| 220 |
+
setTimeout(function () {
|
| 221 |
+
// Fire deviceready on listeners that were registered before cordova.js was loaded.
|
| 222 |
+
if (type === 'deviceready') {
|
| 223 |
+
document.dispatchEvent(evt);
|
| 224 |
+
}
|
| 225 |
+
documentEventHandlers[type].fire(evt);
|
| 226 |
+
}, 0);
|
| 227 |
+
}
|
| 228 |
+
} else {
|
| 229 |
+
document.dispatchEvent(evt);
|
| 230 |
+
}
|
| 231 |
+
},
|
| 232 |
+
fireWindowEvent: function (type, data) {
|
| 233 |
+
var evt = createEvent(type, data);
|
| 234 |
+
if (typeof windowEventHandlers[type] !== 'undefined') {
|
| 235 |
+
setTimeout(function () {
|
| 236 |
+
windowEventHandlers[type].fire(evt);
|
| 237 |
+
}, 0);
|
| 238 |
+
} else {
|
| 239 |
+
window.dispatchEvent(evt);
|
| 240 |
+
}
|
| 241 |
+
},
|
| 242 |
+
|
| 243 |
+
/**
|
| 244 |
+
* Plugin callback mechanism.
|
| 245 |
+
*/
|
| 246 |
+
// Randomize the starting callbackId to avoid collisions after refreshing or navigating.
|
| 247 |
+
// This way, it's very unlikely that any new callback would get the same callbackId as an old callback.
|
| 248 |
+
callbackId: Math.floor(Math.random() * 2000000000),
|
| 249 |
+
callbacks: {},
|
| 250 |
+
callbackStatus: {
|
| 251 |
+
NO_RESULT: 0,
|
| 252 |
+
OK: 1,
|
| 253 |
+
CLASS_NOT_FOUND_EXCEPTION: 2,
|
| 254 |
+
ILLEGAL_ACCESS_EXCEPTION: 3,
|
| 255 |
+
INSTANTIATION_EXCEPTION: 4,
|
| 256 |
+
MALFORMED_URL_EXCEPTION: 5,
|
| 257 |
+
IO_EXCEPTION: 6,
|
| 258 |
+
INVALID_ACTION: 7,
|
| 259 |
+
JSON_EXCEPTION: 8,
|
| 260 |
+
ERROR: 9
|
| 261 |
+
},
|
| 262 |
+
|
| 263 |
+
/**
|
| 264 |
+
* Called by native code when returning successful result from an action.
|
| 265 |
+
*/
|
| 266 |
+
callbackSuccess: function (callbackId, args) {
|
| 267 |
+
cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback);
|
| 268 |
+
},
|
| 269 |
+
|
| 270 |
+
/**
|
| 271 |
+
* Called by native code when returning error result from an action.
|
| 272 |
+
*/
|
| 273 |
+
callbackError: function (callbackId, args) {
|
| 274 |
+
// TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative.
|
| 275 |
+
// Derive success from status.
|
| 276 |
+
cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback);
|
| 277 |
+
},
|
| 278 |
+
|
| 279 |
+
/**
|
| 280 |
+
* Called by native code when returning the result from an action.
|
| 281 |
+
*/
|
| 282 |
+
callbackFromNative: function (callbackId, isSuccess, status, args, keepCallback) {
|
| 283 |
+
try {
|
| 284 |
+
var callback = cordova.callbacks[callbackId];
|
| 285 |
+
if (callback) {
|
| 286 |
+
if (isSuccess && status === cordova.callbackStatus.OK) {
|
| 287 |
+
callback.success && callback.success.apply(null, args);
|
| 288 |
+
} else if (!isSuccess) {
|
| 289 |
+
callback.fail && callback.fail.apply(null, args);
|
| 290 |
+
}
|
| 291 |
+
/*
|
| 292 |
+
else
|
| 293 |
+
Note, this case is intentionally not caught.
|
| 294 |
+
this can happen if isSuccess is true, but callbackStatus is NO_RESULT
|
| 295 |
+
which is used to remove a callback from the list without calling the callbacks
|
| 296 |
+
typically keepCallback is false in this case
|
| 297 |
+
*/
|
| 298 |
+
// Clear callback if not expecting any more results
|
| 299 |
+
if (!keepCallback) {
|
| 300 |
+
delete cordova.callbacks[callbackId];
|
| 301 |
+
}
|
| 302 |
+
}
|
| 303 |
+
} catch (err) {
|
| 304 |
+
var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err;
|
| 305 |
+
console && console.log && console.log(msg);
|
| 306 |
+
console && console.log && err.stack && console.log(err.stack);
|
| 307 |
+
cordova.fireWindowEvent('cordovacallbackerror', { 'message': msg });
|
| 308 |
+
throw err;
|
| 309 |
+
}
|
| 310 |
+
},
|
| 311 |
+
addConstructor: function (func) {
|
| 312 |
+
channel.onCordovaReady.subscribe(function () {
|
| 313 |
+
try {
|
| 314 |
+
func();
|
| 315 |
+
} catch (e) {
|
| 316 |
+
console.log('Failed to run constructor: ' + e);
|
| 317 |
+
}
|
| 318 |
+
});
|
| 319 |
+
}
|
| 320 |
+
};
|
| 321 |
+
|
| 322 |
+
module.exports = cordova;
|
| 323 |
+
|
| 324 |
+
});
|
| 325 |
+
|
| 326 |
+
// file: ../cordova-android/cordova-js-src/android/nativeapiprovider.js
|
| 327 |
+
define("cordova/android/nativeapiprovider", function(require, exports, module) {
|
| 328 |
+
|
| 329 |
+
/**
|
| 330 |
+
* Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi.
|
| 331 |
+
*/
|
| 332 |
+
|
| 333 |
+
var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi');
|
| 334 |
+
var currentApi = nativeApi;
|
| 335 |
+
|
| 336 |
+
module.exports = {
|
| 337 |
+
get: function() { return currentApi; },
|
| 338 |
+
setPreferPrompt: function(value) {
|
| 339 |
+
currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi;
|
| 340 |
+
},
|
| 341 |
+
// Used only by tests.
|
| 342 |
+
set: function(value) {
|
| 343 |
+
currentApi = value;
|
| 344 |
+
}
|
| 345 |
+
};
|
| 346 |
+
|
| 347 |
+
});
|
| 348 |
+
|
| 349 |
+
// file: ../cordova-android/cordova-js-src/android/promptbasednativeapi.js
|
| 350 |
+
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
|
| 351 |
+
|
| 352 |
+
/**
|
| 353 |
+
* Implements the API of ExposedJsApi.java, but uses prompt() to communicate.
|
| 354 |
+
* This is used pre-JellyBean, where addJavascriptInterface() is disabled.
|
| 355 |
+
*/
|
| 356 |
+
|
| 357 |
+
module.exports = {
|
| 358 |
+
exec: function(bridgeSecret, service, action, callbackId, argsJson) {
|
| 359 |
+
return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId]));
|
| 360 |
+
},
|
| 361 |
+
setNativeToJsBridgeMode: function(bridgeSecret, value) {
|
| 362 |
+
prompt(value, 'gap_bridge_mode:' + bridgeSecret);
|
| 363 |
+
},
|
| 364 |
+
retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) {
|
| 365 |
+
return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret);
|
| 366 |
+
}
|
| 367 |
+
};
|
| 368 |
+
|
| 369 |
+
});
|
| 370 |
+
|
| 371 |
+
// file: src/common/argscheck.js
|
| 372 |
+
define("cordova/argscheck", function(require, exports, module) {
|
| 373 |
+
|
| 374 |
+
var utils = require('cordova/utils');
|
| 375 |
+
|
| 376 |
+
var moduleExports = module.exports;
|
| 377 |
+
|
| 378 |
+
var typeMap = {
|
| 379 |
+
'A': 'Array',
|
| 380 |
+
'D': 'Date',
|
| 381 |
+
'N': 'Number',
|
| 382 |
+
'S': 'String',
|
| 383 |
+
'F': 'Function',
|
| 384 |
+
'O': 'Object'
|
| 385 |
+
};
|
| 386 |
+
|
| 387 |
+
function extractParamName (callee, argIndex) {
|
| 388 |
+
return (/\(\s*([^)]*?)\s*\)/).exec(callee)[1].split(/\s*,\s*/)[argIndex];
|
| 389 |
+
}
|
| 390 |
+
|
| 391 |
+
/**
|
| 392 |
+
* Checks the given arguments' types and throws if they are not as expected.
|
| 393 |
+
*
|
| 394 |
+
* `spec` is a string where each character stands for the required type of the
|
| 395 |
+
* argument at the same position. In other words: the character at `spec[i]`
|
| 396 |
+
* specifies the required type for `args[i]`. The characters in `spec` are the
|
| 397 |
+
* first letter of the required type's name. The supported types are:
|
| 398 |
+
*
|
| 399 |
+
* Array, Date, Number, String, Function, Object
|
| 400 |
+
*
|
| 401 |
+
* Lowercase characters specify arguments that must not be `null` or `undefined`
|
| 402 |
+
* while uppercase characters allow those values to be passed.
|
| 403 |
+
*
|
| 404 |
+
* Finally, `*` can be used to allow any type at the corresponding position.
|
| 405 |
+
*
|
| 406 |
+
* @example
|
| 407 |
+
* function foo (arr, opts) {
|
| 408 |
+
* // require `arr` to be an Array and `opts` an Object, null or undefined
|
| 409 |
+
* checkArgs('aO', 'my.package.foo', arguments);
|
| 410 |
+
* // ...
|
| 411 |
+
* }
|
| 412 |
+
* @param {String} spec - the type specification for `args` as described above
|
| 413 |
+
* @param {String} functionName - full name of the callee.
|
| 414 |
+
* Used in the error message
|
| 415 |
+
* @param {Array|arguments} args - the arguments to be checked against `spec`
|
| 416 |
+
* @param {Function} [opt_callee=args.callee] - the recipient of `args`.
|
| 417 |
+
* Used to extract parameter names for the error message
|
| 418 |
+
* @throws {TypeError} if args do not satisfy spec
|
| 419 |
+
*/
|
| 420 |
+
function checkArgs (spec, functionName, args, opt_callee) {
|
| 421 |
+
if (!moduleExports.enableChecks) {
|
| 422 |
+
return;
|
| 423 |
+
}
|
| 424 |
+
var errMsg = null;
|
| 425 |
+
var typeName;
|
| 426 |
+
for (var i = 0; i < spec.length; ++i) {
|
| 427 |
+
var c = spec.charAt(i);
|
| 428 |
+
var cUpper = c.toUpperCase();
|
| 429 |
+
var arg = args[i];
|
| 430 |
+
// Asterix means allow anything.
|
| 431 |
+
if (c === '*') {
|
| 432 |
+
continue;
|
| 433 |
+
}
|
| 434 |
+
typeName = utils.typeName(arg);
|
| 435 |
+
if ((arg === null || arg === undefined) && c === cUpper) {
|
| 436 |
+
continue;
|
| 437 |
+
}
|
| 438 |
+
if (typeName !== typeMap[cUpper]) {
|
| 439 |
+
errMsg = 'Expected ' + typeMap[cUpper];
|
| 440 |
+
break;
|
| 441 |
+
}
|
| 442 |
+
}
|
| 443 |
+
if (errMsg) {
|
| 444 |
+
errMsg += ', but got ' + typeName + '.';
|
| 445 |
+
errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg;
|
| 446 |
+
// Don't log when running unit tests.
|
| 447 |
+
if (typeof jasmine === 'undefined') {
|
| 448 |
+
console.error(errMsg);
|
| 449 |
+
}
|
| 450 |
+
throw TypeError(errMsg);
|
| 451 |
+
}
|
| 452 |
+
}
|
| 453 |
+
|
| 454 |
+
function getValue (value, defaultValue) {
|
| 455 |
+
return value === undefined ? defaultValue : value;
|
| 456 |
+
}
|
| 457 |
+
|
| 458 |
+
moduleExports.checkArgs = checkArgs;
|
| 459 |
+
moduleExports.getValue = getValue;
|
| 460 |
+
moduleExports.enableChecks = true;
|
| 461 |
+
|
| 462 |
+
});
|
| 463 |
+
|
| 464 |
+
// file: src/common/base64.js
|
| 465 |
+
define("cordova/base64", function(require, exports, module) {
|
| 466 |
+
|
| 467 |
+
var base64 = exports;
|
| 468 |
+
|
| 469 |
+
base64.fromArrayBuffer = function (arrayBuffer) {
|
| 470 |
+
var array = new Uint8Array(arrayBuffer);
|
| 471 |
+
return uint8ToBase64(array);
|
| 472 |
+
};
|
| 473 |
+
|
| 474 |
+
base64.toArrayBuffer = function (str) {
|
| 475 |
+
var decodedStr = typeof atob !== 'undefined' ? atob(str) : Buffer.from(str, 'base64').toString('binary'); // eslint-disable-line no-undef
|
| 476 |
+
var arrayBuffer = new ArrayBuffer(decodedStr.length);
|
| 477 |
+
var array = new Uint8Array(arrayBuffer);
|
| 478 |
+
for (var i = 0, len = decodedStr.length; i < len; i++) {
|
| 479 |
+
array[i] = decodedStr.charCodeAt(i);
|
| 480 |
+
}
|
| 481 |
+
return arrayBuffer;
|
| 482 |
+
};
|
| 483 |
+
|
| 484 |
+
// ------------------------------------------------------------------------------
|
| 485 |
+
|
| 486 |
+
/* This code is based on the performance tests at http://jsperf.com/b64tests
|
| 487 |
+
* This 12-bit-at-a-time algorithm was the best performing version on all
|
| 488 |
+
* platforms tested.
|
| 489 |
+
*/
|
| 490 |
+
|
| 491 |
+
var b64_6bit = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
| 492 |
+
var b64_12bit;
|
| 493 |
+
|
| 494 |
+
var b64_12bitTable = function () {
|
| 495 |
+
b64_12bit = [];
|
| 496 |
+
for (var i = 0; i < 64; i++) {
|
| 497 |
+
for (var j = 0; j < 64; j++) {
|
| 498 |
+
b64_12bit[i * 64 + j] = b64_6bit[i] + b64_6bit[j];
|
| 499 |
+
}
|
| 500 |
+
}
|
| 501 |
+
b64_12bitTable = function () { return b64_12bit; };
|
| 502 |
+
return b64_12bit;
|
| 503 |
+
};
|
| 504 |
+
|
| 505 |
+
function uint8ToBase64 (rawData) {
|
| 506 |
+
var numBytes = rawData.byteLength;
|
| 507 |
+
var output = '';
|
| 508 |
+
var segment;
|
| 509 |
+
var table = b64_12bitTable();
|
| 510 |
+
for (var i = 0; i < numBytes - 2; i += 3) {
|
| 511 |
+
segment = (rawData[i] << 16) + (rawData[i + 1] << 8) + rawData[i + 2];
|
| 512 |
+
output += table[segment >> 12];
|
| 513 |
+
output += table[segment & 0xfff];
|
| 514 |
+
}
|
| 515 |
+
if (numBytes - i === 2) {
|
| 516 |
+
segment = (rawData[i] << 16) + (rawData[i + 1] << 8);
|
| 517 |
+
output += table[segment >> 12];
|
| 518 |
+
output += b64_6bit[(segment & 0xfff) >> 6];
|
| 519 |
+
output += '=';
|
| 520 |
+
} else if (numBytes - i === 1) {
|
| 521 |
+
segment = (rawData[i] << 16);
|
| 522 |
+
output += table[segment >> 12];
|
| 523 |
+
output += '==';
|
| 524 |
+
}
|
| 525 |
+
return output;
|
| 526 |
+
}
|
| 527 |
+
|
| 528 |
+
});
|
| 529 |
+
|
| 530 |
+
// file: src/common/builder.js
|
| 531 |
+
define("cordova/builder", function(require, exports, module) {
|
| 532 |
+
|
| 533 |
+
var utils = require('cordova/utils');
|
| 534 |
+
|
| 535 |
+
function each (objects, func, context) {
|
| 536 |
+
for (var prop in objects) {
|
| 537 |
+
if (objects.hasOwnProperty(prop)) {
|
| 538 |
+
func.apply(context, [objects[prop], prop]);
|
| 539 |
+
}
|
| 540 |
+
}
|
| 541 |
+
}
|
| 542 |
+
|
| 543 |
+
function clobber (obj, key, value) {
|
| 544 |
+
exports.replaceHookForTesting(obj, key);
|
| 545 |
+
var needsProperty = false;
|
| 546 |
+
try {
|
| 547 |
+
obj[key] = value;
|
| 548 |
+
} catch (e) {
|
| 549 |
+
needsProperty = true;
|
| 550 |
+
}
|
| 551 |
+
// Getters can only be overridden by getters.
|
| 552 |
+
if (needsProperty || obj[key] !== value) {
|
| 553 |
+
utils.defineGetter(obj, key, function () {
|
| 554 |
+
return value;
|
| 555 |
+
});
|
| 556 |
+
}
|
| 557 |
+
}
|
| 558 |
+
|
| 559 |
+
function assignOrWrapInDeprecateGetter (obj, key, value, message) {
|
| 560 |
+
if (message) {
|
| 561 |
+
utils.defineGetter(obj, key, function () {
|
| 562 |
+
console.log(message);
|
| 563 |
+
delete obj[key];
|
| 564 |
+
clobber(obj, key, value);
|
| 565 |
+
return value;
|
| 566 |
+
});
|
| 567 |
+
} else {
|
| 568 |
+
clobber(obj, key, value);
|
| 569 |
+
}
|
| 570 |
+
}
|
| 571 |
+
|
| 572 |
+
function include (parent, objects, clobber, merge) {
|
| 573 |
+
each(objects, function (obj, key) {
|
| 574 |
+
try {
|
| 575 |
+
var result = obj.path ? require(obj.path) : {};
|
| 576 |
+
|
| 577 |
+
if (clobber) {
|
| 578 |
+
// Clobber if it doesn't exist.
|
| 579 |
+
if (typeof parent[key] === 'undefined') {
|
| 580 |
+
assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
|
| 581 |
+
} else if (typeof obj.path !== 'undefined') {
|
| 582 |
+
// If merging, merge properties onto parent, otherwise, clobber.
|
| 583 |
+
if (merge) {
|
| 584 |
+
recursiveMerge(parent[key], result);
|
| 585 |
+
} else {
|
| 586 |
+
assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
|
| 587 |
+
}
|
| 588 |
+
}
|
| 589 |
+
result = parent[key];
|
| 590 |
+
} else {
|
| 591 |
+
// Overwrite if not currently defined.
|
| 592 |
+
if (typeof parent[key] === 'undefined') {
|
| 593 |
+
assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
|
| 594 |
+
} else {
|
| 595 |
+
// Set result to what already exists, so we can build children into it if they exist.
|
| 596 |
+
result = parent[key];
|
| 597 |
+
}
|
| 598 |
+
}
|
| 599 |
+
|
| 600 |
+
if (obj.children) {
|
| 601 |
+
include(result, obj.children, clobber, merge);
|
| 602 |
+
}
|
| 603 |
+
} catch (e) {
|
| 604 |
+
utils.alert('Exception building Cordova JS globals: ' + e + ' for key "' + key + '"');
|
| 605 |
+
}
|
| 606 |
+
});
|
| 607 |
+
}
|
| 608 |
+
|
| 609 |
+
/**
|
| 610 |
+
* Merge properties from one object onto another recursively. Properties from
|
| 611 |
+
* the src object will overwrite existing target property.
|
| 612 |
+
*
|
| 613 |
+
* @param target Object to merge properties into.
|
| 614 |
+
* @param src Object to merge properties from.
|
| 615 |
+
*/
|
| 616 |
+
function recursiveMerge (target, src) {
|
| 617 |
+
for (var prop in src) {
|
| 618 |
+
if (src.hasOwnProperty(prop)) {
|
| 619 |
+
if (target.prototype && target.prototype.constructor === target) {
|
| 620 |
+
// If the target object is a constructor override off prototype.
|
| 621 |
+
clobber(target.prototype, prop, src[prop]);
|
| 622 |
+
} else {
|
| 623 |
+
if (typeof src[prop] === 'object' && typeof target[prop] === 'object') {
|
| 624 |
+
recursiveMerge(target[prop], src[prop]);
|
| 625 |
+
} else {
|
| 626 |
+
clobber(target, prop, src[prop]);
|
| 627 |
+
}
|
| 628 |
+
}
|
| 629 |
+
}
|
| 630 |
+
}
|
| 631 |
+
}
|
| 632 |
+
|
| 633 |
+
exports.buildIntoButDoNotClobber = function (objects, target) {
|
| 634 |
+
include(target, objects, false, false);
|
| 635 |
+
};
|
| 636 |
+
exports.buildIntoAndClobber = function (objects, target) {
|
| 637 |
+
include(target, objects, true, false);
|
| 638 |
+
};
|
| 639 |
+
exports.buildIntoAndMerge = function (objects, target) {
|
| 640 |
+
include(target, objects, true, true);
|
| 641 |
+
};
|
| 642 |
+
exports.recursiveMerge = recursiveMerge;
|
| 643 |
+
exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter;
|
| 644 |
+
exports.replaceHookForTesting = function () {};
|
| 645 |
+
|
| 646 |
+
});
|
| 647 |
+
|
| 648 |
+
// file: src/common/channel.js
|
| 649 |
+
define("cordova/channel", function(require, exports, module) {
|
| 650 |
+
|
| 651 |
+
var utils = require('cordova/utils');
|
| 652 |
+
var nextGuid = 1;
|
| 653 |
+
|
| 654 |
+
/**
|
| 655 |
+
* Custom pub-sub "channel" that can have functions subscribed to it
|
| 656 |
+
* This object is used to define and control firing of events for
|
| 657 |
+
* cordova initialization, as well as for custom events thereafter.
|
| 658 |
+
*
|
| 659 |
+
* The order of events during page load and Cordova startup is as follows:
|
| 660 |
+
*
|
| 661 |
+
* onDOMContentLoaded* Internal event that is received when the web page is loaded and parsed.
|
| 662 |
+
* onNativeReady* Internal event that indicates the Cordova native side is ready.
|
| 663 |
+
* onCordovaReady* Internal event fired when all Cordova JavaScript objects have been created.
|
| 664 |
+
* onDeviceReady* User event fired to indicate that Cordova is ready
|
| 665 |
+
* onResume User event fired to indicate a start/resume lifecycle event
|
| 666 |
+
* onPause User event fired to indicate a pause lifecycle event
|
| 667 |
+
*
|
| 668 |
+
* The events marked with an * are sticky. Once they have fired, they will stay in the fired state.
|
| 669 |
+
* All listeners that subscribe after the event is fired will be executed right away.
|
| 670 |
+
*
|
| 671 |
+
* The only Cordova events that user code should register for are:
|
| 672 |
+
* deviceready Cordova native code is initialized and Cordova APIs can be called from JavaScript
|
| 673 |
+
* pause App has moved to background
|
| 674 |
+
* resume App has returned to foreground
|
| 675 |
+
*
|
| 676 |
+
* Listeners can be registered as:
|
| 677 |
+
* document.addEventListener("deviceready", myDeviceReadyListener, false);
|
| 678 |
+
* document.addEventListener("resume", myResumeListener, false);
|
| 679 |
+
* document.addEventListener("pause", myPauseListener, false);
|
| 680 |
+
*
|
| 681 |
+
* The DOM lifecycle events should be used for saving and restoring state
|
| 682 |
+
* window.onload
|
| 683 |
+
* window.onunload
|
| 684 |
+
*
|
| 685 |
+
*/
|
| 686 |
+
|
| 687 |
+
/**
|
| 688 |
+
* Channel
|
| 689 |
+
* @constructor
|
| 690 |
+
* @param type String the channel name
|
| 691 |
+
*/
|
| 692 |
+
var Channel = function (type, sticky) {
|
| 693 |
+
this.type = type;
|
| 694 |
+
// Map of guid -> function.
|
| 695 |
+
this.handlers = {};
|
| 696 |
+
// 0 = Non-sticky, 1 = Sticky non-fired, 2 = Sticky fired.
|
| 697 |
+
this.state = sticky ? 1 : 0;
|
| 698 |
+
// Used in sticky mode to remember args passed to fire().
|
| 699 |
+
this.fireArgs = null;
|
| 700 |
+
// Used by onHasSubscribersChange to know if there are any listeners.
|
| 701 |
+
this.numHandlers = 0;
|
| 702 |
+
// Function that is called when the first listener is subscribed, or when
|
| 703 |
+
// the last listener is unsubscribed.
|
| 704 |
+
this.onHasSubscribersChange = null;
|
| 705 |
+
};
|
| 706 |
+
var channel = {
|
| 707 |
+
/**
|
| 708 |
+
* Calls the provided function only after all of the channels specified
|
| 709 |
+
* have been fired. All channels must be sticky channels.
|
| 710 |
+
*/
|
| 711 |
+
join: function (h, c) {
|
| 712 |
+
var len = c.length;
|
| 713 |
+
var i = len;
|
| 714 |
+
var f = function () {
|
| 715 |
+
if (!(--i)) h();
|
| 716 |
+
};
|
| 717 |
+
for (var j = 0; j < len; j++) {
|
| 718 |
+
if (c[j].state === 0) {
|
| 719 |
+
throw Error('Can only use join with sticky channels.');
|
| 720 |
+
}
|
| 721 |
+
c[j].subscribe(f);
|
| 722 |
+
}
|
| 723 |
+
if (!len) h();
|
| 724 |
+
},
|
| 725 |
+
/* eslint-disable no-return-assign */
|
| 726 |
+
create: function (type) {
|
| 727 |
+
return channel[type] = new Channel(type, false);
|
| 728 |
+
},
|
| 729 |
+
createSticky: function (type) {
|
| 730 |
+
return channel[type] = new Channel(type, true);
|
| 731 |
+
},
|
| 732 |
+
/* eslint-enable no-return-assign */
|
| 733 |
+
/**
|
| 734 |
+
* cordova Channels that must fire before "deviceready" is fired.
|
| 735 |
+
*/
|
| 736 |
+
deviceReadyChannelsArray: [],
|
| 737 |
+
deviceReadyChannelsMap: {},
|
| 738 |
+
|
| 739 |
+
/**
|
| 740 |
+
* Indicate that a feature needs to be initialized before it is ready to be used.
|
| 741 |
+
* This holds up Cordova's "deviceready" event until the feature has been initialized
|
| 742 |
+
* and Cordova.initComplete(feature) is called.
|
| 743 |
+
*
|
| 744 |
+
* @param feature {String} The unique feature name
|
| 745 |
+
*/
|
| 746 |
+
waitForInitialization: function (feature) {
|
| 747 |
+
if (feature) {
|
| 748 |
+
var c = channel[feature] || this.createSticky(feature);
|
| 749 |
+
this.deviceReadyChannelsMap[feature] = c;
|
| 750 |
+
this.deviceReadyChannelsArray.push(c);
|
| 751 |
+
}
|
| 752 |
+
},
|
| 753 |
+
|
| 754 |
+
/**
|
| 755 |
+
* Indicate that initialization code has completed and the feature is ready to be used.
|
| 756 |
+
*
|
| 757 |
+
* @param feature {String} The unique feature name
|
| 758 |
+
*/
|
| 759 |
+
initializationComplete: function (feature) {
|
| 760 |
+
var c = this.deviceReadyChannelsMap[feature];
|
| 761 |
+
if (c) {
|
| 762 |
+
c.fire();
|
| 763 |
+
}
|
| 764 |
+
}
|
| 765 |
+
};
|
| 766 |
+
|
| 767 |
+
function checkSubscriptionArgument (argument) {
|
| 768 |
+
if (typeof argument !== 'function' && typeof argument.handleEvent !== 'function') {
|
| 769 |
+
throw new Error(
|
| 770 |
+
'Must provide a function or an EventListener object ' +
|
| 771 |
+
'implementing the handleEvent interface.'
|
| 772 |
+
);
|
| 773 |
+
}
|
| 774 |
+
}
|
| 775 |
+
|
| 776 |
+
/**
|
| 777 |
+
* Subscribes the given function to the channel. Any time that
|
| 778 |
+
* Channel.fire is called so too will the function.
|
| 779 |
+
* Optionally specify an execution context for the function
|
| 780 |
+
* and a guid that can be used to stop subscribing to the channel.
|
| 781 |
+
* Returns the guid.
|
| 782 |
+
*/
|
| 783 |
+
Channel.prototype.subscribe = function (eventListenerOrFunction, eventListener) {
|
| 784 |
+
checkSubscriptionArgument(eventListenerOrFunction);
|
| 785 |
+
var handleEvent, guid;
|
| 786 |
+
|
| 787 |
+
if (eventListenerOrFunction && typeof eventListenerOrFunction === 'object') {
|
| 788 |
+
// Received an EventListener object implementing the handleEvent interface
|
| 789 |
+
handleEvent = eventListenerOrFunction.handleEvent;
|
| 790 |
+
eventListener = eventListenerOrFunction;
|
| 791 |
+
} else {
|
| 792 |
+
// Received a function to handle event
|
| 793 |
+
handleEvent = eventListenerOrFunction;
|
| 794 |
+
}
|
| 795 |
+
|
| 796 |
+
if (this.state === 2) {
|
| 797 |
+
handleEvent.apply(eventListener || this, this.fireArgs);
|
| 798 |
+
return;
|
| 799 |
+
}
|
| 800 |
+
|
| 801 |
+
guid = eventListenerOrFunction.observer_guid;
|
| 802 |
+
if (typeof eventListener === 'object') {
|
| 803 |
+
handleEvent = utils.close(eventListener, handleEvent);
|
| 804 |
+
}
|
| 805 |
+
|
| 806 |
+
if (!guid) {
|
| 807 |
+
// First time any channel has seen this subscriber
|
| 808 |
+
guid = '' + nextGuid++;
|
| 809 |
+
}
|
| 810 |
+
handleEvent.observer_guid = guid;
|
| 811 |
+
eventListenerOrFunction.observer_guid = guid;
|
| 812 |
+
|
| 813 |
+
// Don't add the same handler more than once.
|
| 814 |
+
if (!this.handlers[guid]) {
|
| 815 |
+
this.handlers[guid] = handleEvent;
|
| 816 |
+
this.numHandlers++;
|
| 817 |
+
if (this.numHandlers === 1) {
|
| 818 |
+
this.onHasSubscribersChange && this.onHasSubscribersChange();
|
| 819 |
+
}
|
| 820 |
+
}
|
| 821 |
+
};
|
| 822 |
+
|
| 823 |
+
/**
|
| 824 |
+
* Unsubscribes the function with the given guid from the channel.
|
| 825 |
+
*/
|
| 826 |
+
Channel.prototype.unsubscribe = function (eventListenerOrFunction) {
|
| 827 |
+
checkSubscriptionArgument(eventListenerOrFunction);
|
| 828 |
+
var handleEvent, guid, handler;
|
| 829 |
+
|
| 830 |
+
if (eventListenerOrFunction && typeof eventListenerOrFunction === 'object') {
|
| 831 |
+
// Received an EventListener object implementing the handleEvent interface
|
| 832 |
+
handleEvent = eventListenerOrFunction.handleEvent;
|
| 833 |
+
} else {
|
| 834 |
+
// Received a function to handle event
|
| 835 |
+
handleEvent = eventListenerOrFunction;
|
| 836 |
+
}
|
| 837 |
+
|
| 838 |
+
guid = handleEvent.observer_guid;
|
| 839 |
+
handler = this.handlers[guid];
|
| 840 |
+
if (handler) {
|
| 841 |
+
delete this.handlers[guid];
|
| 842 |
+
this.numHandlers--;
|
| 843 |
+
if (this.numHandlers === 0) {
|
| 844 |
+
this.onHasSubscribersChange && this.onHasSubscribersChange();
|
| 845 |
+
}
|
| 846 |
+
}
|
| 847 |
+
};
|
| 848 |
+
|
| 849 |
+
/**
|
| 850 |
+
* Calls all functions subscribed to this channel.
|
| 851 |
+
*/
|
| 852 |
+
Channel.prototype.fire = function (e) {
|
| 853 |
+
var fail = false; // eslint-disable-line no-unused-vars
|
| 854 |
+
var fireArgs = Array.prototype.slice.call(arguments);
|
| 855 |
+
// Apply stickiness.
|
| 856 |
+
if (this.state === 1) {
|
| 857 |
+
this.state = 2;
|
| 858 |
+
this.fireArgs = fireArgs;
|
| 859 |
+
}
|
| 860 |
+
if (this.numHandlers) {
|
| 861 |
+
// Copy the values first so that it is safe to modify it from within
|
| 862 |
+
// callbacks.
|
| 863 |
+
var toCall = [];
|
| 864 |
+
for (var item in this.handlers) {
|
| 865 |
+
toCall.push(this.handlers[item]);
|
| 866 |
+
}
|
| 867 |
+
for (var i = 0; i < toCall.length; ++i) {
|
| 868 |
+
toCall[i].apply(this, fireArgs);
|
| 869 |
+
}
|
| 870 |
+
if (this.state === 2 && this.numHandlers) {
|
| 871 |
+
this.numHandlers = 0;
|
| 872 |
+
this.handlers = {};
|
| 873 |
+
this.onHasSubscribersChange && this.onHasSubscribersChange();
|
| 874 |
+
}
|
| 875 |
+
}
|
| 876 |
+
};
|
| 877 |
+
|
| 878 |
+
// defining them here so they are ready super fast!
|
| 879 |
+
// DOM event that is received when the web page is loaded and parsed.
|
| 880 |
+
channel.createSticky('onDOMContentLoaded');
|
| 881 |
+
|
| 882 |
+
// Event to indicate the Cordova native side is ready.
|
| 883 |
+
channel.createSticky('onNativeReady');
|
| 884 |
+
|
| 885 |
+
// Event to indicate that all Cordova JavaScript objects have been created
|
| 886 |
+
// and it's time to run plugin constructors.
|
| 887 |
+
channel.createSticky('onCordovaReady');
|
| 888 |
+
|
| 889 |
+
// Event to indicate that all automatically loaded JS plugins are loaded and ready.
|
| 890 |
+
// FIXME remove this
|
| 891 |
+
channel.createSticky('onPluginsReady');
|
| 892 |
+
|
| 893 |
+
// Event to indicate that Cordova is ready
|
| 894 |
+
channel.createSticky('onDeviceReady');
|
| 895 |
+
|
| 896 |
+
// Event to indicate a resume lifecycle event
|
| 897 |
+
channel.create('onResume');
|
| 898 |
+
|
| 899 |
+
// Event to indicate a pause lifecycle event
|
| 900 |
+
channel.create('onPause');
|
| 901 |
+
|
| 902 |
+
// Channels that must fire before "deviceready" is fired.
|
| 903 |
+
channel.waitForInitialization('onCordovaReady');
|
| 904 |
+
channel.waitForInitialization('onDOMContentLoaded');
|
| 905 |
+
|
| 906 |
+
module.exports = channel;
|
| 907 |
+
|
| 908 |
+
});
|
| 909 |
+
|
| 910 |
+
// file: ../cordova-android/cordova-js-src/exec.js
|
| 911 |
+
define("cordova/exec", function(require, exports, module) {
|
| 912 |
+
|
| 913 |
+
/**
|
| 914 |
+
* Execute a cordova command. It is up to the native side whether this action
|
| 915 |
+
* is synchronous or asynchronous. The native side can return:
|
| 916 |
+
* Synchronous: PluginResult object as a JSON string
|
| 917 |
+
* Asynchronous: Empty string ""
|
| 918 |
+
* If async, the native side will cordova.callbackSuccess or cordova.callbackError,
|
| 919 |
+
* depending upon the result of the action.
|
| 920 |
+
*
|
| 921 |
+
* @param {Function} success The success callback
|
| 922 |
+
* @param {Function} fail The fail callback
|
| 923 |
+
* @param {String} service The name of the service to use
|
| 924 |
+
* @param {String} action Action to be run in cordova
|
| 925 |
+
* @param {String[]} [args] Zero or more arguments to pass to the method
|
| 926 |
+
*/
|
| 927 |
+
var cordova = require('cordova'),
|
| 928 |
+
nativeApiProvider = require('cordova/android/nativeapiprovider'),
|
| 929 |
+
utils = require('cordova/utils'),
|
| 930 |
+
base64 = require('cordova/base64'),
|
| 931 |
+
channel = require('cordova/channel'),
|
| 932 |
+
jsToNativeModes = {
|
| 933 |
+
PROMPT: 0,
|
| 934 |
+
JS_OBJECT: 1
|
| 935 |
+
},
|
| 936 |
+
nativeToJsModes = {
|
| 937 |
+
// Polls for messages using the JS->Native bridge.
|
| 938 |
+
POLLING: 0,
|
| 939 |
+
// For LOAD_URL to be viable, it would need to have a work-around for
|
| 940 |
+
// the bug where the soft-keyboard gets dismissed when a message is sent.
|
| 941 |
+
LOAD_URL: 1,
|
| 942 |
+
// For the ONLINE_EVENT to be viable, it would need to intercept all event
|
| 943 |
+
// listeners (both through addEventListener and window.ononline) as well
|
| 944 |
+
// as set the navigator property itself.
|
| 945 |
+
ONLINE_EVENT: 2,
|
| 946 |
+
EVAL_BRIDGE: 3
|
| 947 |
+
},
|
| 948 |
+
jsToNativeBridgeMode, // Set lazily.
|
| 949 |
+
nativeToJsBridgeMode = nativeToJsModes.EVAL_BRIDGE,
|
| 950 |
+
pollEnabled = false,
|
| 951 |
+
bridgeSecret = -1;
|
| 952 |
+
|
| 953 |
+
var messagesFromNative = [];
|
| 954 |
+
var isProcessing = false;
|
| 955 |
+
var resolvedPromise = typeof Promise == 'undefined' ? null : Promise.resolve();
|
| 956 |
+
var nextTick = resolvedPromise ? function(fn) { resolvedPromise.then(fn); } : function(fn) { setTimeout(fn); };
|
| 957 |
+
|
| 958 |
+
function androidExec(success, fail, service, action, args) {
|
| 959 |
+
if (bridgeSecret < 0) {
|
| 960 |
+
// If we ever catch this firing, we'll need to queue up exec()s
|
| 961 |
+
// and fire them once we get a secret. For now, I don't think
|
| 962 |
+
// it's possible for exec() to be called since plugins are parsed but
|
| 963 |
+
// not run until until after onNativeReady.
|
| 964 |
+
throw new Error('exec() called without bridgeSecret');
|
| 965 |
+
}
|
| 966 |
+
// Set default bridge modes if they have not already been set.
|
| 967 |
+
// By default, we use the failsafe, since addJavascriptInterface breaks too often
|
| 968 |
+
if (jsToNativeBridgeMode === undefined) {
|
| 969 |
+
androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
|
| 970 |
+
}
|
| 971 |
+
|
| 972 |
+
// If args is not provided, default to an empty array
|
| 973 |
+
args = args || [];
|
| 974 |
+
|
| 975 |
+
// Process any ArrayBuffers in the args into a string.
|
| 976 |
+
for (var i = 0; i < args.length; i++) {
|
| 977 |
+
if (utils.typeName(args[i]) == 'ArrayBuffer') {
|
| 978 |
+
args[i] = base64.fromArrayBuffer(args[i]);
|
| 979 |
+
}
|
| 980 |
+
}
|
| 981 |
+
|
| 982 |
+
var callbackId = service + cordova.callbackId++,
|
| 983 |
+
argsJson = JSON.stringify(args);
|
| 984 |
+
if (success || fail) {
|
| 985 |
+
cordova.callbacks[callbackId] = {success:success, fail:fail};
|
| 986 |
+
}
|
| 987 |
+
|
| 988 |
+
var msgs = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson);
|
| 989 |
+
// If argsJson was received by Java as null, try again with the PROMPT bridge mode.
|
| 990 |
+
// This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2. See CB-2666.
|
| 991 |
+
if (jsToNativeBridgeMode == jsToNativeModes.JS_OBJECT && msgs === "@Null arguments.") {
|
| 992 |
+
androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT);
|
| 993 |
+
androidExec(success, fail, service, action, args);
|
| 994 |
+
androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
|
| 995 |
+
} else if (msgs) {
|
| 996 |
+
messagesFromNative.push(msgs);
|
| 997 |
+
// Always process async to avoid exceptions messing up stack.
|
| 998 |
+
nextTick(processMessages);
|
| 999 |
+
}
|
| 1000 |
+
}
|
| 1001 |
+
|
| 1002 |
+
androidExec.init = function() {
|
| 1003 |
+
bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode);
|
| 1004 |
+
channel.onNativeReady.fire();
|
| 1005 |
+
};
|
| 1006 |
+
|
| 1007 |
+
function pollOnceFromOnlineEvent() {
|
| 1008 |
+
pollOnce(true);
|
| 1009 |
+
}
|
| 1010 |
+
|
| 1011 |
+
function pollOnce(opt_fromOnlineEvent) {
|
| 1012 |
+
if (bridgeSecret < 0) {
|
| 1013 |
+
// This can happen when the NativeToJsMessageQueue resets the online state on page transitions.
|
| 1014 |
+
// We know there's nothing to retrieve, so no need to poll.
|
| 1015 |
+
return;
|
| 1016 |
+
}
|
| 1017 |
+
var msgs = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent);
|
| 1018 |
+
if (msgs) {
|
| 1019 |
+
messagesFromNative.push(msgs);
|
| 1020 |
+
// Process sync since we know we're already top-of-stack.
|
| 1021 |
+
processMessages();
|
| 1022 |
+
}
|
| 1023 |
+
}
|
| 1024 |
+
|
| 1025 |
+
function pollingTimerFunc() {
|
| 1026 |
+
if (pollEnabled) {
|
| 1027 |
+
pollOnce();
|
| 1028 |
+
setTimeout(pollingTimerFunc, 50);
|
| 1029 |
+
}
|
| 1030 |
+
}
|
| 1031 |
+
|
| 1032 |
+
function hookOnlineApis() {
|
| 1033 |
+
function proxyEvent(e) {
|
| 1034 |
+
cordova.fireWindowEvent(e.type);
|
| 1035 |
+
}
|
| 1036 |
+
// The network module takes care of firing online and offline events.
|
| 1037 |
+
// It currently fires them only on document though, so we bridge them
|
| 1038 |
+
// to window here (while first listening for exec()-releated online/offline
|
| 1039 |
+
// events).
|
| 1040 |
+
window.addEventListener('online', pollOnceFromOnlineEvent, false);
|
| 1041 |
+
window.addEventListener('offline', pollOnceFromOnlineEvent, false);
|
| 1042 |
+
cordova.addWindowEventHandler('online');
|
| 1043 |
+
cordova.addWindowEventHandler('offline');
|
| 1044 |
+
document.addEventListener('online', proxyEvent, false);
|
| 1045 |
+
document.addEventListener('offline', proxyEvent, false);
|
| 1046 |
+
}
|
| 1047 |
+
|
| 1048 |
+
hookOnlineApis();
|
| 1049 |
+
|
| 1050 |
+
androidExec.jsToNativeModes = jsToNativeModes;
|
| 1051 |
+
androidExec.nativeToJsModes = nativeToJsModes;
|
| 1052 |
+
|
| 1053 |
+
androidExec.setJsToNativeBridgeMode = function(mode) {
|
| 1054 |
+
if (mode == jsToNativeModes.JS_OBJECT && !window._cordovaNative) {
|
| 1055 |
+
mode = jsToNativeModes.PROMPT;
|
| 1056 |
+
}
|
| 1057 |
+
nativeApiProvider.setPreferPrompt(mode == jsToNativeModes.PROMPT);
|
| 1058 |
+
jsToNativeBridgeMode = mode;
|
| 1059 |
+
};
|
| 1060 |
+
|
| 1061 |
+
androidExec.setNativeToJsBridgeMode = function(mode) {
|
| 1062 |
+
if (mode == nativeToJsBridgeMode) {
|
| 1063 |
+
return;
|
| 1064 |
+
}
|
| 1065 |
+
if (nativeToJsBridgeMode == nativeToJsModes.POLLING) {
|
| 1066 |
+
pollEnabled = false;
|
| 1067 |
+
}
|
| 1068 |
+
|
| 1069 |
+
nativeToJsBridgeMode = mode;
|
| 1070 |
+
// Tell the native side to switch modes.
|
| 1071 |
+
// Otherwise, it will be set by androidExec.init()
|
| 1072 |
+
if (bridgeSecret >= 0) {
|
| 1073 |
+
nativeApiProvider.get().setNativeToJsBridgeMode(bridgeSecret, mode);
|
| 1074 |
+
}
|
| 1075 |
+
|
| 1076 |
+
if (mode == nativeToJsModes.POLLING) {
|
| 1077 |
+
pollEnabled = true;
|
| 1078 |
+
setTimeout(pollingTimerFunc, 1);
|
| 1079 |
+
}
|
| 1080 |
+
};
|
| 1081 |
+
|
| 1082 |
+
function buildPayload(payload, message) {
|
| 1083 |
+
var payloadKind = message.charAt(0);
|
| 1084 |
+
if (payloadKind == 's') {
|
| 1085 |
+
payload.push(message.slice(1));
|
| 1086 |
+
} else if (payloadKind == 't') {
|
| 1087 |
+
payload.push(true);
|
| 1088 |
+
} else if (payloadKind == 'f') {
|
| 1089 |
+
payload.push(false);
|
| 1090 |
+
} else if (payloadKind == 'N') {
|
| 1091 |
+
payload.push(null);
|
| 1092 |
+
} else if (payloadKind == 'n') {
|
| 1093 |
+
payload.push(+message.slice(1));
|
| 1094 |
+
} else if (payloadKind == 'A') {
|
| 1095 |
+
var data = message.slice(1);
|
| 1096 |
+
payload.push(base64.toArrayBuffer(data));
|
| 1097 |
+
} else if (payloadKind == 'S') {
|
| 1098 |
+
payload.push(window.atob(message.slice(1)));
|
| 1099 |
+
} else if (payloadKind == 'M') {
|
| 1100 |
+
var multipartMessages = message.slice(1);
|
| 1101 |
+
while (multipartMessages !== "") {
|
| 1102 |
+
var spaceIdx = multipartMessages.indexOf(' ');
|
| 1103 |
+
var msgLen = +multipartMessages.slice(0, spaceIdx);
|
| 1104 |
+
var multipartMessage = multipartMessages.substr(spaceIdx + 1, msgLen);
|
| 1105 |
+
multipartMessages = multipartMessages.slice(spaceIdx + msgLen + 1);
|
| 1106 |
+
buildPayload(payload, multipartMessage);
|
| 1107 |
+
}
|
| 1108 |
+
} else {
|
| 1109 |
+
payload.push(JSON.parse(message));
|
| 1110 |
+
}
|
| 1111 |
+
}
|
| 1112 |
+
|
| 1113 |
+
// Processes a single message, as encoded by NativeToJsMessageQueue.java.
|
| 1114 |
+
function processMessage(message) {
|
| 1115 |
+
var firstChar = message.charAt(0);
|
| 1116 |
+
if (firstChar == 'J') {
|
| 1117 |
+
// This is deprecated on the .java side. It doesn't work with CSP enabled.
|
| 1118 |
+
eval(message.slice(1));
|
| 1119 |
+
} else if (firstChar == 'S' || firstChar == 'F') {
|
| 1120 |
+
var success = firstChar == 'S';
|
| 1121 |
+
var keepCallback = message.charAt(1) == '1';
|
| 1122 |
+
var spaceIdx = message.indexOf(' ', 2);
|
| 1123 |
+
var status = +message.slice(2, spaceIdx);
|
| 1124 |
+
var nextSpaceIdx = message.indexOf(' ', spaceIdx + 1);
|
| 1125 |
+
var callbackId = message.slice(spaceIdx + 1, nextSpaceIdx);
|
| 1126 |
+
var payloadMessage = message.slice(nextSpaceIdx + 1);
|
| 1127 |
+
var payload = [];
|
| 1128 |
+
buildPayload(payload, payloadMessage);
|
| 1129 |
+
cordova.callbackFromNative(callbackId, success, status, payload, keepCallback);
|
| 1130 |
+
} else {
|
| 1131 |
+
console.log("processMessage failed: invalid message: " + JSON.stringify(message));
|
| 1132 |
+
}
|
| 1133 |
+
}
|
| 1134 |
+
|
| 1135 |
+
function processMessages() {
|
| 1136 |
+
// Check for the reentrant case.
|
| 1137 |
+
if (isProcessing) {
|
| 1138 |
+
return;
|
| 1139 |
+
}
|
| 1140 |
+
if (messagesFromNative.length === 0) {
|
| 1141 |
+
return;
|
| 1142 |
+
}
|
| 1143 |
+
isProcessing = true;
|
| 1144 |
+
try {
|
| 1145 |
+
var msg = popMessageFromQueue();
|
| 1146 |
+
// The Java side can send a * message to indicate that it
|
| 1147 |
+
// still has messages waiting to be retrieved.
|
| 1148 |
+
if (msg == '*' && messagesFromNative.length === 0) {
|
| 1149 |
+
nextTick(pollOnce);
|
| 1150 |
+
return;
|
| 1151 |
+
}
|
| 1152 |
+
processMessage(msg);
|
| 1153 |
+
} finally {
|
| 1154 |
+
isProcessing = false;
|
| 1155 |
+
if (messagesFromNative.length > 0) {
|
| 1156 |
+
nextTick(processMessages);
|
| 1157 |
+
}
|
| 1158 |
+
}
|
| 1159 |
+
}
|
| 1160 |
+
|
| 1161 |
+
function popMessageFromQueue() {
|
| 1162 |
+
var messageBatch = messagesFromNative.shift();
|
| 1163 |
+
if (messageBatch == '*') {
|
| 1164 |
+
return '*';
|
| 1165 |
+
}
|
| 1166 |
+
|
| 1167 |
+
var spaceIdx = messageBatch.indexOf(' ');
|
| 1168 |
+
var msgLen = +messageBatch.slice(0, spaceIdx);
|
| 1169 |
+
var message = messageBatch.substr(spaceIdx + 1, msgLen);
|
| 1170 |
+
messageBatch = messageBatch.slice(spaceIdx + msgLen + 1);
|
| 1171 |
+
if (messageBatch) {
|
| 1172 |
+
messagesFromNative.unshift(messageBatch);
|
| 1173 |
+
}
|
| 1174 |
+
return message;
|
| 1175 |
+
}
|
| 1176 |
+
|
| 1177 |
+
module.exports = androidExec;
|
| 1178 |
+
|
| 1179 |
+
});
|
| 1180 |
+
|
| 1181 |
+
// file: src/common/exec/proxy.js
|
| 1182 |
+
define("cordova/exec/proxy", function(require, exports, module) {
|
| 1183 |
+
|
| 1184 |
+
// internal map of proxy function
|
| 1185 |
+
var CommandProxyMap = {};
|
| 1186 |
+
|
| 1187 |
+
module.exports = {
|
| 1188 |
+
|
| 1189 |
+
// example: cordova.commandProxy.add("Accelerometer",{getCurrentAcceleration: function(successCallback, errorCallback, options) {...},...);
|
| 1190 |
+
add: function (id, proxyObj) {
|
| 1191 |
+
console.log('adding proxy for ' + id);
|
| 1192 |
+
CommandProxyMap[id] = proxyObj;
|
| 1193 |
+
return proxyObj;
|
| 1194 |
+
},
|
| 1195 |
+
|
| 1196 |
+
// cordova.commandProxy.remove("Accelerometer");
|
| 1197 |
+
remove: function (id) {
|
| 1198 |
+
var proxy = CommandProxyMap[id];
|
| 1199 |
+
delete CommandProxyMap[id];
|
| 1200 |
+
CommandProxyMap[id] = null;
|
| 1201 |
+
return proxy;
|
| 1202 |
+
},
|
| 1203 |
+
|
| 1204 |
+
get: function (service, action) {
|
| 1205 |
+
return (CommandProxyMap[service] ? CommandProxyMap[service][action] : null);
|
| 1206 |
+
}
|
| 1207 |
+
};
|
| 1208 |
+
|
| 1209 |
+
});
|
| 1210 |
+
|
| 1211 |
+
// file: src/common/init.js
|
| 1212 |
+
define("cordova/init", function(require, exports, module) {
|
| 1213 |
+
|
| 1214 |
+
var channel = require('cordova/channel');
|
| 1215 |
+
var cordova = require('cordova');
|
| 1216 |
+
var modulemapper = require('cordova/modulemapper');
|
| 1217 |
+
var platform = require('cordova/platform');
|
| 1218 |
+
var pluginloader = require('cordova/pluginloader');
|
| 1219 |
+
var utils = require('cordova/utils');
|
| 1220 |
+
|
| 1221 |
+
var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady];
|
| 1222 |
+
|
| 1223 |
+
function logUnfiredChannels (arr) {
|
| 1224 |
+
for (var i = 0; i < arr.length; ++i) {
|
| 1225 |
+
if (arr[i].state !== 2) {
|
| 1226 |
+
console.log('Channel not fired: ' + arr[i].type);
|
| 1227 |
+
}
|
| 1228 |
+
}
|
| 1229 |
+
}
|
| 1230 |
+
|
| 1231 |
+
window.setTimeout(function () {
|
| 1232 |
+
if (channel.onDeviceReady.state !== 2) {
|
| 1233 |
+
console.log('deviceready has not fired after 5 seconds.');
|
| 1234 |
+
logUnfiredChannels(platformInitChannelsArray);
|
| 1235 |
+
logUnfiredChannels(channel.deviceReadyChannelsArray);
|
| 1236 |
+
}
|
| 1237 |
+
}, 5000);
|
| 1238 |
+
|
| 1239 |
+
// Replace navigator before any modules are required(), to ensure it happens as soon as possible.
|
| 1240 |
+
// We replace it so that properties that can't be clobbered can instead be overridden.
|
| 1241 |
+
function replaceNavigator (origNavigator) {
|
| 1242 |
+
var CordovaNavigator = function () {};
|
| 1243 |
+
CordovaNavigator.prototype = origNavigator;
|
| 1244 |
+
var newNavigator = new CordovaNavigator();
|
| 1245 |
+
// This work-around really only applies to new APIs that are newer than Function.bind.
|
| 1246 |
+
// Without it, APIs such as getGamepads() break.
|
| 1247 |
+
if (CordovaNavigator.bind) {
|
| 1248 |
+
for (var key in origNavigator) {
|
| 1249 |
+
if (typeof origNavigator[key] === 'function') {
|
| 1250 |
+
newNavigator[key] = origNavigator[key].bind(origNavigator);
|
| 1251 |
+
} else {
|
| 1252 |
+
(function (k) {
|
| 1253 |
+
utils.defineGetterSetter(newNavigator, key, function () {
|
| 1254 |
+
return origNavigator[k];
|
| 1255 |
+
});
|
| 1256 |
+
})(key);
|
| 1257 |
+
}
|
| 1258 |
+
}
|
| 1259 |
+
}
|
| 1260 |
+
return newNavigator;
|
| 1261 |
+
}
|
| 1262 |
+
|
| 1263 |
+
if (window.navigator) {
|
| 1264 |
+
window.navigator = replaceNavigator(window.navigator);
|
| 1265 |
+
}
|
| 1266 |
+
|
| 1267 |
+
if (!window.console) {
|
| 1268 |
+
window.console = {
|
| 1269 |
+
log: function () {}
|
| 1270 |
+
};
|
| 1271 |
+
}
|
| 1272 |
+
if (!window.console.warn) {
|
| 1273 |
+
window.console.warn = function (msg) {
|
| 1274 |
+
this.log('warn: ' + msg);
|
| 1275 |
+
};
|
| 1276 |
+
}
|
| 1277 |
+
|
| 1278 |
+
// Register pause, resume and deviceready channels as events on document.
|
| 1279 |
+
channel.onPause = cordova.addDocumentEventHandler('pause');
|
| 1280 |
+
channel.onResume = cordova.addDocumentEventHandler('resume');
|
| 1281 |
+
channel.onActivated = cordova.addDocumentEventHandler('activated');
|
| 1282 |
+
channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready');
|
| 1283 |
+
|
| 1284 |
+
// Listen for DOMContentLoaded and notify our channel subscribers.
|
| 1285 |
+
if (document.readyState === 'complete' || document.readyState === 'interactive') {
|
| 1286 |
+
channel.onDOMContentLoaded.fire();
|
| 1287 |
+
} else {
|
| 1288 |
+
document.addEventListener('DOMContentLoaded', function () {
|
| 1289 |
+
channel.onDOMContentLoaded.fire();
|
| 1290 |
+
}, false);
|
| 1291 |
+
}
|
| 1292 |
+
|
| 1293 |
+
// _nativeReady is global variable that the native side can set
|
| 1294 |
+
// to signify that the native code is ready. It is a global since
|
| 1295 |
+
// it may be called before any cordova JS is ready.
|
| 1296 |
+
if (window._nativeReady) {
|
| 1297 |
+
channel.onNativeReady.fire();
|
| 1298 |
+
}
|
| 1299 |
+
|
| 1300 |
+
modulemapper.clobbers('cordova', 'cordova');
|
| 1301 |
+
modulemapper.clobbers('cordova/exec', 'cordova.exec');
|
| 1302 |
+
modulemapper.clobbers('cordova/exec', 'Cordova.exec');
|
| 1303 |
+
|
| 1304 |
+
// Call the platform-specific initialization.
|
| 1305 |
+
platform.bootstrap && platform.bootstrap();
|
| 1306 |
+
|
| 1307 |
+
// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js.
|
| 1308 |
+
// The delay allows the attached modules to be defined before the plugin loader looks for them.
|
| 1309 |
+
setTimeout(function () {
|
| 1310 |
+
pluginloader.load(function () {
|
| 1311 |
+
channel.onPluginsReady.fire();
|
| 1312 |
+
});
|
| 1313 |
+
}, 0);
|
| 1314 |
+
|
| 1315 |
+
/**
|
| 1316 |
+
* Create all cordova objects once native side is ready.
|
| 1317 |
+
*/
|
| 1318 |
+
channel.join(function () {
|
| 1319 |
+
modulemapper.mapModules(window);
|
| 1320 |
+
|
| 1321 |
+
platform.initialize && platform.initialize();
|
| 1322 |
+
|
| 1323 |
+
// Fire event to notify that all objects are created
|
| 1324 |
+
channel.onCordovaReady.fire();
|
| 1325 |
+
|
| 1326 |
+
// Fire onDeviceReady event once page has fully loaded, all
|
| 1327 |
+
// constructors have run and cordova info has been received from native
|
| 1328 |
+
// side.
|
| 1329 |
+
channel.join(function () {
|
| 1330 |
+
require('cordova').fireDocumentEvent('deviceready');
|
| 1331 |
+
}, channel.deviceReadyChannelsArray);
|
| 1332 |
+
|
| 1333 |
+
}, platformInitChannelsArray);
|
| 1334 |
+
|
| 1335 |
+
});
|
| 1336 |
+
|
| 1337 |
+
// file: src/common/modulemapper.js
|
| 1338 |
+
define("cordova/modulemapper", function(require, exports, module) {
|
| 1339 |
+
|
| 1340 |
+
var builder = require('cordova/builder');
|
| 1341 |
+
var moduleMap = define.moduleMap; // eslint-disable-line no-undef
|
| 1342 |
+
var symbolList;
|
| 1343 |
+
var deprecationMap;
|
| 1344 |
+
|
| 1345 |
+
exports.reset = function () {
|
| 1346 |
+
symbolList = [];
|
| 1347 |
+
deprecationMap = {};
|
| 1348 |
+
};
|
| 1349 |
+
|
| 1350 |
+
function addEntry (strategy, moduleName, symbolPath, opt_deprecationMessage) {
|
| 1351 |
+
if (!(moduleName in moduleMap)) {
|
| 1352 |
+
throw new Error('Module ' + moduleName + ' does not exist.');
|
| 1353 |
+
}
|
| 1354 |
+
symbolList.push(strategy, moduleName, symbolPath);
|
| 1355 |
+
if (opt_deprecationMessage) {
|
| 1356 |
+
deprecationMap[symbolPath] = opt_deprecationMessage;
|
| 1357 |
+
}
|
| 1358 |
+
}
|
| 1359 |
+
|
| 1360 |
+
// Note: Android 2.3 does have Function.bind().
|
| 1361 |
+
exports.clobbers = function (moduleName, symbolPath, opt_deprecationMessage) {
|
| 1362 |
+
addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
|
| 1363 |
+
};
|
| 1364 |
+
|
| 1365 |
+
exports.merges = function (moduleName, symbolPath, opt_deprecationMessage) {
|
| 1366 |
+
addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
|
| 1367 |
+
};
|
| 1368 |
+
|
| 1369 |
+
exports.defaults = function (moduleName, symbolPath, opt_deprecationMessage) {
|
| 1370 |
+
addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
|
| 1371 |
+
};
|
| 1372 |
+
|
| 1373 |
+
exports.runs = function (moduleName) {
|
| 1374 |
+
addEntry('r', moduleName, null);
|
| 1375 |
+
};
|
| 1376 |
+
|
| 1377 |
+
function prepareNamespace (symbolPath, context) {
|
| 1378 |
+
if (!symbolPath) {
|
| 1379 |
+
return context;
|
| 1380 |
+
}
|
| 1381 |
+
var parts = symbolPath.split('.');
|
| 1382 |
+
var cur = context;
|
| 1383 |
+
for (var i = 0, part; part = parts[i]; ++i) { // eslint-disable-line no-cond-assign
|
| 1384 |
+
cur = cur[part] = cur[part] || {};
|
| 1385 |
+
}
|
| 1386 |
+
return cur;
|
| 1387 |
+
}
|
| 1388 |
+
|
| 1389 |
+
exports.mapModules = function (context) {
|
| 1390 |
+
var origSymbols = {};
|
| 1391 |
+
context.CDV_origSymbols = origSymbols;
|
| 1392 |
+
for (var i = 0, len = symbolList.length; i < len; i += 3) {
|
| 1393 |
+
var strategy = symbolList[i];
|
| 1394 |
+
var moduleName = symbolList[i + 1];
|
| 1395 |
+
var module = require(moduleName);
|
| 1396 |
+
// <runs/>
|
| 1397 |
+
if (strategy === 'r') {
|
| 1398 |
+
continue;
|
| 1399 |
+
}
|
| 1400 |
+
var symbolPath = symbolList[i + 2];
|
| 1401 |
+
var lastDot = symbolPath.lastIndexOf('.');
|
| 1402 |
+
var namespace = symbolPath.substr(0, lastDot);
|
| 1403 |
+
var lastName = symbolPath.substr(lastDot + 1);
|
| 1404 |
+
|
| 1405 |
+
var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
|
| 1406 |
+
var parentObj = prepareNamespace(namespace, context);
|
| 1407 |
+
var target = parentObj[lastName];
|
| 1408 |
+
|
| 1409 |
+
if (strategy === 'm' && target) {
|
| 1410 |
+
builder.recursiveMerge(target, module);
|
| 1411 |
+
} else if ((strategy === 'd' && !target) || (strategy !== 'd')) {
|
| 1412 |
+
if (!(symbolPath in origSymbols)) {
|
| 1413 |
+
origSymbols[symbolPath] = target;
|
| 1414 |
+
}
|
| 1415 |
+
builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
|
| 1416 |
+
}
|
| 1417 |
+
}
|
| 1418 |
+
};
|
| 1419 |
+
|
| 1420 |
+
exports.getOriginalSymbol = function (context, symbolPath) {
|
| 1421 |
+
var origSymbols = context.CDV_origSymbols;
|
| 1422 |
+
if (origSymbols && (symbolPath in origSymbols)) {
|
| 1423 |
+
return origSymbols[symbolPath];
|
| 1424 |
+
}
|
| 1425 |
+
var parts = symbolPath.split('.');
|
| 1426 |
+
var obj = context;
|
| 1427 |
+
for (var i = 0; i < parts.length; ++i) {
|
| 1428 |
+
obj = obj && obj[parts[i]];
|
| 1429 |
+
}
|
| 1430 |
+
return obj;
|
| 1431 |
+
};
|
| 1432 |
+
|
| 1433 |
+
exports.reset();
|
| 1434 |
+
|
| 1435 |
+
});
|
| 1436 |
+
|
| 1437 |
+
// file: ../cordova-android/cordova-js-src/platform.js
|
| 1438 |
+
define("cordova/platform", function(require, exports, module) {
|
| 1439 |
+
|
| 1440 |
+
// The last resume event that was received that had the result of a plugin call.
|
| 1441 |
+
var lastResumeEvent = null;
|
| 1442 |
+
|
| 1443 |
+
module.exports = {
|
| 1444 |
+
id: 'android',
|
| 1445 |
+
bootstrap: function() {
|
| 1446 |
+
var channel = require('cordova/channel'),
|
| 1447 |
+
cordova = require('cordova'),
|
| 1448 |
+
exec = require('cordova/exec'),
|
| 1449 |
+
modulemapper = require('cordova/modulemapper');
|
| 1450 |
+
|
| 1451 |
+
// Get the shared secret needed to use the bridge.
|
| 1452 |
+
exec.init();
|
| 1453 |
+
|
| 1454 |
+
// TODO: Extract this as a proper plugin.
|
| 1455 |
+
modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app');
|
| 1456 |
+
|
| 1457 |
+
var APP_PLUGIN_NAME = Number(cordova.platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
|
| 1458 |
+
|
| 1459 |
+
// Inject a listener for the backbutton on the document.
|
| 1460 |
+
var backButtonChannel = cordova.addDocumentEventHandler('backbutton');
|
| 1461 |
+
backButtonChannel.onHasSubscribersChange = function() {
|
| 1462 |
+
// If we just attached the first handler or detached the last handler,
|
| 1463 |
+
// let native know we need to override the back button.
|
| 1464 |
+
exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [this.numHandlers == 1]);
|
| 1465 |
+
};
|
| 1466 |
+
|
| 1467 |
+
// Add hardware MENU and SEARCH button handlers
|
| 1468 |
+
cordova.addDocumentEventHandler('menubutton');
|
| 1469 |
+
cordova.addDocumentEventHandler('searchbutton');
|
| 1470 |
+
|
| 1471 |
+
function bindButtonChannel(buttonName) {
|
| 1472 |
+
// generic button bind used for volumeup/volumedown buttons
|
| 1473 |
+
var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button');
|
| 1474 |
+
volumeButtonChannel.onHasSubscribersChange = function() {
|
| 1475 |
+
exec(null, null, APP_PLUGIN_NAME, "overrideButton", [buttonName, this.numHandlers == 1]);
|
| 1476 |
+
};
|
| 1477 |
+
}
|
| 1478 |
+
// Inject a listener for the volume buttons on the document.
|
| 1479 |
+
bindButtonChannel('volumeup');
|
| 1480 |
+
bindButtonChannel('volumedown');
|
| 1481 |
+
|
| 1482 |
+
// The resume event is not "sticky", but it is possible that the event
|
| 1483 |
+
// will contain the result of a plugin call. We need to ensure that the
|
| 1484 |
+
// plugin result is delivered even after the event is fired (CB-10498)
|
| 1485 |
+
var cordovaAddEventListener = document.addEventListener;
|
| 1486 |
+
|
| 1487 |
+
document.addEventListener = function(evt, handler, capture) {
|
| 1488 |
+
cordovaAddEventListener(evt, handler, capture);
|
| 1489 |
+
|
| 1490 |
+
if (evt === 'resume' && lastResumeEvent) {
|
| 1491 |
+
handler(lastResumeEvent);
|
| 1492 |
+
}
|
| 1493 |
+
};
|
| 1494 |
+
|
| 1495 |
+
// Let native code know we are all done on the JS side.
|
| 1496 |
+
// Native code will then un-hide the WebView.
|
| 1497 |
+
channel.onCordovaReady.subscribe(function() {
|
| 1498 |
+
exec(onMessageFromNative, null, APP_PLUGIN_NAME, 'messageChannel', []);
|
| 1499 |
+
exec(null, null, APP_PLUGIN_NAME, "show", []);
|
| 1500 |
+
});
|
| 1501 |
+
}
|
| 1502 |
+
};
|
| 1503 |
+
|
| 1504 |
+
function onMessageFromNative(msg) {
|
| 1505 |
+
var cordova = require('cordova');
|
| 1506 |
+
var action = msg.action;
|
| 1507 |
+
|
| 1508 |
+
switch (action)
|
| 1509 |
+
{
|
| 1510 |
+
// Button events
|
| 1511 |
+
case 'backbutton':
|
| 1512 |
+
case 'menubutton':
|
| 1513 |
+
case 'searchbutton':
|
| 1514 |
+
// App life cycle events
|
| 1515 |
+
case 'pause':
|
| 1516 |
+
// Volume events
|
| 1517 |
+
case 'volumedownbutton':
|
| 1518 |
+
case 'volumeupbutton':
|
| 1519 |
+
cordova.fireDocumentEvent(action);
|
| 1520 |
+
break;
|
| 1521 |
+
case 'resume':
|
| 1522 |
+
if(arguments.length > 1 && msg.pendingResult) {
|
| 1523 |
+
if(arguments.length === 2) {
|
| 1524 |
+
msg.pendingResult.result = arguments[1];
|
| 1525 |
+
} else {
|
| 1526 |
+
// The plugin returned a multipart message
|
| 1527 |
+
var res = [];
|
| 1528 |
+
for(var i = 1; i < arguments.length; i++) {
|
| 1529 |
+
res.push(arguments[i]);
|
| 1530 |
+
}
|
| 1531 |
+
msg.pendingResult.result = res;
|
| 1532 |
+
}
|
| 1533 |
+
|
| 1534 |
+
// Save the plugin result so that it can be delivered to the js
|
| 1535 |
+
// even if they miss the initial firing of the event
|
| 1536 |
+
lastResumeEvent = msg;
|
| 1537 |
+
}
|
| 1538 |
+
cordova.fireDocumentEvent(action, msg);
|
| 1539 |
+
break;
|
| 1540 |
+
default:
|
| 1541 |
+
throw new Error('Unknown event action ' + action);
|
| 1542 |
+
}
|
| 1543 |
+
}
|
| 1544 |
+
|
| 1545 |
+
});
|
| 1546 |
+
|
| 1547 |
+
// file: ../cordova-android/cordova-js-src/plugin/android/app.js
|
| 1548 |
+
define("cordova/plugin/android/app", function(require, exports, module) {
|
| 1549 |
+
|
| 1550 |
+
var exec = require('cordova/exec');
|
| 1551 |
+
var APP_PLUGIN_NAME = Number(require('cordova').platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App';
|
| 1552 |
+
|
| 1553 |
+
module.exports = {
|
| 1554 |
+
/**
|
| 1555 |
+
* Clear the resource cache.
|
| 1556 |
+
*/
|
| 1557 |
+
clearCache:function() {
|
| 1558 |
+
exec(null, null, APP_PLUGIN_NAME, "clearCache", []);
|
| 1559 |
+
},
|
| 1560 |
+
|
| 1561 |
+
/**
|
| 1562 |
+
* Load the url into the webview or into new browser instance.
|
| 1563 |
+
*
|
| 1564 |
+
* @param url The URL to load
|
| 1565 |
+
* @param props Properties that can be passed in to the activity:
|
| 1566 |
+
* wait: int => wait msec before loading URL
|
| 1567 |
+
* loadingDialog: "Title,Message" => display a native loading dialog
|
| 1568 |
+
* loadUrlTimeoutValue: int => time in msec to wait before triggering a timeout error
|
| 1569 |
+
* clearHistory: boolean => clear webview history (default=false)
|
| 1570 |
+
* openExternal: boolean => open in a new browser (default=false)
|
| 1571 |
+
*
|
| 1572 |
+
* Example:
|
| 1573 |
+
* navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000});
|
| 1574 |
+
*/
|
| 1575 |
+
loadUrl:function(url, props) {
|
| 1576 |
+
exec(null, null, APP_PLUGIN_NAME, "loadUrl", [url, props]);
|
| 1577 |
+
},
|
| 1578 |
+
|
| 1579 |
+
/**
|
| 1580 |
+
* Cancel loadUrl that is waiting to be loaded.
|
| 1581 |
+
*/
|
| 1582 |
+
cancelLoadUrl:function() {
|
| 1583 |
+
exec(null, null, APP_PLUGIN_NAME, "cancelLoadUrl", []);
|
| 1584 |
+
},
|
| 1585 |
+
|
| 1586 |
+
/**
|
| 1587 |
+
* Clear web history in this web view.
|
| 1588 |
+
* Instead of BACK button loading the previous web page, it will exit the app.
|
| 1589 |
+
*/
|
| 1590 |
+
clearHistory:function() {
|
| 1591 |
+
exec(null, null, APP_PLUGIN_NAME, "clearHistory", []);
|
| 1592 |
+
},
|
| 1593 |
+
|
| 1594 |
+
/**
|
| 1595 |
+
* Go to previous page displayed.
|
| 1596 |
+
* This is the same as pressing the backbutton on Android device.
|
| 1597 |
+
*/
|
| 1598 |
+
backHistory:function() {
|
| 1599 |
+
exec(null, null, APP_PLUGIN_NAME, "backHistory", []);
|
| 1600 |
+
},
|
| 1601 |
+
|
| 1602 |
+
/**
|
| 1603 |
+
* Override the default behavior of the Android back button.
|
| 1604 |
+
* If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired.
|
| 1605 |
+
*
|
| 1606 |
+
* Note: The user should not have to call this method. Instead, when the user
|
| 1607 |
+
* registers for the "backbutton" event, this is automatically done.
|
| 1608 |
+
*
|
| 1609 |
+
* @param override T=override, F=cancel override
|
| 1610 |
+
*/
|
| 1611 |
+
overrideBackbutton:function(override) {
|
| 1612 |
+
exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [override]);
|
| 1613 |
+
},
|
| 1614 |
+
|
| 1615 |
+
/**
|
| 1616 |
+
* Override the default behavior of the Android volume button.
|
| 1617 |
+
* If overridden, when the volume button is pressed, the "volume[up|down]button"
|
| 1618 |
+
* JavaScript event will be fired.
|
| 1619 |
+
*
|
| 1620 |
+
* Note: The user should not have to call this method. Instead, when the user
|
| 1621 |
+
* registers for the "volume[up|down]button" event, this is automatically done.
|
| 1622 |
+
*
|
| 1623 |
+
* @param button volumeup, volumedown
|
| 1624 |
+
* @param override T=override, F=cancel override
|
| 1625 |
+
*/
|
| 1626 |
+
overrideButton:function(button, override) {
|
| 1627 |
+
exec(null, null, APP_PLUGIN_NAME, "overrideButton", [button, override]);
|
| 1628 |
+
},
|
| 1629 |
+
|
| 1630 |
+
/**
|
| 1631 |
+
* Exit and terminate the application.
|
| 1632 |
+
*/
|
| 1633 |
+
exitApp:function() {
|
| 1634 |
+
return exec(null, null, APP_PLUGIN_NAME, "exitApp", []);
|
| 1635 |
+
}
|
| 1636 |
+
};
|
| 1637 |
+
|
| 1638 |
+
});
|
| 1639 |
+
|
| 1640 |
+
// file: src/common/pluginloader.js
|
| 1641 |
+
define("cordova/pluginloader", function(require, exports, module) {
|
| 1642 |
+
|
| 1643 |
+
var modulemapper = require('cordova/modulemapper');
|
| 1644 |
+
|
| 1645 |
+
// Helper function to inject a <script> tag.
|
| 1646 |
+
// Exported for testing.
|
| 1647 |
+
exports.injectScript = function (url, onload, onerror) {
|
| 1648 |
+
var script = document.createElement('script');
|
| 1649 |
+
// onload fires even when script fails loads with an error.
|
| 1650 |
+
script.onload = onload;
|
| 1651 |
+
// onerror fires for malformed URLs.
|
| 1652 |
+
script.onerror = onerror;
|
| 1653 |
+
script.src = url;
|
| 1654 |
+
document.head.appendChild(script);
|
| 1655 |
+
};
|
| 1656 |
+
|
| 1657 |
+
function injectIfNecessary (id, url, onload, onerror) {
|
| 1658 |
+
onerror = onerror || onload;
|
| 1659 |
+
if (id in define.moduleMap) { // eslint-disable-line no-undef
|
| 1660 |
+
onload();
|
| 1661 |
+
} else {
|
| 1662 |
+
exports.injectScript(url, function () {
|
| 1663 |
+
if (id in define.moduleMap) { // eslint-disable-line no-undef
|
| 1664 |
+
onload();
|
| 1665 |
+
} else {
|
| 1666 |
+
onerror();
|
| 1667 |
+
}
|
| 1668 |
+
}, onerror);
|
| 1669 |
+
}
|
| 1670 |
+
}
|
| 1671 |
+
|
| 1672 |
+
function onScriptLoadingComplete (moduleList, finishPluginLoading) {
|
| 1673 |
+
// Loop through all the plugins and then through their clobbers and merges.
|
| 1674 |
+
for (var i = 0, module; module = moduleList[i]; i++) { // eslint-disable-line no-cond-assign
|
| 1675 |
+
if (module.clobbers && module.clobbers.length) {
|
| 1676 |
+
for (var j = 0; j < module.clobbers.length; j++) {
|
| 1677 |
+
modulemapper.clobbers(module.id, module.clobbers[j]);
|
| 1678 |
+
}
|
| 1679 |
+
}
|
| 1680 |
+
|
| 1681 |
+
if (module.merges && module.merges.length) {
|
| 1682 |
+
for (var k = 0; k < module.merges.length; k++) {
|
| 1683 |
+
modulemapper.merges(module.id, module.merges[k]);
|
| 1684 |
+
}
|
| 1685 |
+
}
|
| 1686 |
+
|
| 1687 |
+
// Finally, if runs is truthy we want to simply require() the module.
|
| 1688 |
+
if (module.runs) {
|
| 1689 |
+
modulemapper.runs(module.id);
|
| 1690 |
+
}
|
| 1691 |
+
}
|
| 1692 |
+
|
| 1693 |
+
finishPluginLoading();
|
| 1694 |
+
}
|
| 1695 |
+
|
| 1696 |
+
// Handler for the cordova_plugins.js content.
|
| 1697 |
+
// See plugman's plugin_loader.js for the details of this object.
|
| 1698 |
+
// This function is only called if the really is a plugins array that isn't empty.
|
| 1699 |
+
// Otherwise the onerror response handler will just call finishPluginLoading().
|
| 1700 |
+
function handlePluginsObject (path, moduleList, finishPluginLoading) {
|
| 1701 |
+
// Now inject the scripts.
|
| 1702 |
+
var scriptCounter = moduleList.length;
|
| 1703 |
+
|
| 1704 |
+
if (!scriptCounter) {
|
| 1705 |
+
finishPluginLoading();
|
| 1706 |
+
return;
|
| 1707 |
+
}
|
| 1708 |
+
function scriptLoadedCallback () {
|
| 1709 |
+
if (!--scriptCounter) {
|
| 1710 |
+
onScriptLoadingComplete(moduleList, finishPluginLoading);
|
| 1711 |
+
}
|
| 1712 |
+
}
|
| 1713 |
+
|
| 1714 |
+
for (var i = 0; i < moduleList.length; i++) {
|
| 1715 |
+
injectIfNecessary(moduleList[i].id, path + moduleList[i].file, scriptLoadedCallback);
|
| 1716 |
+
}
|
| 1717 |
+
}
|
| 1718 |
+
|
| 1719 |
+
function findCordovaPath () {
|
| 1720 |
+
var path = null;
|
| 1721 |
+
var scripts = document.getElementsByTagName('script');
|
| 1722 |
+
var term = '/cordova.js';
|
| 1723 |
+
for (var n = scripts.length - 1; n > -1; n--) {
|
| 1724 |
+
var src = scripts[n].src.replace(/\?.*$/, ''); // Strip any query param (CB-6007).
|
| 1725 |
+
if (src.indexOf(term) === (src.length - term.length)) {
|
| 1726 |
+
path = src.substring(0, src.length - term.length) + '/';
|
| 1727 |
+
break;
|
| 1728 |
+
}
|
| 1729 |
+
}
|
| 1730 |
+
return path;
|
| 1731 |
+
}
|
| 1732 |
+
|
| 1733 |
+
// Tries to load all plugins' js-modules.
|
| 1734 |
+
// This is an async process, but onDeviceReady is blocked on onPluginsReady.
|
| 1735 |
+
// onPluginsReady is fired when there are no plugins to load, or they are all done.
|
| 1736 |
+
exports.load = function (callback) {
|
| 1737 |
+
var pathPrefix = findCordovaPath();
|
| 1738 |
+
if (pathPrefix === null) {
|
| 1739 |
+
console.log('Could not find cordova.js script tag. Plugin loading may fail.');
|
| 1740 |
+
pathPrefix = '';
|
| 1741 |
+
}
|
| 1742 |
+
injectIfNecessary('cordova/plugin_list', pathPrefix + 'cordova_plugins.js', function () {
|
| 1743 |
+
var moduleList = require('cordova/plugin_list');
|
| 1744 |
+
handlePluginsObject(pathPrefix, moduleList, callback);
|
| 1745 |
+
}, callback);
|
| 1746 |
+
};
|
| 1747 |
+
|
| 1748 |
+
});
|
| 1749 |
+
|
| 1750 |
+
// file: src/common/urlutil.js
|
| 1751 |
+
define("cordova/urlutil", function(require, exports, module) {
|
| 1752 |
+
|
| 1753 |
+
/**
|
| 1754 |
+
* For already absolute URLs, returns what is passed in.
|
| 1755 |
+
* For relative URLs, converts them to absolute ones.
|
| 1756 |
+
*/
|
| 1757 |
+
exports.makeAbsolute = function makeAbsolute (url) {
|
| 1758 |
+
var anchorEl = document.createElement('a');
|
| 1759 |
+
anchorEl.href = url;
|
| 1760 |
+
return anchorEl.href;
|
| 1761 |
+
};
|
| 1762 |
+
|
| 1763 |
+
});
|
| 1764 |
+
|
| 1765 |
+
// file: src/common/utils.js
|
| 1766 |
+
define("cordova/utils", function(require, exports, module) {
|
| 1767 |
+
|
| 1768 |
+
var utils = exports;
|
| 1769 |
+
|
| 1770 |
+
/**
|
| 1771 |
+
* Defines a property getter / setter for obj[key].
|
| 1772 |
+
*/
|
| 1773 |
+
utils.defineGetterSetter = function (obj, key, getFunc, opt_setFunc) {
|
| 1774 |
+
if (Object.defineProperty) {
|
| 1775 |
+
var desc = {
|
| 1776 |
+
get: getFunc,
|
| 1777 |
+
configurable: true
|
| 1778 |
+
};
|
| 1779 |
+
if (opt_setFunc) {
|
| 1780 |
+
desc.set = opt_setFunc;
|
| 1781 |
+
}
|
| 1782 |
+
Object.defineProperty(obj, key, desc);
|
| 1783 |
+
} else {
|
| 1784 |
+
obj.__defineGetter__(key, getFunc);
|
| 1785 |
+
if (opt_setFunc) {
|
| 1786 |
+
obj.__defineSetter__(key, opt_setFunc);
|
| 1787 |
+
}
|
| 1788 |
+
}
|
| 1789 |
+
};
|
| 1790 |
+
|
| 1791 |
+
/**
|
| 1792 |
+
* Defines a property getter for obj[key].
|
| 1793 |
+
*/
|
| 1794 |
+
utils.defineGetter = utils.defineGetterSetter;
|
| 1795 |
+
|
| 1796 |
+
utils.arrayIndexOf = function (a, item) {
|
| 1797 |
+
if (a.indexOf) {
|
| 1798 |
+
return a.indexOf(item);
|
| 1799 |
+
}
|
| 1800 |
+
var len = a.length;
|
| 1801 |
+
for (var i = 0; i < len; ++i) {
|
| 1802 |
+
if (a[i] === item) {
|
| 1803 |
+
return i;
|
| 1804 |
+
}
|
| 1805 |
+
}
|
| 1806 |
+
return -1;
|
| 1807 |
+
};
|
| 1808 |
+
|
| 1809 |
+
/**
|
| 1810 |
+
* Returns whether the item was found in the array.
|
| 1811 |
+
*/
|
| 1812 |
+
utils.arrayRemove = function (a, item) {
|
| 1813 |
+
var index = utils.arrayIndexOf(a, item);
|
| 1814 |
+
if (index !== -1) {
|
| 1815 |
+
a.splice(index, 1);
|
| 1816 |
+
}
|
| 1817 |
+
return index !== -1;
|
| 1818 |
+
};
|
| 1819 |
+
|
| 1820 |
+
utils.typeName = function (val) {
|
| 1821 |
+
return Object.prototype.toString.call(val).slice(8, -1);
|
| 1822 |
+
};
|
| 1823 |
+
|
| 1824 |
+
/**
|
| 1825 |
+
* Returns an indication of whether the argument is an array or not
|
| 1826 |
+
*/
|
| 1827 |
+
utils.isArray = Array.isArray ||
|
| 1828 |
+
function (a) { return utils.typeName(a) === 'Array'; };
|
| 1829 |
+
|
| 1830 |
+
/**
|
| 1831 |
+
* Returns an indication of whether the argument is a Date or not
|
| 1832 |
+
*/
|
| 1833 |
+
utils.isDate = function (d) {
|
| 1834 |
+
return (d instanceof Date);
|
| 1835 |
+
};
|
| 1836 |
+
|
| 1837 |
+
/**
|
| 1838 |
+
* Does a deep clone of the object.
|
| 1839 |
+
*/
|
| 1840 |
+
utils.clone = function (obj) {
|
| 1841 |
+
if (!obj || typeof obj === 'function' || utils.isDate(obj) || typeof obj !== 'object') {
|
| 1842 |
+
return obj;
|
| 1843 |
+
}
|
| 1844 |
+
|
| 1845 |
+
var retVal, i;
|
| 1846 |
+
|
| 1847 |
+
if (utils.isArray(obj)) {
|
| 1848 |
+
retVal = [];
|
| 1849 |
+
for (i = 0; i < obj.length; ++i) {
|
| 1850 |
+
retVal.push(utils.clone(obj[i]));
|
| 1851 |
+
}
|
| 1852 |
+
return retVal;
|
| 1853 |
+
}
|
| 1854 |
+
|
| 1855 |
+
retVal = {};
|
| 1856 |
+
for (i in obj) {
|
| 1857 |
+
// https://issues.apache.org/jira/browse/CB-11522 'unknown' type may be returned in
|
| 1858 |
+
// custom protocol activation case on Windows Phone 8.1 causing "No such interface supported" exception
|
| 1859 |
+
// on cloning.
|
| 1860 |
+
if ((!(i in retVal) || retVal[i] !== obj[i]) && typeof obj[i] !== 'undefined' && typeof obj[i] !== 'unknown') { // eslint-disable-line valid-typeof
|
| 1861 |
+
retVal[i] = utils.clone(obj[i]);
|
| 1862 |
+
}
|
| 1863 |
+
}
|
| 1864 |
+
return retVal;
|
| 1865 |
+
};
|
| 1866 |
+
|
| 1867 |
+
/**
|
| 1868 |
+
* Returns a wrapped version of the function
|
| 1869 |
+
*/
|
| 1870 |
+
utils.close = function (context, func, params) {
|
| 1871 |
+
return function () {
|
| 1872 |
+
var args = params || arguments;
|
| 1873 |
+
return func.apply(context, args);
|
| 1874 |
+
};
|
| 1875 |
+
};
|
| 1876 |
+
|
| 1877 |
+
// ------------------------------------------------------------------------------
|
| 1878 |
+
function UUIDcreatePart (length) {
|
| 1879 |
+
var uuidpart = '';
|
| 1880 |
+
for (var i = 0; i < length; i++) {
|
| 1881 |
+
var uuidchar = parseInt((Math.random() * 256), 10).toString(16);
|
| 1882 |
+
if (uuidchar.length === 1) {
|
| 1883 |
+
uuidchar = '0' + uuidchar;
|
| 1884 |
+
}
|
| 1885 |
+
uuidpart += uuidchar;
|
| 1886 |
+
}
|
| 1887 |
+
return uuidpart;
|
| 1888 |
+
}
|
| 1889 |
+
|
| 1890 |
+
/**
|
| 1891 |
+
* Create a UUID
|
| 1892 |
+
*/
|
| 1893 |
+
utils.createUUID = function () {
|
| 1894 |
+
return UUIDcreatePart(4) + '-' +
|
| 1895 |
+
UUIDcreatePart(2) + '-' +
|
| 1896 |
+
UUIDcreatePart(2) + '-' +
|
| 1897 |
+
UUIDcreatePart(2) + '-' +
|
| 1898 |
+
UUIDcreatePart(6);
|
| 1899 |
+
};
|
| 1900 |
+
|
| 1901 |
+
/**
|
| 1902 |
+
* Extends a child object from a parent object using classical inheritance
|
| 1903 |
+
* pattern.
|
| 1904 |
+
*/
|
| 1905 |
+
utils.extend = (function () {
|
| 1906 |
+
// proxy used to establish prototype chain
|
| 1907 |
+
var F = function () {};
|
| 1908 |
+
// extend Child from Parent
|
| 1909 |
+
return function (Child, Parent) {
|
| 1910 |
+
|
| 1911 |
+
F.prototype = Parent.prototype;
|
| 1912 |
+
Child.prototype = new F();
|
| 1913 |
+
Child.__super__ = Parent.prototype;
|
| 1914 |
+
Child.prototype.constructor = Child;
|
| 1915 |
+
};
|
| 1916 |
+
}());
|
| 1917 |
+
|
| 1918 |
+
/**
|
| 1919 |
+
* Alerts a message in any available way: alert or console.log.
|
| 1920 |
+
*/
|
| 1921 |
+
utils.alert = function (msg) {
|
| 1922 |
+
if (window.alert) {
|
| 1923 |
+
window.alert(msg);
|
| 1924 |
+
} else if (console && console.log) {
|
| 1925 |
+
console.log(msg);
|
| 1926 |
+
}
|
| 1927 |
+
};
|
| 1928 |
+
|
| 1929 |
+
});
|
| 1930 |
+
|
| 1931 |
+
window.cordova = require('cordova');
|
| 1932 |
+
// file: src/scripts/bootstrap.js
|
| 1933 |
+
require('cordova/init');
|
| 1934 |
+
|
| 1935 |
+
})();
|
assets/www/cordova_plugins.js
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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plugin-file.DirectoryEntry",
|
| 5 |
+
"file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
|
| 6 |
+
"pluginId": "cordova-plugin-file",
|
| 7 |
+
"clobbers": [
|
| 8 |
+
"window.DirectoryEntry"
|
| 9 |
+
]
|
| 10 |
+
},
|
| 11 |
+
{
|
| 12 |
+
"id": "cordova-plugin-file.DirectoryReader",
|
| 13 |
+
"file": "plugins/cordova-plugin-file/www/DirectoryReader.js",
|
| 14 |
+
"pluginId": "cordova-plugin-file",
|
| 15 |
+
"clobbers": [
|
| 16 |
+
"window.DirectoryReader"
|
| 17 |
+
]
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
"id": "cordova-plugin-file.Entry",
|
| 21 |
+
"file": "plugins/cordova-plugin-file/www/Entry.js",
|
| 22 |
+
"pluginId": "cordova-plugin-file",
|
| 23 |
+
"clobbers": [
|
| 24 |
+
"window.Entry"
|
| 25 |
+
]
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"id": "cordova-plugin-file.File",
|
| 29 |
+
"file": "plugins/cordova-plugin-file/www/File.js",
|
| 30 |
+
"pluginId": "cordova-plugin-file",
|
| 31 |
+
"clobbers": [
|
| 32 |
+
"window.File"
|
| 33 |
+
]
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
"id": "cordova-plugin-file.FileEntry",
|
| 37 |
+
"file": "plugins/cordova-plugin-file/www/FileEntry.js",
|
| 38 |
+
"pluginId": "cordova-plugin-file",
|
| 39 |
+
"clobbers": [
|
| 40 |
+
"window.FileEntry"
|
| 41 |
+
]
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
"id": "cordova-plugin-file.FileError",
|
| 45 |
+
"file": "plugins/cordova-plugin-file/www/FileError.js",
|
| 46 |
+
"pluginId": "cordova-plugin-file",
|
| 47 |
+
"clobbers": [
|
| 48 |
+
"window.FileError"
|
| 49 |
+
]
|
| 50 |
+
},
|
| 51 |
+
{
|
| 52 |
+
"id": "cordova-plugin-file.FileReader",
|
| 53 |
+
"file": "plugins/cordova-plugin-file/www/FileReader.js",
|
| 54 |
+
"pluginId": "cordova-plugin-file",
|
| 55 |
+
"clobbers": [
|
| 56 |
+
"window.FileReader"
|
| 57 |
+
]
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
"id": "cordova-plugin-file.FileSystem",
|
| 61 |
+
"file": "plugins/cordova-plugin-file/www/FileSystem.js",
|
| 62 |
+
"pluginId": "cordova-plugin-file",
|
| 63 |
+
"clobbers": [
|
| 64 |
+
"window.FileSystem"
|
| 65 |
+
]
|
| 66 |
+
},
|
| 67 |
+
{
|
| 68 |
+
"id": "cordova-plugin-file.FileUploadOptions",
|
| 69 |
+
"file": "plugins/cordova-plugin-file/www/FileUploadOptions.js",
|
| 70 |
+
"pluginId": "cordova-plugin-file",
|
| 71 |
+
"clobbers": [
|
| 72 |
+
"window.FileUploadOptions"
|
| 73 |
+
]
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"id": "cordova-plugin-file.FileUploadResult",
|
| 77 |
+
"file": "plugins/cordova-plugin-file/www/FileUploadResult.js",
|
| 78 |
+
"pluginId": "cordova-plugin-file",
|
| 79 |
+
"clobbers": [
|
| 80 |
+
"window.FileUploadResult"
|
| 81 |
+
]
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
"id": "cordova-plugin-file.FileWriter",
|
| 85 |
+
"file": "plugins/cordova-plugin-file/www/FileWriter.js",
|
| 86 |
+
"pluginId": "cordova-plugin-file",
|
| 87 |
+
"clobbers": [
|
| 88 |
+
"window.FileWriter"
|
| 89 |
+
]
|
| 90 |
+
},
|
| 91 |
+
{
|
| 92 |
+
"id": "cordova-plugin-file.Flags",
|
| 93 |
+
"file": "plugins/cordova-plugin-file/www/Flags.js",
|
| 94 |
+
"pluginId": "cordova-plugin-file",
|
| 95 |
+
"clobbers": [
|
| 96 |
+
"window.Flags"
|
| 97 |
+
]
|
| 98 |
+
},
|
| 99 |
+
{
|
| 100 |
+
"id": "cordova-plugin-file.LocalFileSystem",
|
| 101 |
+
"file": "plugins/cordova-plugin-file/www/LocalFileSystem.js",
|
| 102 |
+
"pluginId": "cordova-plugin-file",
|
| 103 |
+
"clobbers": [
|
| 104 |
+
"window.LocalFileSystem"
|
| 105 |
+
],
|
| 106 |
+
"merges": [
|
| 107 |
+
"window"
|
| 108 |
+
]
|
| 109 |
+
},
|
| 110 |
+
{
|
| 111 |
+
"id": "cordova-plugin-file.Metadata",
|
| 112 |
+
"file": "plugins/cordova-plugin-file/www/Metadata.js",
|
| 113 |
+
"pluginId": "cordova-plugin-file",
|
| 114 |
+
"clobbers": [
|
| 115 |
+
"window.Metadata"
|
| 116 |
+
]
|
| 117 |
+
},
|
| 118 |
+
{
|
| 119 |
+
"id": "cordova-plugin-file.ProgressEvent",
|
| 120 |
+
"file": "plugins/cordova-plugin-file/www/ProgressEvent.js",
|
| 121 |
+
"pluginId": "cordova-plugin-file",
|
| 122 |
+
"clobbers": [
|
| 123 |
+
"window.ProgressEvent"
|
| 124 |
+
]
|
| 125 |
+
},
|
| 126 |
+
{
|
| 127 |
+
"id": "cordova-plugin-file.fileSystems",
|
| 128 |
+
"file": "plugins/cordova-plugin-file/www/fileSystems.js",
|
| 129 |
+
"pluginId": "cordova-plugin-file"
|
| 130 |
+
},
|
| 131 |
+
{
|
| 132 |
+
"id": "cordova-plugin-file.requestFileSystem",
|
| 133 |
+
"file": "plugins/cordova-plugin-file/www/requestFileSystem.js",
|
| 134 |
+
"pluginId": "cordova-plugin-file",
|
| 135 |
+
"clobbers": [
|
| 136 |
+
"window.requestFileSystem"
|
| 137 |
+
]
|
| 138 |
+
},
|
| 139 |
+
{
|
| 140 |
+
"id": "cordova-plugin-file.resolveLocalFileSystemURI",
|
| 141 |
+
"file": "plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js",
|
| 142 |
+
"pluginId": "cordova-plugin-file",
|
| 143 |
+
"merges": [
|
| 144 |
+
"window"
|
| 145 |
+
]
|
| 146 |
+
},
|
| 147 |
+
{
|
| 148 |
+
"id": "cordova-plugin-file.isChrome",
|
| 149 |
+
"file": "plugins/cordova-plugin-file/www/browser/isChrome.js",
|
| 150 |
+
"pluginId": "cordova-plugin-file",
|
| 151 |
+
"runs": true
|
| 152 |
+
},
|
| 153 |
+
{
|
| 154 |
+
"id": "cordova-plugin-file.androidFileSystem",
|
| 155 |
+
"file": "plugins/cordova-plugin-file/www/android/FileSystem.js",
|
| 156 |
+
"pluginId": "cordova-plugin-file",
|
| 157 |
+
"merges": [
|
| 158 |
+
"FileSystem"
|
| 159 |
+
]
|
| 160 |
+
},
|
| 161 |
+
{
|
| 162 |
+
"id": "cordova-plugin-file.fileSystems-roots",
|
| 163 |
+
"file": "plugins/cordova-plugin-file/www/fileSystems-roots.js",
|
| 164 |
+
"pluginId": "cordova-plugin-file",
|
| 165 |
+
"runs": true
|
| 166 |
+
},
|
| 167 |
+
{
|
| 168 |
+
"id": "cordova-plugin-file.fileSystemPaths",
|
| 169 |
+
"file": "plugins/cordova-plugin-file/www/fileSystemPaths.js",
|
| 170 |
+
"pluginId": "cordova-plugin-file",
|
| 171 |
+
"merges": [
|
| 172 |
+
"cordova"
|
| 173 |
+
],
|
| 174 |
+
"runs": true
|
| 175 |
+
},
|
| 176 |
+
{
|
| 177 |
+
"id": "cordova-plugin-inappbrowser.inappbrowser",
|
| 178 |
+
"file": "plugins/cordova-plugin-inappbrowser/www/inappbrowser.js",
|
| 179 |
+
"pluginId": "cordova-plugin-inappbrowser",
|
| 180 |
+
"clobbers": [
|
| 181 |
+
"cordova.InAppBrowser.open",
|
| 182 |
+
"window.open"
|
| 183 |
+
]
|
| 184 |
+
},
|
| 185 |
+
{
|
| 186 |
+
"id": "cordova-plugin-statusbar.statusbar",
|
| 187 |
+
"file": "plugins/cordova-plugin-statusbar/www/statusbar.js",
|
| 188 |
+
"pluginId": "cordova-plugin-statusbar",
|
| 189 |
+
"clobbers": [
|
| 190 |
+
"window.StatusBar"
|
| 191 |
+
]
|
| 192 |
+
}
|
| 193 |
+
];
|
| 194 |
+
module.exports.metadata = {
|
| 195 |
+
"cordova-plugin-whitelist": "1.3.4",
|
| 196 |
+
"cordova-custom-config": "5.1.0",
|
| 197 |
+
"cordova-plugin-file": "6.0.2",
|
| 198 |
+
"cordova-plugin-inappbrowser": "3.2.0",
|
| 199 |
+
"cordova-plugin-statusbar": "2.4.3",
|
| 200 |
+
"cordova-plugin-wkwebview-engine": "1.2.1"
|
| 201 |
+
};
|
| 202 |
+
});
|
assets/www/data.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/www/icon-144.png
ADDED
|
|
Git LFS Details
|
assets/www/icon-192.png
ADDED
|
|
Git LFS Details
|
assets/www/icon-36.png
ADDED
|
|
Git LFS Details
|
assets/www/icon-48.png
ADDED
|
|
Git LFS Details
|
assets/www/icon-72.png
ADDED
|
|
Git LFS Details
|
assets/www/icon-96.png
ADDED
|
|
Git LFS Details
|
assets/www/images/aliahamark-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/bar-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/blackboard-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/blackscreen-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/brnlangsi-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnattack-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnbethigh-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnbethighsi-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnbetlow-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnbetlowsi-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btncontinue-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btncontinuesi-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btncover-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btneasy-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btneasysi-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnendgame-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnfacebook-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnfbdontshare-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnfbshare-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnguess-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnguesssi-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnhard-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnhardsi-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnlangen-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnletsplay-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnletsplaysi-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnmathcombat-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnpause-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnplay-sheet0.png
ADDED
|
Git LFS Details
|
assets/www/images/btnpullen-sheet0.png
ADDED
|
Git LFS Details
|