diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-08-31 23:07:20 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-08-31 23:07:20 +0200 |
| commit | 22721a013bdd10d5eb395ba18453585f5f3f1f7f (patch) | |
| tree | 5a920e31d6026ed5dc55265e5fd057febccc50e3 /StoneIsland/platforms/ios/platform_www | |
| parent | d22d51a1ae49680015326857360eb699f31efced (diff) | |
rebuild the ios platform and the plugins
Diffstat (limited to 'StoneIsland/platforms/ios/platform_www')
22 files changed, 1131 insertions, 2514 deletions
diff --git a/StoneIsland/platforms/ios/platform_www/cordova-js-src/exec.js b/StoneIsland/platforms/ios/platform_www/cordova-js-src/exec.js index 3fb7fa19..466220d8 100644 --- a/StoneIsland/platforms/ios/platform_www/cordova-js-src/exec.js +++ b/StoneIsland/platforms/ios/platform_www/cordova-js-src/exec.js @@ -19,30 +19,24 @@ * */ -/*global require, module, atob, document */ - /** - * Creates a gap bridge iframe used to notify the native code about queued + * Creates the exec bridge used to notify the native code of * commands. */ -var cordova = require('cordova'), - utils = require('cordova/utils'), - base64 = require('cordova/base64'), - execIframe, - commandQueue = [], // Contains pending JS->Native messages. - isInContextOfEvalJs = 0, - failSafeTimerId = 0; +var cordova = require('cordova'); +var utils = require('cordova/utils'); +var base64 = require('cordova/base64'); -function massageArgsJsToNative(args) { - if (!args || utils.typeName(args) != 'Array') { +function massageArgsJsToNative (args) { + if (!args || utils.typeName(args) !== 'Array') { return args; } var ret = []; - args.forEach(function(arg, i) { - if (utils.typeName(arg) == 'ArrayBuffer') { + args.forEach(function (arg, i) { + if (utils.typeName(arg) === 'ArrayBuffer') { ret.push({ - 'CDVType': 'ArrayBuffer', - 'data': base64.fromArrayBuffer(arg) + CDVType: 'ArrayBuffer', + data: base64.fromArrayBuffer(arg) }); } else { ret.push(arg); @@ -51,29 +45,29 @@ function massageArgsJsToNative(args) { return ret; } -function massageMessageNativeToJs(message) { - if (message.CDVType == 'ArrayBuffer') { - var stringToArrayBuffer = function(str) { +function massageMessageNativeToJs (message) { + if (message.CDVType === 'ArrayBuffer') { + var stringToArrayBuffer = function (str) { var ret = new Uint8Array(str.length); for (var i = 0; i < str.length; i++) { ret[i] = str.charCodeAt(i); } return ret.buffer; }; - var base64ToArrayBuffer = function(b64) { - return stringToArrayBuffer(atob(b64)); + var base64ToArrayBuffer = function (b64) { + return stringToArrayBuffer(atob(b64)); // eslint-disable-line no-undef }; message = base64ToArrayBuffer(message.data); } return message; } -function convertMessageToArgsNativeToJs(message) { +function convertMessageToArgsNativeToJs (message) { var args = []; - if (!message || !message.hasOwnProperty('CDVType')) { + if (!message || !Object.prototype.hasOwnProperty.call(message, 'CDVType')) { args.push(message); - } else if (message.CDVType == 'MultiPart') { - message.messages.forEach(function(e) { + } else if (message.CDVType === 'MultiPart') { + message.messages.forEach(function (e) { args.push(massageMessageNativeToJs(e)); }); } else { @@ -82,8 +76,7 @@ function convertMessageToArgsNativeToJs(message) { return args; } -function iOSExec() { - +var iOSExec = function () { var successCallback, failCallback, service, action, actionArgs; var callbackId = null; if (typeof arguments[0] !== 'string') { @@ -100,9 +93,8 @@ function iOSExec() { // an invalid callbackId and passes it even if no callbacks were given. callbackId = 'INVALID'; } else { - throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' + - 'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);' - ); + throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' + // eslint-disable-line + 'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);'); } // If actionArgs is not provided, default to an empty array @@ -113,149 +105,54 @@ function iOSExec() { if (successCallback || failCallback) { callbackId = service + cordova.callbackId++; cordova.callbacks[callbackId] = - {success:successCallback, fail:failCallback}; + { success: successCallback, fail: failCallback }; } actionArgs = massageArgsJsToNative(actionArgs); - var command = [callbackId, service, action, actionArgs]; - - // Stringify and queue the command. We stringify to command now to - // effectively clone the command arguments in case they are mutated before - // the command is executed. - commandQueue.push(JSON.stringify(command)); - - // If we're in the context of a stringByEvaluatingJavaScriptFromString call, - // then the queue will be flushed when it returns; no need for a poke. - // Also, if there is already a command in the queue, then we've already - // poked the native side, so there is no reason to do so again. - if (!isInContextOfEvalJs && commandQueue.length == 1) { - pokeNative(); - } -} - -// CB-10530 -function proxyChanged() { - var cexec = cordovaExec(); - - return (execProxy !== cexec && // proxy objects are different - iOSExec !== cexec // proxy object is not the current iOSExec - ); -} - -// CB-10106 -function handleBridgeChange() { - if (proxyChanged()) { - var commandString = commandQueue.shift(); - while(commandString) { - var command = JSON.parse(commandString); - var callbackId = command[0]; - var service = command[1]; - var action = command[2]; - var actionArgs = command[3]; - var callbacks = cordova.callbacks[callbackId] || {}; - - execProxy(callbacks.success, callbacks.fail, service, action, actionArgs); - - commandString = commandQueue.shift(); - }; - return true; - } - - return false; -} - -function pokeNative() { - // CB-5488 - Don't attempt to create iframe before document.body is available. - if (!document.body) { - setTimeout(pokeNative); - return; - } - - // Check if they've removed it from the DOM, and put it back if so. - if (execIframe && execIframe.contentWindow) { - execIframe.contentWindow.location = 'gap://ready'; - } else { - execIframe = document.createElement('iframe'); - execIframe.style.display = 'none'; - execIframe.src = 'gap://ready'; - document.body.appendChild(execIframe); - } - // Use a timer to protect against iframe being unloaded during the poke (CB-7735). - // This makes the bridge ~ 7% slower, but works around the poke getting lost - // when the iframe is removed from the DOM. - // An onunload listener could be used in the case where the iframe has just been - // created, but since unload events fire only once, it doesn't work in the normal - // case of iframe reuse (where unload will have already fired due to the attempted - // navigation of the page). - failSafeTimerId = setTimeout(function() { - if (commandQueue.length) { - // CB-10106 - flush the queue on bridge change - if (!handleBridgeChange()) { - pokeNative(); - } - } - }, 50); // Making this > 0 improves performance (marginally) in the normal case (where it doesn't fire). -} - -iOSExec.nativeFetchMessages = function() { - // Stop listing for window detatch once native side confirms poke. - if (failSafeTimerId) { - clearTimeout(failSafeTimerId); - failSafeTimerId = 0; - } - // Each entry in commandQueue is a JSON string already. - if (!commandQueue.length) { - return ''; - } - var json = '[' + commandQueue.join(',') + ']'; - commandQueue.length = 0; - return json; + // CB-10133 DataClone DOM Exception 25 guard (fast function remover) + var command = [callbackId, service, action, JSON.parse(JSON.stringify(actionArgs))]; + window.webkit.messageHandlers.cordova.postMessage(command); }; -iOSExec.nativeCallback = function(callbackId, status, message, keepCallback, debug) { - return iOSExec.nativeEvalAndFetch(function() { - var success = status === 0 || status === 1; - var args = convertMessageToArgsNativeToJs(message); - function nc2() { - cordova.callbackFromNative(callbackId, success, status, args, keepCallback); - } - setTimeout(nc2, 0); +iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, debug) { + var success = status === 0 || status === 1; + var args = convertMessageToArgsNativeToJs(message); + Promise.resolve().then(function () { + cordova.callbackFromNative(callbackId, success, status, args, keepCallback); // eslint-disable-line }); }; -iOSExec.nativeEvalAndFetch = function(func) { - // This shouldn't be nested, but better to be safe. - isInContextOfEvalJs++; +// for backwards compatibility +iOSExec.nativeEvalAndFetch = function (func) { try { func(); - return iOSExec.nativeFetchMessages(); - } finally { - isInContextOfEvalJs--; + } catch (e) { + console.log(e); } }; // Proxy the exec for bridge changes. See CB-10106 -function cordovaExec() { +function cordovaExec () { var cexec = require('cordova/exec'); var cexec_valid = (typeof cexec.nativeFetchMessages === 'function') && (typeof cexec.nativeEvalAndFetch === 'function') && (typeof cexec.nativeCallback === 'function'); - return (cexec_valid && execProxy !== cexec)? cexec : iOSExec; + return (cexec_valid && execProxy !== cexec) ? cexec : iOSExec; } -function execProxy() { +function execProxy () { cordovaExec().apply(null, arguments); -}; +} -execProxy.nativeFetchMessages = function() { +execProxy.nativeFetchMessages = function () { return cordovaExec().nativeFetchMessages.apply(null, arguments); }; -execProxy.nativeEvalAndFetch = function() { +execProxy.nativeEvalAndFetch = function () { return cordovaExec().nativeEvalAndFetch.apply(null, arguments); }; -execProxy.nativeCallback = function() { +execProxy.nativeCallback = function () { return cordovaExec().nativeCallback.apply(null, arguments); }; diff --git a/StoneIsland/platforms/ios/platform_www/cordova-js-src/platform.js b/StoneIsland/platforms/ios/platform_www/cordova-js-src/platform.js index 2345fa5b..83868c81 100644 --- a/StoneIsland/platforms/ios/platform_www/cordova-js-src/platform.js +++ b/StoneIsland/platforms/ios/platform_www/cordova-js-src/platform.js @@ -26,6 +26,14 @@ module.exports = { // see the file under plugin/ios/console.js require('cordova/modulemapper').clobbers('cordova/plugin/ios/console', 'window.console'); + // Attach the wkwebkit utility to window.WkWebView + // see the file under plugin/ios/wkwebkit.js + require('cordova/modulemapper').clobbers('cordova/plugin/ios/wkwebkit', 'window.WkWebView'); + + // Attach the splashscreen utility to window.navigator.splashscreen + // see the file under plugin/ios/launchscreen.js + require('cordova/modulemapper').clobbers('cordova/plugin/ios/launchscreen', 'navigator.splashscreen'); + require('cordova/channel').onNativeReady.fire(); } }; diff --git a/StoneIsland/platforms/ios/platform_www/cordova-js-src/plugin/ios/console.js b/StoneIsland/platforms/ios/platform_www/cordova-js-src/plugin/ios/console.js index 6224fb44..0a4820ed 100644 --- a/StoneIsland/platforms/ios/platform_www/cordova-js-src/plugin/ios/console.js +++ b/StoneIsland/platforms/ios/platform_www/cordova-js-src/plugin/ios/console.js @@ -19,168 +19,168 @@ * */ -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ var logger = require('cordova/plugin/ios/logger'); -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // object that we're exporting -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ var console = module.exports; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // copy of the original console object -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ var WinConsole = window.console; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // whether to use the logger -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ var UseLogger = false; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // Timers -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ var Timers = {}; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // used for unimplemented methods -//------------------------------------------------------------------------------ -function noop() {} +// ------------------------------------------------------------------------------ +function noop () {} -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // used for unimplemented methods -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.useLogger = function (value) { if (arguments.length) UseLogger = !!value; if (UseLogger) { if (logger.useConsole()) { - throw new Error("console and logger are too intertwingly"); + throw new Error('console and logger are too intertwingly'); } } return UseLogger; }; -//------------------------------------------------------------------------------ -console.log = function() { +// ------------------------------------------------------------------------------ +console.log = function () { if (logger.useConsole()) return; logger.log.apply(logger, [].slice.call(arguments)); }; -//------------------------------------------------------------------------------ -console.error = function() { +// ------------------------------------------------------------------------------ +console.error = function () { if (logger.useConsole()) return; logger.error.apply(logger, [].slice.call(arguments)); }; -//------------------------------------------------------------------------------ -console.warn = function() { +// ------------------------------------------------------------------------------ +console.warn = function () { if (logger.useConsole()) return; logger.warn.apply(logger, [].slice.call(arguments)); }; -//------------------------------------------------------------------------------ -console.info = function() { +// ------------------------------------------------------------------------------ +console.info = function () { if (logger.useConsole()) return; logger.info.apply(logger, [].slice.call(arguments)); }; -//------------------------------------------------------------------------------ -console.debug = function() { +// ------------------------------------------------------------------------------ +console.debug = function () { if (logger.useConsole()) return; logger.debug.apply(logger, [].slice.call(arguments)); }; -//------------------------------------------------------------------------------ -console.assert = function(expression) { +// ------------------------------------------------------------------------------ +console.assert = function (expression) { if (expression) return; var message = logger.format.apply(logger.format, [].slice.call(arguments, 1)); - console.log("ASSERT: " + message); + console.log('ASSERT: ' + message); }; -//------------------------------------------------------------------------------ -console.clear = function() {}; +// ------------------------------------------------------------------------------ +console.clear = function () {}; -//------------------------------------------------------------------------------ -console.dir = function(object) { - console.log("%o", object); +// ------------------------------------------------------------------------------ +console.dir = function (object) { + console.log('%o', object); }; -//------------------------------------------------------------------------------ -console.dirxml = function(node) { +// ------------------------------------------------------------------------------ +console.dirxml = function (node) { console.log(node.innerHTML); }; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.trace = noop; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.group = console.log; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.groupCollapsed = console.log; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.groupEnd = noop; -//------------------------------------------------------------------------------ -console.time = function(name) { +// ------------------------------------------------------------------------------ +console.time = function (name) { Timers[name] = new Date().valueOf(); }; -//------------------------------------------------------------------------------ -console.timeEnd = function(name) { +// ------------------------------------------------------------------------------ +console.timeEnd = function (name) { var timeStart = Timers[name]; if (!timeStart) { - console.warn("unknown timer: " + name); + console.warn('unknown timer: ' + name); return; } var timeElapsed = new Date().valueOf() - timeStart; - console.log(name + ": " + timeElapsed + "ms"); + console.log(name + ': ' + timeElapsed + 'ms'); }; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.timeStamp = noop; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.profile = noop; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.profileEnd = noop; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.count = noop; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.exception = console.log; -//------------------------------------------------------------------------------ -console.table = function(data, columns) { - console.log("%o", data); +// ------------------------------------------------------------------------------ +console.table = function (data, columns) { + console.log('%o', data); }; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // return a new function that calls both functions passed as args -//------------------------------------------------------------------------------ -function wrappedOrigCall(orgFunc, newFunc) { - return function() { +// ------------------------------------------------------------------------------ +function wrappedOrigCall (orgFunc, newFunc) { + return function () { var args = [].slice.call(arguments); try { orgFunc.apply(WinConsole, args); } catch (e) {} - try { newFunc.apply(console, args); } catch (e) {} + try { newFunc.apply(console, args); } catch (e) {} }; } -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // For every function that exists in the original console object, that // also exists in the new console object, wrap the new console method // with one that calls both -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ for (var key in console) { - if (typeof WinConsole[key] == "function") { + if (typeof WinConsole[key] === 'function') { console[key] = wrappedOrigCall(WinConsole[key], console[key]); } } diff --git a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-splashscreen/www/splashscreen.js b/StoneIsland/platforms/ios/platform_www/cordova-js-src/plugin/ios/launchscreen.js index 5beaa5fd..24606969 100644 --- a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-splashscreen/www/splashscreen.js +++ b/StoneIsland/platforms/ios/platform_www/cordova-js-src/plugin/ios/launchscreen.js @@ -1,4 +1,3 @@ -cordova.define("cordova-plugin-splashscreen.SplashScreen", function(require, exports, module) { /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -22,15 +21,13 @@ cordova.define("cordova-plugin-splashscreen.SplashScreen", function(require, exp var exec = require('cordova/exec'); -var splashscreen = { - show:function() { - exec(null, null, "SplashScreen", "show", []); +var launchscreen = { + show: function () { + exec(null, null, 'LaunchScreen', 'show', []); }, - hide:function() { - exec(null, null, "SplashScreen", "hide", []); + hide: function () { + exec(null, null, 'LaunchScreen', 'hide', []); } }; -module.exports = splashscreen; - -}); +module.exports = launchscreen; diff --git a/StoneIsland/platforms/ios/platform_www/cordova-js-src/plugin/ios/logger.js b/StoneIsland/platforms/ios/platform_www/cordova-js-src/plugin/ios/logger.js index 430d887d..6f59e1c8 100644 --- a/StoneIsland/platforms/ios/platform_www/cordova-js-src/plugin/ios/logger.js +++ b/StoneIsland/platforms/ios/platform_www/cordova-js-src/plugin/ios/logger.js @@ -19,7 +19,7 @@ * */ -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // The logger module exports the following properties/functions: // // LOG - constant for the level LOG @@ -38,16 +38,16 @@ // debug(message,...) - logs a message at level DEBUG // logLevel(level,message,...) - logs a message specified level // -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ var logger = exports; -var exec = require('cordova/exec'); +var exec = require('cordova/exec'); -var UseConsole = false; -var UseLogger = true; -var Queued = []; -var DeviceReady = false; +var UseConsole = false; +var UseLogger = true; +var Queued = []; +var DeviceReady = false; var CurrentLevel; var originalConsole = console; @@ -57,11 +57,11 @@ var originalConsole = console; */ var Levels = [ - "LOG", - "ERROR", - "WARN", - "INFO", - "DEBUG" + 'LOG', + 'ERROR', + 'WARN', + 'INFO', + 'DEBUG' ]; /* @@ -70,10 +70,10 @@ var Levels = [ */ var LevelsMap = {}; -for (var i=0; i<Levels.length; i++) { +for (var i = 0; i < Levels.length; i++) { var level = Levels[i]; LevelsMap[level] = i; - logger[level] = level; + logger[level] = level; } CurrentLevel = LevelsMap.WARN; @@ -100,7 +100,7 @@ CurrentLevel = LevelsMap.WARN; logger.level = function (value) { if (arguments.length) { if (LevelsMap[value] === null) { - throw new Error("invalid logging level: " + value); + throw new Error('invalid logging level: ' + value); } CurrentLevel = LevelsMap[value]; } @@ -118,17 +118,17 @@ logger.useConsole = function (value) { if (arguments.length) UseConsole = !!value; if (UseConsole) { - if (typeof console == "undefined") { - throw new Error("global console object is not defined"); + if (typeof console === 'undefined') { + throw new Error('global console object is not defined'); } - if (typeof console.log != "function") { - throw new Error("global console object does not have a log function"); + if (typeof console.log !== 'function') { + throw new Error('global console object does not have a log function'); } - if (typeof console.useLogger == "function") { + if (typeof console.useLogger === 'function') { if (console.useLogger()) { - throw new Error("console and logger are too intertwingly"); + throw new Error('console and logger are too intertwingly'); } } } @@ -154,7 +154,7 @@ logger.useLogger = function (value) { * Parameters passed after message are used applied to * the message with utils.format() */ -logger.log = function(message) { logWithArgs("LOG", arguments); }; +logger.log = function (message) { logWithArgs('LOG', arguments); }; /** * Logs a message at the ERROR level. @@ -162,7 +162,7 @@ logger.log = function(message) { logWithArgs("LOG", arguments); }; * Parameters passed after message are used applied to * the message with utils.format() */ -logger.error = function(message) { logWithArgs("ERROR", arguments); }; +logger.error = function (message) { logWithArgs('ERROR', arguments); }; /** * Logs a message at the WARN level. @@ -170,7 +170,7 @@ logger.error = function(message) { logWithArgs("ERROR", arguments); }; * Parameters passed after message are used applied to * the message with utils.format() */ -logger.warn = function(message) { logWithArgs("WARN", arguments); }; +logger.warn = function (message) { logWithArgs('WARN', arguments); }; /** * Logs a message at the INFO level. @@ -178,7 +178,7 @@ logger.warn = function(message) { logWithArgs("WARN", arguments); }; * Parameters passed after message are used applied to * the message with utils.format() */ -logger.info = function(message) { logWithArgs("INFO", arguments); }; +logger.info = function (message) { logWithArgs('INFO', arguments); }; /** * Logs a message at the DEBUG level. @@ -186,17 +186,17 @@ logger.info = function(message) { logWithArgs("INFO", arguments); }; * Parameters passed after message are used applied to * the message with utils.format() */ -logger.debug = function(message) { logWithArgs("DEBUG", arguments); }; +logger.debug = function (message) { logWithArgs('DEBUG', arguments); }; // log at the specified level with args -function logWithArgs(level, args) { +function logWithArgs (level, args) { args = [level].concat([].slice.call(args)); logger.logLevel.apply(logger, args); } // return the correct formatString for an object -function formatStringForMessage(message) { - return (typeof message === "string") ? "" : "%o"; +function formatStringForMessage (message) { + return (typeof message === 'string') ? '' : '%o'; } /** @@ -205,18 +205,18 @@ function formatStringForMessage(message) { * Parameters passed after message are used applied to * the message with utils.format() */ -logger.logLevel = function(level /* , ... */) { +logger.logLevel = function (level /* , ... */) { // format the message with the parameters var formatArgs = [].slice.call(arguments, 1); var fmtString = formatStringForMessage(formatArgs[0]); - if (fmtString.length > 0){ + if (fmtString.length > 0) { formatArgs.unshift(fmtString); // add formatString } - var message = logger.format.apply(logger.format, formatArgs); + var message = logger.format.apply(logger.format, formatArgs); if (LevelsMap[level] === null) { - throw new Error("invalid logging level: " + level); + throw new Error('invalid logging level: ' + level); } if (LevelsMap[level] > CurrentLevel) return; @@ -229,28 +229,27 @@ logger.logLevel = function(level /* , ... */) { // Log using the native logger if that is enabled if (UseLogger) { - exec(null, null, "Console", "logLevel", [level, message]); + exec(null, null, 'Console', 'logLevel', [level, message]); } // Log using the console if that is enabled if (UseConsole) { // make sure console is not using logger if (console.useLogger()) { - throw new Error("console and logger are too intertwingly"); + throw new Error('console and logger are too intertwingly'); } // log to the console switch (level) { - case logger.LOG: originalConsole.log(message); break; - case logger.ERROR: originalConsole.log("ERROR: " + message); break; - case logger.WARN: originalConsole.log("WARN: " + message); break; - case logger.INFO: originalConsole.log("INFO: " + message); break; - case logger.DEBUG: originalConsole.log("DEBUG: " + message); break; + case logger.LOG: originalConsole.log(message); break; + case logger.ERROR: originalConsole.log('ERROR: ' + message); break; + case logger.WARN: originalConsole.log('WARN: ' + message); break; + case logger.INFO: originalConsole.log('INFO: ' + message); break; + case logger.DEBUG: originalConsole.log('DEBUG: ' + message); break; } } }; - /** * Formats a string and arguments following it ala console.log() * @@ -259,12 +258,11 @@ logger.logLevel = function(level /* , ... */) { * for rationale, see FireBug's Console API: * http://getfirebug.com/wiki/index.php/Console_API */ -logger.format = function(formatString, args) { - return __format(arguments[0], [].slice.call(arguments,1)).join(' '); +logger.format = function (formatString, args) { + return __format(arguments[0], [].slice.call(arguments, 1)).join(' '); }; - -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ /** * Formats a string and arguments following it ala vsprintf() * @@ -279,26 +277,25 @@ logger.format = function(formatString, args) { * Returns an array containing the formatted string and any remaining * arguments. */ -function __format(formatString, args) { - if (formatString === null || formatString === undefined) return [""]; - if (arguments.length == 1) return [formatString.toString()]; +function __format (formatString, args) { + if (formatString === null || formatString === undefined) return ['']; + if (arguments.length === 1) return [formatString.toString()]; - if (typeof formatString != "string") - formatString = formatString.toString(); + if (typeof formatString !== 'string') { formatString = formatString.toString(); } var pattern = /(.*?)%(.)(.*)/; - var rest = formatString; - var result = []; + var rest = formatString; + var result = []; while (args.length) { var match = pattern.exec(rest); if (!match) break; - var arg = args.shift(); + var arg = args.shift(); rest = match[3]; result.push(match[1]); - if (match[2] == '%') { + if (match[2] === '%') { result.push('%'); args.unshift(arg); continue; @@ -314,17 +311,15 @@ function __format(formatString, args) { return remainingArgs; } -function __formatted(object, formatChar) { - +function __formatted (object, formatChar) { try { - switch(formatChar) { - case 'j': - case 'o': return JSON.stringify(object); - case 'c': return ''; + switch (formatChar) { + case 'j': + case 'o': return JSON.stringify(object); + case 'c': return ''; } - } - catch (e) { - return "error JSON.stringify()ing argument: " + e; + } catch (e) { + return 'error JSON.stringify()ing argument: ' + e; } if ((object === null) || (object === undefined)) { @@ -334,15 +329,14 @@ function __formatted(object, formatChar) { return object.toString(); } - -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // when deviceready fires, log queued messages -logger.__onDeviceReady = function() { +logger.__onDeviceReady = function () { if (DeviceReady) return; DeviceReady = true; - for (var i=0; i<Queued.length; i++) { + for (var i = 0; i < Queued.length; i++) { var messageArgs = Queued[i]; logger.logLevel(messageArgs[0], messageArgs[1]); } @@ -351,4 +345,4 @@ logger.__onDeviceReady = function() { }; // add a deviceready event to log queued messages -document.addEventListener("deviceready", logger.__onDeviceReady, false); +document.addEventListener('deviceready', logger.__onDeviceReady, false); diff --git a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-network-information/www/Connection.js b/StoneIsland/platforms/ios/platform_www/cordova-js-src/plugin/ios/wkwebkit.js index 5f7279c5..35c819cf 100644 --- a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-network-information/www/Connection.js +++ b/StoneIsland/platforms/ios/platform_www/cordova-js-src/plugin/ios/wkwebkit.js @@ -1,4 +1,3 @@ -cordova.define("cordova-plugin-network-information.Connection", function(require, exports, module) { /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -20,18 +19,24 @@ cordova.define("cordova-plugin-network-information.Connection", function(require * */ -/** - * Network status - */ -module.exports = { - UNKNOWN: "unknown", - ETHERNET: "ethernet", - WIFI: "wifi", - CELL_2G: "2g", - CELL_3G: "3g", - CELL_4G: "4g", - CELL:"cellular", - NONE: "none" +var exec = require('cordova/exec'); + +var WkWebKit = { + allowsBackForwardNavigationGestures: function (allow) { + exec(null, null, 'CDVWebViewEngine', 'allowsBackForwardNavigationGestures', [allow]); + }, + convertFilePath: function (path) { + if (!path || !window.CDV_ASSETS_URL) { + return path; + } + if (path.startsWith('/')) { + return window.CDV_ASSETS_URL + '/_app_file_' + path; + } + if (path.startsWith('file://')) { + return window.CDV_ASSETS_URL + path.replace('file://', '/_app_file_'); + } + return path; + } }; -}); +module.exports = WkWebKit; diff --git a/StoneIsland/platforms/ios/platform_www/cordova.js b/StoneIsland/platforms/ios/platform_www/cordova.js index a320f5ee..a837c75f 100644 --- a/StoneIsland/platforms/ios/platform_www/cordova.js +++ b/StoneIsland/platforms/ios/platform_www/cordova.js @@ -1,5 +1,5 @@ // Platform: ios -// ff66178b108b93be36a1aafe341af17381a727a3 +// 538a985db128858c0a0eb4dd40fb9c8e5433fc94 /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -8,9 +8,9 @@ to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -19,12 +19,8 @@ under the License. */ ;(function() { -var PLATFORM_VERSION_BUILD_LABEL = '4.5.2'; +var PLATFORM_VERSION_BUILD_LABEL = '6.1.1'; // file: src/scripts/require.js - -/* jshint -W079 */ -/* jshint -W020 */ - var require; var define; @@ -54,10 +50,10 @@ var define; require = function (id) { if (!modules[id]) { - throw 'module ' + id + ' not found'; + throw new Error('module ' + id + ' not found'); } else if (id in inProgressModules) { var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id; - throw 'Cycle in require graph: ' + cycle; + throw new Error('Cycle in require graph: ' + cycle); } if (modules[id].factory) { try { @@ -73,8 +69,8 @@ var define; }; define = function (id, factory) { - if (modules[id]) { - throw 'module ' + id + ' already defined'; + if (Object.prototype.hasOwnProperty.call(modules, id)) { + throw new Error('module ' + id + ' already defined'); } modules[id] = { @@ -101,7 +97,7 @@ define("cordova", function(require, exports, module) { // Workaround for Windows 10 in hosted environment case // http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object -if (window.cordova && !(window.cordova instanceof HTMLElement)) { // eslint-disable-line no-undef +if (window.cordova && !(window.cordova instanceof HTMLElement)) { throw new Error('cordova already defined'); } @@ -166,7 +162,7 @@ function createEvent (type, data) { event.initEvent(type, false, false); if (data) { for (var i in data) { - if (data.hasOwnProperty(i)) { + if (Object.prototype.hasOwnProperty.call(data, i)) { event[i] = data[i]; } } @@ -174,7 +170,6 @@ function createEvent (type, data) { return event; } -/* eslint-disable no-undef */ var cordova = { define: define, require: require, @@ -182,8 +177,6 @@ var cordova = { platformVersion: PLATFORM_VERSION_BUILD_LABEL, platformId: platform.id, - /* eslint-enable no-undef */ - /** * Methods to add/remove your own addEventListener hijacking on document + window. */ @@ -202,15 +195,25 @@ var cordova = { removeDocumentEventHandler: function (event) { delete documentEventHandlers[event]; }, + /** * Retrieve original event handlers that were replaced by Cordova * * @return object */ getOriginalHandlers: function () { - return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener}, - 'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}}; + return { + document: { + addEventListener: m_document_addEventListener, + removeEventListener: m_document_removeEventListener + }, + window: { + addEventListener: m_window_addEventListener, + removeEventListener: m_window_removeEventListener + } + }; }, + /** * Method to fire event from native code * bNoDetach is required for events which cause an exception which needs to be caught in native code @@ -233,6 +236,7 @@ var cordova = { document.dispatchEvent(evt); } }, + fireWindowEvent: function (type, data) { var evt = createEvent(type, data); if (typeof windowEventHandlers[type] !== 'undefined') { @@ -306,11 +310,11 @@ var cordova = { } } catch (err) { var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err; - console && console.log && console.log(msg); - cordova.fireWindowEvent('cordovacallbackerror', { 'message': msg }); + cordova.fireWindowEvent('cordovacallbackerror', { message: msg, error: err }); throw err; } }, + addConstructor: function (func) { channel.onCordovaReady.subscribe(function () { try { @@ -334,18 +338,47 @@ var utils = require('cordova/utils'); var moduleExports = module.exports; var typeMap = { - 'A': 'Array', - 'D': 'Date', - 'N': 'Number', - 'S': 'String', - 'F': 'Function', - 'O': 'Object' + A: 'Array', + D: 'Date', + N: 'Number', + S: 'String', + F: 'Function', + O: 'Object' }; function extractParamName (callee, argIndex) { - return (/.*?\((.*?)\)/).exec(callee)[1].split(', ')[argIndex]; + return (/\(\s*([^)]*?)\s*\)/).exec(callee)[1].split(/\s*,\s*/)[argIndex]; } +/** + * Checks the given arguments' types and throws if they are not as expected. + * + * `spec` is a string where each character stands for the required type of the + * argument at the same position. In other words: the character at `spec[i]` + * specifies the required type for `args[i]`. The characters in `spec` are the + * first letter of the required type's name. The supported types are: + * + * Array, Date, Number, String, Function, Object + * + * Lowercase characters specify arguments that must not be `null` or `undefined` + * while uppercase characters allow those values to be passed. + * + * Finally, `*` can be used to allow any type at the corresponding position. + * + * @example + * function foo (arr, opts) { + * // require `arr` to be an Array and `opts` an Object, null or undefined + * checkArgs('aO', 'my.package.foo', arguments); + * // ... + * } + * @param {String} spec - the type specification for `args` as described above + * @param {String} functionName - full name of the callee. + * Used in the error message + * @param {Array|arguments} args - the arguments to be checked against `spec` + * @param {Function} [opt_callee=args.callee] - the recipient of `args`. + * Used to extract parameter names for the error message + * @throws {TypeError} if args do not satisfy spec + */ function checkArgs (spec, functionName, args, opt_callee) { if (!moduleExports.enableChecks) { return; @@ -401,7 +434,7 @@ base64.fromArrayBuffer = function (arrayBuffer) { }; base64.toArrayBuffer = function (str) { - var decodedStr = typeof atob !== 'undefined' ? atob(str) : Buffer.from(str, 'base64').toString('binary'); // eslint-disable-line no-undef + var decodedStr = atob(str); var arrayBuffer = new ArrayBuffer(decodedStr.length); var array = new Uint8Array(arrayBuffer); for (var i = 0, len = decodedStr.length; i < len; i++) { @@ -463,14 +496,13 @@ var utils = require('cordova/utils'); function each (objects, func, context) { for (var prop in objects) { - if (objects.hasOwnProperty(prop)) { + if (Object.prototype.hasOwnProperty.call(objects, prop)) { func.apply(context, [objects[prop], prop]); } } } function clobber (obj, key, value) { - exports.replaceHookForTesting(obj, key); var needsProperty = false; try { obj[key] = value; @@ -544,7 +576,7 @@ function include (parent, objects, clobber, merge) { */ function recursiveMerge (target, src) { for (var prop in src) { - if (src.hasOwnProperty(prop)) { + if (Object.prototype.hasOwnProperty.call(src, prop)) { if (target.prototype && target.prototype.constructor === target) { // If the target object is a constructor override off prototype. clobber(target.prototype, prop, src[prop]); @@ -570,7 +602,6 @@ exports.buildIntoAndMerge = function (objects, target) { }; exports.recursiveMerge = recursiveMerge; exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter; -exports.replaceHookForTesting = function () {}; }); @@ -651,14 +682,14 @@ var channel = { } if (!len) h(); }, - /* eslint-disable no-return-assign */ + create: function (type) { - return channel[type] = new Channel(type, false); + return (channel[type] = new Channel(type, false)); }, createSticky: function (type) { - return channel[type] = new Channel(type, true); + return (channel[type] = new Channel(type, true)); }, - /* eslint-enable no-return-assign */ + /** * cordova Channels that must fire before "deviceready" is fired. */ @@ -779,7 +810,6 @@ Channel.prototype.unsubscribe = function (eventListenerOrFunction) { * Calls all functions subscribed to this channel. */ Channel.prototype.fire = function (e) { - var fail = false; // eslint-disable-line no-unused-vars var fireArgs = Array.prototype.slice.call(arguments); // Apply stickiness. if (this.state === 1) { @@ -836,33 +866,27 @@ module.exports = channel; }); -// file: /Users/spindori/Documents/Cordova/cordova-ios/cordova-js-src/exec.js +// file: ../cordova-ios/cordova-js-src/exec.js define("cordova/exec", function(require, exports, module) { -/*global require, module, atob, document */ - /** - * Creates a gap bridge iframe used to notify the native code about queued + * Creates the exec bridge used to notify the native code of * commands. */ -var cordova = require('cordova'), - utils = require('cordova/utils'), - base64 = require('cordova/base64'), - execIframe, - commandQueue = [], // Contains pending JS->Native messages. - isInContextOfEvalJs = 0, - failSafeTimerId = 0; +var cordova = require('cordova'); +var utils = require('cordova/utils'); +var base64 = require('cordova/base64'); -function massageArgsJsToNative(args) { - if (!args || utils.typeName(args) != 'Array') { +function massageArgsJsToNative (args) { + if (!args || utils.typeName(args) !== 'Array') { return args; } var ret = []; - args.forEach(function(arg, i) { - if (utils.typeName(arg) == 'ArrayBuffer') { + args.forEach(function (arg, i) { + if (utils.typeName(arg) === 'ArrayBuffer') { ret.push({ - 'CDVType': 'ArrayBuffer', - 'data': base64.fromArrayBuffer(arg) + CDVType: 'ArrayBuffer', + data: base64.fromArrayBuffer(arg) }); } else { ret.push(arg); @@ -871,29 +895,29 @@ function massageArgsJsToNative(args) { return ret; } -function massageMessageNativeToJs(message) { - if (message.CDVType == 'ArrayBuffer') { - var stringToArrayBuffer = function(str) { +function massageMessageNativeToJs (message) { + if (message.CDVType === 'ArrayBuffer') { + var stringToArrayBuffer = function (str) { var ret = new Uint8Array(str.length); for (var i = 0; i < str.length; i++) { ret[i] = str.charCodeAt(i); } return ret.buffer; }; - var base64ToArrayBuffer = function(b64) { - return stringToArrayBuffer(atob(b64)); + var base64ToArrayBuffer = function (b64) { + return stringToArrayBuffer(atob(b64)); // eslint-disable-line no-undef }; message = base64ToArrayBuffer(message.data); } return message; } -function convertMessageToArgsNativeToJs(message) { +function convertMessageToArgsNativeToJs (message) { var args = []; - if (!message || !message.hasOwnProperty('CDVType')) { + if (!message || !Object.prototype.hasOwnProperty.call(message, 'CDVType')) { args.push(message); - } else if (message.CDVType == 'MultiPart') { - message.messages.forEach(function(e) { + } else if (message.CDVType === 'MultiPart') { + message.messages.forEach(function (e) { args.push(massageMessageNativeToJs(e)); }); } else { @@ -902,8 +926,7 @@ function convertMessageToArgsNativeToJs(message) { return args; } -function iOSExec() { - +var iOSExec = function () { var successCallback, failCallback, service, action, actionArgs; var callbackId = null; if (typeof arguments[0] !== 'string') { @@ -920,9 +943,8 @@ function iOSExec() { // an invalid callbackId and passes it even if no callbacks were given. callbackId = 'INVALID'; } else { - throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' + - 'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);' - ); + throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' + // eslint-disable-line + 'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);'); } // If actionArgs is not provided, default to an empty array @@ -933,149 +955,54 @@ function iOSExec() { if (successCallback || failCallback) { callbackId = service + cordova.callbackId++; cordova.callbacks[callbackId] = - {success:successCallback, fail:failCallback}; + { success: successCallback, fail: failCallback }; } actionArgs = massageArgsJsToNative(actionArgs); - var command = [callbackId, service, action, actionArgs]; - - // Stringify and queue the command. We stringify to command now to - // effectively clone the command arguments in case they are mutated before - // the command is executed. - commandQueue.push(JSON.stringify(command)); - - // If we're in the context of a stringByEvaluatingJavaScriptFromString call, - // then the queue will be flushed when it returns; no need for a poke. - // Also, if there is already a command in the queue, then we've already - // poked the native side, so there is no reason to do so again. - if (!isInContextOfEvalJs && commandQueue.length == 1) { - pokeNative(); - } -} - -// CB-10530 -function proxyChanged() { - var cexec = cordovaExec(); - - return (execProxy !== cexec && // proxy objects are different - iOSExec !== cexec // proxy object is not the current iOSExec - ); -} - -// CB-10106 -function handleBridgeChange() { - if (proxyChanged()) { - var commandString = commandQueue.shift(); - while(commandString) { - var command = JSON.parse(commandString); - var callbackId = command[0]; - var service = command[1]; - var action = command[2]; - var actionArgs = command[3]; - var callbacks = cordova.callbacks[callbackId] || {}; - - execProxy(callbacks.success, callbacks.fail, service, action, actionArgs); - - commandString = commandQueue.shift(); - }; - return true; - } - - return false; -} - -function pokeNative() { - // CB-5488 - Don't attempt to create iframe before document.body is available. - if (!document.body) { - setTimeout(pokeNative); - return; - } - - // Check if they've removed it from the DOM, and put it back if so. - if (execIframe && execIframe.contentWindow) { - execIframe.contentWindow.location = 'gap://ready'; - } else { - execIframe = document.createElement('iframe'); - execIframe.style.display = 'none'; - execIframe.src = 'gap://ready'; - document.body.appendChild(execIframe); - } - // Use a timer to protect against iframe being unloaded during the poke (CB-7735). - // This makes the bridge ~ 7% slower, but works around the poke getting lost - // when the iframe is removed from the DOM. - // An onunload listener could be used in the case where the iframe has just been - // created, but since unload events fire only once, it doesn't work in the normal - // case of iframe reuse (where unload will have already fired due to the attempted - // navigation of the page). - failSafeTimerId = setTimeout(function() { - if (commandQueue.length) { - // CB-10106 - flush the queue on bridge change - if (!handleBridgeChange()) { - pokeNative(); - } - } - }, 50); // Making this > 0 improves performance (marginally) in the normal case (where it doesn't fire). -} - -iOSExec.nativeFetchMessages = function() { - // Stop listing for window detatch once native side confirms poke. - if (failSafeTimerId) { - clearTimeout(failSafeTimerId); - failSafeTimerId = 0; - } - // Each entry in commandQueue is a JSON string already. - if (!commandQueue.length) { - return ''; - } - var json = '[' + commandQueue.join(',') + ']'; - commandQueue.length = 0; - return json; + // CB-10133 DataClone DOM Exception 25 guard (fast function remover) + var command = [callbackId, service, action, JSON.parse(JSON.stringify(actionArgs))]; + window.webkit.messageHandlers.cordova.postMessage(command); }; -iOSExec.nativeCallback = function(callbackId, status, message, keepCallback, debug) { - return iOSExec.nativeEvalAndFetch(function() { - var success = status === 0 || status === 1; - var args = convertMessageToArgsNativeToJs(message); - function nc2() { - cordova.callbackFromNative(callbackId, success, status, args, keepCallback); - } - setTimeout(nc2, 0); +iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, debug) { + var success = status === 0 || status === 1; + var args = convertMessageToArgsNativeToJs(message); + Promise.resolve().then(function () { + cordova.callbackFromNative(callbackId, success, status, args, keepCallback); // eslint-disable-line }); }; -iOSExec.nativeEvalAndFetch = function(func) { - // This shouldn't be nested, but better to be safe. - isInContextOfEvalJs++; +// for backwards compatibility +iOSExec.nativeEvalAndFetch = function (func) { try { func(); - return iOSExec.nativeFetchMessages(); - } finally { - isInContextOfEvalJs--; + } catch (e) { + console.log(e); } }; // Proxy the exec for bridge changes. See CB-10106 -function cordovaExec() { +function cordovaExec () { var cexec = require('cordova/exec'); var cexec_valid = (typeof cexec.nativeFetchMessages === 'function') && (typeof cexec.nativeEvalAndFetch === 'function') && (typeof cexec.nativeCallback === 'function'); - return (cexec_valid && execProxy !== cexec)? cexec : iOSExec; + return (cexec_valid && execProxy !== cexec) ? cexec : iOSExec; } -function execProxy() { +function execProxy () { cordovaExec().apply(null, arguments); -}; +} -execProxy.nativeFetchMessages = function() { +execProxy.nativeFetchMessages = function () { return cordovaExec().nativeFetchMessages.apply(null, arguments); }; -execProxy.nativeEvalAndFetch = function() { +execProxy.nativeEvalAndFetch = function () { return cordovaExec().nativeEvalAndFetch.apply(null, arguments); }; -execProxy.nativeCallback = function() { +execProxy.nativeCallback = function () { return cordovaExec().nativeCallback.apply(null, arguments); }; @@ -1121,7 +1048,6 @@ var cordova = require('cordova'); var modulemapper = require('cordova/modulemapper'); var platform = require('cordova/platform'); var pluginloader = require('cordova/pluginloader'); -var utils = require('cordova/utils'); var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady]; @@ -1141,34 +1067,6 @@ window.setTimeout(function () { } }, 5000); -// Replace navigator before any modules are required(), to ensure it happens as soon as possible. -// We replace it so that properties that can't be clobbered can instead be overridden. -function replaceNavigator (origNavigator) { - var CordovaNavigator = function () {}; - CordovaNavigator.prototype = origNavigator; - var newNavigator = new CordovaNavigator(); - // This work-around really only applies to new APIs that are newer than Function.bind. - // Without it, APIs such as getGamepads() break. - if (CordovaNavigator.bind) { - for (var key in origNavigator) { - if (typeof origNavigator[key] === 'function') { - newNavigator[key] = origNavigator[key].bind(origNavigator); - } else { - (function (k) { - utils.defineGetterSetter(newNavigator, key, function () { - return origNavigator[k]; - }); - })(key); - } - } - } - return newNavigator; -} - -if (window.navigator) { - window.navigator = replaceNavigator(window.navigator); -} - if (!window.console) { window.console = { log: function () {} @@ -1234,131 +1132,6 @@ channel.join(function () { channel.join(function () { require('cordova').fireDocumentEvent('deviceready'); }, channel.deviceReadyChannelsArray); - -}, platformInitChannelsArray); - -}); - -// file: src/common/init_b.js -define("cordova/init_b", function(require, exports, module) { - -var channel = require('cordova/channel'); -var cordova = require('cordova'); -var modulemapper = require('cordova/modulemapper'); -var platform = require('cordova/platform'); -var pluginloader = require('cordova/pluginloader'); -var utils = require('cordova/utils'); - -var platformInitChannelsArray = [channel.onDOMContentLoaded, channel.onNativeReady, channel.onPluginsReady]; - -// setting exec -cordova.exec = require('cordova/exec'); - -function logUnfiredChannels (arr) { - for (var i = 0; i < arr.length; ++i) { - if (arr[i].state !== 2) { - console.log('Channel not fired: ' + arr[i].type); - } - } -} - -window.setTimeout(function () { - if (channel.onDeviceReady.state !== 2) { - console.log('deviceready has not fired after 5 seconds.'); - logUnfiredChannels(platformInitChannelsArray); - logUnfiredChannels(channel.deviceReadyChannelsArray); - } -}, 5000); - -// Replace navigator before any modules are required(), to ensure it happens as soon as possible. -// We replace it so that properties that can't be clobbered can instead be overridden. -function replaceNavigator (origNavigator) { - var CordovaNavigator = function () {}; - CordovaNavigator.prototype = origNavigator; - var newNavigator = new CordovaNavigator(); - // This work-around really only applies to new APIs that are newer than Function.bind. - // Without it, APIs such as getGamepads() break. - if (CordovaNavigator.bind) { - for (var key in origNavigator) { - if (typeof origNavigator[key] === 'function') { - newNavigator[key] = origNavigator[key].bind(origNavigator); - } else { - (function (k) { - utils.defineGetterSetter(newNavigator, key, function () { - return origNavigator[k]; - }); - })(key); - } - } - } - return newNavigator; -} -if (window.navigator) { - window.navigator = replaceNavigator(window.navigator); -} - -if (!window.console) { - window.console = { - log: function () {} - }; -} -if (!window.console.warn) { - window.console.warn = function (msg) { - this.log('warn: ' + msg); - }; -} - -// Register pause, resume and deviceready channels as events on document. -channel.onPause = cordova.addDocumentEventHandler('pause'); -channel.onResume = cordova.addDocumentEventHandler('resume'); -channel.onActivated = cordova.addDocumentEventHandler('activated'); -channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready'); - -// Listen for DOMContentLoaded and notify our channel subscribers. -if (document.readyState === 'complete' || document.readyState === 'interactive') { - channel.onDOMContentLoaded.fire(); -} else { - document.addEventListener('DOMContentLoaded', function () { - channel.onDOMContentLoaded.fire(); - }, false); -} - -// _nativeReady is global variable that the native side can set -// to signify that the native code is ready. It is a global since -// it may be called before any cordova JS is ready. -if (window._nativeReady) { - channel.onNativeReady.fire(); -} - -// Call the platform-specific initialization. -platform.bootstrap && platform.bootstrap(); - -// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js. -// The delay allows the attached modules to be defined before the plugin loader looks for them. -setTimeout(function () { - pluginloader.load(function () { - channel.onPluginsReady.fire(); - }); -}, 0); - -/** - * Create all cordova objects once native side is ready. - */ -channel.join(function () { - modulemapper.mapModules(window); - - platform.initialize && platform.initialize(); - - // Fire event to notify that all objects are created - channel.onCordovaReady.fire(); - - // Fire onDeviceReady event once page has fully loaded, all - // constructors have run and cordova info has been received from native - // side. - channel.join(function () { - require('cordova').fireDocumentEvent('deviceready'); - }, channel.deviceReadyChannelsArray); - }, platformInitChannelsArray); }); @@ -1367,7 +1140,7 @@ channel.join(function () { define("cordova/modulemapper", function(require, exports, module) { var builder = require('cordova/builder'); -var moduleMap = define.moduleMap; // eslint-disable-line no-undef +var moduleMap = define.moduleMap; var symbolList; var deprecationMap; @@ -1407,12 +1180,9 @@ function prepareNamespace (symbolPath, context) { if (!symbolPath) { return context; } - var parts = symbolPath.split('.'); - var cur = context; - for (var i = 0, part; part = parts[i]; ++i) { // eslint-disable-line no-cond-assign - cur = cur[part] = cur[part] || {}; - } - return cur; + return symbolPath.split('.').reduce(function (cur, part) { + return (cur[part] = cur[part] || {}); + }, context); } exports.mapModules = function (context) { @@ -1463,103 +1233,7 @@ exports.reset(); }); -// file: src/common/modulemapper_b.js -define("cordova/modulemapper_b", function(require, exports, module) { - -var builder = require('cordova/builder'); -var symbolList = []; -var deprecationMap; - -exports.reset = function () { - symbolList = []; - deprecationMap = {}; -}; - -function addEntry (strategy, moduleName, symbolPath, opt_deprecationMessage) { - symbolList.push(strategy, moduleName, symbolPath); - if (opt_deprecationMessage) { - deprecationMap[symbolPath] = opt_deprecationMessage; - } -} - -// Note: Android 2.3 does have Function.bind(). -exports.clobbers = function (moduleName, symbolPath, opt_deprecationMessage) { - addEntry('c', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.merges = function (moduleName, symbolPath, opt_deprecationMessage) { - addEntry('m', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.defaults = function (moduleName, symbolPath, opt_deprecationMessage) { - addEntry('d', moduleName, symbolPath, opt_deprecationMessage); -}; - -exports.runs = function (moduleName) { - addEntry('r', moduleName, null); -}; - -function prepareNamespace (symbolPath, context) { - if (!symbolPath) { - return context; - } - var parts = symbolPath.split('.'); - var cur = context; - for (var i = 0, part; part = parts[i]; ++i) { // eslint-disable-line no-cond-assign - cur = cur[part] = cur[part] || {}; - } - return cur; -} - -exports.mapModules = function (context) { - var origSymbols = {}; - context.CDV_origSymbols = origSymbols; - for (var i = 0, len = symbolList.length; i < len; i += 3) { - var strategy = symbolList[i]; - var moduleName = symbolList[i + 1]; - var module = require(moduleName); - // <runs/> - if (strategy === 'r') { - continue; - } - var symbolPath = symbolList[i + 2]; - var lastDot = symbolPath.lastIndexOf('.'); - var namespace = symbolPath.substr(0, lastDot); - var lastName = symbolPath.substr(lastDot + 1); - - var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null; - var parentObj = prepareNamespace(namespace, context); - var target = parentObj[lastName]; - - if (strategy === 'm' && target) { - builder.recursiveMerge(target, module); - } else if ((strategy === 'd' && !target) || (strategy !== 'd')) { - if (!(symbolPath in origSymbols)) { - origSymbols[symbolPath] = target; - } - builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg); - } - } -}; - -exports.getOriginalSymbol = function (context, symbolPath) { - var origSymbols = context.CDV_origSymbols; - if (origSymbols && (symbolPath in origSymbols)) { - return origSymbols[symbolPath]; - } - var parts = symbolPath.split('.'); - var obj = context; - for (var i = 0; i < parts.length; ++i) { - obj = obj && obj[parts[i]]; - } - return obj; -}; - -exports.reset(); - -}); - -// file: /Users/spindori/Documents/Cordova/cordova-ios/cordova-js-src/platform.js +// file: ../cordova-ios/cordova-js-src/platform.js define("cordova/platform", function(require, exports, module) { module.exports = { @@ -1569,187 +1243,213 @@ module.exports = { // see the file under plugin/ios/console.js require('cordova/modulemapper').clobbers('cordova/plugin/ios/console', 'window.console'); + // Attach the wkwebkit utility to window.WkWebView + // see the file under plugin/ios/wkwebkit.js + require('cordova/modulemapper').clobbers('cordova/plugin/ios/wkwebkit', 'window.WkWebView'); + + // Attach the splashscreen utility to window.navigator.splashscreen + // see the file under plugin/ios/launchscreen.js + require('cordova/modulemapper').clobbers('cordova/plugin/ios/launchscreen', 'navigator.splashscreen'); + require('cordova/channel').onNativeReady.fire(); } }; }); -// file: /Users/spindori/Documents/Cordova/cordova-ios/cordova-js-src/plugin/ios/console.js +// file: ../cordova-ios/cordova-js-src/plugin/ios/console.js define("cordova/plugin/ios/console", function(require, exports, module) { -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ var logger = require('cordova/plugin/ios/logger'); -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // object that we're exporting -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ var console = module.exports; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // copy of the original console object -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ var WinConsole = window.console; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // whether to use the logger -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ var UseLogger = false; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // Timers -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ var Timers = {}; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // used for unimplemented methods -//------------------------------------------------------------------------------ -function noop() {} +// ------------------------------------------------------------------------------ +function noop () {} -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // used for unimplemented methods -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.useLogger = function (value) { if (arguments.length) UseLogger = !!value; if (UseLogger) { if (logger.useConsole()) { - throw new Error("console and logger are too intertwingly"); + throw new Error('console and logger are too intertwingly'); } } return UseLogger; }; -//------------------------------------------------------------------------------ -console.log = function() { +// ------------------------------------------------------------------------------ +console.log = function () { if (logger.useConsole()) return; logger.log.apply(logger, [].slice.call(arguments)); }; -//------------------------------------------------------------------------------ -console.error = function() { +// ------------------------------------------------------------------------------ +console.error = function () { if (logger.useConsole()) return; logger.error.apply(logger, [].slice.call(arguments)); }; -//------------------------------------------------------------------------------ -console.warn = function() { +// ------------------------------------------------------------------------------ +console.warn = function () { if (logger.useConsole()) return; logger.warn.apply(logger, [].slice.call(arguments)); }; -//------------------------------------------------------------------------------ -console.info = function() { +// ------------------------------------------------------------------------------ +console.info = function () { if (logger.useConsole()) return; logger.info.apply(logger, [].slice.call(arguments)); }; -//------------------------------------------------------------------------------ -console.debug = function() { +// ------------------------------------------------------------------------------ +console.debug = function () { if (logger.useConsole()) return; logger.debug.apply(logger, [].slice.call(arguments)); }; -//------------------------------------------------------------------------------ -console.assert = function(expression) { +// ------------------------------------------------------------------------------ +console.assert = function (expression) { if (expression) return; var message = logger.format.apply(logger.format, [].slice.call(arguments, 1)); - console.log("ASSERT: " + message); + console.log('ASSERT: ' + message); }; -//------------------------------------------------------------------------------ -console.clear = function() {}; +// ------------------------------------------------------------------------------ +console.clear = function () {}; -//------------------------------------------------------------------------------ -console.dir = function(object) { - console.log("%o", object); +// ------------------------------------------------------------------------------ +console.dir = function (object) { + console.log('%o', object); }; -//------------------------------------------------------------------------------ -console.dirxml = function(node) { +// ------------------------------------------------------------------------------ +console.dirxml = function (node) { console.log(node.innerHTML); }; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.trace = noop; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.group = console.log; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.groupCollapsed = console.log; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.groupEnd = noop; -//------------------------------------------------------------------------------ -console.time = function(name) { +// ------------------------------------------------------------------------------ +console.time = function (name) { Timers[name] = new Date().valueOf(); }; -//------------------------------------------------------------------------------ -console.timeEnd = function(name) { +// ------------------------------------------------------------------------------ +console.timeEnd = function (name) { var timeStart = Timers[name]; if (!timeStart) { - console.warn("unknown timer: " + name); + console.warn('unknown timer: ' + name); return; } var timeElapsed = new Date().valueOf() - timeStart; - console.log(name + ": " + timeElapsed + "ms"); + console.log(name + ': ' + timeElapsed + 'ms'); }; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.timeStamp = noop; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.profile = noop; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.profileEnd = noop; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.count = noop; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ console.exception = console.log; -//------------------------------------------------------------------------------ -console.table = function(data, columns) { - console.log("%o", data); +// ------------------------------------------------------------------------------ +console.table = function (data, columns) { + console.log('%o', data); }; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // return a new function that calls both functions passed as args -//------------------------------------------------------------------------------ -function wrappedOrigCall(orgFunc, newFunc) { - return function() { +// ------------------------------------------------------------------------------ +function wrappedOrigCall (orgFunc, newFunc) { + return function () { var args = [].slice.call(arguments); try { orgFunc.apply(WinConsole, args); } catch (e) {} - try { newFunc.apply(console, args); } catch (e) {} + try { newFunc.apply(console, args); } catch (e) {} }; } -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // For every function that exists in the original console object, that // also exists in the new console object, wrap the new console method // with one that calls both -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ for (var key in console) { - if (typeof WinConsole[key] == "function") { + if (typeof WinConsole[key] === 'function') { console[key] = wrappedOrigCall(WinConsole[key], console[key]); } } }); -// file: /Users/spindori/Documents/Cordova/cordova-ios/cordova-js-src/plugin/ios/logger.js +// file: ../cordova-ios/cordova-js-src/plugin/ios/launchscreen.js +define("cordova/plugin/ios/launchscreen", function(require, exports, module) { + +var exec = require('cordova/exec'); + +var launchscreen = { + show: function () { + exec(null, null, 'LaunchScreen', 'show', []); + }, + hide: function () { + exec(null, null, 'LaunchScreen', 'hide', []); + } +}; + +module.exports = launchscreen; + +}); + +// file: ../cordova-ios/cordova-js-src/plugin/ios/logger.js define("cordova/plugin/ios/logger", function(require, exports, module) { -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // The logger module exports the following properties/functions: // // LOG - constant for the level LOG @@ -1768,16 +1468,16 @@ define("cordova/plugin/ios/logger", function(require, exports, module) { // debug(message,...) - logs a message at level DEBUG // logLevel(level,message,...) - logs a message specified level // -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ var logger = exports; -var exec = require('cordova/exec'); +var exec = require('cordova/exec'); -var UseConsole = false; -var UseLogger = true; -var Queued = []; -var DeviceReady = false; +var UseConsole = false; +var UseLogger = true; +var Queued = []; +var DeviceReady = false; var CurrentLevel; var originalConsole = console; @@ -1787,11 +1487,11 @@ var originalConsole = console; */ var Levels = [ - "LOG", - "ERROR", - "WARN", - "INFO", - "DEBUG" + 'LOG', + 'ERROR', + 'WARN', + 'INFO', + 'DEBUG' ]; /* @@ -1800,10 +1500,10 @@ var Levels = [ */ var LevelsMap = {}; -for (var i=0; i<Levels.length; i++) { +for (var i = 0; i < Levels.length; i++) { var level = Levels[i]; LevelsMap[level] = i; - logger[level] = level; + logger[level] = level; } CurrentLevel = LevelsMap.WARN; @@ -1830,7 +1530,7 @@ CurrentLevel = LevelsMap.WARN; logger.level = function (value) { if (arguments.length) { if (LevelsMap[value] === null) { - throw new Error("invalid logging level: " + value); + throw new Error('invalid logging level: ' + value); } CurrentLevel = LevelsMap[value]; } @@ -1848,17 +1548,17 @@ logger.useConsole = function (value) { if (arguments.length) UseConsole = !!value; if (UseConsole) { - if (typeof console == "undefined") { - throw new Error("global console object is not defined"); + if (typeof console === 'undefined') { + throw new Error('global console object is not defined'); } - if (typeof console.log != "function") { - throw new Error("global console object does not have a log function"); + if (typeof console.log !== 'function') { + throw new Error('global console object does not have a log function'); } - if (typeof console.useLogger == "function") { + if (typeof console.useLogger === 'function') { if (console.useLogger()) { - throw new Error("console and logger are too intertwingly"); + throw new Error('console and logger are too intertwingly'); } } } @@ -1884,7 +1584,7 @@ logger.useLogger = function (value) { * Parameters passed after message are used applied to * the message with utils.format() */ -logger.log = function(message) { logWithArgs("LOG", arguments); }; +logger.log = function (message) { logWithArgs('LOG', arguments); }; /** * Logs a message at the ERROR level. @@ -1892,7 +1592,7 @@ logger.log = function(message) { logWithArgs("LOG", arguments); }; * Parameters passed after message are used applied to * the message with utils.format() */ -logger.error = function(message) { logWithArgs("ERROR", arguments); }; +logger.error = function (message) { logWithArgs('ERROR', arguments); }; /** * Logs a message at the WARN level. @@ -1900,7 +1600,7 @@ logger.error = function(message) { logWithArgs("ERROR", arguments); }; * Parameters passed after message are used applied to * the message with utils.format() */ -logger.warn = function(message) { logWithArgs("WARN", arguments); }; +logger.warn = function (message) { logWithArgs('WARN', arguments); }; /** * Logs a message at the INFO level. @@ -1908,7 +1608,7 @@ logger.warn = function(message) { logWithArgs("WARN", arguments); }; * Parameters passed after message are used applied to * the message with utils.format() */ -logger.info = function(message) { logWithArgs("INFO", arguments); }; +logger.info = function (message) { logWithArgs('INFO', arguments); }; /** * Logs a message at the DEBUG level. @@ -1916,17 +1616,17 @@ logger.info = function(message) { logWithArgs("INFO", arguments); }; * Parameters passed after message are used applied to * the message with utils.format() */ -logger.debug = function(message) { logWithArgs("DEBUG", arguments); }; +logger.debug = function (message) { logWithArgs('DEBUG', arguments); }; // log at the specified level with args -function logWithArgs(level, args) { +function logWithArgs (level, args) { args = [level].concat([].slice.call(args)); logger.logLevel.apply(logger, args); } // return the correct formatString for an object -function formatStringForMessage(message) { - return (typeof message === "string") ? "" : "%o"; +function formatStringForMessage (message) { + return (typeof message === 'string') ? '' : '%o'; } /** @@ -1935,18 +1635,18 @@ function formatStringForMessage(message) { * Parameters passed after message are used applied to * the message with utils.format() */ -logger.logLevel = function(level /* , ... */) { +logger.logLevel = function (level /* , ... */) { // format the message with the parameters var formatArgs = [].slice.call(arguments, 1); var fmtString = formatStringForMessage(formatArgs[0]); - if (fmtString.length > 0){ + if (fmtString.length > 0) { formatArgs.unshift(fmtString); // add formatString } - var message = logger.format.apply(logger.format, formatArgs); + var message = logger.format.apply(logger.format, formatArgs); if (LevelsMap[level] === null) { - throw new Error("invalid logging level: " + level); + throw new Error('invalid logging level: ' + level); } if (LevelsMap[level] > CurrentLevel) return; @@ -1959,28 +1659,27 @@ logger.logLevel = function(level /* , ... */) { // Log using the native logger if that is enabled if (UseLogger) { - exec(null, null, "Console", "logLevel", [level, message]); + exec(null, null, 'Console', 'logLevel', [level, message]); } // Log using the console if that is enabled if (UseConsole) { // make sure console is not using logger if (console.useLogger()) { - throw new Error("console and logger are too intertwingly"); + throw new Error('console and logger are too intertwingly'); } // log to the console switch (level) { - case logger.LOG: originalConsole.log(message); break; - case logger.ERROR: originalConsole.log("ERROR: " + message); break; - case logger.WARN: originalConsole.log("WARN: " + message); break; - case logger.INFO: originalConsole.log("INFO: " + message); break; - case logger.DEBUG: originalConsole.log("DEBUG: " + message); break; + case logger.LOG: originalConsole.log(message); break; + case logger.ERROR: originalConsole.log('ERROR: ' + message); break; + case logger.WARN: originalConsole.log('WARN: ' + message); break; + case logger.INFO: originalConsole.log('INFO: ' + message); break; + case logger.DEBUG: originalConsole.log('DEBUG: ' + message); break; } } }; - /** * Formats a string and arguments following it ala console.log() * @@ -1989,12 +1688,11 @@ logger.logLevel = function(level /* , ... */) { * for rationale, see FireBug's Console API: * http://getfirebug.com/wiki/index.php/Console_API */ -logger.format = function(formatString, args) { - return __format(arguments[0], [].slice.call(arguments,1)).join(' '); +logger.format = function (formatString, args) { + return __format(arguments[0], [].slice.call(arguments, 1)).join(' '); }; - -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ /** * Formats a string and arguments following it ala vsprintf() * @@ -2009,26 +1707,25 @@ logger.format = function(formatString, args) { * Returns an array containing the formatted string and any remaining * arguments. */ -function __format(formatString, args) { - if (formatString === null || formatString === undefined) return [""]; - if (arguments.length == 1) return [formatString.toString()]; +function __format (formatString, args) { + if (formatString === null || formatString === undefined) return ['']; + if (arguments.length === 1) return [formatString.toString()]; - if (typeof formatString != "string") - formatString = formatString.toString(); + if (typeof formatString !== 'string') { formatString = formatString.toString(); } var pattern = /(.*?)%(.)(.*)/; - var rest = formatString; - var result = []; + var rest = formatString; + var result = []; while (args.length) { var match = pattern.exec(rest); if (!match) break; - var arg = args.shift(); + var arg = args.shift(); rest = match[3]; result.push(match[1]); - if (match[2] == '%') { + if (match[2] === '%') { result.push('%'); args.unshift(arg); continue; @@ -2044,17 +1741,15 @@ function __format(formatString, args) { return remainingArgs; } -function __formatted(object, formatChar) { - +function __formatted (object, formatChar) { try { - switch(formatChar) { - case 'j': - case 'o': return JSON.stringify(object); - case 'c': return ''; + switch (formatChar) { + case 'j': + case 'o': return JSON.stringify(object); + case 'c': return ''; } - } - catch (e) { - return "error JSON.stringify()ing argument: " + e; + } catch (e) { + return 'error JSON.stringify()ing argument: ' + e; } if ((object === null) || (object === undefined)) { @@ -2064,15 +1759,14 @@ function __formatted(object, formatChar) { return object.toString(); } - -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ // when deviceready fires, log queued messages -logger.__onDeviceReady = function() { +logger.__onDeviceReady = function () { if (DeviceReady) return; DeviceReady = true; - for (var i=0; i<Queued.length; i++) { + for (var i = 0; i < Queued.length; i++) { var messageArgs = Queued[i]; logger.logLevel(messageArgs[0], messageArgs[1]); } @@ -2081,7 +1775,34 @@ logger.__onDeviceReady = function() { }; // add a deviceready event to log queued messages -document.addEventListener("deviceready", logger.__onDeviceReady, false); +document.addEventListener('deviceready', logger.__onDeviceReady, false); + +}); + +// file: ../cordova-ios/cordova-js-src/plugin/ios/wkwebkit.js +define("cordova/plugin/ios/wkwebkit", function(require, exports, module) { + +var exec = require('cordova/exec'); + +var WkWebKit = { + allowsBackForwardNavigationGestures: function (allow) { + exec(null, null, 'CDVWebViewEngine', 'allowsBackForwardNavigationGestures', [allow]); + }, + convertFilePath: function (path) { + if (!path || !window.CDV_ASSETS_URL) { + return path; + } + if (path.startsWith('/')) { + return window.CDV_ASSETS_URL + '/_app_file_' + path; + } + if (path.startsWith('file://')) { + return window.CDV_ASSETS_URL + path.replace('file://', '/_app_file_'); + } + return path; + } +}; + +module.exports = WkWebKit; }); @@ -2104,11 +1825,11 @@ exports.injectScript = function (url, onload, onerror) { function injectIfNecessary (id, url, onload, onerror) { onerror = onerror || onload; - if (id in define.moduleMap) { // eslint-disable-line no-undef + if (id in define.moduleMap) { onload(); } else { exports.injectScript(url, function () { - if (id in define.moduleMap) { // eslint-disable-line no-undef + if (id in define.moduleMap) { onload(); } else { onerror(); @@ -2119,7 +1840,7 @@ function injectIfNecessary (id, url, onload, onerror) { function onScriptLoadingComplete (moduleList, finishPluginLoading) { // Loop through all the plugins and then through their clobbers and merges. - for (var i = 0, module; module = moduleList[i]; i++) { // eslint-disable-line no-cond-assign + for (var i = 0, module; (module = moduleList[i]); i++) { if (module.clobbers && module.clobbers.length) { for (var j = 0; j < module.clobbers.length; j++) { modulemapper.clobbers(module.id, module.clobbers[j]); @@ -2195,53 +1916,6 @@ exports.load = function (callback) { }); -// file: src/common/pluginloader_b.js -define("cordova/pluginloader_b", function(require, exports, module) { - -var modulemapper = require('cordova/modulemapper'); - -// Handler for the cordova_plugins.js content. -// See plugman's plugin_loader.js for the details of this object. -function handlePluginsObject (moduleList) { - // if moduleList is not defined or empty, we've nothing to do - if (!moduleList || !moduleList.length) { - return; - } - - // Loop through all the modules and then through their clobbers and merges. - for (var i = 0, module; module = moduleList[i]; i++) { // eslint-disable-line no-cond-assign - if (module.clobbers && module.clobbers.length) { - for (var j = 0; j < module.clobbers.length; j++) { - modulemapper.clobbers(module.id, module.clobbers[j]); - } - } - - if (module.merges && module.merges.length) { - for (var k = 0; k < module.merges.length; k++) { - modulemapper.merges(module.id, module.merges[k]); - } - } - - // Finally, if runs is truthy we want to simply require() the module. - if (module.runs) { - modulemapper.runs(module.id); - } - } -} - -// Loads all plugins' js-modules. Plugin loading is syncronous in browserified bundle -// but the method accepts callback to be compatible with non-browserify flow. -// onDeviceReady is blocked on onPluginsReady. onPluginsReady is fired when there are -// no plugins to load, or they are all done. -exports.load = function (callback) { - var moduleList = require('cordova/plugin_list'); - handlePluginsObject(moduleList); - - callback(); -}; - -}); - // file: src/common/urlutil.js define("cordova/urlutil", function(require, exports, module) { @@ -2349,10 +2023,11 @@ utils.clone = function (obj) { retVal = {}; for (i in obj) { - // https://issues.apache.org/jira/browse/CB-11522 'unknown' type may be returned in - // custom protocol activation case on Windows Phone 8.1 causing "No such interface supported" exception - // on cloning. - if ((!(i in retVal) || retVal[i] !== obj[i]) && typeof obj[i] !== 'undefined' && typeof obj[i] !== 'unknown') { // eslint-disable-line valid-typeof + // 'unknown' type may be returned in custom protocol activation case on + // Windows Phone 8.1 causing "No such interface supported" exception on + // cloning (https://issues.apache.org/jira/browse/CB-11522) + // eslint-disable-next-line valid-typeof + if ((!(i in retVal) || retVal[i] !== obj[i]) && typeof obj[i] !== 'undefined' && typeof obj[i] !== 'unknown') { retVal[i] = utils.clone(obj[i]); } } @@ -2402,7 +2077,6 @@ utils.extend = (function () { var F = function () {}; // extend Child from Parent return function (Child, Parent) { - F.prototype = Parent.prototype; Child.prototype = new F(); Child.__super__ = Parent.prototype; @@ -2425,7 +2099,6 @@ utils.alert = function (msg) { window.cordova = require('cordova'); // file: src/scripts/bootstrap.js - require('cordova/init'); -})();
\ No newline at end of file +})(); diff --git a/StoneIsland/platforms/ios/platform_www/cordova_plugins.js b/StoneIsland/platforms/ios/platform_www/cordova_plugins.js index 8469b08b..74e8a3a4 100644 --- a/StoneIsland/platforms/ios/platform_www/cordova_plugins.js +++ b/StoneIsland/platforms/ios/platform_www/cordova_plugins.js @@ -1,172 +1,97 @@ cordova.define('cordova/plugin_list', function(require, exports, module) { -module.exports = [ - { - "id": "cordova-plugin-customurlscheme.LaunchMyApp", - "file": "plugins/cordova-plugin-customurlscheme/www/ios/LaunchMyApp.js", - "pluginId": "cordova-plugin-customurlscheme", - "clobbers": [ - "window.plugins.launchmyapp" - ] - }, - { - "id": "cordova-plugin-device.device", - "file": "plugins/cordova-plugin-device/www/device.js", - "pluginId": "cordova-plugin-device", - "clobbers": [ - "device" - ] - }, - { - "id": "cordova-plugin-dialogs.notification", - "file": "plugins/cordova-plugin-dialogs/www/notification.js", - "pluginId": "cordova-plugin-dialogs", - "merges": [ - "navigator.notification" - ] - }, - { - "id": "cordova-plugin-geolocation.Coordinates", - "file": "plugins/cordova-plugin-geolocation/www/Coordinates.js", - "pluginId": "cordova-plugin-geolocation", - "clobbers": [ - "Coordinates" - ] - }, - { - "id": "cordova-plugin-geolocation.PositionError", - "file": "plugins/cordova-plugin-geolocation/www/PositionError.js", - "pluginId": "cordova-plugin-geolocation", - "clobbers": [ - "PositionError" - ] - }, - { - "id": "cordova-plugin-geolocation.Position", - "file": "plugins/cordova-plugin-geolocation/www/Position.js", - "pluginId": "cordova-plugin-geolocation", - "clobbers": [ - "Position" - ] - }, - { - "id": "cordova-plugin-geolocation.geolocation", - "file": "plugins/cordova-plugin-geolocation/www/geolocation.js", - "pluginId": "cordova-plugin-geolocation", - "clobbers": [ - "navigator.geolocation" - ] - }, - { - "id": "cordova-plugin-inappbrowser.inappbrowser", - "file": "plugins/cordova-plugin-inappbrowser/www/inappbrowser.js", - "pluginId": "cordova-plugin-inappbrowser", - "clobbers": [ - "cordova.InAppBrowser.open", - "window.open" - ] - }, - { - "id": "cordova-plugin-network-information.network", - "file": "plugins/cordova-plugin-network-information/www/network.js", - "pluginId": "cordova-plugin-network-information", - "clobbers": [ - "navigator.connection", - "navigator.network.connection" - ] - }, - { - "id": "cordova-plugin-network-information.Connection", - "file": "plugins/cordova-plugin-network-information/www/Connection.js", - "pluginId": "cordova-plugin-network-information", - "clobbers": [ - "Connection" - ] - }, - { - "id": "cordova-plugin-splashscreen.SplashScreen", - "file": "plugins/cordova-plugin-splashscreen/www/splashscreen.js", - "pluginId": "cordova-plugin-splashscreen", - "clobbers": [ - "navigator.splashscreen" - ] - }, - { - "id": "cordova-plugin-statusbar.statusbar", - "file": "plugins/cordova-plugin-statusbar/www/statusbar.js", - "pluginId": "cordova-plugin-statusbar", - "clobbers": [ - "window.StatusBar" - ] - }, - { - "id": "cordova-plugin-x-socialsharing.SocialSharing", - "file": "plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js", - "pluginId": "cordova-plugin-x-socialsharing", - "clobbers": [ - "window.plugins.socialsharing" - ] - }, - { - "id": "ionic-plugin-keyboard.keyboard", - "file": "plugins/ionic-plugin-keyboard/www/ios/keyboard.js", - "pluginId": "ionic-plugin-keyboard", - "clobbers": [ - "cordova.plugins.Keyboard" - ], - "runs": true - }, - { - "id": "phonegap-plugin-push.PushNotification", - "file": "plugins/phonegap-plugin-push/www/push.js", - "pluginId": "phonegap-plugin-push", - "clobbers": [ - "PushNotification" - ] - }, - { - "id": "cordova-plugin-sim.Sim", - "file": "plugins/cordova-plugin-sim/www/sim.js", - "pluginId": "cordova-plugin-sim", - "merges": [ - "window.plugins.sim" - ] - }, - { - "id": "phonegap-plugin-mobile-accessibility.mobile-accessibility", - "file": "plugins/phonegap-plugin-mobile-accessibility/www/mobile-accessibility.js", - "pluginId": "phonegap-plugin-mobile-accessibility", - "clobbers": [ - "window.MobileAccessibility" - ] - }, - { - "id": "phonegap-plugin-mobile-accessibility.MobileAccessibilityNotifications", - "file": "plugins/phonegap-plugin-mobile-accessibility/www/MobileAccessibilityNotifications.js", - "pluginId": "phonegap-plugin-mobile-accessibility", - "clobbers": [ - "MobileAccessibilityNotifications" - ] - } -]; -module.exports.metadata = -// TOP OF METADATA -{ - "cordova-plugin-app-name": "1.0.4", - "cordova-plugin-compat": "1.1.0", - "cordova-plugin-customurlscheme": "4.2.0", - "cordova-plugin-device": "1.1.3", - "cordova-plugin-dialogs": "1.3.0", - "cordova-plugin-geolocation": "2.4.0", - "cordova-plugin-inappbrowser": "1.5.0", - "cordova-plugin-network-information": "1.3.0", - "cordova-plugin-splashscreen": "4.0.3", - "cordova-plugin-statusbar": "2.2.3", - "cordova-plugin-whitelist": "1.3.0", - "cordova-plugin-x-socialsharing": "5.1.3", - "ionic-plugin-keyboard": "2.2.1", - "phonegap-plugin-push": "1.9.2", - "cordova-plugin-sim": "1.3.3", - "phonegap-plugin-mobile-accessibility": "1.0.5-dev" -}; -// BOTTOM OF METADATA + module.exports = [ + { + "id": "cordova-plugin-customurlscheme.LaunchMyApp", + "file": "plugins/cordova-plugin-customurlscheme/www/ios/LaunchMyApp.js", + "pluginId": "cordova-plugin-customurlscheme", + "clobbers": [ + "window.plugins.launchmyapp" + ] + }, + { + "id": "cordova-plugin-device.device", + "file": "plugins/cordova-plugin-device/www/device.js", + "pluginId": "cordova-plugin-device", + "clobbers": [ + "device" + ] + }, + { + "id": "cordova-plugin-dialogs.notification", + "file": "plugins/cordova-plugin-dialogs/www/notification.js", + "pluginId": "cordova-plugin-dialogs", + "merges": [ + "navigator.notification" + ] + }, + { + "id": "cordova-plugin-firebasex.FirebasePlugin", + "file": "plugins/cordova-plugin-firebasex/www/firebase.js", + "pluginId": "cordova-plugin-firebasex", + "clobbers": [ + "FirebasePlugin" + ] + }, + { + "id": "cordova-plugin-ionic-keyboard.keyboard", + "file": "plugins/cordova-plugin-ionic-keyboard/www/ios/keyboard.js", + "pluginId": "cordova-plugin-ionic-keyboard", + "clobbers": [ + "window.Keyboard" + ] + }, + { + "id": "cordova-plugin-sim.Sim", + "file": "plugins/cordova-plugin-sim/www/sim.js", + "pluginId": "cordova-plugin-sim", + "merges": [ + "window.plugins.sim" + ] + }, + { + "id": "cordova-plugin-geolocation.Coordinates", + "file": "plugins/cordova-plugin-geolocation/www/Coordinates.js", + "pluginId": "cordova-plugin-geolocation", + "clobbers": [ + "Coordinates" + ] + }, + { + "id": "cordova-plugin-geolocation.PositionError", + "file": "plugins/cordova-plugin-geolocation/www/PositionError.js", + "pluginId": "cordova-plugin-geolocation", + "clobbers": [ + "PositionError" + ] + }, + { + "id": "cordova-plugin-geolocation.Position", + "file": "plugins/cordova-plugin-geolocation/www/Position.js", + "pluginId": "cordova-plugin-geolocation", + "clobbers": [ + "Position" + ] + }, + { + "id": "cordova-plugin-geolocation.geolocation", + "file": "plugins/cordova-plugin-geolocation/www/geolocation.js", + "pluginId": "cordova-plugin-geolocation", + "clobbers": [ + "navigator.geolocation" + ] + } + ]; + module.exports.metadata = { + "cordova-plugin-app-name": "1.0.4", + "cordova-plugin-compat": "1.1.0", + "cordova-plugin-customurlscheme": "4.2.0", + "cordova-plugin-device": "1.1.3", + "cordova-plugin-dialogs": "1.3.0", + "cordova-plugin-androidx": "2.0.0", + "cordova-plugin-androidx-adapter": "1.1.1", + "cordova-plugin-firebasex": "10.2.0-cli", + "cordova-plugin-ionic-keyboard": "2.2.0", + "cordova-plugin-sim": "1.3.3", + "cordova-plugin-geolocation": "4.0.2" + }; });
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-firebasex/www/firebase.js b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-firebasex/www/firebase.js new file mode 100644 index 00000000..0e8005e5 --- /dev/null +++ b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-firebasex/www/firebase.js @@ -0,0 +1,388 @@ +cordova.define("cordova-plugin-firebasex.FirebasePlugin", function(require, exports, module) { +var exec = require('cordova/exec'); + +var ensureBooleanFn = function (callback){ + return function(result){ + callback(ensureBoolean(result)); + } +}; + +var ensureBoolean = function(value){ + if(value === "true"){ + value = true; + }else if(value === "false"){ + value = false; + } + return !!value; +}; + +var onAuthStateChangeCallback = function(){}; + +/*********************** + * Protected internals + ***********************/ +exports._onAuthStateChange = function(userSignedIn){ + onAuthStateChangeCallback(userSignedIn); +}; + +/************** + * Public API + **************/ + +// Notifications +exports.getId = function (success, error) { + exec(success, error, "FirebasePlugin", "getId", []); +}; + +exports.getToken = function (success, error) { + exec(success, error, "FirebasePlugin", "getToken", []); +}; + +exports.getAPNSToken = function (success, error) { + exec(success, error, "FirebasePlugin", "getAPNSToken", []); +}; + +exports.onMessageReceived = function (success, error) { + exec(success, error, "FirebasePlugin", "onMessageReceived", []); +}; + +exports.onTokenRefresh = function (success, error) { + exec(success, error, "FirebasePlugin", "onTokenRefresh", []); +}; + +exports.onApnsTokenReceived = function (success, error) { + exec(success, error, "FirebasePlugin", "onApnsTokenReceived", []); +}; + +exports.subscribe = function (topic, success, error) { + exec(success, error, "FirebasePlugin", "subscribe", [topic]); +}; + +exports.unsubscribe = function (topic, success, error) { + exec(success, error, "FirebasePlugin", "unsubscribe", [topic]); +}; + +exports.unregister = function (success, error) { + exec(success, error, "FirebasePlugin", "unregister", []); +}; + +exports.isAutoInitEnabled = function (success, error) { + exec(success, error, "FirebasePlugin", "isAutoInitEnabled", []); +}; + +exports.setAutoInitEnabled = function (enabled, success, error) { + exec(success, error, "FirebasePlugin", "setAutoInitEnabled", [!!enabled]); +}; + +// Notifications - iOS-only +exports.setBadgeNumber = function (number, success, error) { + exec(success, error, "FirebasePlugin", "setBadgeNumber", [number]); +}; + +exports.getBadgeNumber = function (success, error) { + exec(success, error, "FirebasePlugin", "getBadgeNumber", []); +}; + +exports.grantPermission = function (success, error) { + exec(ensureBooleanFn(success), error, "FirebasePlugin", "grantPermission", []); +}; + +exports.hasPermission = function (success, error) { + exec(ensureBooleanFn(success), error, "FirebasePlugin", "hasPermission", []); +}; + +// Notifications - Android-only +exports.setDefaultChannel = function (options, success, error) { + exec(success, error, "FirebasePlugin", "setDefaultChannel", [options]); +}; + +exports.createChannel = function (options, success, error) { + exec(success, error, "FirebasePlugin", "createChannel", [options]); +}; + +exports.deleteChannel = function (channelID, success, error) { + exec(success, error, "FirebasePlugin", "deleteChannel", [channelID]); +}; + +exports.listChannels = function (success, error) { + exec(success, error, "FirebasePlugin", "listChannels", []); +}; + +// Analytics +exports.setAnalyticsCollectionEnabled = function (enabled, success, error) { + exec(success, error, "FirebasePlugin", "setAnalyticsCollectionEnabled", [!!enabled]); +}; + +exports.isAnalyticsCollectionEnabled = function (success, error) { + exec(success, error, "FirebasePlugin", "isAnalyticsCollectionEnabled", []); +}; + +exports.logEvent = function (name, params, success, error) { + exec(success, error, "FirebasePlugin", "logEvent", [name, params]); +}; + +exports.setScreenName = function (name, success, error) { + exec(success, error, "FirebasePlugin", "setScreenName", [name]); +}; + +exports.setUserId = function (id, success, error) { + exec(success, error, "FirebasePlugin", "setUserId", [id]); +}; + +exports.setUserProperty = function (name, value, success, error) { + exec(success, error, "FirebasePlugin", "setUserProperty", [name, value]); +}; + +exports.activateFetched = function (success, error) { + exec(ensureBooleanFn(success), error, "FirebasePlugin", "activateFetched", []); +}; + +exports.fetch = function (cacheExpirationSeconds, success, error) { + var args = []; + if (typeof cacheExpirationSeconds === 'number') { + args.push(cacheExpirationSeconds); + } else { + error = success; + success = cacheExpirationSeconds; + } + exec(success, error, "FirebasePlugin", "fetch", args); +}; + +exports.getByteArray = function (key, success, error) { + exec(success, error, "FirebasePlugin", "getByteArray", [key]); +}; + +exports.getValue = function (key, success, error) { + exec(success, error, "FirebasePlugin", "getValue", [key]); +}; + +exports.getInfo = function (success, error) { + exec(success, error, "FirebasePlugin", "getInfo", []); +}; + +exports.setConfigSettings = function (settings, success, error) { + exec(success, error, "FirebasePlugin", "setConfigSettings", [settings]); +}; + +exports.setDefaults = function (defaults, success, error) { + exec(success, error, "FirebasePlugin", "setDefaults", [defaults]); +}; + +exports.startTrace = function (name, success, error) { + exec(success, error, "FirebasePlugin", "startTrace", [name]); +}; + +exports.incrementCounter = function (name, counterNamed, success, error) { + exec(success, error, "FirebasePlugin", "incrementCounter", [name, counterNamed]); +}; + +exports.stopTrace = function (name, success, error) { + exec(success, error, "FirebasePlugin", "stopTrace", [name]); +}; + +exports.setPerformanceCollectionEnabled = function (enabled, success, error) { + exec(success, error, "FirebasePlugin", "setPerformanceCollectionEnabled", [!!enabled]); +}; + +exports.isPerformanceCollectionEnabled = function (success, error) { + exec(success, error, "FirebasePlugin", "isPerformanceCollectionEnabled", []); +}; + +exports.clearAllNotifications = function (success, error) { + exec(success, error, "FirebasePlugin", "clearAllNotifications", []); +}; + + +// Crashlytics +exports.setCrashlyticsCollectionEnabled = function (enabled, success, error) { + exec(success, error, "FirebasePlugin", "setCrashlyticsCollectionEnabled", [!!enabled]); +}; + +exports.isCrashlyticsCollectionEnabled = function (success, error) { + exec(success, error, "FirebasePlugin", "isCrashlyticsCollectionEnabled", []); +}; + +exports.logMessage = function (message, success, error) { + exec(success, error, "FirebasePlugin", "logMessage", [message]); +}; + +exports.sendCrash = function (success, error) { + exec(success, error, "FirebasePlugin", "sendCrash", []); +}; + +exports.logError = function (message, stackTrace, success, error) { + var args = [message]; + // "stackTrace" is an optional arg that's an array of objects. + if (stackTrace) { + if (typeof stackTrace === 'function') { + error = success; + success = stackTrace; + } else { + args.push(stackTrace); + } + } + exec(success, error, "FirebasePlugin", "logError", args); +}; + +exports.setCrashlyticsUserId = function (userId, success, error) { + exec(success, error, "FirebasePlugin", "setCrashlyticsUserId", [userId]); +}; + + +// Authentication +exports.verifyPhoneNumber = function (success, error, number, timeOutDuration, fakeVerificationCode) { + exec(function(credential){ + if(typeof credential === 'object'){ + credential.instantVerification = ensureBoolean(credential.instantVerification); + } + success(credential); + }, error, "FirebasePlugin", "verifyPhoneNumber", [number, timeOutDuration, fakeVerificationCode]); +}; + +exports.createUserWithEmailAndPassword = function (email, password, success, error) { + exec(success, error, "FirebasePlugin", "createUserWithEmailAndPassword", [email, password]); +}; + +exports.signInUserWithEmailAndPassword = function (email, password, success, error) { + exec(success, error, "FirebasePlugin", "signInUserWithEmailAndPassword", [email, password]); +}; + +exports.signInUserWithCustomToken = function (customToken, success, error) { + exec(success, error, "FirebasePlugin", "signInUserWithCustomToken", [customToken]); +}; + +exports.signInUserAnonymously = function (success, error) { + exec(success, error, "FirebasePlugin", "signInUserAnonymously"); +}; + +exports.authenticateUserWithGoogle = function (clientId, success, error) { + exec(success, error, "FirebasePlugin", "authenticateUserWithGoogle", [clientId]); +}; + +exports.authenticateUserWithApple = function (success, error, locale) { + exec(success, error, "FirebasePlugin", "authenticateUserWithApple", [locale]); +}; + +exports.signInWithCredential = function (credential, success, error) { + if(typeof credential !== 'object') return error("'credential' must be an object"); + exec(success, error, "FirebasePlugin", "signInWithCredential", [credential]); +}; + +exports.linkUserWithCredential = function (credential, success, error) { + if(typeof credential !== 'object') return error("'credential' must be an object"); + exec(success, error, "FirebasePlugin", "linkUserWithCredential", [credential]); +}; + +exports.reauthenticateWithCredential = function (credential, success, error) { + if(typeof credential !== 'object') return error("'credential' must be an object"); + exec(success, error, "FirebasePlugin", "reauthenticateWithCredential", [credential]); +}; + +exports.isUserSignedIn = function (success, error) { + exec(ensureBooleanFn(success), error, "FirebasePlugin", "isUserSignedIn", []); +}; + +exports.signOutUser = function (success, error) { + exec(ensureBooleanFn(success), error, "FirebasePlugin", "signOutUser", []); +}; + + +exports.getCurrentUser = function (success, error) { + exec(function(user){ + user.emailIsVerified = ensureBoolean(user.emailIsVerified); + success(user); + }, error, "FirebasePlugin", "getCurrentUser", []); +}; + +exports.reloadCurrentUser = function (success, error) { + exec(function(user){ + user.emailIsVerified = ensureBoolean(user.emailIsVerified); + success(user); + }, error, "FirebasePlugin", "reloadCurrentUser", []); +}; + +exports.updateUserProfile = function (profile, success, error) { + if(typeof profile !== 'object') return error("'profile' must be an object with keys 'name' and/or 'photoUri'"); + exec(success, error, "FirebasePlugin", "updateUserProfile", [profile]); +}; + +exports.updateUserEmail = function (email, success, error) { + if(typeof email !== 'string' || !email) return error("'email' must be a valid email address"); + exec(success, error, "FirebasePlugin", "updateUserEmail", [email]); +}; + +exports.sendUserEmailVerification = function (success, error) { + exec(success, error, "FirebasePlugin", "sendUserEmailVerification", []); +}; + +exports.updateUserPassword = function (password, success, error) { + if(typeof password !== 'string' || !password) return error("'password' must be a valid string"); + exec(success, error, "FirebasePlugin", "updateUserPassword", [password]); +}; + +exports.sendUserPasswordResetEmail = function (email, success, error) { + if(typeof email !== 'string' || !email) return error("'email' must be a valid email address"); + exec(success, error, "FirebasePlugin", "sendUserPasswordResetEmail", [email]); +}; + +exports.deleteUser = function (success, error) { + exec(success, error, "FirebasePlugin", "deleteUser", []); +}; + +exports.registerAuthStateChangeListener = function(fn){ + if(typeof fn !== "function") throw "The specified argument must be a function"; + onAuthStateChangeCallback = fn; +}; + +// Firestore +exports.addDocumentToFirestoreCollection = function (document, collection, success, error) { + if(typeof collection !== 'string') return error("'collection' must be a string specifying the Firestore collection name"); + if(typeof document !== 'object' || typeof document.length === 'number') return error("'document' must be an object specifying record data"); + + exec(success, error, "FirebasePlugin", "addDocumentToFirestoreCollection", [document, collection]); +}; + +exports.setDocumentInFirestoreCollection = function (documentId, document, collection, success, error) { + if(typeof documentId !== 'string' && typeof documentId !== 'number') return error("'documentId' must be a string or number specifying the Firestore document identifier"); + if(typeof collection !== 'string') return error("'collection' must be a string specifying the Firestore collection name"); + if(typeof document !== 'object' || typeof document.length === 'number') return error("'document' must be an object specifying record data"); + + exec(success, error, "FirebasePlugin", "setDocumentInFirestoreCollection", [documentId.toString(), document, collection]); +}; + +exports.updateDocumentInFirestoreCollection = function (documentId, document, collection, success, error) { + if(typeof documentId !== 'string' && typeof documentId !== 'number') return error("'documentId' must be a string or number specifying the Firestore document identifier"); + if(typeof collection !== 'string') return error("'collection' must be a string specifying the Firestore collection name"); + if(typeof document !== 'object' || typeof document.length === 'number') return error("'document' must be an object specifying record data"); + + exec(success, error, "FirebasePlugin", "updateDocumentInFirestoreCollection", [documentId.toString(), document, collection]); +}; + +exports.deleteDocumentFromFirestoreCollection = function (documentId, collection, success, error) { + if(typeof documentId !== 'string' && typeof documentId !== 'number') return error("'documentId' must be a string or number specifying the Firestore document identifier"); + if(typeof collection !== 'string') return error("'collection' must be a string specifying the Firestore collection name"); + + exec(success, error, "FirebasePlugin", "deleteDocumentFromFirestoreCollection", [documentId.toString(), collection]); +}; + +exports.documentExistsInFirestoreCollection = function (documentId, collection, success, error) { + if(typeof documentId !== 'string' && typeof documentId !== 'number') return error("'documentId' must be a string or number specifying the Firestore document identifier"); + if(typeof collection !== 'string') return error("'collection' must be a string specifying the Firestore collection name"); + + exec(ensureBooleanFn(success), error, "FirebasePlugin", "documentExistsInFirestoreCollection", [documentId.toString(), collection]); +}; + +exports.fetchDocumentInFirestoreCollection = function (documentId, collection, success, error) { + if(typeof documentId !== 'string' && typeof documentId !== 'number') return error("'documentId' must be a string or number specifying the Firestore document identifier"); + if(typeof collection !== 'string') return error("'collection' must be a string specifying the Firestore collection name"); + + exec(success, error, "FirebasePlugin", "fetchDocumentInFirestoreCollection", [documentId.toString(), collection]); +}; + +exports.fetchFirestoreCollection = function (collection, filters, success, error) { + if(typeof collection !== 'string') return error("'collection' must be a string specifying the Firestore collection name"); + if(filters && (typeof filters !== 'object' || typeof filters.length === 'undefined')) return error("'filters' must be a array specifying a list of filters to apply to documents in the Firestore collection"); + exec(success, error, "FirebasePlugin", "fetchFirestoreCollection", [collection, filters || []]); +}; + +}); diff --git a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-geolocation/www/Coordinates.js b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-geolocation/www/Coordinates.js index 4a995077..ff1003be 100644 --- a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-geolocation/www/Coordinates.js +++ b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-geolocation/www/Coordinates.js @@ -31,7 +31,7 @@ cordova.define("cordova-plugin-geolocation.Coordinates", function(require, expor * @param {Object} altacc * @constructor */ -var Coordinates = function(lat, lng, alt, acc, head, vel, altacc) { +var Coordinates = function (lat, lng, alt, acc, head, vel, altacc) { /** * The latitude of the position. */ diff --git a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-geolocation/www/Position.js b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-geolocation/www/Position.js index 97c6c2e3..22d47b83 100644 --- a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-geolocation/www/Position.js +++ b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-geolocation/www/Position.js @@ -22,7 +22,7 @@ cordova.define("cordova-plugin-geolocation.Position", function(require, exports, var Coordinates = require('./Coordinates'); -var Position = function(coords, timestamp) { +var Position = function (coords, timestamp) { if (coords) { this.coords = new Coordinates(coords.latitude, coords.longitude, coords.altitude, coords.accuracy, coords.heading, coords.velocity, coords.altitudeAccuracy); } else { diff --git a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-geolocation/www/PositionError.js b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-geolocation/www/PositionError.js index c26dd754..e5ceeea0 100644 --- a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-geolocation/www/PositionError.js +++ b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-geolocation/www/PositionError.js @@ -27,7 +27,7 @@ cordova.define("cordova-plugin-geolocation.PositionError", function(require, exp * @param code * @param message */ -var PositionError = function(code, message) { +var PositionError = function (code, message) { this.code = code || null; this.message = message || ''; }; diff --git a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-geolocation/www/geolocation.js b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-geolocation/www/geolocation.js index 50f1f953..465d90b8 100644 --- a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-geolocation/www/geolocation.js +++ b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-geolocation/www/geolocation.js @@ -20,16 +20,16 @@ cordova.define("cordova-plugin-geolocation.geolocation", function(require, expor * */ -var argscheck = require('cordova/argscheck'), - utils = require('cordova/utils'), - exec = require('cordova/exec'), - PositionError = require('./PositionError'), - Position = require('./Position'); +var argscheck = require('cordova/argscheck'); +var utils = require('cordova/utils'); +var exec = require('cordova/exec'); +var PositionError = require('./PositionError'); +var Position = require('./Position'); -var timers = {}; // list of timers in use +var timers = {}; // list of timers in use // Returns default params, overrides if provided with values -function parseParameters(options) { +function parseParameters (options) { var opt = { maximumAge: 0, enableHighAccuracy: false, @@ -56,20 +56,20 @@ function parseParameters(options) { } // Returns a timeout failure, closed over a specified timeout value and error callback. -function createTimeout(errorCallback, timeout) { - var t = setTimeout(function() { +function createTimeout (errorCallback, timeout) { + var t = setTimeout(function () { clearTimeout(t); t = null; errorCallback({ - code:PositionError.TIMEOUT, - message:"Position retrieval timed out." + code: PositionError.TIMEOUT, + message: 'Position retrieval timed out.' }); }, timeout); return t; } var geolocation = { - lastPosition:null, // reference to last known (cached) position returned + lastPosition: null, // reference to last known (cached) position returned /** * Asynchronously acquires the current position. * @@ -77,15 +77,15 @@ var geolocation = { * @param {Function} errorCallback The function to call when there is an error getting the heading position. (OPTIONAL) * @param {PositionOptions} options The options for getting the position data. (OPTIONAL) */ - getCurrentPosition:function(successCallback, errorCallback, options) { + getCurrentPosition: function (successCallback, errorCallback, options) { argscheck.checkArgs('fFO', 'geolocation.getCurrentPosition', arguments); options = parseParameters(options); // Timer var that will fire an error callback if no position is retrieved from native // before the "timeout" param provided expires - var timeoutTimer = {timer:null}; + var timeoutTimer = {timer: null}; - var win = function(p) { + var win = function (p) { clearTimeout(timeoutTimer.timer); if (!(timeoutTimer.timer)) { // Timeout already happened, or native fired error callback for @@ -95,20 +95,20 @@ var geolocation = { } var pos = new Position( { - latitude:p.latitude, - longitude:p.longitude, - altitude:p.altitude, - accuracy:p.accuracy, - heading:p.heading, - velocity:p.velocity, - altitudeAccuracy:p.altitudeAccuracy + latitude: p.latitude, + longitude: p.longitude, + altitude: p.altitude, + accuracy: p.accuracy, + heading: p.heading, + velocity: p.velocity, + altitudeAccuracy: p.altitudeAccuracy }, p.timestamp ); geolocation.lastPosition = pos; successCallback(pos); }; - var fail = function(e) { + var fail = function (e) { clearTimeout(timeoutTimer.timer); timeoutTimer.timer = null; var err = new PositionError(e.code, e.message); @@ -124,8 +124,8 @@ var geolocation = { // If the cached position check failed and the timeout was set to 0, error out with a TIMEOUT error object. } else if (options.timeout === 0) { fail({ - code:PositionError.TIMEOUT, - message:"timeout value in PositionOptions set to 0 and no cached Position object available, or cached Position object's age exceeds provided PositionOptions' maximumAge parameter." + code: PositionError.TIMEOUT, + message: "timeout value in PositionOptions set to 0 and no cached Position object available, or cached Position object's age exceeds provided PositionOptions' maximumAge parameter." }); // Otherwise we have to call into native to retrieve a position. } else { @@ -140,7 +140,7 @@ var geolocation = { // always truthy before we call into native timeoutTimer.timer = true; } - exec(win, fail, "Geolocation", "getLocation", [options.enableHighAccuracy, options.maximumAge]); + exec(win, fail, 'Geolocation', 'getLocation', [options.enableHighAccuracy, options.maximumAge]); } return timeoutTimer; }, @@ -153,7 +153,7 @@ var geolocation = { * @param {PositionOptions} options The options for getting the location data such as frequency. (OPTIONAL) * @return String The watch id that must be passed to #clearWatch to stop watching. */ - watchPosition:function(successCallback, errorCallback, options) { + watchPosition: function (successCallback, errorCallback, options) { argscheck.checkArgs('fFO', 'geolocation.getCurrentPosition', arguments); options = parseParameters(options); @@ -162,7 +162,7 @@ var geolocation = { // Tell device to get a position ASAP, and also retrieve a reference to the timeout timer generated in getCurrentPosition timers[id] = geolocation.getCurrentPosition(successCallback, errorCallback, options); - var fail = function(e) { + var fail = function (e) { clearTimeout(timers[id].timer); var err = new PositionError(e.code, e.message); if (errorCallback) { @@ -170,20 +170,20 @@ var geolocation = { } }; - var win = function(p) { + var win = function (p) { clearTimeout(timers[id].timer); if (options.timeout !== Infinity) { timers[id].timer = createTimeout(fail, options.timeout); } var pos = new Position( { - latitude:p.latitude, - longitude:p.longitude, - altitude:p.altitude, - accuracy:p.accuracy, - heading:p.heading, - velocity:p.velocity, - altitudeAccuracy:p.altitudeAccuracy + latitude: p.latitude, + longitude: p.longitude, + altitude: p.altitude, + accuracy: p.accuracy, + heading: p.heading, + velocity: p.velocity, + altitudeAccuracy: p.altitudeAccuracy }, p.timestamp ); @@ -191,7 +191,7 @@ var geolocation = { successCallback(pos); }; - exec(win, fail, "Geolocation", "addWatch", [id, options.enableHighAccuracy]); + exec(win, fail, 'Geolocation', 'addWatch', [id, options.enableHighAccuracy]); return id; }, @@ -200,11 +200,11 @@ var geolocation = { * * @param {String} id The ID of the watch returned from #watchPosition */ - clearWatch:function(id) { + clearWatch: function (id) { if (id && timers[id] !== undefined) { clearTimeout(timers[id].timer); timers[id].timer = false; - exec(null, null, "Geolocation", "clearWatch", [id]); + exec(null, null, 'Geolocation', 'clearWatch', [id]); } } }; diff --git a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js deleted file mode 100644 index 3e87a6e7..00000000 --- a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js +++ /dev/null @@ -1,114 +0,0 @@ -cordova.define("cordova-plugin-inappbrowser.inappbrowser", function(require, exports, module) { -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -(function() { - // special patch to correctly work on Ripple emulator (CB-9760) - if (window.parent && !!window.parent.ripple) { // https://gist.github.com/triceam/4658021 - module.exports = window.open.bind(window); // fallback to default window.open behaviour - return; - } - - var exec = require('cordova/exec'); - var channel = require('cordova/channel'); - var modulemapper = require('cordova/modulemapper'); - var urlutil = require('cordova/urlutil'); - - function InAppBrowser() { - this.channels = { - 'loadstart': channel.create('loadstart'), - 'loadstop' : channel.create('loadstop'), - 'loaderror' : channel.create('loaderror'), - 'exit' : channel.create('exit') - }; - } - - InAppBrowser.prototype = { - _eventHandler: function (event) { - if (event && (event.type in this.channels)) { - this.channels[event.type].fire(event); - } - }, - close: function (eventname) { - exec(null, null, "InAppBrowser", "close", []); - }, - show: function (eventname) { - exec(null, null, "InAppBrowser", "show", []); - }, - addEventListener: function (eventname,f) { - if (eventname in this.channels) { - this.channels[eventname].subscribe(f); - } - }, - removeEventListener: function(eventname, f) { - if (eventname in this.channels) { - this.channels[eventname].unsubscribe(f); - } - }, - - executeScript: function(injectDetails, cb) { - if (injectDetails.code) { - exec(cb, null, "InAppBrowser", "injectScriptCode", [injectDetails.code, !!cb]); - } else if (injectDetails.file) { - exec(cb, null, "InAppBrowser", "injectScriptFile", [injectDetails.file, !!cb]); - } else { - throw new Error('executeScript requires exactly one of code or file to be specified'); - } - }, - - insertCSS: function(injectDetails, cb) { - if (injectDetails.code) { - exec(cb, null, "InAppBrowser", "injectStyleCode", [injectDetails.code, !!cb]); - } else if (injectDetails.file) { - exec(cb, null, "InAppBrowser", "injectStyleFile", [injectDetails.file, !!cb]); - } else { - throw new Error('insertCSS requires exactly one of code or file to be specified'); - } - } - }; - - module.exports = function(strUrl, strWindowName, strWindowFeatures, callbacks) { - // Don't catch calls that write to existing frames (e.g. named iframes). - if (window.frames && window.frames[strWindowName]) { - var origOpenFunc = modulemapper.getOriginalSymbol(window, 'open'); - return origOpenFunc.apply(window, arguments); - } - - strUrl = urlutil.makeAbsolute(strUrl); - var iab = new InAppBrowser(); - - callbacks = callbacks || {}; - for (var callbackName in callbacks) { - iab.addEventListener(callbackName, callbacks[callbackName]); - } - - var cb = function(eventname) { - iab._eventHandler(eventname); - }; - - strWindowFeatures = strWindowFeatures || ""; - - exec(cb, cb, "InAppBrowser", "open", [strUrl, strWindowName, strWindowFeatures]); - return iab; - }; -})(); - -}); diff --git a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-ionic-keyboard/www/ios/keyboard.js b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-ionic-keyboard/www/ios/keyboard.js new file mode 100644 index 00000000..50e3ea9d --- /dev/null +++ b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-ionic-keyboard/www/ios/keyboard.js @@ -0,0 +1,105 @@ +cordova.define("cordova-plugin-ionic-keyboard.keyboard", function(require, exports, module) { +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +var argscheck = require('cordova/argscheck'), + utils = require('cordova/utils'), + exec = require('cordova/exec'); + +var Keyboard = function () {}; + +Keyboard.fireOnShow = function (height) { + Keyboard.isVisible = true; + cordova.fireWindowEvent('keyboardDidShow', { + 'keyboardHeight': height + }); + + // To support the keyboardAttach directive listening events + // inside Ionic's main bundle + cordova.fireWindowEvent('native.keyboardshow', { + 'keyboardHeight': height + }); +}; + +Keyboard.fireOnHide = function () { + Keyboard.isVisible = false; + cordova.fireWindowEvent('keyboardDidHide'); + + // To support the keyboardAttach directive listening events + // inside Ionic's main bundle + cordova.fireWindowEvent('native.keyboardhide'); +}; + +Keyboard.fireOnHiding = function () { + cordova.fireWindowEvent('keyboardWillHide'); +}; + +Keyboard.fireOnShowing = function (height) { + cordova.fireWindowEvent('keyboardWillShow', { + 'keyboardHeight': height + }); +}; + +Keyboard.fireOnResize = function (height, screenHeight, ele) { + if (!ele) { + return; + } + if (height === 0) { + ele.style.height = null; + } else { + ele.style.height = (screenHeight - height) + 'px'; + } +}; + +Keyboard.hideFormAccessoryBar = function (hide, success) { + if (hide !== null && hide !== undefined) { + exec(success, null, "CDVIonicKeyboard", "hideFormAccessoryBar", [hide]); + } else { + exec(success, null, "CDVIonicKeyboard", "hideFormAccessoryBar", []); + } +}; + +Keyboard.hide = function () { + exec(null, null, "CDVIonicKeyboard", "hide", []); +}; + +Keyboard.show = function () { + console.warn('Showing keyboard not supported in iOS due to platform limitations.'); + console.warn('Instead, use input.focus(), and ensure that you have the following setting in your config.xml: \n'); + console.warn(' <preference name="KeyboardDisplayRequiresUserAction" value="false"/>\n'); +}; + +Keyboard.disableScroll = function (disable) { + exec(null, null, "CDVIonicKeyboard", "disableScroll", [disable]); +}; + +Keyboard.setResizeMode = function (mode) { + exec(null, null, "CDVIonicKeyboard", "setResizeMode", [mode]); +} + +Keyboard.setKeyboardStyle = function(style) { + exec(null, null, "CDVIonicKeyboard", "keyboardStyle", [style]); +}; + +Keyboard.isVisible = false; + +module.exports = Keyboard; +}); diff --git a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-network-information/www/network.js b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-network-information/www/network.js deleted file mode 100644 index 770e6ba5..00000000 --- a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-network-information/www/network.js +++ /dev/null @@ -1,94 +0,0 @@ -cordova.define("cordova-plugin-network-information.network", function(require, exports, module) { -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var exec = require('cordova/exec'), - cordova = require('cordova'), - channel = require('cordova/channel'), - utils = require('cordova/utils'); - -// Link the onLine property with the Cordova-supplied network info. -// This works because we clobber the navigator object with our own -// object in bootstrap.js. -// Browser platform do not need to define this property, because -// it is already supported by modern browsers -if (cordova.platformId !== 'browser' && typeof navigator != 'undefined') { - utils.defineGetter(navigator, 'onLine', function() { - return this.connection.type != 'none'; - }); -} - -function NetworkConnection() { - this.type = 'unknown'; -} - -/** - * Get connection info - * - * @param {Function} successCallback The function to call when the Connection data is available - * @param {Function} errorCallback The function to call when there is an error getting the Connection data. (OPTIONAL) - */ -NetworkConnection.prototype.getInfo = function(successCallback, errorCallback) { - exec(successCallback, errorCallback, "NetworkStatus", "getConnectionInfo", []); -}; - -var me = new NetworkConnection(); -var timerId = null; -var timeout = 500; - -channel.createSticky('onCordovaConnectionReady'); -channel.waitForInitialization('onCordovaConnectionReady'); - -channel.onCordovaReady.subscribe(function() { - me.getInfo(function(info) { - me.type = info; - if (info === "none") { - // set a timer if still offline at the end of timer send the offline event - timerId = setTimeout(function(){ - cordova.fireDocumentEvent("offline"); - timerId = null; - }, timeout); - } else { - // If there is a current offline event pending clear it - if (timerId !== null) { - clearTimeout(timerId); - timerId = null; - } - cordova.fireDocumentEvent("online"); - } - - // should only fire this once - if (channel.onCordovaConnectionReady.state !== 2) { - channel.onCordovaConnectionReady.fire(); - } - }, - function (e) { - // If we can't get the network info we should still tell Cordova - // to fire the deviceready event. - if (channel.onCordovaConnectionReady.state !== 2) { - channel.onCordovaConnectionReady.fire(); - } - console.log("Error initializing Network Connection: " + e); - }); -}); - -module.exports = me; - -}); diff --git a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-statusbar/www/statusbar.js b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-statusbar/www/statusbar.js deleted file mode 100644 index 708186f9..00000000 --- a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-statusbar/www/statusbar.js +++ /dev/null @@ -1,116 +0,0 @@ -cordova.define("cordova-plugin-statusbar.statusbar", function(require, exports, module) { -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -/* global cordova */ - -var exec = require('cordova/exec'); - -var namedColors = { - "black": "#000000", - "darkGray": "#A9A9A9", - "lightGray": "#D3D3D3", - "white": "#FFFFFF", - "gray": "#808080", - "red": "#FF0000", - "green": "#00FF00", - "blue": "#0000FF", - "cyan": "#00FFFF", - "yellow": "#FFFF00", - "magenta": "#FF00FF", - "orange": "#FFA500", - "purple": "#800080", - "brown": "#A52A2A" -}; - -var StatusBar = { - - isVisible: true, - - overlaysWebView: function (doOverlay) { - exec(null, null, "StatusBar", "overlaysWebView", [doOverlay]); - }, - - styleDefault: function () { - // dark text ( to be used on a light background ) - exec(null, null, "StatusBar", "styleDefault", []); - }, - - styleLightContent: function () { - // light text ( to be used on a dark background ) - exec(null, null, "StatusBar", "styleLightContent", []); - }, - - styleBlackTranslucent: function () { - // #88000000 ? Apple says to use lightContent instead - exec(null, null, "StatusBar", "styleBlackTranslucent", []); - }, - - styleBlackOpaque: function () { - // #FF000000 ? Apple says to use lightContent instead - exec(null, null, "StatusBar", "styleBlackOpaque", []); - }, - - backgroundColorByName: function (colorname) { - return StatusBar.backgroundColorByHexString(namedColors[colorname]); - }, - - backgroundColorByHexString: function (hexString) { - if (hexString.charAt(0) !== "#") { - hexString = "#" + hexString; - } - - if (hexString.length === 4) { - var split = hexString.split(""); - hexString = "#" + split[1] + split[1] + split[2] + split[2] + split[3] + split[3]; - } - - exec(null, null, "StatusBar", "backgroundColorByHexString", [hexString]); - }, - - hide: function () { - exec(null, null, "StatusBar", "hide", []); - StatusBar.isVisible = false; - }, - - show: function () { - exec(null, null, "StatusBar", "show", []); - StatusBar.isVisible = true; - } - -}; - -// prime it. setTimeout so that proxy gets time to init -window.setTimeout(function () { - exec(function (res) { - if (typeof res == 'object') { - if (res.type == 'tap') { - cordova.fireWindowEvent('statusTap'); - } - } else { - StatusBar.isVisible = res; - } - }, null, "StatusBar", "_ready", []); -}, 0); - -module.exports = StatusBar; - -}); diff --git a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js deleted file mode 100644 index fe0e83ad..00000000 --- a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js +++ /dev/null @@ -1,124 +0,0 @@ -cordova.define("cordova-plugin-x-socialsharing.SocialSharing", function(require, exports, module) { -function SocialSharing() { -} - -// Override this method (after deviceready) to set the location where you want the iPad popup arrow to appear. -// If not overridden with different values, the popup is not used. Example: -// -// window.plugins.socialsharing.iPadPopupCoordinates = function() { -// return "100,100,200,300"; -// }; -SocialSharing.prototype.iPadPopupCoordinates = function () { - // left,top,width,height - return "-1,-1,-1,-1"; -}; - -SocialSharing.prototype.setIPadPopupCoordinates = function (coords) { - // left,top,width,height - cordova.exec(function() {}, this._getErrorCallback(function() {}, "setIPadPopupCoordinates"), "SocialSharing", "setIPadPopupCoordinates", [coords]); -}; - -SocialSharing.prototype.available = function (callback) { - cordova.exec(function (avail) { - callback(avail ? true : false); - }, null, "SocialSharing", "available", []); -}; - -// this is the recommended way to share as it is the most feature-rich with respect to what you pass in and get back -SocialSharing.prototype.shareWithOptions = function (options, successCallback, errorCallback) { - cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareWithOptions"), "SocialSharing", "shareWithOptions", [options]); -}; - -SocialSharing.prototype.share = function (message, subject, fileOrFileArray, url, successCallback, errorCallback) { - cordova.exec(successCallback, this._getErrorCallback(errorCallback, "share"), "SocialSharing", "share", [message, subject, this._asArray(fileOrFileArray), url]); -}; - -SocialSharing.prototype.shareViaTwitter = function (message, file /* multiple not allowed by twitter */, url, successCallback, errorCallback) { - var fileArray = this._asArray(file); - var ecb = this._getErrorCallback(errorCallback, "shareViaTwitter"); - if (fileArray.length > 1) { - ecb("shareViaTwitter supports max one file"); - } else { - cordova.exec(successCallback, ecb, "SocialSharing", "shareViaTwitter", [message, null, fileArray, url]); - } -}; - -SocialSharing.prototype.shareViaFacebook = function (message, fileOrFileArray, url, successCallback, errorCallback) { - cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaFacebook"), "SocialSharing", "shareViaFacebook", [message, null, this._asArray(fileOrFileArray), url]); -}; - -SocialSharing.prototype.shareViaFacebookWithPasteMessageHint = function (message, fileOrFileArray, url, pasteMessageHint, successCallback, errorCallback) { - pasteMessageHint = pasteMessageHint || "If you like you can paste a message from your clipboard"; - cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaFacebookWithPasteMessageHint"), "SocialSharing", "shareViaFacebookWithPasteMessageHint", [message, null, this._asArray(fileOrFileArray), url, pasteMessageHint]); -}; - -SocialSharing.prototype.shareViaWhatsApp = function (message, fileOrFileArray, url, successCallback, errorCallback) { - cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsApp"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, null]); -}; - -SocialSharing.prototype.shareViaWhatsAppToReceiver = function (receiver, message, fileOrFileArray, url, successCallback, errorCallback) { - cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsAppToReceiver"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, receiver]); -}; - -SocialSharing.prototype.shareViaSMS = function (options, phonenumbers, successCallback, errorCallback) { - var opts = options; - if (typeof options == "string") { - opts = {"message":options}; // for backward compatibility as the options param used to be the message - } - cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaSMS"), "SocialSharing", "shareViaSMS", [opts, phonenumbers]); -}; - -SocialSharing.prototype.shareViaEmail = function (message, subject, toArray, ccArray, bccArray, fileOrFileArray, successCallback, errorCallback) { - cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaEmail"), "SocialSharing", "shareViaEmail", [message, subject, this._asArray(toArray), this._asArray(ccArray), this._asArray(bccArray), this._asArray(fileOrFileArray)]); -}; - -SocialSharing.prototype.canShareVia = function (via, message, subject, fileOrFileArray, url, successCallback, errorCallback) { - cordova.exec(successCallback, this._getErrorCallback(errorCallback, "canShareVia"), "SocialSharing", "canShareVia", [message, subject, this._asArray(fileOrFileArray), url, via]); -}; - -SocialSharing.prototype.canShareViaEmail = function (successCallback, errorCallback) { - cordova.exec(successCallback, this._getErrorCallback(errorCallback, "canShareViaEmail"), "SocialSharing", "canShareViaEmail", []); -}; - -SocialSharing.prototype.shareViaInstagram = function (message, fileOrFileArray, successCallback, errorCallback) { - cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaInstagram"), "SocialSharing", "shareViaInstagram", [message, null, this._asArray(fileOrFileArray), null]); -}; - -SocialSharing.prototype.shareVia = function (via, message, subject, fileOrFileArray, url, successCallback, errorCallback) { - cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareVia"), "SocialSharing", "shareVia", [message, subject, this._asArray(fileOrFileArray), url, via]); -}; - -SocialSharing.prototype.saveToPhotoAlbum = function (fileOrFileArray, successCallback, errorCallback) { - cordova.exec(successCallback, this._getErrorCallback(errorCallback, "saveToPhotoAlbum"), "SocialSharing", "saveToPhotoAlbum", [this._asArray(fileOrFileArray)]); -}; - -SocialSharing.prototype._asArray = function (param) { - if (param == null) { - param = []; - } else if (typeof param === 'string') { - param = new Array(param); - } - return param; -}; - -SocialSharing.prototype._getErrorCallback = function (ecb, functionName) { - if (typeof ecb === 'function') { - return ecb; - } else { - return function (result) { - console.log("The injected error callback of '" + functionName + "' received: " + JSON.stringify(result)); - } - } -}; - -SocialSharing.install = function () { - if (!window.plugins) { - window.plugins = {}; - } - - window.plugins.socialsharing = new SocialSharing(); - return window.plugins.socialsharing; -}; - -cordova.addConstructor(SocialSharing.install); -}); diff --git a/StoneIsland/platforms/ios/platform_www/plugins/ionic-plugin-keyboard/www/ios/keyboard.js b/StoneIsland/platforms/ios/platform_www/plugins/ionic-plugin-keyboard/www/ios/keyboard.js deleted file mode 100644 index c74bb4d6..00000000 --- a/StoneIsland/platforms/ios/platform_www/plugins/ionic-plugin-keyboard/www/ios/keyboard.js +++ /dev/null @@ -1,43 +0,0 @@ -cordova.define("ionic-plugin-keyboard.keyboard", function(require, exports, module) { - -var argscheck = require('cordova/argscheck'), - utils = require('cordova/utils'), - exec = require('cordova/exec'); - - -var Keyboard = function() { -}; - -Keyboard.hideKeyboardAccessoryBar = function(hide) { - exec(null, null, "Keyboard", "hideKeyboardAccessoryBar", [hide]); -}; - -Keyboard.close = function() { - exec(null, null, "Keyboard", "close", []); -}; - -Keyboard.show = function() { - console.warn('Showing keyboard not supported in iOS due to platform limitations.') - console.warn('Instead, use input.focus(), and ensure that you have the following setting in your config.xml: \n'); - console.warn(' <preference name="KeyboardDisplayRequiresUserAction" value="false"/>\n'); - // exec(null, null, "Keyboard", "show", []); -}; - -Keyboard.disableScroll = function(disable) { - exec(null, null, "Keyboard", "disableScroll", [disable]); -}; - -/* -Keyboard.styleDark = function(dark) { - exec(null, null, "Keyboard", "styleDark", [dark]); -}; -*/ - -Keyboard.isVisible = false; - -module.exports = Keyboard; - - - - -}); diff --git a/StoneIsland/platforms/ios/platform_www/plugins/phonegap-plugin-mobile-accessibility/www/MobileAccessibilityNotifications.js b/StoneIsland/platforms/ios/platform_www/plugins/phonegap-plugin-mobile-accessibility/www/MobileAccessibilityNotifications.js deleted file mode 100644 index f5d0aaf7..00000000 --- a/StoneIsland/platforms/ios/platform_www/plugins/phonegap-plugin-mobile-accessibility/www/MobileAccessibilityNotifications.js +++ /dev/null @@ -1,53 +0,0 @@ -cordova.define("phonegap-plugin-mobile-accessibility.MobileAccessibilityNotifications", function(require, exports, module) { -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -/** - * Mobile Accessibility Notification event constants - */ -module.exports = { - /* MobileAccessibility window events */ - SCREEN_READER_STATUS_CHANGED : "screenreaderstatuschanged", - CLOSED_CAPTIONING_STATUS_CHANGED : "closedcaptioningstatuschanged", - GUIDED_ACCESS_STATUS_CHANGED : "guidedaccessstatuschanged", - INVERT_COLORS_STATUS_CHANGED : "invertcolorsstatuschanged", - MONO_AUDIO_STATUS_CHANGED : "monoaudiostatuschanged", - REDUCE_MOTION_STATUS_CHANGED : "reducemotionstatuschanged", - TOUCH_EXPLORATION_STATUS_CHANGED : "touchexplorationstatechanged", - BOLD_TEXT_STATUS_CHANGED : "boldtextstatuschanged", - DARKER_SYSTEM_COLORS_STATUS_CHANGED : "darkersystemcolorsstatuschanged", - GRAYSCALE_STATUS_CHANGED : "grayscalestatuschanged", - REDUCE_TRANSPARENCY_STATUS_CHANGED : "reducetransparencystatuschanged", - SPEAK_SCREEN_STATUS_CHANGED : "speakscreenstatuschanged", - SPEAK_SELECTION_STATUS_CHANGED : "speakselectionstatuschanged", - SWITCH_CONTROL_STATUS_CHANGED : "switchcontrolstatuschanged", - - /* iOS specific UIAccessibilityNotifications */ - SCREEN_CHANGED : 1000, - LAYOUT_CHANGED : 1001, - ANNOUNCEMENT : 1008, - PAGE_SCROLLED : 1009, - - /* Windows specific high contrast event */ - HIGH_CONTRAST_CHANGED : "highcontrastchanged" -}; - -}); diff --git a/StoneIsland/platforms/ios/platform_www/plugins/phonegap-plugin-mobile-accessibility/www/mobile-accessibility.js b/StoneIsland/platforms/ios/platform_www/plugins/phonegap-plugin-mobile-accessibility/www/mobile-accessibility.js deleted file mode 100644 index 852b8d34..00000000 --- a/StoneIsland/platforms/ios/platform_www/plugins/phonegap-plugin-mobile-accessibility/www/mobile-accessibility.js +++ /dev/null @@ -1,502 +0,0 @@ -cordova.define("phonegap-plugin-mobile-accessibility.mobile-accessibility", function(require, exports, module) { -/** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var argscheck = require('cordova/argscheck'), - utils = require('cordova/utils'), - exec = require('cordova/exec'), - device = require('cordova-plugin-device.device'), - network = require('cordova-plugin-network-information.network'), - connection = require('cordova-plugin-network-information.Connection'), - MobileAccessibilityNotifications = require('phonegap-plugin-mobile-accessibility.MobileAccessibilityNotifications'); - -var MobileAccessibility = function() { - this._isBoldTextEnabled = false; - this._isClosedCaptioningEnabled = false; - this._isDarkerSystemColorsEnabled = false; - this._isGrayscaleEnabled = false; - this._isGuidedAccessEnabled = false; - this._isInvertColorsEnabled = false; - this._isMonoAudioEnabled = false; - this._isReduceMotionEnabled = false; - this._isReduceTransparencyEnabled = false; - this._isScreenReaderRunning = false; - this._isSpeakScreenEnabled = false; - this._isSpeakSelectionEnabled = false; - this._isSwitchControlRunning = false; - this._isTouchExplorationEnabled = false; - this._usePreferredTextZoom = false; - this._isHighContrastEnabled = false; - this._highContrastScheme = undefined; - - // Create new event handlers on the window (returns a channel instance) - this.channels = { - boldtextstatuschanged : cordova.addWindowEventHandler(MobileAccessibilityNotifications.BOLD_TEXT_STATUS_CHANGED), - closedcaptioningstatuschanged : cordova.addWindowEventHandler(MobileAccessibilityNotifications.CLOSED_CAPTIONING_STATUS_CHANGED), - darkersystemcolorsstatuschanged : cordova.addWindowEventHandler(MobileAccessibilityNotifications.DARKER_SYSTEM_COLORS_STATUS_CHANGED), - grayscalestatuschanged : cordova.addWindowEventHandler(MobileAccessibilityNotifications.GRAYSCALE_STATUS_CHANGED), - guidedaccessstatuschanged : cordova.addWindowEventHandler(MobileAccessibilityNotifications.GUIDED_ACCESS_STATUS_CHANGED), - invertcolorsstatuschanged : cordova.addWindowEventHandler(MobileAccessibilityNotifications.INVERT_COLORS_STATUS_CHANGED), - monoaudiostatuschanged : cordova.addWindowEventHandler(MobileAccessibilityNotifications.MONO_AUDIO_STATUS_CHANGED), - reducemotionstatuschanged : cordova.addWindowEventHandler(MobileAccessibilityNotifications.REDUCE_MOTION_STATUS_CHANGED), - reducetransparencystatuschanged : cordova.addWindowEventHandler(MobileAccessibilityNotifications.REDUCE_TRANSPARENCY_STATUS_CHANGED), - screenreaderstatuschanged : cordova.addWindowEventHandler(MobileAccessibilityNotifications.SCREEN_READER_STATUS_CHANGED), - speakscreenstatuschanged : cordova.addWindowEventHandler(MobileAccessibilityNotifications.SPEAK_SCREEN_STATUS_CHANGED), - speakselectionstatuschanged : cordova.addWindowEventHandler(MobileAccessibilityNotifications.SPEAK_SELECTION_STATUS_CHANGED), - switchcontrolstatuschanged : cordova.addWindowEventHandler(MobileAccessibilityNotifications.SWITCH_CONTROL_STATUS_CHANGED), - touchexplorationstatechanged : cordova.addWindowEventHandler(MobileAccessibilityNotifications.TOUCH_EXPLORATION_STATUS_CHANGED), - highcontrastchanged : cordova.addWindowEventHandler(MobileAccessibilityNotifications.HIGH_CONTRAST_CHANGED) - }; - for (var key in this.channels) { - this.channels[key].onHasSubscribersChange = MobileAccessibility.onHasSubscribersChange; - } -}; - -/** - * @private - * @ignore - */ -function handlers() { - return mobileAccessibility.channels.boldtextstatuschanged.numHandlers + - mobileAccessibility.channels.closedcaptioningstatuschanged.numHandlers + - mobileAccessibility.channels.darkersystemcolorsstatuschanged.numHandlers + - mobileAccessibility.channels.grayscalestatuschanged.numHandlers + - mobileAccessibility.channels.guidedaccessstatuschanged.numHandlers + - mobileAccessibility.channels.invertcolorsstatuschanged.numHandlers + - mobileAccessibility.channels.monoaudiostatuschanged.numHandlers + - mobileAccessibility.channels.reducemotionstatuschanged.numHandlers + - mobileAccessibility.channels.reducetransparencystatuschanged.numHandlers + - mobileAccessibility.channels.screenreaderstatuschanged.numHandlers + - mobileAccessibility.channels.speakscreenstatuschanged.numHandlers + - mobileAccessibility.channels.speakselectionstatuschanged.numHandlers + - mobileAccessibility.channels.switchcontrolstatuschanged.numHandlers + - mobileAccessibility.channels.touchexplorationstatechanged.numHandlers + - mobileAccessibility.channels.highcontrastchanged.numHandlers; -}; - -/** - * - * Event handlers for when callback methods get registered for mobileAccessibility. - * Keep track of how many handlers we have so we can start and stop the native MobileAccessibility listener - * appropriately. - * @private - * @ignore - */ -MobileAccessibility.onHasSubscribersChange = function() { - // If we just registered the first handler, make sure native listener is started. - if (this.numHandlers === 1 && handlers() === 1) { - exec(mobileAccessibility._status, mobileAccessibility._error, "MobileAccessibility", "start", []); - } else if (handlers() === 0) { - exec(null, null, "MobileAccessibility", "stop", []); - } -}; - -/** - * Asynchronous call to native MobileAccessibility determine if a screen reader is running. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.isScreenReaderRunning = function(callback) { - exec(function(bool) { - mobileAccessibility.activateOrDeactivateChromeVox(bool); - callback(Boolean(bool)); - }, null, "MobileAccessibility", "isScreenReaderRunning", []); -}; -MobileAccessibility.prototype.isVoiceOverRunning = function(callback) { - if (device.platform.toLowerCase() === "ios") { - MobileAccessibility.prototype.isScreenReaderRunning(callback); - } else { - callback(false); - } -}; -MobileAccessibility.prototype.isTalkBackRunning = function(callback) { - if (device.platform.toLowerCase() === "android" || device.platform.toLowerCase() === "amazon-fireos") { - MobileAccessibility.prototype.isScreenReaderRunning(callback); - } else { - callback(false); - } -}; -MobileAccessibility.prototype.isChromeVoxActive = function () { - return typeof cvox !== "undefined" && cvox.ChromeVox.host.ttsLoaded() && cvox.Api.isChromeVoxActive(); -}; -MobileAccessibility.prototype.activateOrDeactivateChromeVox = function(bool) { - if (device.platform !== "Android") return; - if (typeof cvox === "undefined") { - if (bool) { - console.warn('A screen reader is running but ChromeVox has failed to initialize.'); - if (navigator.connection.type === Connection.UNKNOWN || navigator.connection.type === Connection.NONE) { - mobileAccessibility.injectLocalAndroidVoxScript(); - } - } - } else { - // activate or deactivate ChromeVox based on whether or not or not the screen reader is running. - try { - cvox.ChromeVox.host.activateOrDeactivateChromeVox(bool); - } catch (err) { - console.error(err); - } - } - - if (bool) { - if (!mobileAccessibility.hasOrientationChangeListener) { - window.addEventListener("orientationchange", mobileAccessibility.onOrientationChange); - mobileAccessibility.hasOrientationChangeListener = true; - } - } else if(mobileAccessibility.hasOrientationChangeListener) { - window.removeEventListener("orientationchange", mobileAccessibility.onOrientationChange); - mobileAccessibility.hasOrientationChangeListener = false; - } -}; - -MobileAccessibility.prototype.hasOrientationChangeListener = false; -MobileAccessibility.prototype.onOrientationChange = function(event) { - if (!mobileAccessibility.isChromeVoxActive()) return; - cvox.ChromeVox.navigationManager.updateIndicator(); -}; - -MobileAccessibility.prototype.scriptInjected = false; -MobileAccessibility.prototype.injectLocalAndroidVoxScript = function() { - var versionsplit = device.version.split('.'); - if (device.platform !== "Android" || - !(versionsplit[0] > 4 || (versionsplit[0] == 4 && versionsplit[1] >= 1)) || - typeof cvox !== "undefined" || mobileAccessibility.scriptInjected) return; - var script = document.createElement('script'); - script.type = 'text/javascript'; - script.async = true; - script.onload = function(){ - // console.log(this.src + ' has loaded'); - if (mobileAccessibility.isChromeVoxActive()) { - cordova.fireWindowEvent("screenreaderstatuschanged", { - isScreenReaderRunning: true - }); - } - }; - - script.src = (versionsplit[0] > 4 || versionsplit[1] > 3) - ? "plugins/com.phonegap.plugin.mobile-accessibility/android/chromeandroidvox.js" - : "plugins/com.phonegap.plugin.mobile-accessibility/android/AndroidVox_v1.js"; - document.getElementsByTagName('head')[0].appendChild(script); - mobileAccessibility.scriptInjected = true; -}; - -/** - * Asynchronous call to native MobileAccessibility to determine if Bold Text is enabled. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.isBoldTextEnabled = function(callback) { - exec(callback, null, "MobileAccessibility", "isBoldTextEnabled", []); -}; - -/** - * Asynchronous call to native MobileAccessibility to determine if Closed Captioning is enabled. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.isClosedCaptioningEnabled = function(callback) { - exec(callback, null, "MobileAccessibility", "isClosedCaptioningEnabled", []); -}; - -/** - * Asynchronous call to native MobileAccessibility to determine if Darker System Colors are enabled. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.isDarkerSystemColorsEnabled = function(callback) { - exec(callback, null, "MobileAccessibility", "isDarkerSystemColorsEnabled", []); -}; - -/** - * Asynchronous call to native MobileAccessibility to determine if Grayscale is enabled. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.isGrayscaleEnabled = function(callback) { - exec(callback, null, "MobileAccessibility", "isGrayscaleEnabled", []); -}; - -/** - * Asynchronous call to native MobileAccessibility to determine if Guided Access is enabled. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.isGuidedAccessEnabled = function(callback) { - exec(callback, null, "MobileAccessibility", "isGuidedAccessEnabled", []); -}; - -/** - * Asynchronous call to native MobileAccessibility to determine if the display colors have been inverted. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.isInvertColorsEnabled = function(callback) { - exec(callback, null, "MobileAccessibility", "isInvertColorsEnabled", []); -}; - -/** - * Asynchronous call to native MobileAccessibility to determine if Mono Audio is enabled. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.isMonoAudioEnabled = function(callback) { - exec(callback, null, "MobileAccessibility", "isMonoAudioEnabled", []); -}; - -/** - * Asynchronous call to native MobileAccessibility to determine if Reduce Motion is enabled. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.isReduceMotionEnabled = function(callback) { - exec(callback, null, "MobileAccessibility", "isReduceMotionEnabled", []); -}; - -/** - * Asynchronous call to native MobileAccessibility to determine if Reduce Transparency is enabled. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.isReduceTransparencyEnabled = function(callback) { - exec(callback, null, "MobileAccessibility", "isReduceTransparencyEnabled", []); -}; - -/** - * Asynchronous call to native MobileAccessibility to determine if Speak Screen is enabled. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.isSpeakScreenEnabled = function(callback) { - exec(callback, null, "MobileAccessibility", "isSpeakScreenEnabled", []); -}; - -/** - * Asynchronous call to native MobileAccessibility to determine if Speak Selection is enabled. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.isSpeakSelectionEnabled = function(callback) { - exec(callback, null, "MobileAccessibility", "isSpeakSelectionEnabled", []); -}; - -/** - * Asynchronous call to native MobileAccessibility to determine if Switch Control is running. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.isSwitchControlRunning = function(callback) { - exec(callback, null, "MobileAccessibility", "isSwitchControlRunning", []); -}; - -/** - * Asynchronous call to native MobileAccessibility to determine if Touch Exploration is enabled on Android. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.isTouchExplorationEnabled = function(callback) { - exec(callback, null, "MobileAccessibility", "isTouchExplorationEnabled", []); -}; - -/** - * Asynchronous call to native MobileAccessibility to determine if High Contrast is enabled on Windows. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.isHighContrastEnabled = function(callback) { - exec(callback, null, "MobileAccessibility", "isHighContrastEnabled", []); -}; - -/** - * Asynchronous call to native MobileAccessibility to return the current text zoom percent value for the WebView. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.getTextZoom = function(callback) { - exec(callback, null, "MobileAccessibility", "getTextZoom", []); -}; - -/** - * Asynchronous call to native MobileAccessibility to set the current text zoom percent value for the WebView. - * @param {Number} textZoom A percentage value by which text in the WebView should be scaled. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.setTextZoom = function(textZoom, callback) { - exec(callback, null, "MobileAccessibility", "setTextZoom", [textZoom]); -}; - -/** - * Asynchronous call to native MobileAccessibility to retrieve the user's preferred text zoom from system settings and apply it to the application WebView. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility. - */ -MobileAccessibility.prototype.updateTextZoom = function(callback) { - exec(callback, null, "MobileAccessibility", "updateTextZoom", []); -}; - -MobileAccessibility.prototype.usePreferredTextZoom = function(bool) { - var currentValue = window.localStorage.getItem("MobileAccessibility.usePreferredTextZoom") === "true"; - - if (arguments.length === 0) { - return currentValue; - } - - if (currentValue != bool) { - window.localStorage.setItem("MobileAccessibility.usePreferredTextZoom", bool); - } - - var callback = function(){ - // Wrapping updateTextZoom call in a function to stop - // the event parameter propagation. This fixes an error - // on resume where cordova tried to call apply() on the - // event, expecting a function. - mobileAccessibility.updateTextZoom(); - }; - - document.removeEventListener("resume", callback); - - if (bool) { - // console.log("We should update the text zoom at this point: " + bool) - document.addEventListener("resume", callback, false); - mobileAccessibility.updateTextZoom(); - } else { - mobileAccessibility.setTextZoom(100); - } - - return Boolean(bool); -}; - -MobileAccessibility.prototype.MobileAccessibilityNotifications = MobileAccessibilityNotifications; - -/** - * Posts a notification with a string for a screen reader to announce, if it is running. - * @param {uint} mobileAccessibilityNotification A numeric constant for the type of notification to send. Constants are defined in MobileAccessibility.MobileAccessibilityNotifications. - * @param {string} string A string to be announced by a screen reader. - * @param {function} callback A callback method to receive the asynchronous result from the native MobileAccessibility, when the announcement is finished, the function should expect an object containing the stringValue that was voiced and a boolean indicating that the announcement wasSuccessful. - */ -MobileAccessibility.prototype.postNotification = function(mobileAccessibilityNotification, string, callback) { - exec(callback, null, "MobileAccessibility", "postNotification", [mobileAccessibilityNotification, string]); -}; - -/** - * Speaks the given string, and if ChromeVox is active, it will use the specified queueMode and properties. - * @param {string} string A string to be announced by a screen reader. - * @param {number} [queueMode] Optional number. Valid modes are 0 for flush; 1 for queue. - * @param {Object} [properties] Speech properties to use for this utterance. - */ -MobileAccessibility.prototype.speak = function(string, queueMode, properties) { - if (this.isChromeVoxActive()) { - cvox.ChromeVox.tts.speak(string, queueMode, properties); - } else { - exec(null, null, "MobileAccessibility", "postNotification", [MobileAccessibilityNotifications.ANNOUNCEMENT, string]); - } -} - -/** - * Stops speech. - */ -MobileAccessibility.prototype.stop = function() { - if (this.isChromeVoxActive()) { - cvox.ChromeVox.tts.stop(); - } else { - exec(null, null, "MobileAccessibility", "postNotification", [MobileAccessibilityNotifications.ANNOUNCEMENT, "\u200b"]); - } -} - -/** - * Callback from native MobileAccessibility returning an object which describes the status of MobileAccessibility features. - * - * @param {Object} info - * @config {Boolean} [isBoldTextEnabled] Boolean to indicate bold text status (ios). - * @config {Boolean} [isClosedCaptioningEnabled] Boolean to indicate closed captioning status. - * @config {Boolean} [isDarkerSystemColorsEnabled] Boolean to indicate darker system colors status (ios). - * @config {Boolean} [isGrayscaleEnabled] Boolean to indicate grayscale status (ios). - * @config {Boolean} [isGuidedAccessEnabled] Boolean to indicate guided access status (ios). - * @config {Boolean} [isInvertColorsEnabled] Boolean to indicate invert colors status (ios). - * @config {Boolean} [isMonoAudioEnabled] Boolean to indicate mono audio status (ios). - * @config {Boolean} [isReduceMotionEnabled] Boolean to indicate reduce motion status (ios). - * @config {Boolean} [isReduceTransparencyEnabled] Boolean to indicate reduce transparency status (ios). - * @config {Boolean} [isScreenReaderRunning] Boolean to indicate screen reader status. - * @config {Boolean} [isSpeakScreenEnabled] Boolean to indicate speak screen status (ios). - * @config {Boolean} [isSpeakSelectionEnabled] Boolean to indicate speak selection status (ios). - * @config {Boolean} [isSwitchControlRunning] Boolean to indicate switch control status (ios). - * @config {Boolean} [isTouchExplorationEnabled] Boolean to indicate touch exploration status (android). - */ -MobileAccessibility.prototype._status = function(info) { - if (info) { - mobileAccessibility.activateOrDeactivateChromeVox(info.isScreenReaderRunning); - if (mobileAccessibility._isBoldTextEnabled !== info.isBoldTextEnabled) { - mobileAccessibility._isBoldTextEnabled = info.isBoldTextEnabled; - cordova.fireWindowEvent(MobileAccessibilityNotifications.BOLD_TEXT_STATUS_CHANGED, info); - } - if (mobileAccessibility._isClosedCaptioningEnabled !== info.isClosedCaptioningEnabled) { - mobileAccessibility._isClosedCaptioningEnabled = info.isClosedCaptioningEnabled; - cordova.fireWindowEvent(MobileAccessibilityNotifications.CLOSED_CAPTIONING_STATUS_CHANGED, info); - } - if (mobileAccessibility._isDarkerSystemColorsEnabled !== info.isDarkerSystemColorsEnabled) { - mobileAccessibility._isDarkerSystemColorsEnabled = info.isDarkerSystemColorsEnabled; - cordova.fireWindowEvent(MobileAccessibilityNotifications.DARKER_SYSTEM_COLORS_STATUS_CHANGED, info); - } - if (mobileAccessibility._isGrayscaleEnabled !== info.isGrayscaleEnabled) { - mobileAccessibility._isGrayscaleEnabled = info.isGrayscaleEnabled; - cordova.fireWindowEvent(MobileAccessibilityNotifications.GRAYSCALE_STATUS_CHANGED, info); - } - if (mobileAccessibility._isGuidedAccessEnabled !== info.isGuidedAccessEnabled) { - mobileAccessibility._isGuidedAccessEnabled = info.isGuidedAccessEnabled; - cordova.fireWindowEvent(MobileAccessibilityNotifications.GUIDED_ACCESS_STATUS_CHANGED, info); - } - if (mobileAccessibility._isInvertColorsEnabled !== info.isInvertColorsEnabled) { - mobileAccessibility._isInvertColorsEnabled = info.isInvertColorsEnabled; - cordova.fireWindowEvent(MobileAccessibilityNotifications.INVERT_COLORS_STATUS_CHANGED, info); - } - if (mobileAccessibility._isMonoAudioEnabled !== info.isMonoAudioEnabled) { - mobileAccessibility._isMonoAudioEnabled = info.isMonoAudioEnabled; - cordova.fireWindowEvent(MobileAccessibilityNotifications.MONO_AUDIO_STATUS_CHANGED, info); - } - if (mobileAccessibility._isReduceMotionEnabled !== info.isReduceMotionEnabled) { - mobileAccessibility._isReduceMotionEnabled = info.isReduceMotionEnabled; - cordova.fireWindowEvent(MobileAccessibilityNotifications.REDUCE_MOTION_STATUS_CHANGED, info); - } - if (mobileAccessibility._isReduceTransparencyEnabled !== info.isReduceTransparencyEnabled) { - mobileAccessibility._isReduceTransparencyEnabled = info.isReduceTransparencyEnabled; - cordova.fireWindowEvent(MobileAccessibilityNotifications.REDUCE_TRANSPARENCY_STATUS_CHANGED, info); - } - if (mobileAccessibility._isScreenReaderRunning !== info.isScreenReaderRunning) { - mobileAccessibility._isScreenReaderRunning = info.isScreenReaderRunning; - cordova.fireWindowEvent(MobileAccessibilityNotifications.SCREEN_READER_STATUS_CHANGED, info); - } - if (mobileAccessibility._isSpeakScreenEnabled !== info.isSpeakScreenEnabled) { - mobileAccessibility._isSpeakScreenEnabled = info.isSpeakScreenEnabled; - cordova.fireWindowEvent(MobileAccessibilityNotifications.SPEAK_SCREEN_STATUS_CHANGED, info); - } - if (mobileAccessibility._isSpeakSelectionEnabled !== info.isSpeakSelectionEnabled) { - mobileAccessibility._isSpeakSelectionEnabled = info.isSpeakSelectionEnabled; - cordova.fireWindowEvent(MobileAccessibilityNotifications.SPEAK_SELECTION_STATUS_CHANGED, info); - } - if (mobileAccessibility._isSwitchControlRunning !== info.isSwitchControlRunning) { - mobileAccessibility._isSwitchControlRunning = info.isSwitchControlRunning; - cordova.fireWindowEvent(MobileAccessibilityNotifications.SWITCH_CONTROL_STATUS_CHANGED, info); - } - if (mobileAccessibility._isTouchExplorationEnabled !== info.isTouchExplorationEnabled) { - mobileAccessibility._isTouchExplorationEnabled = info.isTouchExplorationEnabled; - cordova.fireWindowEvent(MobileAccessibilityNotifications.TOUCH_EXPLORATION_STATUS_CHANGED, info); - } - if (mobileAccessibility._isHighContrastEnabled !== info.isHighContrastEnabled) { - mobileAccessibility._isHighContrastEnabled = info.isHighContrastEnabled; - mobileAccessibility._highContrastScheme = info.highContrastScheme; - cordova.fireWindowEvent(MobileAccessibilityNotifications.HIGH_CONTRAST_CHANGED, info); - } - } -}; - -/** - * Error callback for MobileAccessibility start - */ -MobileAccessibility.prototype._error = function(e) { - console.log("Error initializing MobileAccessibility: " + e); -}; - -var mobileAccessibility = new MobileAccessibility(); - -module.exports = mobileAccessibility; - -}); diff --git a/StoneIsland/platforms/ios/platform_www/plugins/phonegap-plugin-push/www/push.js b/StoneIsland/platforms/ios/platform_www/plugins/phonegap-plugin-push/www/push.js deleted file mode 100644 index a5315486..00000000 --- a/StoneIsland/platforms/ios/platform_www/plugins/phonegap-plugin-push/www/push.js +++ /dev/null @@ -1,329 +0,0 @@ -cordova.define("phonegap-plugin-push.PushNotification", function(require, exports, module) { -/* global cordova:false */ -/* globals window */ - -/*! - * Module dependencies. - */ - -var exec = cordova.require('cordova/exec'); - -/** - * PushNotification constructor. - * - * @param {Object} options to initiate Push Notifications. - * @return {PushNotification} instance that can be monitored and cancelled. - */ - -var PushNotification = function(options) { - this._handlers = { - 'registration': [], - 'notification': [], - 'error': [] - }; - - // require options parameter - if (typeof options === 'undefined') { - throw new Error('The options argument is required.'); - } - - // store the options to this object instance - this.options = options; - - // triggered on registration and notification - var that = this; - var success = function(result) { - if (result && typeof result.registrationId !== 'undefined') { - that.emit('registration', result); - } else if (result && result.additionalData && typeof result.additionalData.actionCallback !== 'undefined') { - var executeFuctionOrEmitEventByName = function(callbackName, context, arg) { - var namespaces = callbackName.split('.'); - var func = namespaces.pop(); - for (var i = 0; i < namespaces.length; i++) { - context = context[namespaces[i]]; - } - - if (typeof context[func] === 'function') { - context[func].call(context, arg); - } else { - that.emit(callbackName, arg); - } - }; - - executeFuctionOrEmitEventByName(result.additionalData.actionCallback, window, result); - } else if (result) { - that.emit('notification', result); - } - }; - - // triggered on error - var fail = function(msg) { - var e = (typeof msg === 'string') ? new Error(msg) : msg; - that.emit('error', e); - }; - - // wait at least one process tick to allow event subscriptions - setTimeout(function() { - exec(success, fail, 'PushNotification', 'init', [options]); - }, 10); -}; - -/** - * Unregister from push notifications - */ - -PushNotification.prototype.unregister = function(successCallback, errorCallback, options) { - if (!errorCallback) { errorCallback = function() {}; } - - if (typeof errorCallback !== 'function') { - console.log('PushNotification.unregister failure: failure parameter not a function'); - return; - } - - if (typeof successCallback !== 'function') { - console.log('PushNotification.unregister failure: success callback parameter must be a function'); - return; - } - - var that = this; - var cleanHandlersAndPassThrough = function() { - if (!options) { - that._handlers = { - 'registration': [], - 'notification': [], - 'error': [] - }; - } - successCallback(); - }; - - exec(cleanHandlersAndPassThrough, errorCallback, 'PushNotification', 'unregister', [options]); -}; - -/** - * subscribe to a topic - * @param {String} topic topic to subscribe - * @param {Function} successCallback success callback - * @param {Function} errorCallback error callback - * @return {void} - */ -PushNotification.prototype.subscribe = function(topic, successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } - - if (typeof errorCallback !== 'function') { - console.log('PushNotification.subscribe failure: failure parameter not a function'); - return; - } - - if (typeof successCallback !== 'function') { - console.log('PushNotification.subscribe failure: success callback parameter must be a function'); - return; - } - - exec(successCallback, errorCallback, 'PushNotification', 'subscribe', [topic]); -}; - -/** - * unsubscribe to a topic - * @param {String} topic topic to unsubscribe - * @param {Function} successCallback success callback - * @param {Function} errorCallback error callback - * @return {void} - */ -PushNotification.prototype.unsubscribe = function(topic, successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } - - if (typeof errorCallback !== 'function') { - console.log('PushNotification.unsubscribe failure: failure parameter not a function'); - return; - } - - if (typeof successCallback !== 'function') { - console.log('PushNotification.unsubscribe failure: success callback parameter must be a function'); - return; - } - - exec(successCallback, errorCallback, 'PushNotification', 'unsubscribe', [topic]); -}; - -/** - * Call this to set the application icon badge - */ - -PushNotification.prototype.setApplicationIconBadgeNumber = function(successCallback, errorCallback, badge) { - if (!errorCallback) { errorCallback = function() {}; } - - if (typeof errorCallback !== 'function') { - console.log('PushNotification.setApplicationIconBadgeNumber failure: failure parameter not a function'); - return; - } - - if (typeof successCallback !== 'function') { - console.log('PushNotification.setApplicationIconBadgeNumber failure: success callback parameter must be a function'); - return; - } - - exec(successCallback, errorCallback, 'PushNotification', 'setApplicationIconBadgeNumber', [{badge: badge}]); -}; - -/** - * Get the application icon badge - */ - -PushNotification.prototype.getApplicationIconBadgeNumber = function(successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } - - if (typeof errorCallback !== 'function') { - console.log('PushNotification.getApplicationIconBadgeNumber failure: failure parameter not a function'); - return; - } - - if (typeof successCallback !== 'function') { - console.log('PushNotification.getApplicationIconBadgeNumber failure: success callback parameter must be a function'); - return; - } - - exec(successCallback, errorCallback, 'PushNotification', 'getApplicationIconBadgeNumber', []); -}; - -/** - * Get the application icon badge - */ - -PushNotification.prototype.clearAllNotifications = function(successCallback, errorCallback) { - if (!successCallback) { successCallback = function() {}; } - if (!errorCallback) { errorCallback = function() {}; } - - if (typeof errorCallback !== 'function') { - console.log('PushNotification.clearAllNotifications failure: failure parameter not a function'); - return; - } - - if (typeof successCallback !== 'function') { - console.log('PushNotification.clearAllNotifications failure: success callback parameter must be a function'); - return; - } - - exec(successCallback, errorCallback, 'PushNotification', 'clearAllNotifications', []); -}; - -/** - * Listen for an event. - * - * Any event is supported, but the following are built-in: - * - * - registration - * - notification - * - error - * - * @param {String} eventName to subscribe to. - * @param {Function} callback triggered on the event. - */ - -PushNotification.prototype.on = function(eventName, callback) { - if (!this._handlers.hasOwnProperty(eventName)) { - this._handlers[eventName] = []; - } - this._handlers[eventName].push(callback); -}; - -/** - * Remove event listener. - * - * @param {String} eventName to match subscription. - * @param {Function} handle function associated with event. - */ - -PushNotification.prototype.off = function (eventName, handle) { - if (this._handlers.hasOwnProperty(eventName)) { - var handleIndex = this._handlers[eventName].indexOf(handle); - if (handleIndex >= 0) { - this._handlers[eventName].splice(handleIndex, 1); - } - } -}; - -/** - * Emit an event. - * - * This is intended for internal use only. - * - * @param {String} eventName is the event to trigger. - * @param {*} all arguments are passed to the event listeners. - * - * @return {Boolean} is true when the event is triggered otherwise false. - */ - -PushNotification.prototype.emit = function() { - var args = Array.prototype.slice.call(arguments); - var eventName = args.shift(); - - if (!this._handlers.hasOwnProperty(eventName)) { - return false; - } - - for (var i = 0, length = this._handlers[eventName].length; i < length; i++) { - var callback = this._handlers[eventName][i]; - if (typeof callback === 'function') { - callback.apply(undefined,args); - } else { - console.log('event handler: ' + eventName + ' must be a function'); - } - } - - return true; -}; - -PushNotification.prototype.finish = function(successCallback, errorCallback, id) { - if (!successCallback) { successCallback = function() {}; } - if (!errorCallback) { errorCallback = function() {}; } - if (!id) { id = 'handler'; } - - if (typeof successCallback !== 'function') { - console.log('finish failure: success callback parameter must be a function'); - return; - } - - if (typeof errorCallback !== 'function') { - console.log('finish failure: failure parameter not a function'); - return; - } - - exec(successCallback, errorCallback, 'PushNotification', 'finish', [id]); -}; - -/*! - * Push Notification Plugin. - */ - -module.exports = { - /** - * Register for Push Notifications. - * - * This method will instantiate a new copy of the PushNotification object - * and start the registration process. - * - * @param {Object} options - * @return {PushNotification} instance - */ - - init: function(options) { - return new PushNotification(options); - }, - - hasPermission: function(successCallback, errorCallback) { - exec(successCallback, errorCallback, 'PushNotification', 'hasPermission', []); - }, - - /** - * PushNotification Object. - * - * Expose the PushNotification object for direct use - * and testing. Typically, you should use the - * .init helper method. - */ - - PushNotification: PushNotification -}; - -}); |
