You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2013/05/23 23:51:24 UTC

git commit: updated plugin.xml, native src files

Updated Branches:
  refs/heads/master c6174ce21 -> 0b6342e56


updated plugin.xml, native src files


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/0b6342e5
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/0b6342e5
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/0b6342e5

Branch: refs/heads/master
Commit: 0b6342e56c0038bad3929e85093aec22dc0350e8
Parents: c6174ce
Author: Steven Gill <st...@gmail.com>
Authored: Thu May 23 14:51:18 2013 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Thu May 23 14:51:18 2013 -0700

----------------------------------------------------------------------
 plugin.xml                     |   31 +++++++++++++++++++++----------
 src/ios/CDVCamera.h            |    2 +-
 src/ios/CDVCamera.m            |    6 +++---
 www/Camera.js                  |    4 ++--
 www/CameraPopoverOptions.js    |    2 +-
 www/ios/CameraPopoverHandle.js |   34 ++++++++++++++++++++++++++++++++++
 6 files changed, 62 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/0b6342e5/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 06155f5..5c07c4c 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -6,25 +6,31 @@ id="org.apache.cordova.core.CameraLauncher"
     version="0.1.0">
     <name>Camera</name>
 
-    <js-module src="www/CameraConstants.js" name="camera">
-        <clobbers target="window.camera" />
+    <js-module src="www/Camera.js" name="camera">
+        <clobbers target="navigator.camera" />
     </js-module>
 
-    <js-module src="www/CameraPopoverOptions.js" name="camera">
-        <clobbers target="window.camera" />
+    <js-module src="www/CameraConstants.js" name="Camera">
+        <clobbers target="Camera" />
     </js-module>
-    
-    <js-module src="www/Camera.js" name="camera">
-        <clobbers target="navigator.camera" />
+
+    <js-module src="www/CameraPopoverOptions.js" name="CameraPopoverOptions">
+        <clobbers target="CameraPopoverOptions" />
+    </js-module>
+
+    <js-module src="www/CameraPopoverHandle.js" name="CameraPopoverHandle">
+        <merges target="CameraPopoverHandle" />
     </js-module>
     
     <!-- android -->
     <platform name="android">
-        <config-file target="res/xml/config.xml" parent="/cordova/plugins">
-            <plugin name="Camera" value="org.apache.cordova.core"/>
+        <config-file target="res/xml/config.xml" parent="/*">
+            <feature name="Camera" 
+                <param name="android-package" value="org.apache.cordova.core"/>
+            </feature>
         </config-file>
 
-        <source-file src="CameraLauncher.java" target-dir="org/apache/cordova/core" />
+        <source-file src="src/android/CameraLauncher.java" target-dir="src/org/apache/cordova/core" />
      </platform>
      
      <!-- ios -->
@@ -34,6 +40,11 @@ id="org.apache.cordova.core.CameraLauncher"
                  <param name="ios-package" value="CDVCamera" /> 
              </feature>
          </config-file>
+
+         <js-module src="www/ios/CameraPopoverHandle.js" name="CameraPopoverHandle">
+            <merges target="CameraPopoverHandle" />
+        </js-module>
+
          <header-file src="src/ios/CDVCamera.h" />
          <source-file src="src/ios/CDVCamera.m" />
          <header-file src="src/ios/CDVJpegHeaderWriter.h" />

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/0b6342e5/src/ios/CDVCamera.h
----------------------------------------------------------------------
diff --git a/src/ios/CDVCamera.h b/src/ios/CDVCamera.h
index 2932e3b..744ae7f 100644
--- a/src/ios/CDVCamera.h
+++ b/src/ios/CDVCamera.h
@@ -20,7 +20,7 @@
 #import <Foundation/Foundation.h>
 #import <CoreLocation/CoreLocation.h>
 #import <CoreLocation/CLLocationManager.h>
-#import "CDVPlugin.h"
+#import <Cordova/CDVPlugin.h>
 
 enum CDVDestinationType {
     DestinationTypeDataUrl = 0,

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/0b6342e5/src/ios/CDVCamera.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m
index 1ee641c..2b769ba 100644
--- a/src/ios/CDVCamera.m
+++ b/src/ios/CDVCamera.m
@@ -19,9 +19,9 @@
 
 #import "CDVCamera.h"
 #import "CDVJpegHeaderWriter.h"
-#import "NSArray+Comparisons.h"
-#import "NSData+Base64.h"
-#import "NSDictionary+Extensions.h"
+#import <Cordova/NSArray+Comparisons.h>
+#import <CordovaNSData+Base64.h>
+#import <Cordova/NSDictionary+Extensions.h>
 #import <ImageIO/CGImageProperties.h>
 #import <AssetsLibrary/ALAssetRepresentation.h>
 #import <ImageIO/CGImageSource.h>

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/0b6342e5/www/Camera.js
----------------------------------------------------------------------
diff --git a/www/Camera.js b/www/Camera.js
index 77f4a98..2d16ee0 100644
--- a/www/Camera.js
+++ b/www/Camera.js
@@ -21,8 +21,8 @@
 
 var argscheck = require('cordova/argscheck'),
     exec = require('cordova/exec'),
-    Camera = require('org.apache.cordova.core.CameraConstants'),
-    CameraPopoverHandle = require('org.apache.cordova.core.CameraPopoverHandle');
+    Camera = require('org.apache.cordova.core.CameraLauncher.CameraConstants'),
+    CameraPopoverHandle = require('org.apache.cordova.core.CameraLauncher.CameraPopoverHandle');
 
 var cameraExport = {};
 

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/0b6342e5/www/CameraPopoverOptions.js
----------------------------------------------------------------------
diff --git a/www/CameraPopoverOptions.js b/www/CameraPopoverOptions.js
index 3df3745..36858a9 100644
--- a/www/CameraPopoverOptions.js
+++ b/www/CameraPopoverOptions.js
@@ -19,7 +19,7 @@
  *
 */
 
-var Camera = require('org.apache.cordova.core.CameraConstants');
+var Camera = require('org.apache.cordova.core.CameraLauncher.Camera');
 
 /**
  * Encapsulates options for iOS Popover image picker

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/0b6342e5/www/ios/CameraPopoverHandle.js
----------------------------------------------------------------------
diff --git a/www/ios/CameraPopoverHandle.js b/www/ios/CameraPopoverHandle.js
new file mode 100644
index 0000000..fc48c11
--- /dev/null
+++ b/www/ios/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;