incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tim...@apache.org
Subject webworks commit: Updating to 1.8.0
Date Tue, 05 Jun 2012 21:44:52 GMT
Updated Branches:
  refs/heads/master 69321e879 -> 7c610d645


Updating to 1.8.0


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/commit/7c610d64
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/tree/7c610d64
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/diff/7c610d64

Branch: refs/heads/master
Commit: 7c610d64540744951687810114e7768a3fe5dcdd
Parents: 69321e8
Author: Tim Kim <tim.kim@nitobi.com>
Authored: Tue Jun 5 14:43:23 2012 -0700
Committer: Tim Kim <tim.kim@nitobi.com>
Committed: Tue Jun 5 14:43:23 2012 -0700

----------------------------------------------------------------------
 VERSION                                            |    2 +-
 .../ext/src/org/apache/cordova/device/Device.java  |    2 +-
 javascript/cordova.blackberry.js                   |   75 +++++++++++---
 javascript/cordova.playbook.js                     |   79 +++++++++++---
 4 files changed, 124 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/7c610d64/VERSION
----------------------------------------------------------------------
diff --git a/VERSION b/VERSION
index 92f201f..27f9cd3 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.8.0rc1
+1.8.0

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/7c610d64/framework/ext/src/org/apache/cordova/device/Device.java
----------------------------------------------------------------------
diff --git a/framework/ext/src/org/apache/cordova/device/Device.java b/framework/ext/src/org/apache/cordova/device/Device.java
index f9b6b9b..7aaff29 100644
--- a/framework/ext/src/org/apache/cordova/device/Device.java
+++ b/framework/ext/src/org/apache/cordova/device/Device.java
@@ -53,7 +53,7 @@ public final class Device extends Plugin {
 				JSONObject device = new JSONObject();
 				device.put( FIELD_PLATFORM, new String(DeviceInfo.getPlatformVersion() ) );
 				device.put( FIELD_UUID, new Integer( DeviceInfo.getDeviceId()) );
-				device.put( FIELD_CORDOVA, "1.8.0rc1" );
+				device.put( FIELD_CORDOVA, "1.8.0" );
 				device.put( FIELD_NAME, new String(DeviceInfo.getDeviceName()) );
 				device.put( FIELD_VERSION, new String(DeviceInfo.getSoftwareVersion()) );
 				result = new PluginResult(PluginResult.Status.OK, device);

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/7c610d64/javascript/cordova.blackberry.js
----------------------------------------------------------------------
diff --git a/javascript/cordova.blackberry.js b/javascript/cordova.blackberry.js
index b347541..a70b153 100644
--- a/javascript/cordova.blackberry.js
+++ b/javascript/cordova.blackberry.js
@@ -1,6 +1,6 @@
-// commit eab1ae45c970f66068784cb614bf544508e0654a
+// commit ac0a3990438f4a89faa993316fb5614f61cf3be6
 
-// File generated at :: Fri May 25 2012 13:45:45 GMT-0700 (PDT)
+// File generated at :: Tue Jun 05 2012 14:11:27 GMT-0700 (PDT)
 
 /*
  Licensed to the Apache Software Foundation (ASF) under one
@@ -77,7 +77,7 @@ var channel = require('cordova/channel');
 document.addEventListener('DOMContentLoaded', function() {
     channel.onDOMContentLoaded.fire();
 }, false);
-if (document.readyState == 'complete') {
+if (document.readyState == 'complete' || document.readyState == 'interactive') {
     channel.onDOMContentLoaded.fire();
 }
 
@@ -99,7 +99,11 @@ var documentEventHandlers = {},
 document.addEventListener = function(evt, handler, capture) {
     var e = evt.toLowerCase();
     if (typeof documentEventHandlers[e] != 'undefined') {
-        documentEventHandlers[e].subscribe(handler);
+        if (evt === 'deviceready') {
+            documentEventHandlers[e].subscribeOnce(handler);
+        } else {
+            documentEventHandlers[e].subscribe(handler);
+        }
     } else {
         m_document_addEventListener.call(document, evt, handler, capture);
     }
@@ -504,7 +508,7 @@ var Channel = function(type, opts) {
     this.type = type;
     this.handlers = {};
     this.numHandlers = 0;
-    this.guid = 0;
+    this.guid = 1;
     this.fired = false;
     this.enabled = true;
     this.events = {
@@ -595,12 +599,21 @@ Channel.prototype.subscribe = function(f, c, g) {
     var func = f;
     if (typeof c == "object") { func = utils.close(c, f); }
 
-    g = g || func.observer_guid || f.observer_guid || this.guid++;
+    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;
+    }
     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);
     return g;
 };
 
@@ -637,6 +650,7 @@ Channel.prototype.unsubscribe = function(g) {
     if (typeof g == 'function') { g = g.observer_guid; }
     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--;
@@ -779,6 +793,9 @@ module.exports = {
         Camera:{
             path: 'cordova/plugin/CameraConstants'
         },
+        CameraPopoverOptions: {
+            path: 'cordova/plugin/CameraPopoverOptions'
+        },
         CaptureError: {
             path: 'cordova/plugin/CaptureError'
         },
@@ -1312,6 +1329,26 @@ module.exports = {
 };
 });
 
+// file: lib/common/plugin/CameraPopoverOptions.js
+define("cordova/plugin/CameraPopoverOptions", function(require, exports, module) {
+var Camera = require('cordova/plugin/CameraConstants');
+
+/**
+ * Encapsulates options for iOS Popover image picker
+ */
+var CameraPopoverOptions = function(x,y,width,height,arrowDir){
+    // information of rectangle that popover should be anchored to
+    this.x = x || 0;
+    this.y = y || 32;
+    this.width = width || 320;
+    this.height = height || 480;
+    // The direction of the popover arrow
+    this.arrowDir = arrowDir || Camera.PopoverArrowDirection.ARROW_ANY;
+};
+
+module.exports = CameraPopoverOptions;
+});
+
 // file: lib/common/plugin/CaptureAudioOptions.js
 define("cordova/plugin/CaptureAudioOptions", function(require, exports, module) {
 /**
@@ -3310,7 +3347,7 @@ var Position = function(coords, timestamp) {
     } else {
         this.coords = new Coordinates();
     }
-    this.timestamp = (timestamp !== undefined) ? timestamp : new Date().getTime();
+    this.timestamp = (timestamp !== undefined) ? timestamp : new Date();
 };
 
 module.exports = Position;
@@ -5539,7 +5576,7 @@ var geolocation = {
                     velocity:p.velocity,
                     altitudeAccuracy:p.altitudeAccuracy
                 },
-                p.timestamp || new Date()
+                (p.timestamp === undefined ? new Date() : ((p.timestamp instanceof Date)
? p.timestamp : new Date(p.timestamp)))
             );
             geolocation.lastPosition = pos;
             successCallback(pos);
@@ -5623,7 +5660,7 @@ var geolocation = {
                     velocity:p.velocity,
                     altitudeAccuracy:p.altitudeAccuracy
                 },
-                p.timestamp || new Date()
+                (p.timestamp === undefined ? new Date() : ((p.timestamp instanceof Date)
? p.timestamp : new Date(p.timestamp)))
             );
             geolocation.lastPosition = pos;
             successCallback(pos);
@@ -6255,9 +6292,10 @@ utils.format = function(formatString /* ,... */) {
 utils.vformat = function(formatString, args) {
     if (formatString === null || formatString === undefined) return "";
     if (arguments.length == 1) return formatString.toString();
+    if (typeof formatString != "string") return formatString.toString();
 
     var pattern = /(.*?)%(.)(.*)/;
-    var rest    = formatString.toString();
+    var rest    = formatString;
     var result  = [];
 
     while (args.length) {
@@ -6300,13 +6338,20 @@ function UUIDcreatePart(length) {
 //------------------------------------------------------------------------------
 function formatted(object, formatChar) {
 
-    switch(formatChar) {
-        case 'j':
-        case 'o': return JSON.stringify(object);
-        case 'c': return '';
+    try {
+        switch(formatChar) {
+            case 'j':
+            case 'o': return JSON.stringify(object);
+            case 'c': return '';
+        }
+    }
+    catch (e) {
+        return "error JSON.stringify()ing argument: " + e;
     }
 
-    if (null === object) return Object.prototype.toString.call(object);
+    if ((object === null) || (object === undefined)) {
+        return Object.prototype.toString.call(object);
+    }
 
     return object.toString();
 }

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/7c610d64/javascript/cordova.playbook.js
----------------------------------------------------------------------
diff --git a/javascript/cordova.playbook.js b/javascript/cordova.playbook.js
index 9a35ccf..9021706 100644
--- a/javascript/cordova.playbook.js
+++ b/javascript/cordova.playbook.js
@@ -1,6 +1,6 @@
-// commit eab1ae45c970f66068784cb614bf544508e0654a
+// commit ac0a3990438f4a89faa993316fb5614f61cf3be6
 
-// File generated at :: Fri May 25 2012 13:45:45 GMT-0700 (PDT)
+// File generated at :: Tue Jun 05 2012 14:11:27 GMT-0700 (PDT)
 
 /*
  Licensed to the Apache Software Foundation (ASF) under one
@@ -77,7 +77,7 @@ var channel = require('cordova/channel');
 document.addEventListener('DOMContentLoaded', function() {
     channel.onDOMContentLoaded.fire();
 }, false);
-if (document.readyState == 'complete') {
+if (document.readyState == 'complete' || document.readyState == 'interactive') {
     channel.onDOMContentLoaded.fire();
 }
 
@@ -99,7 +99,11 @@ var documentEventHandlers = {},
 document.addEventListener = function(evt, handler, capture) {
     var e = evt.toLowerCase();
     if (typeof documentEventHandlers[e] != 'undefined') {
-        documentEventHandlers[e].subscribe(handler);
+        if (evt === 'deviceready') {
+            documentEventHandlers[e].subscribeOnce(handler);
+        } else {
+            documentEventHandlers[e].subscribe(handler);
+        }
     } else {
         m_document_addEventListener.call(document, evt, handler, capture);
     }
@@ -504,7 +508,7 @@ var Channel = function(type, opts) {
     this.type = type;
     this.handlers = {};
     this.numHandlers = 0;
-    this.guid = 0;
+    this.guid = 1;
     this.fired = false;
     this.enabled = true;
     this.events = {
@@ -595,12 +599,21 @@ Channel.prototype.subscribe = function(f, c, g) {
     var func = f;
     if (typeof c == "object") { func = utils.close(c, f); }
 
-    g = g || func.observer_guid || f.observer_guid || this.guid++;
+    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;
+    }
     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);
     return g;
 };
 
@@ -637,6 +650,7 @@ Channel.prototype.unsubscribe = function(g) {
     if (typeof g == 'function') { g = g.observer_guid; }
     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--;
@@ -779,6 +793,9 @@ module.exports = {
         Camera:{
             path: 'cordova/plugin/CameraConstants'
         },
+        CameraPopoverOptions: {
+            path: 'cordova/plugin/CameraPopoverOptions'
+        },
         CaptureError: {
             path: 'cordova/plugin/CaptureError'
         },
@@ -1148,6 +1165,26 @@ module.exports = {
 };
 });
 
+// file: lib/common/plugin/CameraPopoverOptions.js
+define("cordova/plugin/CameraPopoverOptions", function(require, exports, module) {
+var Camera = require('cordova/plugin/CameraConstants');
+
+/**
+ * Encapsulates options for iOS Popover image picker
+ */
+var CameraPopoverOptions = function(x,y,width,height,arrowDir){
+    // information of rectangle that popover should be anchored to
+    this.x = x || 0;
+    this.y = y || 32;
+    this.width = width || 320;
+    this.height = height || 480;
+    // The direction of the popover arrow
+    this.arrowDir = arrowDir || Camera.PopoverArrowDirection.ARROW_ANY;
+};
+
+module.exports = CameraPopoverOptions;
+});
+
 // file: lib/common/plugin/CaptureAudioOptions.js
 define("cordova/plugin/CaptureAudioOptions", function(require, exports, module) {
 /**
@@ -3146,7 +3183,7 @@ var Position = function(coords, timestamp) {
     } else {
         this.coords = new Coordinates();
     }
-    this.timestamp = (timestamp !== undefined) ? timestamp : new Date().getTime();
+    this.timestamp = (timestamp !== undefined) ? timestamp : new Date();
 };
 
 module.exports = Position;
@@ -3974,7 +4011,7 @@ var geolocation = {
                     velocity:p.velocity,
                     altitudeAccuracy:p.altitudeAccuracy
                 },
-                p.timestamp || new Date()
+                (p.timestamp === undefined ? new Date() : ((p.timestamp instanceof Date)
? p.timestamp : new Date(p.timestamp)))
             );
             geolocation.lastPosition = pos;
             successCallback(pos);
@@ -4058,7 +4095,7 @@ var geolocation = {
                     velocity:p.velocity,
                     altitudeAccuracy:p.altitudeAccuracy
                 },
-                p.timestamp || new Date()
+                (p.timestamp === undefined ? new Date() : ((p.timestamp instanceof Date)
? p.timestamp : new Date(p.timestamp)))
             );
             geolocation.lastPosition = pos;
             successCallback(pos);
@@ -4534,7 +4571,7 @@ var webworks = require('cordova/plugin/webworks/manager'),
                             "name" : blackberry.system.model,
                             "uuid" : blackberry.identity.PIN,
                             "platform" : "PlayBook",
-                            "cordova" : "1.8.0rc1"
+                            "cordova" : "1.8.0"
                         }
                 };
             }
@@ -5046,9 +5083,10 @@ utils.format = function(formatString /* ,... */) {
 utils.vformat = function(formatString, args) {
     if (formatString === null || formatString === undefined) return "";
     if (arguments.length == 1) return formatString.toString();
+    if (typeof formatString != "string") return formatString.toString();
 
     var pattern = /(.*?)%(.)(.*)/;
-    var rest    = formatString.toString();
+    var rest    = formatString;
     var result  = [];
 
     while (args.length) {
@@ -5091,13 +5129,20 @@ function UUIDcreatePart(length) {
 //------------------------------------------------------------------------------
 function formatted(object, formatChar) {
 
-    switch(formatChar) {
-        case 'j':
-        case 'o': return JSON.stringify(object);
-        case 'c': return '';
+    try {
+        switch(formatChar) {
+            case 'j':
+            case 'o': return JSON.stringify(object);
+            case 'c': return '';
+        }
+    }
+    catch (e) {
+        return "error JSON.stringify()ing argument: " + e;
     }
 
-    if (null === object) return Object.prototype.toString.call(object);
+    if ((object === null) || (object === undefined)) {
+        return Object.prototype.toString.call(object);
+    }
 
     return object.toString();
 }
@@ -5164,4 +5209,4 @@ window.cordova = require('cordova');
 // file: lib/scripts/bootstrap-playbook.js
 require('cordova/channel').onNativeReady.fire();
 
-})();
+})();
\ No newline at end of file


Mime
View raw message