incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From becka...@apache.org
Subject docs commit: Fixes CB-856 - new iOS camera options
Date Mon, 04 Jun 2012 18:17:43 GMT
Updated Branches:
  refs/heads/master 77102c832 -> c85ddfd6b


Fixes CB-856 - new iOS camera options

Added documentation for new camera option for iOS, popoverOption
and its associated CameraPopoverOptions object.


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

Branch: refs/heads/master
Commit: c85ddfd6b27f60b267bd60a0e1ba1c6fd95c66f3
Parents: 77102c8
Author: Becky Gibson <becka11y@apache.org>
Authored: Mon Jun 4 10:20:16 2012 -0400
Committer: Becky Gibson <becka11y@apache.org>
Committed: Mon Jun 4 14:13:51 2012 -0400

----------------------------------------------------------------------
 docs/en/edge/config.json                           |    3 +-
 .../camera/parameter/CameraPopoverOptions.md       |   71 +++++++++++++++
 .../edge/cordova/camera/parameter/cameraOptions.md |    4 +-
 3 files changed, 76 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/c85ddfd6/docs/en/edge/config.json
----------------------------------------------------------------------
diff --git a/docs/en/edge/config.json b/docs/en/edge/config.json
index a4aa16e..8e7e209 100644
--- a/docs/en/edge/config.json
+++ b/docs/en/edge/config.json
@@ -16,7 +16,8 @@
             "cordova/camera/camera.getPicture.md",
             "cordova/camera/parameter/cameraSuccess.md",
             "cordova/camera/parameter/cameraError.md",
-            "cordova/camera/parameter/cameraOptions.md"
+            "cordova/camera/parameter/cameraOptions.md",
+            "cordova/camera/parameter/CameraPopoverOptions.md"
         ],
         "capture.md": [
             "cordova/media/capture/capture.md",

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/c85ddfd6/docs/en/edge/cordova/camera/parameter/CameraPopoverOptions.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/camera/parameter/CameraPopoverOptions.md b/docs/en/edge/cordova/camera/parameter/CameraPopoverOptions.md
new file mode 100644
index 0000000..6314e8a
--- /dev/null
+++ b/docs/en/edge/cordova/camera/parameter/CameraPopoverOptions.md
@@ -0,0 +1,71 @@
+---
+license: 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.
+---
+
+CameraPopoverOptions
+====================
+
+Parameters only used by iOS to specify the anchor element location and arrow direction of
popover used on iPad when selecting images from the library or album.
+
+    { x : 0, 
+      y :  32,
+      width : 320,
+      height : 480,
+      arrowDir : Camera.PopoverArrowDirection.ARROW_ANY
+    };
+
+CameraPopoverOptions
+--------------------
+
+- __x:__ x pixel coordinate of element on the screen to anchor popover onto. (`Number`)
+
+- __y:__ y pixel coordinate of element on the screen to anchor popover onto. (`Number`)
+
+- __width:__ width, in pixels, of the element on the screen to anchor popover onto. (`Number`)
+
+- __height:__ height, in pixels, of the element on the screen to anchor popover onto. (`Number`)
+
+- __arrowDir:__ Direction the arrow on the popover should point.  Defined in Camera.PopoverArrowDirection
(`Number`)
+        
+            Camera.PopoverArrowDirection = {
+                ARROW_UP : 1,        // matches iOS UIPopoverArrowDirection constants
+                ARROW_DOWN : 2,
+                ARROW_LEFT : 4,
+                ARROW_RIGHT : 8,
+                ARROW_ANY : 15
+            };
+  
+Note that the size of the popover may change to adjust to the direction of the arrow and
orientation of the screen.  Make sure to account for orientation changes when specifying the
anchor element location. 
+
+Quick Example
+-------------
+
+     var popover = new CameraPopoverOptions(300,300,100,100,Camera.PopoverArrowDirection.ARROW_ANY);
+     var options = { quality: 50, destinationType: Camera.DestinationType.DATA_URL,sourceType:
Camera.PictureSource.SAVEDPHOTOALBUM, popoverOptions : popover };
+     
+     navigator.camera.getPicture(onSuccess, onFail, options);
+     
+     function onSuccess(imageData) {
+        var image = document.getElementById('myImage');
+        image.src = "data:image/jpeg;base64," + imageData;
+    }
+
+    function onFail(message) {
+        alert('Failed because: ' + message);
+    }
+     

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/c85ddfd6/docs/en/edge/cordova/camera/parameter/cameraOptions.md
----------------------------------------------------------------------
diff --git a/docs/en/edge/cordova/camera/parameter/cameraOptions.md b/docs/en/edge/cordova/camera/parameter/cameraOptions.md
index 003a92a..0665ee8 100644
--- a/docs/en/edge/cordova/camera/parameter/cameraOptions.md
+++ b/docs/en/edge/cordova/camera/parameter/cameraOptions.md
@@ -28,7 +28,8 @@ Optional parameters to customize the camera settings.
       allowEdit : true,
       encodingType: Camera.EncodingType.JPEG,
       targetWidth: 100,
-      targetHeight: 100 };
+      targetHeight: 100,
+      popoverOptions: CameraPopoverOptions };
 
 Options
 -------
@@ -72,6 +73,7 @@ Options
 
 - __correctOrientation:__ Rotate the image to correct for the orientation of the device during
capture. (`Boolean`)
 - __saveToPhotoAlbum:__ Save the image to the photo album on the device after capture. (`Boolean`)
+- __popoverOptions:__ iOS only options to specify popover location in iPad.  Defined in CameraPopoverOptions
   
 Android Quirks
 --------------


Mime
View raw message