mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
Updating cordova.android.js to override FileReader
This commit is contained in:
parent
73aa5cc7c3
commit
a69bd65152
@ -1067,6 +1067,9 @@ module.exports = {
|
||||
File: { // exists natively on Android WebView, override
|
||||
path: "cordova/plugin/File"
|
||||
},
|
||||
FileReader: { // exists natively on Android WebView, override
|
||||
path: "cordova/plugin/FileReader"
|
||||
},
|
||||
FileError: { //exists natively on Android WebView on Android 4.x
|
||||
path: "cordova/plugin/FileError"
|
||||
}
|
||||
@ -1435,7 +1438,13 @@ define('cordova/plugin/Camera', function(require, exports, module) {
|
||||
var exec = require('cordova/exec'),
|
||||
Camera = require('cordova/plugin/CameraConstants');
|
||||
|
||||
module.exports = {
|
||||
var cameraExport = {};
|
||||
|
||||
// Tack on the Camera Constants to the base camera plugin.
|
||||
for (var key in Camera) {
|
||||
cameraExport[key] = Camera[key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a picture from source defined by "options.sourceType", and returns the
|
||||
* image as defined by the "options.destinationType" option.
|
||||
@ -1446,8 +1455,7 @@ module.exports = {
|
||||
* @param {Function} errorCallback
|
||||
* @param {Object} options
|
||||
*/
|
||||
getPicture: function (successCallback, errorCallback, options) {
|
||||
|
||||
cameraExport.getPicture = function(successCallback, errorCallback, options) {
|
||||
// successCallback required
|
||||
if (typeof successCallback != "function") {
|
||||
console.log("Camera Error: successCallback is not a function");
|
||||
@ -1460,6 +1468,7 @@ module.exports = {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (options && typeof options.quality == "number") {
|
||||
quality = options.quality;
|
||||
} else if (options && typeof options.quality == "string") {
|
||||
@ -1470,7 +1479,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
var destinationType = Camera.DestinationType.FILE_URL;
|
||||
if (options.destinationType) {
|
||||
if (typeof options.destinationType == "number") {
|
||||
destinationType = options.destinationType;
|
||||
}
|
||||
|
||||
@ -1506,7 +1515,8 @@ module.exports = {
|
||||
|
||||
exec(successCallback, errorCallback, "Camera", "takePicture", [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType]);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = cameraExport;
|
||||
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user