You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2012/04/04 22:38:54 UTC

[3/16] android commit: Updating cordova.android.js for CB-421 and CB-426

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/CordovaWebView
Commit: e213772f98975bf265bccff59f8c356b99c76f62
Parents: 0577b4b
Author: macdonst <si...@gmail.com>
Authored: Tue Apr 3 13:09:31 2012 -0400
Committer: macdonst <si...@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;