diff options
Diffstat (limited to 'plugins/uk.co.whiteoctober.cordova.appversion/www')
| -rw-r--r-- | plugins/uk.co.whiteoctober.cordova.appversion/www/AppVersionPlugin.js | 48 | ||||
| -rw-r--r-- | plugins/uk.co.whiteoctober.cordova.appversion/www/blackberry10/AppVersionProxy.js | 18 |
2 files changed, 0 insertions, 66 deletions
diff --git a/plugins/uk.co.whiteoctober.cordova.appversion/www/AppVersionPlugin.js b/plugins/uk.co.whiteoctober.cordova.appversion/www/AppVersionPlugin.js deleted file mode 100644 index 3e395260..00000000 --- a/plugins/uk.co.whiteoctober.cordova.appversion/www/AppVersionPlugin.js +++ /dev/null @@ -1,48 +0,0 @@ -/*jslint indent: 2 */ -/*global window, jQuery, angular, cordova */ -"use strict"; - -// Returns a jQuery or AngularJS deferred object, or pass a success and fail callbacks if you don't want to use jQuery or AngularJS -var getPromisedCordovaExec = function (command, success, fail) { - var toReturn, deferred, injector, $q; - if (success === undefined) { - if (window.jQuery) { - deferred = jQuery.Deferred(); - toReturn = deferred; - } else if (window.angular) { - injector = angular.injector(["ng"]); - $q = injector.get("$q"); - deferred = $q.defer(); - toReturn = deferred.promise; - } else { - return console.error('AppVersion either needs a success callback, or jQuery/AngularJS defined for using promises'); - } - success = deferred.resolve; - fail = deferred.reject; - } - // 5th param is NOT optional. must be at least empty array - cordova.exec(success, fail, "AppVersion", command, []); - return toReturn; -}; - -var getAppVersion = function (success, fail) { - return getPromisedCordovaExec('getVersionNumber', success, fail); -}; - -getAppVersion.getAppName = function (success, fail) { - return getPromisedCordovaExec('getAppName', success, fail); -}; - -getAppVersion.getPackageName = function (success, fail) { - return getPromisedCordovaExec('getPackageName', success, fail); -}; - -getAppVersion.getVersionNumber = function (success, fail) { - return getPromisedCordovaExec('getVersionNumber', success, fail); -}; - -getAppVersion.getVersionCode = function (success, fail) { - return getPromisedCordovaExec('getVersionCode', success, fail); -}; - -module.exports = getAppVersion; diff --git a/plugins/uk.co.whiteoctober.cordova.appversion/www/blackberry10/AppVersionProxy.js b/plugins/uk.co.whiteoctober.cordova.appversion/www/blackberry10/AppVersionProxy.js deleted file mode 100644 index 82dc82aa..00000000 --- a/plugins/uk.co.whiteoctober.cordova.appversion/www/blackberry10/AppVersionProxy.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = { - getVersionNumber: function( success, fail ) { - if( !blackberry || !blackberry.app || !blackberry.app.version ) { - if( fail ) { - return fail(); - } else { - return ""; - } - } - - if( success ) { - return success( blackberry.app.version ); - } - return blackberry.app.version; - } -}; - -require("cordova/exec/proxy").add("AppVersion", module.exports); |
