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

[1/2] spec commit: [CB-2793] added definition and display of default values for camera.getPicture test

Updated Branches:
  refs/heads/master b3caa3e87 -> f08af16ad


[CB-2793] added definition and display of default values for camera.getPicture test


Project: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/commit/826d4433
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/826d4433
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/826d4433

Branch: refs/heads/master
Commit: 826d4433e7c174bbcc563c5aa73e5abb091b0acd
Parents: dbf631c
Author: lorinbeer <lo...@adobe.com>
Authored: Wed Mar 27 14:18:05 2013 -0700
Committer: lorinbeer <lo...@adobe.com>
Committed: Wed Mar 27 14:18:05 2013 -0700

----------------------------------------------------------------------
 camera/index.html |   50 +++++++++++++++++++++++++++++++++++------------
 1 files changed, 37 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/826d4433/camera/index.html
----------------------------------------------------------------------
diff --git a/camera/index.html b/camera/index.html
index d0285df..09b08f3 100644
--- a/camera/index.html
+++ b/camera/index.html
@@ -39,6 +39,17 @@
     var fileObj = null;
     var fileEntry = null;
     var pageStartTime = +new Date();
+    
+    //default camera options
+    var camQualityDefault = ['quality value', 50];
+    var camDestinationTypeDefault = ['FILE_URI', 1];
+    var camPictureSourceTypeDefault = ['CAMERA', 1];
+    var camAllowEditDefault = ['allowEdit', false];
+    var camEncodingTypeDefault = ['JPEG', 0];
+    var camMediaTypeDefault = ['mediaType', 0];
+    var camCorrectOrientationDefault = ['correctOrientation', false];
+    var camSaveToPhotoAlbumDefault = ['saveToPhotoAlbum', true];
+    
 
     //-------------------------------------------------------------------------
     // Camera
@@ -276,25 +287,37 @@
         return ret;
     }
 
-    function createOptionsEl(name, values) {
+    function createOptionsEl(name, values, selectionDefault) {
         var container = document.createElement('div');
         container.style.display = 'inline-block';
         container.appendChild(document.createTextNode(name + ': '));
         var select = document.createElement('select');
         select.keyName = name;
         container.appendChild(select);
-        var opt = document.createElement('option');
-        opt.value = '';
-        opt.textContent = '<default>';
-        select.appendChild(opt);
+        
+        // if we didn't get a default value, insert the blank <default> entry
+        if (selectionDefault == undefined) {
+            var opt = document.createElement('option');
+            opt.value = '';
+            opt.text = '<default>';
+            select.appendChild(opt);
+        }
+        
         select.isBool = typeof values == 'boolean';
         if (select.isBool) {
             values = {'true': 1, 'false': 0};
         }
+        
         for (var k in values) {
+            console.log(name + " value = " + k);
             var opt = document.createElement('option');
             opt.value = values[k];
             opt.textContent = k;
+            if (selectionDefault) {
+                if (selectionDefault[0] == k) {
+                    opt.selected = true;
+                }
+            }
             select.appendChild(opt);
         }
         var optionsDiv = document.getElementById('image-options');
@@ -308,17 +331,18 @@
         document.addEventListener("deviceready", function() {
             deviceReady = true;
             console.log("Device="+device.platform+" "+device.version);
-            createOptionsEl('sourceType', Camera.PictureSourceType);
-            createOptionsEl('destinationType', Camera.DestinationType);
-            createOptionsEl('encodingType', Camera.EncodingType);
-            createOptionsEl('mediaType', Camera.MediaType);
-            createOptionsEl('quality', {'0': 0, '50': 50, '80': 80, '100': 100});
+            createOptionsEl('sourceType', Camera.PictureSourceType, camPictureSourceTypeDefault);
+            createOptionsEl('destinationType', Camera.DestinationType, camDestinationTypeDefault);
+            createOptionsEl('encodingType', Camera.EncodingType, camEncodingTypeDefault);
+            createOptionsEl('mediaType', Camera.MediaType, camMediaTypeDefault);
+            createOptionsEl('quality', {'0': 0, '50': 50, '80': 80, '100': 100}, camQualityDefault);
             createOptionsEl('targetWidth', {'50': 50, '200': 200, '800': 800, '2048': 2048});
             createOptionsEl('targetHeight', {'50': 50, '200': 200, '800': 800, '2048': 2048});
-            createOptionsEl('allowEdit', true);
-            createOptionsEl('correctOrientation', true);
-            createOptionsEl('saveToPhotoAlbum', true);
+            createOptionsEl('allowEdit', true, camAllowEditDefault);
+            createOptionsEl('correctOrientation', true, camCorrectOrientationDefault);
+            createOptionsEl('saveToPhotoAlbum', true, camSaveToPhotoAlbumDefault);
             createOptionsEl('cameraDirection', Camera.Direction);
+                          
         }, false);
         window.setTimeout(function() {
             if (!deviceReady) {


[2/2] spec commit: Merge remote-tracking branch 'apache/master'

Posted by lo...@apache.org.
Merge remote-tracking branch 'apache/master'


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

Branch: refs/heads/master
Commit: f08af16ad6e10b74c63aab108ab7a1bb294b4c75
Parents: 826d443 b3caa3e
Author: lorinbeer <lo...@adobe.com>
Authored: Fri Mar 29 06:49:21 2013 -0700
Committer: lorinbeer <lo...@adobe.com>
Committed: Fri Mar 29 06:49:21 2013 -0700

----------------------------------------------------------------------
 VERSION                              |    2 +-
 autotest/tests/filetransfer.tests.js |   45 +++++++++++++++++++++++++++++
 cordova.js                           |   13 ++++++--
 3 files changed, 56 insertions(+), 4 deletions(-)
----------------------------------------------------------------------