Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

Commit

Permalink
Add prebuild android missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoit HERVIER committed Oct 27, 2016
1 parent 7d3c84f commit 022b9a1
Show file tree
Hide file tree
Showing 19 changed files with 1,612 additions and 0 deletions.
Binary file not shown.
Binary file modified platforms/android/.gradle/2.13/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file modified platforms/android/.gradle/2.13/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file modified platforms/android/.gradle/2.13/taskArtifacts/taskArtifacts.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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;

});
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;

});
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;

});
Loading

0 comments on commit 022b9a1

Please sign in to comment.