diff options
| author | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-10-31 08:21:38 -0400 |
|---|---|---|
| committer | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-10-31 08:21:38 -0400 |
| commit | 02811010cf62f1b21a06780d1e470d04bb24c50f (patch) | |
| tree | 0d933789068aac11c810ed4bb169d14ab16c43c6 /plugins/uk.co.whiteoctober.cordova.appversion/www/AppVersionPlugin.js | |
| parent | bca561c1b3989d62a1fba829e0380c6fbf36caf5 (diff) | |
removed unecessary files from git
Diffstat (limited to 'plugins/uk.co.whiteoctober.cordova.appversion/www/AppVersionPlugin.js')
| -rw-r--r-- | plugins/uk.co.whiteoctober.cordova.appversion/www/AppVersionPlugin.js | 48 |
1 files changed, 0 insertions, 48 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; |
