You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/03/14 18:55:56 UTC

js commit: [CB-1686] Added a camera direction option.

Updated Branches:
  refs/heads/master d79881dc2 -> ee0451759


[CB-1686] Added a camera direction option.


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

Branch: refs/heads/master
Commit: ee045175931ab6b6f21f0321a26579d9273aafdd
Parents: d79881d
Author: Max Woghiren <ma...@gmail.com>
Authored: Wed Mar 13 14:27:34 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Mar 14 13:55:50 2013 -0400

----------------------------------------------------------------------
 lib/common/plugin/Camera.js          |    3 ++-
 lib/common/plugin/CameraConstants.js |    4 ++++
 2 files changed, 6 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/ee045175/lib/common/plugin/Camera.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/Camera.js b/lib/common/plugin/Camera.js
index 5794b91..b197bd7 100644
--- a/lib/common/plugin/Camera.js
+++ b/lib/common/plugin/Camera.js
@@ -57,9 +57,10 @@ cameraExport.getPicture = function(successCallback, errorCallback, options) {
     var correctOrientation = !!options.correctOrientation;
     var saveToPhotoAlbum = !!options.saveToPhotoAlbum;
     var popoverOptions = getValue(options.popoverOptions, null);
+    var cameraDirection = getValue(options.cameraDirection, Camera.Direction.BACK);
 
     var args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType,
-                mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions];
+                mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions, cameraDirection];
 
     exec(successCallback, errorCallback, "Camera", "takePicture", args);
     return new CameraPopoverHandle();

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/ee045175/lib/common/plugin/CameraConstants.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/CameraConstants.js b/lib/common/plugin/CameraConstants.js
index ac23926..ae4e534 100644
--- a/lib/common/plugin/CameraConstants.js
+++ b/lib/common/plugin/CameraConstants.js
@@ -45,5 +45,9 @@ module.exports = {
       ARROW_LEFT : 4,
       ARROW_RIGHT : 8,
       ARROW_ANY : 15
+  },
+  Direction:{
+      BACK: 0,
+      FRONT: 1
   }
 };