mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
updating cordova.js to include camera constants fix. added clean dependency to build-javascript target in ant file
This commit is contained in:
parent
73aa5cc7c3
commit
7392b63b99
@ -1435,7 +1435,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 +1452,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 +1465,7 @@ module.exports = {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (options && typeof options.quality == "number") {
|
||||
quality = options.quality;
|
||||
} else if (options && typeof options.quality == "string") {
|
||||
@ -1470,7 +1476,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
var destinationType = Camera.DestinationType.FILE_URL;
|
||||
if (options.destinationType) {
|
||||
if (typeof options.destinationType == "number") {
|
||||
destinationType = options.destinationType;
|
||||
}
|
||||
|
||||
@ -1506,7 +1512,8 @@ module.exports = {
|
||||
|
||||
exec(successCallback, errorCallback, "Camera", "takePicture", [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType]);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = cameraExport;
|
||||
|
||||
});
|
||||
|
||||
|
@ -143,7 +143,7 @@
|
||||
</target>
|
||||
|
||||
<!-- Combine JavaScript files into one cordova-uncompressed.js file. -->
|
||||
<target name="build-javascript">
|
||||
<target name="build-javascript" depends="clean">
|
||||
|
||||
<!-- Clean up existing files -->
|
||||
<!--<delete file="assets/www/cordova_${version}.js"/>-->
|
||||
|
Loading…
Reference in New Issue
Block a user