You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by be...@apache.org on 2013/02/21 19:51:45 UTC

js commit: [IOS] [COMMON] Added a handle to camera popovers. [CB-2411]

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 <ma...@gmail.com>
Authored: Fri Feb 15 13:00:00 2013 -0500
Committer: Becky Gibson <be...@apache.org>
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;