You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2012/08/25 01:46:48 UTC

[1/4] ios commit: Updated VERSION and cordova-js to 2.1.0rc1, updated hello-world-app to latest

Updated Branches:
  refs/heads/master e8630a584 -> f1fd9d2db


Updated VERSION and cordova-js to 2.1.0rc1, updated hello-world-app to latest


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

Branch: refs/heads/master
Commit: f1fd9d2db39a90701f9a3edd4554e45a16e02cf6
Parents: e8630a5
Author: Shazron Abdullah <sh...@apache.org>
Authored: Fri Aug 24 16:46:39 2012 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Aug 24 16:46:39 2012 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/CDVAvailability.h               |    3 +-
 CordovaLib/VERSION                                 |    2 +-
 CordovaLib/javascript/cordova.ios.js               |   91 +-
 bin/templates/project/www/config.xml               |   47 -
 bin/templates/project/www/cordova-2.0.0.js         | 5242 --------------
 bin/templates/project/www/cordova-2.1.0rc1.js      | 5298 +++++++++++++++
 bin/templates/project/www/css/index.css            |   83 +-
 bin/templates/project/www/img/cordova.png          |  Bin 19932 -> 0 bytes
 bin/templates/project/www/img/logo.png             |  Bin 0 -> 19932 bytes
 bin/templates/project/www/index.html               |   42 +-
 bin/templates/project/www/js/index.js              |   32 +-
 bin/templates/project/www/res/icon/cordova_128.png |  Bin 11401 -> 0 bytes
 bin/templates/project/www/res/icon/cordova_16.png  |  Bin 1699 -> 0 bytes
 bin/templates/project/www/res/icon/cordova_24.png  |  Bin 2215 -> 0 bytes
 bin/templates/project/www/res/icon/cordova_256.png |  Bin 27408 -> 0 bytes
 bin/templates/project/www/res/icon/cordova_32.png  |  Bin 2843 -> 0 bytes
 bin/templates/project/www/res/icon/cordova_48.png  |  Bin 4111 -> 0 bytes
 bin/templates/project/www/res/icon/cordova_512.png |  Bin 39830 -> 0 bytes
 bin/templates/project/www/res/icon/cordova_64.png  |  Bin 5463 -> 0 bytes
 .../project/www/res/icon/cordova_android_36.png    |  Bin 3096 -> 0 bytes
 .../project/www/res/icon/cordova_android_48.png    |  Bin 4090 -> 0 bytes
 .../project/www/res/icon/cordova_android_72.png    |  Bin 6080 -> 0 bytes
 .../project/www/res/icon/cordova_android_96.png    |  Bin 7685 -> 0 bytes
 .../project/www/res/icon/cordova_bb_80.png         |  Bin 7287 -> 0 bytes
 .../project/www/res/icon/cordova_ios_114.png       |  Bin 7869 -> 0 bytes
 .../project/www/res/icon/cordova_ios_144.png       |  Bin 11706 -> 0 bytes
 .../project/www/res/icon/cordova_ios_57.png        |  Bin 3908 -> 0 bytes
 .../project/www/res/icon/cordova_ios_72.png        |  Bin 4944 -> 0 bytes
 .../project/www/res/icon/ios/icon-57-2x.png        |  Bin 0 -> 7869 bytes
 bin/templates/project/www/res/icon/ios/icon-57.png |  Bin 0 -> 3908 bytes
 .../project/www/res/icon/ios/icon-72-2x.png        |  Bin 0 -> 11706 bytes
 bin/templates/project/www/res/icon/ios/icon-72.png |  Bin 0 -> 4944 bytes
 .../www/res/screen/android_hdpi_landscape.png      |  Bin 218302 -> 0 bytes
 .../www/res/screen/android_hdpi_portrait.png       |  Bin 222148 -> 0 bytes
 .../www/res/screen/android_ldpi_landscape.png      |  Bin 42616 -> 0 bytes
 .../www/res/screen/android_ldpi_portrait.png       |  Bin 42034 -> 0 bytes
 .../www/res/screen/android_mdpi_landscape.png      |  Bin 92347 -> 0 bytes
 .../www/res/screen/android_mdpi_portrait.png       |  Bin 90555 -> 0 bytes
 .../www/res/screen/android_xhdpi_landscape.png     |  Bin 489604 -> 0 bytes
 .../www/res/screen/android_xhdpi_portrait.png      |  Bin 504508 -> 0 bytes
 .../www/res/screen/blackberry_transparent_300.png  |  Bin 15823 -> 0 bytes
 .../www/res/screen/blackberry_transparent_400.png  |  Bin 11001 -> 0 bytes
 .../res/screen/ios/screen-ipad-landscape-2x.png    |  Bin 0 -> 1534088 bytes
 .../www/res/screen/ios/screen-ipad-landscape.png   |  Bin 0 -> 407370 bytes
 .../www/res/screen/ios/screen-ipad-portrait-2x.png |  Bin 0 -> 1610434 bytes
 .../www/res/screen/ios/screen-ipad-portrait.png    |  Bin 0 -> 422441 bytes
 .../res/screen/ios/screen-iphone-landscape-2x.png  |  Bin 0 -> 339639 bytes
 .../www/res/screen/ios/screen-iphone-landscape.png |  Bin 0 -> 92301 bytes
 .../res/screen/ios/screen-iphone-portrait-2x.png   |  Bin 0 -> 350593 bytes
 .../www/res/screen/ios/screen-iphone-portrait.png  |  Bin 0 -> 93897 bytes
 .../project/www/res/screen/ipad_landscape.png      |  Bin 407370 -> 0 bytes
 .../project/www/res/screen/ipad_portrait.png       |  Bin 422441 -> 0 bytes
 .../www/res/screen/ipad_retina_landscape.png       |  Bin 1534088 -> 0 bytes
 .../www/res/screen/ipad_retina_portrait.png        |  Bin 1610434 -> 0 bytes
 .../project/www/res/screen/iphone_landscape.png    |  Bin 92301 -> 0 bytes
 .../project/www/res/screen/iphone_portrait.png     |  Bin 93897 -> 0 bytes
 .../www/res/screen/iphone_retina_landscape.png     |  Bin 339639 -> 0 bytes
 .../www/res/screen/iphone_retina_portrait.png      |  Bin 350593 -> 0 bytes
 .../www/res/screen/windows_phone_portrait.jpg      |  Bin 11483 -> 0 bytes
 bin/templates/project/www/spec.html                |   18 +
 bin/templates/project/www/spec/helper.js           |   18 +
 bin/templates/project/www/spec/index.js            |   18 +
 62 files changed, 5483 insertions(+), 5411 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/f1fd9d2d/CordovaLib/Classes/CDVAvailability.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVAvailability.h b/CordovaLib/Classes/CDVAvailability.h
index c980ff8..e593bef 100644
--- a/CordovaLib/Classes/CDVAvailability.h
+++ b/CordovaLib/Classes/CDVAvailability.h
@@ -32,6 +32,7 @@
 #define __CORDOVA_1_8_1  10801
 #define __CORDOVA_1_9_0  10900
 #define __CORDOVA_2_0_0  20000
+#define __CORDOVA_2_1_0  20100
 #define __CORDOVA_NA     99999  /* not available */
 
 
@@ -43,7 +44,7 @@
  #endif
  */
 #ifndef CORDOVA_VERSION_MIN_REQUIRED
-    #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_2_0_0
+    #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_2_1_0
 #endif
 
 /* 

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/f1fd9d2d/CordovaLib/VERSION
----------------------------------------------------------------------
diff --git a/CordovaLib/VERSION b/CordovaLib/VERSION
index 359a5b9..112370a 100644
--- a/CordovaLib/VERSION
+++ b/CordovaLib/VERSION
@@ -1 +1 @@
-2.0.0
\ No newline at end of file
+2.1.0rc1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/f1fd9d2d/CordovaLib/javascript/cordova.ios.js
----------------------------------------------------------------------
diff --git a/CordovaLib/javascript/cordova.ios.js b/CordovaLib/javascript/cordova.ios.js
index a40e860..547f885 100644
--- a/CordovaLib/javascript/cordova.ios.js
+++ b/CordovaLib/javascript/cordova.ios.js
@@ -1,6 +1,6 @@
-// commit 7b33b31a909a156f7d59db40c6a04fce1a476c46
+// commit 69d652e9dcaaaf4bdaa55ec37329636dd5b20fbe
 
-// File generated at :: Mon Aug 20 2012 21:31:08 GMT-0400 (EDT)
+// File generated at :: Fri Aug 24 2012 16:42:37 GMT-0700 (PDT)
 
 /*
  Licensed to the Apache Software Foundation (ASF) under one
@@ -418,7 +418,8 @@ module.exports = {
 
 // file: lib/common/channel.js
 define("cordova/channel", function(require, exports, module) {
-var utils = require('cordova/utils');
+var utils = require('cordova/utils'),
+    nextGuid = 1;
 
 /**
  * Custom pub-sub "channel" that can have functions subscribed to it
@@ -470,7 +471,6 @@ var Channel = function(type, opts) {
     this.type = type;
     this.handlers = {};
     this.numHandlers = 0;
-    this.guid = 1;
     this.fired = false;
     this.enabled = true;
     this.events = {
@@ -563,19 +563,19 @@ Channel.prototype.subscribe = function(f, c, g) {
 
     g = g || func.observer_guid || f.observer_guid;
     if (!g) {
-        // first time we've seen this subscriber
-        g = this.guid++;
-    }
-    else {
-        // subscriber already handled; dont set it twice
-        return g;
+        // first time any channel has seen this subscriber
+        g = nextGuid++;
     }
     func.observer_guid = g;
     f.observer_guid = g;
-    this.handlers[g] = func;
-    this.numHandlers++;
-    if (this.events.onSubscribe) this.events.onSubscribe.call(this);
-    if (this.fired) func.call(this);
+
+    // Don't add the same handler more than once.
+    if (!this.handlers[g]) {
+        this.handlers[g] = func;
+        this.numHandlers++;
+        if (this.events.onSubscribe) this.events.onSubscribe.call(this);
+        if (this.fired) func.apply(this, this.fireArgs);
+    }
     return g;
 };
 
@@ -589,15 +589,14 @@ Channel.prototype.subscribeOnce = function(f, c) {
 
     var g = null;
     var _this = this;
-    var m = function() {
-        f.apply(c || null, arguments);
-        _this.unsubscribe(g);
-    };
     if (this.fired) {
-        if (typeof c == "object") { f = utils.close(c, f); }
-        f.apply(this, this.fireArgs);
+        f.apply(c || null, this.fireArgs);
     } else {
-        g = this.subscribe(m);
+        g = this.subscribe(function() {
+            _this.unsubscribe(g);
+            f.apply(c || null, arguments);
+        });
+        f.observer_guid = g;
     }
     return g;
 };
@@ -613,7 +612,6 @@ Channel.prototype.unsubscribe = function(g) {
     var handler = this.handlers[g];
     if (handler) {
         if (handler.observer_guid) handler.observer_guid=null;
-        this.handlers[g] = null;
         delete this.handlers[g];
         this.numHandlers--;
         if (this.events.onUnsubscribe) this.events.onUnsubscribe.call(this);
@@ -627,14 +625,17 @@ Channel.prototype.fire = function(e) {
     if (this.enabled) {
         var fail = false;
         this.fired = true;
+        this.fireArgs = arguments;
+        // Copy the values first so that it is safe to modify it from within
+        // callbacks.
+        var toCall = [];
         for (var item in this.handlers) {
-            var handler = this.handlers[item];
-            if (typeof handler == 'function') {
-                var rv = (handler.apply(this, arguments)===false);
-                fail = fail || rv;
-            }
+            toCall.push(this.handlers[item]);
+        }
+        for (var i = 0; i < toCall.length; ++i) {
+            var rv = (toCall[i].apply(this, arguments)===false);
+            fail = fail || rv;
         }
-        this.fireArgs = arguments;
         return !fail;
     }
     return true;
@@ -906,7 +907,7 @@ var cordova = require('cordova'),
         XHR_WITH_PAYLOAD: 2,
         XHR_OPTIONAL_PAYLOAD: 3
     },
-    bridgeMode = jsToNativeModes.IFRAME_NAV,
+    bridgeMode = jsToNativeModes.XHR_OPTIONAL_PAYLOAD,
     execIframe,
     execXhr;
 
@@ -2837,7 +2838,7 @@ FileWriter.prototype.seek = function(offset) {
     if (offset < 0) {
         this.position = Math.max(offset + this.length, 0);
     }
-    // Offset is bigger then file size so set position
+    // Offset is bigger than file size so set position
     // to the end of the file.
     else if (offset > this.length) {
         this.position = this.length;
@@ -3206,28 +3207,6 @@ MediaFile.prototype.getFormatData = function(successCallback, errorCallback) {
     }
 };
 
-// TODO: can we axe this?
-/**
- * Casts a PluginResult message property  (array of objects) to an array of MediaFile objects
- * (used in Objective-C and Android)
- *
- * @param {PluginResult} pluginResult
- */
-MediaFile.cast = function(pluginResult) {
-    var mediaFiles = [];
-    for (var i=0; i<pluginResult.message.length; i++) {
-        var mediaFile = new MediaFile();
-        mediaFile.name = pluginResult.message[i].name;
-        mediaFile.fullPath = pluginResult.message[i].fullPath;
-        mediaFile.type = pluginResult.message[i].type;
-        mediaFile.lastModifiedDate = pluginResult.message[i].lastModifiedDate;
-        mediaFile.size = pluginResult.message[i].size;
-        mediaFiles.push(mediaFile);
-    }
-    pluginResult.message = mediaFiles;
-    return pluginResult;
-};
-
 module.exports = MediaFile;
 
 });
@@ -3486,7 +3465,7 @@ var accelerometer = {
 
         if (running) {
             // If we're already running then immediately invoke the success callback
-            // but only if we have retreived a value, sample code does not check for null ...
+            // but only if we have retrieved a value, sample code does not check for null ...
             if(accel) {
                 successCallback(accel);
             }
@@ -4004,7 +3983,7 @@ var contacts = {
      * This function creates a new contact, but it does not persist the contact
      * to device storage. To persist the contact to device storage, invoke
      * contact.save().
-     * @param properties an object who's properties will be examined to create a new Contact
+     * @param properties an object whose properties will be examined to create a new Contact
      * @returns new Contact object
      */
     create:function(properties) {
@@ -4218,7 +4197,7 @@ var geolocation = {
         } else if (options.timeout === 0) {
             fail({
                 code:PositionError.TIMEOUT,
-                message:"timeout value in PositionOptions set to 0 and no cached Position object available, or cached Position object's age exceed's provided PositionOptions' maximumAge parameter."
+                message:"timeout value in PositionOptions set to 0 and no cached Position object available, or cached Position object's age exceeds provided PositionOptions' maximumAge parameter."
             });
         // Otherwise we have to call into native to retrieve a position.
         } else {
@@ -4677,7 +4656,7 @@ CurrentLevel = LevelsMap.WARN;
  *
  * The value used determines which messages get printed.  The logging
  * values above are in order, and only messages logged at the logging
- * level or above will actually be displayed to the user.  Eg, the
+ * level or above will actually be displayed to the user.  E.g., the
  * default level is WARN, so only messages logged with LOG, ERROR, or
  * WARN will be displayed; INFO and DEBUG messages will be ignored.
  */

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/f1fd9d2d/bin/templates/project/www/config.xml
----------------------------------------------------------------------
diff --git a/bin/templates/project/www/config.xml b/bin/templates/project/www/config.xml
deleted file mode 100644
index a7e35db..0000000
--- a/bin/templates/project/www/config.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns     = "http://www.w3.org/ns/widgets"
-        xmlns:gap = "http://phonegap.com/ns/1.0"
-        id        = "io.cordova.hello-cordova"
-        version   = "2.0.0">
-    <name>Hello Cordova</name>
-
-    <description>
-        A sample Apache Cordova application that responds to the deviceready event.
-    </description>
-
-    <author href="http://cordova.io" email="callback-dev@incubator.apache.org">
-        Apache Cordova Team
-    </author>
-
-    <icon src="res/icon/cordova_512.png"        width="512" height="512" />
-    <icon src="res/icon/cordova_android_96.png" width="96"  height="96"  gap:platform="android" />
-    <icon src="res/icon/cordova_bb_80.png"      width="80"  height="80"  gap:platform="blackberry" />
-    <icon src="res/icon/cordova_ios_144.png"    width="144" height="144" gap:platform="ios" />
-
-    <gap:splash src="res/screen/android_hdpi_landscape.png"      width="800"  height="480"  gap:platform="android" />
-    <gap:splash src="res/screen/android_hdpi_portrait.png"       width="480"  height="800"  gap:platform="android" />
-    <gap:splash src="res/screen/android_ldpi_landscape.png"      width="320"  height="200"  gap:platform="android" />
-    <gap:splash src="res/screen/android_ldpi_portrait.png"       width="200"  height="320"  gap:platform="android" />
-    <gap:splash src="res/screen/android_mdpi_landscape.png"      width="480"  height="320"  gap:platform="android" />
-    <gap:splash src="res/screen/android_mdpi_portrait.png"       width="320"  height="480"  gap:platform="android" />
-    <gap:splash src="res/screen/android_xhdpi_landscape.png"     width="1280" height="720"  gap:platform="android" />
-    <gap:splash src="res/screen/android_xhdpi_portrait.png"      width="720"  height="1280" gap:platform="android" />
-    <gap:splash src="res/screen/blackberry_transparent_300.png"  width="300"  height="300"  gap:platform="blackberry" />
-    <gap:splash src="res/screen/blackberry_transparent_400.png"  width="200"  height="200"  gap:platform="blackberry" />
-    <gap:splash src="res/screen/ipad_landscape.png"              width="1024" height="748"  gap:platform="ios" />
-    <gap:splash src="res/screen/ipad_portrait.png"               width="768"  height="1004" gap:platform="ios" />
-    <gap:splash src="res/screen/ipad_retina_landscape.png"       width="2048" height="1496" gap:platform="ios" />
-    <gap:splash src="res/screen/ipad_retina_portrait.png"        width="1536" height="2008" gap:platform="ios" />
-    <gap:splash src="res/screen/iphone_landscape.png"            width="480"  height="320"  gap:platform="ios" />
-    <gap:splash src="res/screen/iphone_portrait.png"             width="320"  height="480"  gap:platform="ios" />
-    <gap:splash src="res/screen/iphone_retina_landscape.png"     width="960"  height="640"  gap:platform="ios" />
-    <gap:splash src="res/screen/iphone_retina_portrait.png"      width="640"  height="960"  gap:platform="ios" />
-    <gap:splash src="res/screen/windows_phone_portrait.jpg"      width="480"  height="800"  gap:platform="winphone" />
-
-    <feature name="http://api.phonegap.com/1.0/device" />
-
-    <preference name="phonegap-version" value="1.9.0" />
-    <preference name="orientation"      value="default" />
-    <preference name="target-device"    value="universal" />
-    <preference name="fullscreen"       value="false" />
-</widget>