Migrate android project to crosswalk+cordova bundle
This commit is contained in:
parent
c2dcd4f44b
commit
053718884a
855 changed files with 109265 additions and 0 deletions
|
|
@ -0,0 +1,89 @@
|
|||
cordova.define("com.phonegap.plugins.barcodescanner.BarcodeScanner", function(require, exports, module) { /**
|
||||
* cordova is available under *either* the terms of the modified BSD license *or* the
|
||||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
|
||||
*
|
||||
* Copyright (c) Matt Kane 2010
|
||||
* Copyright (c) 2011, IBM Corporation
|
||||
*/
|
||||
|
||||
|
||||
var exec = require("cordova/exec");
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @returns {BarcodeScanner}
|
||||
*/
|
||||
function BarcodeScanner() {
|
||||
|
||||
/**
|
||||
* Encoding constants.
|
||||
*
|
||||
* @type Object
|
||||
*/
|
||||
this.Encode = {
|
||||
TEXT_TYPE: "TEXT_TYPE",
|
||||
EMAIL_TYPE: "EMAIL_TYPE",
|
||||
PHONE_TYPE: "PHONE_TYPE",
|
||||
SMS_TYPE: "SMS_TYPE"
|
||||
// CONTACT_TYPE: "CONTACT_TYPE", // TODO: not implemented, requires passing a Bundle class from Javascript to Java
|
||||
// LOCATION_TYPE: "LOCATION_TYPE" // TODO: not implemented, requires passing a Bundle class from Javascript to Java
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Read code from scanner.
|
||||
*
|
||||
* @param {Function} successCallback This function will recieve a result object: {
|
||||
* text : '12345-mock', // The code that was scanned.
|
||||
* format : 'FORMAT_NAME', // Code format.
|
||||
* cancelled : true/false, // Was canceled.
|
||||
* }
|
||||
* @param {Function} errorCallback
|
||||
*/
|
||||
BarcodeScanner.prototype.scan = function (successCallback, errorCallback) {
|
||||
if (errorCallback == null) {
|
||||
errorCallback = function () {
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof errorCallback != "function") {
|
||||
console.log("BarcodeScanner.scan failure: failure parameter not a function");
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof successCallback != "function") {
|
||||
console.log("BarcodeScanner.scan failure: success callback parameter must be a function");
|
||||
return;
|
||||
}
|
||||
|
||||
exec(successCallback, errorCallback, 'BarcodeScanner', 'scan', []);
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
BarcodeScanner.prototype.encode = function (type, data, successCallback, errorCallback, options) {
|
||||
if (errorCallback == null) {
|
||||
errorCallback = function () {
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof errorCallback != "function") {
|
||||
console.log("BarcodeScanner.encode failure: failure parameter not a function");
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof successCallback != "function") {
|
||||
console.log("BarcodeScanner.encode failure: success callback parameter must be a function");
|
||||
return;
|
||||
}
|
||||
|
||||
exec(successCallback, errorCallback, 'BarcodeScanner', 'encode', [
|
||||
{"type": type, "data": data, "options": options}
|
||||
]);
|
||||
};
|
||||
|
||||
var barcodeScanner = new BarcodeScanner();
|
||||
module.exports = barcodeScanner;
|
||||
|
||||
|
||||
});
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
cordova.define("de.appplant.cordova.plugin.email-composer.EmailComposer", function(require, exports, module) { /*
|
||||
Copyright 2013-2014 appPlant UG
|
||||
|
||||
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 EmailComposer = function () {
|
||||
|
||||
};
|
||||
|
||||
EmailComposer.prototype = {
|
||||
/**
|
||||
* Displays the email composer pre-filled with data.
|
||||
*
|
||||
* @param {Object} options
|
||||
* Different properties of the email like the body, subject
|
||||
* @param {Function} callback
|
||||
* A callback function to be called with the result
|
||||
* @param {Object?} scope
|
||||
* The scope of the callback
|
||||
*/
|
||||
open: function (options, callback, scope) {
|
||||
var callbackFn = this.createCallbackFn(callback, scope),
|
||||
options = options || {};
|
||||
|
||||
var defaults = {
|
||||
subject: null,
|
||||
body: null,
|
||||
to: null,
|
||||
cc: null,
|
||||
bcc: null,
|
||||
attachments: null,
|
||||
isHtml: true
|
||||
}
|
||||
|
||||
for (var key in defaults) {
|
||||
if (options[key] !== undefined) {
|
||||
defaults[key] = options[key];
|
||||
} else {
|
||||
console.log('EmailComposer plugin: unknown property "' + key + '"');
|
||||
}
|
||||
}
|
||||
|
||||
cordova.exec(callbackFn, null, 'EmailComposer', 'open', [options]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Alias für `open()`.
|
||||
*/
|
||||
openDraft: function () {
|
||||
this.open.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* Verifies if sending emails is supported on the device.
|
||||
*
|
||||
* @param {Function} callback
|
||||
* A callback function to be called with the result
|
||||
* @param {Object} scope
|
||||
* The scope of the callback
|
||||
*/
|
||||
isServiceAvailable: function (callback, scope) {
|
||||
var callbackFn = this.createCallbackFn(callback, scope);
|
||||
|
||||
cordova.exec(callbackFn, null, 'EmailComposer', 'isServiceAvailable', []);
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* Creates a callback, which will be executed within a specific scope.
|
||||
*
|
||||
* @param {Function} callbackFn
|
||||
* The callback function
|
||||
* @param {Object} scope
|
||||
* The scope for the function
|
||||
*
|
||||
* @return {Function}
|
||||
* The new callback function
|
||||
*/
|
||||
createCallbackFn: function (callbackFn, scope) {
|
||||
return function () {
|
||||
if (typeof callbackFn == 'function') {
|
||||
callbackFn.apply(scope || this, arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var plugin = new EmailComposer();
|
||||
|
||||
module.exports = plugin;
|
||||
});
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
cordova.define("org.apache.cordova.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;
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue