Updated Branches: refs/heads/master 0ff216501 -> 51419a695
fixes CB-427 - add back iOS specific getPicture options add allowEdit, correctOrientation, saveToPhotoAlbum into argument list for getPicture Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/51419a69 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/51419a69 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/51419a69 Branch: refs/heads/master Commit: 51419a6952104d640780abeda32ece7ecd6b522d Parents: 0ff2165 Author: Becky Gibson <becka...@apache.org> Authored: Wed Apr 4 10:42:49 2012 -0400 Committer: Becky Gibson <becka...@apache.org> Committed: Wed Apr 4 15:02:40 2012 -0400 ---------------------------------------------------------------------- lib/common/plugin/Camera.js | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/51419a69/lib/common/plugin/Camera.js ---------------------------------------------------------------------- diff --git a/lib/common/plugin/Camera.js b/lib/common/plugin/Camera.js index db6c224..d104707 100644 --- a/lib/common/plugin/Camera.js +++ b/lib/common/plugin/Camera.js @@ -80,9 +80,26 @@ cameraExport.getPicture = function(successCallback, errorCallback, options) { if (typeof options.mediaType == "number") { mediaType = options.mediaType; } - // TODO: enable allow edit? + var allowEdit = false; + if (typeof options.allowEdit == "boolean") { + allowEdit = options.allowEdit; + } else if (typeof options.allowEdit == "number") { + allowEdit = options.allowEdit <= 0 ? false : true; + } + var correctOrientation = false; + if (typeof options.correctOrientation == "boolean") { + correctOrientation = options.correctOrientation; + } else if (typeof options.correctOrientation == "number") { + correctOrientation = options.correctOrientation <=0 ? false : true; + } + var saveToPhotoAlbum = false; + if (typeof options.saveToPhotoAlbum == "boolean") { + saveToPhotoAlbum = options.saveToPhotoAlbum; + } else if (typeof options.saveToPhotoAlbum == "number") { + saveToPhotoAlbum = options.saveToPhotoAlbum <=0 ? false : true; + } - exec(successCallback, errorCallback, "Camera", "takePicture", [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType, mediaType]); + exec(successCallback, errorCallback, "Camera", "takePicture", [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType, mediaType, allowEdit, correctOrientation, saveToPhotoAlbum]); } module.exports = cameraExport;