incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [2/5] git commit: Revert "CB-337 capture options.limit < 1"
Date Fri, 20 Apr 2012 21:16:04 GMT
Revert "CB-337 capture options.limit < 1"

This reverts commit e034157cb25fa3de442ddb10f47bb802b29d1fc4.


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/fb50819d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/fb50819d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/fb50819d

Branch: refs/heads/master
Commit: fb50819d0e1bee6e0ecff6242d74f66e9a313cba
Parents: 452126a
Author: Jesse MacFadyen <purplecabbage@gmail.com>
Authored: Fri Apr 20 13:27:14 2012 -0700
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
Committed: Fri Apr 20 13:27:14 2012 -0700

----------------------------------------------------------------------
 lib/common/plugin/capture.js |   23 +++++------------------
 1 files changed, 5 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/fb50819d/lib/common/plugin/capture.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/capture.js b/lib/common/plugin/capture.js
index f544a33..d1d5d3a 100644
--- a/lib/common/plugin/capture.js
+++ b/lib/common/plugin/capture.js
@@ -1,6 +1,5 @@
 var exec = require('cordova/exec'),
-    MediaFile = require('cordova/plugin/MediaFile'),
-    CaptureError = require('cordova/plugin/CaptureError');
+    MediaFile = require('cordova/plugin/MediaFile');
 
 /**
  * Launches a capture of different types.
@@ -12,11 +11,9 @@ var exec = require('cordova/exec'),
  */
 function _capture(type, successCallback, errorCallback, options) {
     var win = function(pluginResult) {
-        var mediaFiles = []
-            ,i
-            ,len = pluginResult.length;
-            
-        for (i = 0; i < len; i++) {
+        var mediaFiles = [];
+        var i;
+        for (i = 0; i < pluginResult.length; i++) {
             var mediaFile = new MediaFile();
             mediaFile.name = pluginResult[i].name;
             mediaFile.fullPath = pluginResult[i].fullPath;
@@ -27,17 +24,7 @@ function _capture(type, successCallback, errorCallback, options) {
         }
         successCallback(mediaFiles);
     };
-    if(options && options.limit & options.limit < 1) {
-        if(errorCallback) {
-            setTimeout(function(){
-                    errorCallback({code:CaptureError.CAPTURE_INVALID_ARGUMENT});
-            },0);
-        }
-        // else ?? Exception ? console.error ?
-    }
-    else {
-        exec(win, errorCallback, "Capture", type, [options]);
-    }
+    exec(win, errorCallback, "Capture", type, [options]);
 }
 /**
  * The Capture interface exposes an interface to the camera and microphone of the hosting
device.


Mime
View raw message