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/plugins | |
| parent | d22d51a1ae49680015326857360eb699f31efced (diff) | |
rebuild the ios platform and the plugins
Diffstat (limited to 'StoneIsland/platforms/ios/platform_www/plugins')
16 files changed, 535 insertions, 1490 deletions
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/Connection.js b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-network-information/www/Connection.js deleted file mode 100644 index 5f7279c5..00000000 --- a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-network-information/www/Connection.js +++ /dev/null @@ -1,37 +0,0 @@ -cordova.define("cordova-plugin-network-information.Connection", 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. - * -*/ - -/** - * Network status - */ -module.exports = { - UNKNOWN: "unknown", - ETHERNET: "ethernet", - WIFI: "wifi", - CELL_2G: "2g", - CELL_3G: "3g", - CELL_4G: "4g", - CELL:"cellular", - NONE: "none" -}; - -}); 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-splashscreen/www/splashscreen.js b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-splashscreen/www/splashscreen.js deleted file mode 100644 index 5beaa5fd..00000000 --- a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-splashscreen/www/splashscreen.js +++ /dev/null @@ -1,36 +0,0 @@ -cordova.define("cordova-plugin-splashscreen.SplashScreen", 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'); - -var splashscreen = { - show:function() { - exec(null, null, "SplashScreen", "show", []); - }, - hide:function() { - exec(null, null, "SplashScreen", "hide", []); - } -}; - -module.exports = splashscreen; - -}); 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 -}; - -}); |
