This repository has been archived by the owner on Jun 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Benoit HERVIER
committed
Oct 27, 2016
1 parent
7d3c84f
commit 022b9a1
Showing
19 changed files
with
1,612 additions
and
0 deletions.
There are no files selected for viewing
Binary file modified
BIN
+0 Bytes
(100%)
platforms/android/.gradle/2.13/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
platforms/android/.gradle/2.13/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
platforms/android/.gradle/2.13/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
platforms/android/.gradle/2.13/taskArtifacts/taskArtifacts.bin
Binary file not shown.
Binary file added
BIN
+68.7 KB
...e/2.13/tasks/_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin
Binary file not shown.
Binary file added
BIN
+17 Bytes
.../2.13/tasks/_compileReleaseJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.lock
Binary file not shown.
Binary file added
BIN
+18.4 KB
...asks/_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.bin
Binary file not shown.
Binary file added
BIN
+17 Bytes
...sks/_compileReleaseJavaWithJavac/localJarClasspathSnapshot/localJarClasspathSnapshot.lock
Binary file not shown.
68 changes: 68 additions & 0 deletions
68
platforms/android/assets/www/plugins/cordova-plugin-app-version/www/AppVersionPlugin.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
cordova.define("cordova-plugin-app-version.AppVersionPlugin", function(require, exports, module) { | ||
/*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(); | ||
success = deferred.resolve; | ||
fail = deferred.reject; | ||
toReturn = deferred; | ||
} else if (window.angular) { | ||
injector = angular.injector(["ng"]); | ||
$q = injector.get("$q"); | ||
deferred = $q.defer(); | ||
success = deferred.resolve; | ||
fail = deferred.reject; | ||
toReturn = deferred.promise; | ||
} else if (window.when && window.when.promise) { | ||
deferred = when.defer(); | ||
success = deferred.resolve; | ||
fail = deferred.reject; | ||
toReturn = deferred.promise; | ||
} else if (window.Promise) { | ||
toReturn = new Promise(function(c, e) { | ||
success = c; | ||
fail = e; | ||
}); | ||
} else if (window.WinJS && window.WinJS.Promise) { | ||
toReturn = new WinJS.Promise(function(c, e) { | ||
success = c; | ||
fail = e; | ||
}); | ||
} else { | ||
return console.error('AppVersion either needs a success callback, or jQuery/AngularJS/Promise/WinJS.Promise defined for using promises'); | ||
} | ||
} | ||
// 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; | ||
|
||
}); |
39 changes: 39 additions & 0 deletions
39
platforms/android/assets/www/plugins/cordova-plugin-nativestorage/www/LocalStorageHandle.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
cordova.define("cordova-plugin-nativestorage.LocalStorageHandle", function(require, exports, module) { | ||
var NativeStorageError = require('./NativeStorageError'); | ||
|
||
// args = [reference, variable] | ||
function LocalStorageHandle(success, error, intent, operation, args) { | ||
var reference = args[0]; | ||
var variable = args[1]; | ||
|
||
if (operation.startsWith('put') || operation.startsWith('set')) { | ||
try { | ||
var varAsString = JSON.stringify(variable); | ||
if (reference === null) { | ||
error(new NativeStorageError(NativeStorageError.NULL_REFERENCE, "JS", "")); | ||
return; | ||
} | ||
localStorage.setItem(reference, varAsString); | ||
success(variable); | ||
} catch (err) { | ||
error(new NativeStorageError(NativeStorageError.JSON_ERROR, "JS", err)); | ||
} | ||
} else if (operation.startsWith('get')) { | ||
var item = {}; | ||
item = localStorage.getItem(reference); | ||
if (item === null) { | ||
error(NativeStorageError.ITEM_NOT_FOUND); | ||
return; | ||
} | ||
try { | ||
var obj = JSON.parse(item); | ||
//console.log("LocalStorage Reading: "+obj); | ||
success(obj); | ||
} catch (err) { | ||
error(new NativeStorageError(NativeStorageError.JSON_ERROR, "JS", err)); | ||
} | ||
} | ||
} | ||
module.exports = LocalStorageHandle; | ||
|
||
}); |
21 changes: 21 additions & 0 deletions
21
platforms/android/assets/www/plugins/cordova-plugin-nativestorage/www/NativeStorageError.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
cordova.define("cordova-plugin-nativestorage.NativeStorageError", function(require, exports, module) { | ||
/** | ||
* NativeStorageError | ||
* @constructor | ||
*/ | ||
var NativeStorageError = function(code, source, exception) { | ||
this.code = code || null; | ||
this.source = source || null; | ||
this.exception = exception || null; | ||
}; | ||
|
||
NativeStorageError.NATIVE_WRITE_FAILED = 1; | ||
NativeStorageError.ITEM_NOT_FOUND = 2; | ||
NativeStorageError.NULL_REFERENCE = 3; | ||
NativeStorageError.UNDEFINED_TYPE = 4; | ||
NativeStorageError.JSON_ERROR = 5; | ||
NativeStorageError.WRONG_PARAMETER = 6; | ||
|
||
module.exports = NativeStorageError; | ||
|
||
}); |
Oops, something went wrong.