Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C854FE1CC for ; Thu, 21 Feb 2013 18:51:45 +0000 (UTC) Received: (qmail 75247 invoked by uid 500); 21 Feb 2013 18:51:45 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 75216 invoked by uid 500); 21 Feb 2013 18:51:45 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 75209 invoked by uid 99); 21 Feb 2013 18:51:45 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Feb 2013 18:51:45 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 7C25682DE9A; Thu, 21 Feb 2013 18:51:45 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: becka11y@apache.org To: commits@cordova.apache.org X-Mailer: ASF-Git Admin Mailer Subject: js commit: [IOS] [COMMON] Added a handle to camera popovers. [CB-2411] Message-Id: <20130221185145.7C25682DE9A@tyr.zones.apache.org> Date: Thu, 21 Feb 2013 18:51:45 +0000 (UTC) Updated Branches: refs/heads/next 64a70f9bd -> 73b6ecefc [IOS] [COMMON] Added a handle to camera popovers. [CB-2411] This is returned by Camera.getPicture. Developers can use this to reposition the popover. CameraPopoverHandle.setPosition is a no-op on non-iOS platforms. Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/73b6ecef Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/73b6ecef Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/73b6ecef Branch: refs/heads/next Commit: 73b6ecefc25840ea4a73c6b72b523f9f7bd83d82 Parents: 64a70f9 Author: Max Woghiren Authored: Fri Feb 15 13:00:00 2013 -0500 Committer: Becky Gibson Committed: Thu Feb 21 12:17:43 2013 -0500 ---------------------------------------------------------------------- lib/common/plugin/Camera.js | 4 ++- lib/common/plugin/CameraPopoverHandle.js | 33 ++++++++++++++++++++++++ lib/ios/plugin/CameraPopoverHandle.js | 34 +++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-js/blob/73b6ecef/lib/common/plugin/Camera.js ---------------------------------------------------------------------- diff --git a/lib/common/plugin/Camera.js b/lib/common/plugin/Camera.js index 172d667..5794b91 100644 --- a/lib/common/plugin/Camera.js +++ b/lib/common/plugin/Camera.js @@ -21,7 +21,8 @@ var argscheck = require('cordova/argscheck'), exec = require('cordova/exec'), - Camera = require('cordova/plugin/CameraConstants'); + Camera = require('cordova/plugin/CameraConstants'), + CameraPopoverHandle = require('cordova/plugin/CameraPopoverHandle'); var cameraExport = {}; @@ -61,6 +62,7 @@ cameraExport.getPicture = function(successCallback, errorCallback, options) { mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions]; exec(successCallback, errorCallback, "Camera", "takePicture", args); + return new CameraPopoverHandle(); }; cameraExport.cleanup = function(successCallback, errorCallback) { http://git-wip-us.apache.org/repos/asf/cordova-js/blob/73b6ecef/lib/common/plugin/CameraPopoverHandle.js ---------------------------------------------------------------------- diff --git a/lib/common/plugin/CameraPopoverHandle.js b/lib/common/plugin/CameraPopoverHandle.js new file mode 100644 index 0000000..7a4c32d --- /dev/null +++ b/lib/common/plugin/CameraPopoverHandle.js @@ -0,0 +1,33 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +var exec = require('cordova/exec'); + +/** + * A handle to an image picker popover. + */ +var CameraPopoverHandle = function() { + this.setPosition = function(popoverOptions) { + console.log('CameraPopoverHandle.setPosition is only supported on iOS.'); + }; +}; + +module.exports = CameraPopoverHandle; http://git-wip-us.apache.org/repos/asf/cordova-js/blob/73b6ecef/lib/ios/plugin/CameraPopoverHandle.js ---------------------------------------------------------------------- diff --git a/lib/ios/plugin/CameraPopoverHandle.js b/lib/ios/plugin/CameraPopoverHandle.js new file mode 100644 index 0000000..fc48c11 --- /dev/null +++ b/lib/ios/plugin/CameraPopoverHandle.js @@ -0,0 +1,34 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +var exec = require('cordova/exec'); + +/** + * A handle to an image picker popover. + */ +var CameraPopoverHandle = function() { + this.setPosition = function(popoverOptions) { + var args = [ popoverOptions ]; + exec(null, null, "Camera", "repositionPopover", args); + }; +}; + +module.exports = CameraPopoverHandle;