incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From macdo...@apache.org
Subject android commit: Updating cordova.android.js for CB-421 and CB-426
Date Tue, 03 Apr 2012 17:09:39 GMT
Updated Branches:
  refs/heads/master 0577b4bf5 -> e213772f9


Updating cordova.android.js for CB-421 and CB-426


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/e213772f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/e213772f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/e213772f

Branch: refs/heads/master
Commit: e213772f98975bf265bccff59f8c356b99c76f62
Parents: 0577b4b
Author: macdonst <simon.macdonald@gmail.com>
Authored: Tue Apr 3 13:09:31 2012 -0400
Committer: macdonst <simon.macdonald@gmail.com>
Committed: Tue Apr 3 13:09:31 2012 -0400

----------------------------------------------------------------------
 framework/assets/js/cordova.android.js |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/e213772f/framework/assets/js/cordova.android.js
----------------------------------------------------------------------
diff --git a/framework/assets/js/cordova.android.js b/framework/assets/js/cordova.android.js
index ad18513..edbee03 100644
--- a/framework/assets/js/cordova.android.js
+++ b/framework/assets/js/cordova.android.js
@@ -1116,10 +1116,14 @@ cameraExport.getPicture = function(successCallback, errorCallback,
options) {
     if (typeof options.encodingType == "number") {
         encodingType = options.encodingType;
     }
-    // TODO: parse MediaType
+    
+    var mediaType = Camera.MediaType.PICTURE;
+    if (typeof options.mediaType == "number") {
+        mediaType = options.mediaType;
+    }
     // TODO: enable allow edit?
 
-    exec(successCallback, errorCallback, "Camera", "takePicture", [quality, destinationType,
sourceType, targetWidth, targetHeight, encodingType]);
+    exec(successCallback, errorCallback, "Camera", "takePicture", [quality, destinationType,
sourceType, targetWidth, targetHeight, encodingType, mediaType]);
 }
 
 module.exports = cameraExport;
@@ -1997,10 +2001,15 @@ Entry.prototype.remove = function(successCallback, errorCallback)
{
  * @param errorCallback {Function} called with a FileError
  */
 Entry.prototype.getParent = function(successCallback, errorCallback) {
+    var win = typeof successCallback !== 'function' ? null : function(result) {
+        var DirectoryEntry = require('cordova/plugin/DirectoryEntry');
+        var entry = new DirectoryEntry(result.name, result.fullPath);
+        successCallback(entry);
+    };
     var fail = typeof errorCallback !== 'function' ? null : function(code) {
         errorCallback(new FileError(code));
     };
-    exec(successCallback, fail, "File", "getParent", [this.fullPath]);
+    exec(win, fail, "File", "getParent", [this.fullPath]);
 };
 
 module.exports = Entry;


Mime
View raw message