diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-11-08 12:37:03 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-11-08 12:37:03 -0500 |
| commit | ef4f212fc1482136dba1e690ec589b315b4a377f (patch) | |
| tree | 0b7e16d72567fafcfd3e08d7c5c591ad07a63458 /StoneIsland/platforms/android/platform_www/plugins | |
| parent | 5fa81da81260d65113f57a293b6256d334fe8e2d (diff) | |
build 0.7.0
Diffstat (limited to 'StoneIsland/platforms/android/platform_www/plugins')
16 files changed, 310 insertions, 929 deletions
diff --git a/StoneIsland/platforms/android/platform_www/plugins/com.ionic.keyboard/www/keyboard.js b/StoneIsland/platforms/android/platform_www/plugins/com.ionic.keyboard/www/keyboard.js deleted file mode 100755 index 7d30ba59..00000000 --- a/StoneIsland/platforms/android/platform_www/plugins/com.ionic.keyboard/www/keyboard.js +++ /dev/null @@ -1,39 +0,0 @@ -cordova.define("com.ionic.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() { - 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/android/platform_www/plugins/cordova-plugin-console/www/console-via-logger.js b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-console/www/console-via-logger.js deleted file mode 100755 index 0ce8cea8..00000000 --- a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-console/www/console-via-logger.js +++ /dev/null @@ -1,189 +0,0 @@ -cordova.define("cordova-plugin-console.console", 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 logger = require("./logger"); -var utils = require("cordova/utils"); - -//------------------------------------------------------------------------------ -// 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() {} - -//------------------------------------------------------------------------------ -// 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"); - } - } - - return UseLogger; -}; - -//------------------------------------------------------------------------------ -console.log = function() { - if (logger.useConsole()) return; - logger.log.apply(logger, [].slice.call(arguments)); -}; - -//------------------------------------------------------------------------------ -console.error = function() { - if (logger.useConsole()) return; - logger.error.apply(logger, [].slice.call(arguments)); -}; - -//------------------------------------------------------------------------------ -console.warn = function() { - if (logger.useConsole()) return; - logger.warn.apply(logger, [].slice.call(arguments)); -}; - -//------------------------------------------------------------------------------ -console.info = function() { - if (logger.useConsole()) return; - logger.info.apply(logger, [].slice.call(arguments)); -}; - -//------------------------------------------------------------------------------ -console.debug = function() { - if (logger.useConsole()) return; - logger.debug.apply(logger, [].slice.call(arguments)); -}; - -//------------------------------------------------------------------------------ -console.assert = function(expression) { - if (expression) return; - - var message = logger.format.apply(logger.format, [].slice.call(arguments, 1)); - console.log("ASSERT: " + message); -}; - -//------------------------------------------------------------------------------ -console.clear = function() {}; - -//------------------------------------------------------------------------------ -console.dir = function(object) { - console.log("%o", object); -}; - -//------------------------------------------------------------------------------ -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) { - Timers[name] = new Date().valueOf(); -}; - -//------------------------------------------------------------------------------ -console.timeEnd = function(name) { - var timeStart = Timers[name]; - if (!timeStart) { - console.warn("unknown timer: " + name); - return; - } - - var timeElapsed = new Date().valueOf() - timeStart; - 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); -}; - -//------------------------------------------------------------------------------ -// return a new function that calls both functions passed as args -//------------------------------------------------------------------------------ -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) {} - }; -} - -//------------------------------------------------------------------------------ -// 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") { - console[key] = wrappedOrigCall(WinConsole[key], console[key]); - } -} - -}); diff --git a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-console/www/logger.js b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-console/www/logger.js deleted file mode 100755 index 7a9a75d3..00000000 --- a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-console/www/logger.js +++ /dev/null @@ -1,357 +0,0 @@ -cordova.define("cordova-plugin-console.logger", 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. - * -*/ - -//------------------------------------------------------------------------------ -// The logger module exports the following properties/functions: -// -// LOG - constant for the level LOG -// ERROR - constant for the level ERROR -// WARN - constant for the level WARN -// INFO - constant for the level INFO -// DEBUG - constant for the level DEBUG -// logLevel() - returns current log level -// logLevel(value) - sets and returns a new log level -// useConsole() - returns whether logger is using console -// useConsole(value) - sets and returns whether logger is using console -// log(message,...) - logs a message at level LOG -// error(message,...) - logs a message at level ERROR -// warn(message,...) - logs a message at level WARN -// info(message,...) - logs a message at level INFO -// 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 utils = require('cordova/utils'); - -var UseConsole = false; -var UseLogger = true; -var Queued = []; -var DeviceReady = false; -var CurrentLevel; - -var originalConsole = console; - -/** - * Logging levels - */ - -var Levels = [ - "LOG", - "ERROR", - "WARN", - "INFO", - "DEBUG" -]; - -/* - * add the logging levels to the logger object and - * to a separate levelsMap object for testing - */ - -var LevelsMap = {}; -for (var i=0; i<Levels.length; i++) { - var level = Levels[i]; - LevelsMap[level] = i; - logger[level] = level; -} - -CurrentLevel = LevelsMap.WARN; - -/** - * Getter/Setter for the logging level - * - * Returns the current logging level. - * - * When a value is passed, sets the logging level to that value. - * The values should be one of the following constants: - * logger.LOG - * logger.ERROR - * logger.WARN - * logger.INFO - * logger.DEBUG - * - * The value used determines which messages get printed. The logging - * values above are in order, and only messages logged at the logging - * level or above will actually be displayed to the user. E.g., the - * default level is WARN, so only messages logged with LOG, ERROR, or - * WARN will be displayed; INFO and DEBUG messages will be ignored. - */ -logger.level = function (value) { - if (arguments.length) { - if (LevelsMap[value] === null) { - throw new Error("invalid logging level: " + value); - } - CurrentLevel = LevelsMap[value]; - } - - return Levels[CurrentLevel]; -}; - -/** - * Getter/Setter for the useConsole functionality - * - * When useConsole is true, the logger will log via the - * browser 'console' object. - */ -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.log != "function") { - throw new Error("global console object does not have a log function"); - } - - if (typeof console.useLogger == "function") { - if (console.useLogger()) { - throw new Error("console and logger are too intertwingly"); - } - } - } - - return UseConsole; -}; - -/** - * Getter/Setter for the useLogger functionality - * - * When useLogger is true, the logger will log via the - * native Logger plugin. - */ -logger.useLogger = function (value) { - // Enforce boolean - if (arguments.length) UseLogger = !!value; - return UseLogger; -}; - -/** - * Logs a message at the LOG level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.log = function(message) { logWithArgs("LOG", arguments); }; - -/** - * Logs a message at the ERROR level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.error = function(message) { logWithArgs("ERROR", arguments); }; - -/** - * Logs a message at the WARN level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.warn = function(message) { logWithArgs("WARN", arguments); }; - -/** - * Logs a message at the INFO level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.info = function(message) { logWithArgs("INFO", arguments); }; - -/** - * Logs a message at the DEBUG level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -logger.debug = function(message) { logWithArgs("DEBUG", arguments); }; - -// log at the specified level with 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"; -} - -/** - * Logs a message at the specified level. - * - * Parameters passed after message are used applied to - * the message with utils.format() - */ -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){ - formatArgs.unshift(fmtString); // add formatString - } - - var message = logger.format.apply(logger.format, formatArgs); - - if (LevelsMap[level] === null) { - throw new Error("invalid logging level: " + level); - } - - if (LevelsMap[level] > CurrentLevel) return; - - // queue the message if not yet at deviceready - if (!DeviceReady && !UseConsole) { - Queued.push([level, message]); - return; - } - - // Log using the native logger if that is enabled - if (UseLogger) { - 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"); - } - - // 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; - } - } -}; - - -/** - * Formats a string and arguments following it ala console.log() - * - * Any remaining arguments will be appended to the formatted string. - * - * 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(' '); -}; - - -//------------------------------------------------------------------------------ -/** - * Formats a string and arguments following it ala vsprintf() - * - * format chars: - * %j - format arg as JSON - * %o - format arg as JSON - * %c - format arg as '' - * %% - replace with '%' - * any other char following % will format it's - * arg via toString(). - * - * 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()]; - - if (typeof formatString != "string") - formatString = formatString.toString(); - - var pattern = /(.*?)%(.)(.*)/; - var rest = formatString; - var result = []; - - while (args.length) { - var match = pattern.exec(rest); - if (!match) break; - - var arg = args.shift(); - rest = match[3]; - result.push(match[1]); - - if (match[2] == '%') { - result.push('%'); - args.unshift(arg); - continue; - } - - result.push(__formatted(arg, match[2])); - } - - result.push(rest); - - var remainingArgs = [].slice.call(args); - remainingArgs.unshift(result.join('')); - return remainingArgs; -} - -function __formatted(object, formatChar) { - - try { - switch(formatChar) { - case 'j': - case 'o': return JSON.stringify(object); - case 'c': return ''; - } - } - catch (e) { - return "error JSON.stringify()ing argument: " + e; - } - - if ((object === null) || (object === undefined)) { - return Object.prototype.toString.call(object); - } - - return object.toString(); -} - - -//------------------------------------------------------------------------------ -// when deviceready fires, log queued messages -logger.__onDeviceReady = function() { - if (DeviceReady) return; - - DeviceReady = true; - - for (var i=0; i<Queued.length; i++) { - var messageArgs = Queued[i]; - logger.logLevel(messageArgs[0], messageArgs[1]); - } - - Queued = null; -}; - -// add a deviceready event to log queued messages -document.addEventListener("deviceready", logger.__onDeviceReady, false); - -}); diff --git a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js index 7402e4de..091a8297 100755..100644 --- a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js +++ b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-customurlscheme/www/android/LaunchMyApp.js @@ -4,10 +4,18 @@ cordova.define("cordova-plugin-customurlscheme.LaunchMyApp", function(require, e var remainingAttempts = 10; function waitForAndCallHandlerFunction(url) { - if (typeof window.handleOpenURL == "function") { + if (typeof window.handleOpenURL === "function") { + // Clear the intent when we have a handler (note that this is only done when the preference 'CustomURLSchemePluginClearsAndroidIntent' is 'true' in config.xml + cordova.exec( + null, + null, + "LaunchMyApp", + "clearIntent", + []); + window.handleOpenURL(url); } else if (remainingAttempts-- > 0) { - setTimeout(function(){waitForAndCallHandlerFunction(url)}, 500); + setTimeout(function(){waitForAndCallHandlerFunction(url);}, 500); } } @@ -21,6 +29,20 @@ cordova.define("cordova-plugin-customurlscheme.LaunchMyApp", function(require, e } document.addEventListener("deviceready", triggerOpenURL, false); + + var launchmyapp = { + getLastIntent: function(success, failure) { + cordova.exec( + success, + failure, + "LaunchMyApp", + "getLastIntent", + []); + } + } + + module.exports = launchmyapp; + }()); }); diff --git a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-device/www/device.js b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-device/www/device.js index 023bafd2..ff0c5b48 100755..100644 --- a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-device/www/device.js +++ b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-device/www/device.js @@ -42,6 +42,8 @@ function Device() { this.cordova = null; this.model = null; this.manufacturer = null; + this.isVirtual = null; + this.serial = null; var me = this; @@ -56,7 +58,9 @@ function Device() { me.uuid = info.uuid; me.cordova = buildLabel; me.model = info.model; + me.isVirtual = info.isVirtual; me.manufacturer = info.manufacturer || 'unknown'; + me.serial = info.serial || 'unknown'; channel.onCordovaInfoReady.fire(); },function(e) { me.available = false; diff --git a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-dialogs/www/android/notification.js b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-dialogs/www/android/notification.js index 07b92378..07b92378 100755..100644 --- a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-dialogs/www/android/notification.js +++ b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-dialogs/www/android/notification.js diff --git a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-dialogs/www/notification.js b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-dialogs/www/notification.js index ea97eefb..d08d34a6 100755..100644 --- a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-dialogs/www/notification.js +++ b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-dialogs/www/notification.js @@ -37,9 +37,10 @@ module.exports = { * @param {String} buttonLabel Label of the close button (default: OK) */ alert: function(message, completeCallback, title, buttonLabel) { - var _title = (title || "Alert"); + var _message = (typeof message === "string" ? message : JSON.stringify(message)); + var _title = (typeof title === "string" ? title : "Alert"); var _buttonLabel = (buttonLabel || "OK"); - exec(completeCallback, null, "Notification", "alert", [message, _title, _buttonLabel]); + exec(completeCallback, null, "Notification", "alert", [_message, _title, _buttonLabel]); }, /** @@ -52,7 +53,8 @@ module.exports = { * @param {Array} buttonLabels Array of the labels of the buttons (default: ['OK', 'Cancel']) */ confirm: function(message, resultCallback, title, buttonLabels) { - var _title = (title || "Confirm"); + var _message = (typeof message === "string" ? message : JSON.stringify(message)); + var _title = (typeof title === "string" ? title : "Confirm"); var _buttonLabels = (buttonLabels || ["OK", "Cancel"]); // Strings are deprecated! @@ -60,23 +62,9 @@ module.exports = { console.log("Notification.confirm(string, function, string, string) is deprecated. Use Notification.confirm(string, function, string, array)."); } - // Some platforms take an array of button label names. - // Other platforms take a comma separated list. - // For compatibility, we convert to the desired type based on the platform. - if (platform.id == "amazon-fireos" || platform.id == "android" || platform.id == "ios" || - platform.id == "windowsphone" || platform.id == "firefoxos" || platform.id == "ubuntu" || - platform.id == "windows8" || platform.id == "windows") { + _buttonLabels = convertButtonLabels(_buttonLabels); - if (typeof _buttonLabels === 'string') { - _buttonLabels = _buttonLabels.split(","); // not crazy about changing the var type here - } - } else { - if (Array.isArray(_buttonLabels)) { - var buttonLabelArray = _buttonLabels; - _buttonLabels = buttonLabelArray.toString(); - } - } - exec(resultCallback, null, "Notification", "confirm", [message, _title, _buttonLabels]); + exec(resultCallback, null, "Notification", "confirm", [_message, _title, _buttonLabels]); }, /** @@ -92,9 +80,17 @@ module.exports = { * @param {String} defaultText Textbox input value (default: empty string) */ prompt: function(message, resultCallback, title, buttonLabels, defaultText) { - var _message = (message || "Prompt message"); - var _title = (title || "Prompt"); + var _message = (typeof message === "string" ? message : JSON.stringify(message)); + var _title = (typeof title === "string" ? title : "Prompt"); var _buttonLabels = (buttonLabels || ["OK","Cancel"]); + + // Strings are deprecated! + if (typeof _buttonLabels === 'string') { + console.log("Notification.prompt(string, function, string, string) is deprecated. Use Notification.confirm(string, function, string, array)."); + } + + _buttonLabels = convertButtonLabels(_buttonLabels); + var _defaultText = (defaultText || ""); exec(resultCallback, null, "Notification", "prompt", [_message, _title, _buttonLabels, _defaultText]); }, @@ -111,4 +107,26 @@ module.exports = { } }; +function convertButtonLabels(buttonLabels) { + + // Some platforms take an array of button label names. + // Other platforms take a comma separated list. + // For compatibility, we convert to the desired type based on the platform. + if (platform.id == "amazon-fireos" || platform.id == "android" || platform.id == "ios" || + platform.id == "windowsphone" || platform.id == "firefoxos" || platform.id == "ubuntu" || + platform.id == "windows8" || platform.id == "windows") { + + if (typeof buttonLabels === 'string') { + buttonLabels = buttonLabels.split(","); // not crazy about changing the var type here + } + } else { + if (Array.isArray(buttonLabels)) { + var buttonLabelArray = buttonLabels; + buttonLabels = buttonLabelArray.toString(); + } + } + + return buttonLabels; +} + }); diff --git a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-whitelist/whitelist.js b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-geolocation/www/PositionError.js index b83f5795..45439b70 100755..100644 --- a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-whitelist/whitelist.js +++ b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-geolocation/www/PositionError.js @@ -1,4 +1,5 @@ -cordova.define("cordova-plugin-whitelist.whitelist", function(require, exports, module) { /* +cordova.define("cordova-plugin-geolocation.PositionError", 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 @@ -18,12 +19,22 @@ cordova.define("cordova-plugin-whitelist.whitelist", function(require, exports, * */ -if (!document.querySelector('meta[http-equiv=Content-Security-Policy]')) { - var msg = 'No Content-Security-Policy meta tag found. Please add one when using the cordova-plugin-whitelist plugin.'; - console.error(msg); - setInterval(function() { - console.warn(msg); - }, 10000); -} +/** + * Position error object + * + * @constructor + * @param code + * @param message + */ +var PositionError = function(code, message) { + this.code = code || null; + this.message = message || ''; +}; + +PositionError.prototype.PERMISSION_DENIED = PositionError.PERMISSION_DENIED = 1; +PositionError.prototype.POSITION_UNAVAILABLE = PositionError.POSITION_UNAVAILABLE = 2; +PositionError.prototype.TIMEOUT = PositionError.TIMEOUT = 3; + +module.exports = PositionError; }); diff --git a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-geolocation/www/android/geolocation.js b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-geolocation/www/android/geolocation.js new file mode 100644 index 00000000..c90d3c2a --- /dev/null +++ b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-geolocation/www/android/geolocation.js @@ -0,0 +1,73 @@ +cordova.define("cordova-plugin-geolocation.geolocation", 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 = cordova.require('cordova/exec'); +var utils = require('cordova/utils'); +var PositionError = require('./PositionError'); + +// Native watchPosition method is called async after permissions prompt. +// So we use additional map and own ids to return watch id synchronously. +var pluginToNativeWatchMap = {}; + +module.exports = { + getCurrentPosition: function(success, error, args) { + var win = function() { + var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation'); + geo.getCurrentPosition(success, error, args); + }; + var fail = function() { + if (error) { + error(new PositionError (PositionError.PERMISSION_DENIED, 'Illegal Access')); + } + }; + exec(win, fail, "Geolocation", "getPermission", []); + }, + + watchPosition: function(success, error, args) { + var pluginWatchId = utils.createUUID(); + + var win = function() { + var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation'); + pluginToNativeWatchMap[pluginWatchId] = geo.watchPosition(success, error, args); + }; + + var fail = function() { + if (error) { + error(new PositionError(PositionError.PERMISSION_DENIED, 'Illegal Access')); + } + }; + exec(win, fail, "Geolocation", "getPermission", []); + + return pluginWatchId; + }, + + clearWatch: function(pluginWatchId) { + var win = function() { + var nativeWatchId = pluginToNativeWatchMap[pluginWatchId]; + var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation'); + geo.clearWatch(nativeWatchId); + }; + + exec(win, null, "Geolocation", "getPermission", []); + } +}; + +}); diff --git a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js index 6c7a844a..20bcd65a 100755..100644 --- a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js +++ b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js @@ -19,94 +19,95 @@ cordova.define("cordova-plugin-inappbrowser.inappbrowser", function(require, exp * */ -// 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; -} +(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'); + 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') - }; -} + 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); - } - }, + 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'); - } - }, + 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'); + 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(); + 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); + } - callbacks = callbacks || {}; - for (var callbackName in callbacks) { - iab.addEventListener(callbackName, callbacks[callbackName]); - } + strUrl = urlutil.makeAbsolute(strUrl); + var iab = new InAppBrowser(); - var cb = function(eventname) { - iab._eventHandler(eventname); - }; + callbacks = callbacks || {}; + for (var callbackName in callbacks) { + iab.addEventListener(callbackName, callbacks[callbackName]); + } - strWindowFeatures = strWindowFeatures || ""; + var cb = function(eventname) { + iab._eventHandler(eventname); + }; - exec(cb, cb, "InAppBrowser", "open", [strUrl, strWindowName, strWindowFeatures]); - return iab; -}; + strWindowFeatures = strWindowFeatures || ""; + exec(cb, cb, "InAppBrowser", "open", [strUrl, strWindowName, strWindowFeatures]); + return iab; + }; +})(); }); diff --git a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-network-information/www/Connection.js b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-network-information/www/Connection.js index 1450e953..1450e953 100755..100644 --- a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-network-information/www/Connection.js +++ b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-network-information/www/Connection.js diff --git a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-network-information/www/network.js b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-network-information/www/network.js index bfac2e3f..bfac2e3f 100755..100644 --- a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-network-information/www/network.js +++ b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-network-information/www/network.js diff --git a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-splashscreen/www/splashscreen.js b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-splashscreen/www/splashscreen.js index 0e6a10af..0e6a10af 100755..100644 --- a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-splashscreen/www/splashscreen.js +++ b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-splashscreen/www/splashscreen.js diff --git a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js index aa82acf6..dbfd4d63 100755..100644 --- a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js +++ b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js @@ -1,6 +1,4 @@ -cordova.define("cordova-plugin-x-socialsharing.SocialSharing", function(require, exports, module) { var cordova = require('cordova'); - -function SocialSharing() { +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. @@ -25,6 +23,11 @@ SocialSharing.prototype.available = function (callback) { }, 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]); }; @@ -49,7 +52,11 @@ SocialSharing.prototype.shareViaFacebookWithPasteMessageHint = function (message }; SocialSharing.prototype.shareViaWhatsApp = function (message, fileOrFileArray, url, successCallback, errorCallback) { - cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsApp"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url]); + 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) { @@ -113,5 +120,4 @@ SocialSharing.install = function () { }; cordova.addConstructor(SocialSharing.install); - }); diff --git a/StoneIsland/platforms/android/platform_www/plugins/ionic-plugin-keyboard/www/android/keyboard.js b/StoneIsland/platforms/android/platform_www/plugins/ionic-plugin-keyboard/www/android/keyboard.js new file mode 100644 index 00000000..cce2e5be --- /dev/null +++ b/StoneIsland/platforms/android/platform_www/plugins/ionic-plugin-keyboard/www/android/keyboard.js @@ -0,0 +1,62 @@ +cordova.define("ionic-plugin-keyboard.keyboard", function(require, exports, module) { +var argscheck = require('cordova/argscheck'), + utils = require('cordova/utils'), + exec = require('cordova/exec'), + channel = require('cordova/channel'); + + +var Keyboard = function() { +}; + +Keyboard.hideKeyboardAccessoryBar = function(hide) { + exec(null, null, "Keyboard", "hideKeyboardAccessoryBar", [hide]); +}; + +Keyboard.close = function() { + exec(null, null, "Keyboard", "close", []); +}; + +Keyboard.show = function() { + 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; + +channel.onCordovaReady.subscribe(function() { + exec(success, null, 'Keyboard', 'init', []); + + function success(msg) { + var action = msg.charAt(0); + if ( action === 'S' ) { + var keyboardHeight = msg.substr(1); + cordova.plugins.Keyboard.isVisible = true; + cordova.fireWindowEvent('native.keyboardshow', { 'keyboardHeight': + keyboardHeight }); + + //deprecated + cordova.fireWindowEvent('native.showkeyboard', { 'keyboardHeight': + keyboardHeight }); + } else if ( action === 'H' ) { + cordova.plugins.Keyboard.isVisible = false; + cordova.fireWindowEvent('native.keyboardhide'); + + //deprecated + cordova.fireWindowEvent('native.hidekeyboard'); + } + } +}); + +module.exports = Keyboard; + + + + +}); diff --git a/StoneIsland/platforms/android/platform_www/plugins/phonegap-plugin-push/www/push.js b/StoneIsland/platforms/android/platform_www/plugins/phonegap-plugin-push/www/push.js deleted file mode 100755 index 7aa30fd7..00000000 --- a/StoneIsland/platforms/android/platform_www/plugins/phonegap-plugin-push/www/push.js +++ /dev/null @@ -1,231 +0,0 @@ -cordova.define("phonegap-plugin-push.PushNotification", function(require, exports, module) { /* global cordova:false */ - -/*! - * 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 && typeof result.callback !== 'undefined') { - var executeFunctionByName = function(functionName, context /*, args */) { - var args = Array.prototype.slice.call(arguments, 2); - var namespaces = functionName.split("."); - var func = namespaces.pop(); - for (var i = 0; i < namespaces.length; i++) { - context = context[namespaces[i]]; - } - return context[func].apply(context, args); - } - - executeFunctionByName(result.callback, 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 == null) { 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 - } - - exec(successCallback, errorCallback, "PushNotification", "unregister", [options]); -}; - -/** - * Call this to set the application icon badge - */ - -PushNotification.prototype.setApplicationIconBadgeNumber = function(successCallback, errorCallback, badge) { - if (errorCallback == null) { 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 == null) { 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", []); -}; - -/** - * Listen for an event. - * - * The following events are supported: - * - * - 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].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++) { - this._handlers[eventName][i].apply(undefined,args); - } - - return true; -}; - -PushNotification.prototype.finish = function(successCallback, errorCallback) { - if (successCallback == null) { successCallback = function() {}} - if (errorCallback == null) { errorCallback = function() {}} - - 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', []); -} - -/*! - * 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); - }, - - /** - * PushNotification Object. - * - * Expose the PushNotification object for direct use - * and testing. Typically, you should use the - * .init helper method. - */ - - PushNotification: PushNotification -}; -}); |
