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 2014/08/21 01:30:42 UTC

[1/5] android commit: Revert "Update JS snapshot to version 3.5.0 (via coho)"

Repository: cordova-android
Updated Branches:
  refs/heads/3.5.x f89e63bc2 -> 8784ce454


Revert "Update JS snapshot to version 3.5.0 (via coho)"

This reverts commit f89e63bc2e7a7a233e96491e96fc3e5ffe79392e.


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/98d6176c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/98d6176c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/98d6176c

Branch: refs/heads/3.5.x
Commit: 98d6176cb5c61355277059505ab6b3e0417240ab
Parents: f89e63b
Author: Steven Gill <st...@gmail.com>
Authored: Wed Aug 20 16:27:37 2014 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Wed Aug 20 16:27:37 2014 -0700

----------------------------------------------------------------------
 framework/assets/www/cordova.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/98d6176c/framework/assets/www/cordova.js
----------------------------------------------------------------------
diff --git a/framework/assets/www/cordova.js b/framework/assets/www/cordova.js
index a791995..2c4b681 100644
--- a/framework/assets/www/cordova.js
+++ b/framework/assets/www/cordova.js
@@ -1,5 +1,5 @@
 // Platform: android
-// 3.6.0-dev-ff0358b
+// 6e7d6458852630c595a2e73c8e99da9b18fe8794
 /*
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
@@ -19,7 +19,7 @@
  under the License.
 */
 ;(function() {
-var CORDOVA_JS_BUILD_LABEL = '3.6.0-dev-ff0358b';
+var PLATFORM_VERSION_BUILD_LABEL = '3.5.0';
 // file: src/scripts/require.js
 
 /*jshint -W079 */
@@ -175,7 +175,8 @@ function createEvent(type, data) {
 var cordova = {
     define:define,
     require:require,
-    version:CORDOVA_JS_BUILD_LABEL,
+    version:PLATFORM_VERSION_BUILD_LABEL,
+    platformVersion:PLATFORM_VERSION_BUILD_LABEL,
     platformId:platform.id,
     /**
      * Methods to add/remove your own addEventListener hijacking on document + window.


[2/5] android commit: Revert "Update JS snapshot to version 3.5.0 (via coho)"

Posted by st...@apache.org.
Revert "Update JS snapshot to version 3.5.0 (via coho)"

This reverts commit bd30fdbda8c07349bdb90f9caf1ef8f3cddd17d1.


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/8c583065
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/8c583065
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/8c583065

Branch: refs/heads/3.5.x
Commit: 8c583065bd3a2260d477257210ff4e4f2c547df2
Parents: 98d6176
Author: Steven Gill <st...@gmail.com>
Authored: Wed Aug 20 16:27:55 2014 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Wed Aug 20 16:27:55 2014 -0700

----------------------------------------------------------------------
 framework/assets/www/cordova.js | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/8c583065/framework/assets/www/cordova.js
----------------------------------------------------------------------
diff --git a/framework/assets/www/cordova.js b/framework/assets/www/cordova.js
index 2c4b681..a791995 100644
--- a/framework/assets/www/cordova.js
+++ b/framework/assets/www/cordova.js
@@ -1,5 +1,5 @@
 // Platform: android
-// 6e7d6458852630c595a2e73c8e99da9b18fe8794
+// 3.6.0-dev-ff0358b
 /*
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
@@ -19,7 +19,7 @@
  under the License.
 */
 ;(function() {
-var PLATFORM_VERSION_BUILD_LABEL = '3.5.0';
+var CORDOVA_JS_BUILD_LABEL = '3.6.0-dev-ff0358b';
 // file: src/scripts/require.js
 
 /*jshint -W079 */
@@ -175,8 +175,7 @@ function createEvent(type, data) {
 var cordova = {
     define:define,
     require:require,
-    version:PLATFORM_VERSION_BUILD_LABEL,
-    platformVersion:PLATFORM_VERSION_BUILD_LABEL,
+    version:CORDOVA_JS_BUILD_LABEL,
     platformId:platform.id,
     /**
      * Methods to add/remove your own addEventListener hijacking on document + window.


[3/5] android commit: Revert "Update JS snapshot to version 3.5.0 (via coho)"

Posted by st...@apache.org.
Revert "Update JS snapshot to version 3.5.0 (via coho)"

This reverts commit 5ed35eeabb417020e1c26a295809a0ad363725a1.


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/66419af8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/66419af8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/66419af8

Branch: refs/heads/3.5.x
Commit: 66419af8b0408ae05a15b8c8d60f6788bc10b5be
Parents: 8c58306
Author: Steven Gill <st...@gmail.com>
Authored: Wed Aug 20 16:28:05 2014 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Wed Aug 20 16:28:05 2014 -0700

----------------------------------------------------------------------
 framework/assets/www/cordova.js | 112 ++++++++++++-----------------------
 1 file changed, 37 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/66419af8/framework/assets/www/cordova.js
----------------------------------------------------------------------
diff --git a/framework/assets/www/cordova.js b/framework/assets/www/cordova.js
index a791995..b2103fb 100644
--- a/framework/assets/www/cordova.js
+++ b/framework/assets/www/cordova.js
@@ -1,5 +1,5 @@
 // Platform: android
-// 3.6.0-dev-ff0358b
+// 3.5.0
 /*
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
@@ -19,7 +19,7 @@
  under the License.
 */
 ;(function() {
-var CORDOVA_JS_BUILD_LABEL = '3.6.0-dev-ff0358b';
+var CORDOVA_JS_BUILD_LABEL = '3.5.0';
 // file: src/scripts/require.js
 
 /*jshint -W079 */
@@ -265,7 +265,7 @@ var cordova = {
         try {
             cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback);
         } catch (e) {
-            console.log("Error in success callback: " + callbackId + " = "+e);
+            console.log("Error in error callback: " + callbackId + " = "+e);
         }
     },
 
@@ -344,18 +344,18 @@ define("cordova/android/promptbasednativeapi", function(require, exports, module
 
 /**
  * Implements the API of ExposedJsApi.java, but uses prompt() to communicate.
- * This is used pre-JellyBean, where addJavascriptInterface() is disabled.
+ * This is used only on the 2.3 simulator, where addJavascriptInterface() is broken.
  */
 
 module.exports = {
-    exec: function(bridgeSecret, service, action, callbackId, argsJson) {
-        return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId]));
+    exec: function(service, action, callbackId, argsJson) {
+        return prompt(argsJson, 'gap:'+JSON.stringify([service, action, callbackId]));
     },
-    setNativeToJsBridgeMode: function(bridgeSecret, value) {
-        prompt(value, 'gap_bridge_mode:' + bridgeSecret);
+    setNativeToJsBridgeMode: function(value) {
+        prompt(value, 'gap_bridge_mode:');
     },
-    retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) {
-        return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret);
+    retrieveJsMessages: function(fromOnlineEvent) {
+        return prompt(+fromOnlineEvent, 'gap_poll:');
     }
 };
 
@@ -869,10 +869,13 @@ var cordova = require('cordova'),
     nativeApiProvider = require('cordova/android/nativeapiprovider'),
     utils = require('cordova/utils'),
     base64 = require('cordova/base64'),
-    channel = require('cordova/channel'),
     jsToNativeModes = {
         PROMPT: 0,
-        JS_OBJECT: 1
+        JS_OBJECT: 1,
+        // This mode is currently for benchmarking purposes only. It must be enabled
+        // on the native side through the ENABLE_LOCATION_CHANGE_EXEC_MODE
+        // constant within CordovaWebViewClient.java before it will work.
+        LOCATION_CHANGE: 2
     },
     nativeToJsModes = {
         // Polls for messages using the JS->Native bridge.
@@ -892,17 +895,9 @@ var cordova = require('cordova'),
     jsToNativeBridgeMode,  // Set lazily.
     nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT,
     pollEnabled = false,
-    messagesFromNative = [],
-    bridgeSecret = -1;
+    messagesFromNative = [];
 
 function androidExec(success, fail, service, action, args) {
-    if (bridgeSecret < 0) {
-        // If we ever catch this firing, we'll need to queue up exec()s
-        // and fire them once we get a secret. For now, I don't think
-        // it's possible for exec() to be called since plugins are parsed but
-        // not run until until after onNativeReady.
-        throw new Error('exec() called without bridgeSecret');
-    }
     // Set default bridge modes if they have not already been set.
     // By default, we use the failsafe, since addJavascriptInterface breaks too often
     if (jsToNativeBridgeMode === undefined) {
@@ -923,35 +918,29 @@ function androidExec(success, fail, service, action, args) {
         cordova.callbacks[callbackId] = {success:success, fail:fail};
     }
 
-    var messages = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson);
-    // If argsJson was received by Java as null, try again with the PROMPT bridge mode.
-    // This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2.  See CB-2666.
-    if (jsToNativeBridgeMode == jsToNativeModes.JS_OBJECT && messages === "@Null arguments.") {
-        androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT);
-        androidExec(success, fail, service, action, args);
-        androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
-        return;
+    if (jsToNativeBridgeMode == jsToNativeModes.LOCATION_CHANGE) {
+        window.location = 'http://cdv_exec/' + service + '#' + action + '#' + callbackId + '#' + argsJson;
     } else {
-        androidExec.processMessages(messages, true);
+        var messages = nativeApiProvider.get().exec(service, action, callbackId, argsJson);
+        // If argsJson was received by Java as null, try again with the PROMPT bridge mode.
+        // This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2.  See CB-2666.
+        if (jsToNativeBridgeMode == jsToNativeModes.JS_OBJECT && messages === "@Null arguments.") {
+            androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT);
+            androidExec(success, fail, service, action, args);
+            androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
+            return;
+        } else {
+            androidExec.processMessages(messages, true);
+        }
     }
 }
 
-androidExec.init = function() {
-    bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode);
-    channel.onNativeReady.fire();
-};
-
 function pollOnceFromOnlineEvent() {
     pollOnce(true);
 }
 
 function pollOnce(opt_fromOnlineEvent) {
-    if (bridgeSecret < 0) {
-        // This can happen when the NativeToJsMessageQueue resets the online state on page transitions.
-        // We know there's nothing to retrieve, so no need to poll.
-        return;
-    }
-    var msg = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent);
+    var msg = nativeApiProvider.get().retrieveJsMessages(!!opt_fromOnlineEvent);
     androidExec.processMessages(msg);
 }
 
@@ -1001,10 +990,7 @@ androidExec.setNativeToJsBridgeMode = function(mode) {
 
     nativeToJsBridgeMode = mode;
     // Tell the native side to switch modes.
-    // Otherwise, it will be set by androidExec.init()
-    if (bridgeSecret >= 0) {
-        nativeApiProvider.get().setNativeToJsBridgeMode(bridgeSecret, mode);
-    }
+    nativeApiProvider.get().setNativeToJsBridgeMode(mode);
 
     if (mode == nativeToJsModes.POLLING) {
         pollEnabled = true;
@@ -1479,8 +1465,10 @@ module.exports = {
             exec = require('cordova/exec'),
             modulemapper = require('cordova/modulemapper');
 
-        // Get the shared secret needed to use the bridge.
-        exec.init();
+        // Tell the native code that a page change has occurred.
+        exec(null, null, 'PluginManager', 'startup', []);
+        // Tell the JS that the native side is ready.
+        channel.onNativeReady.fire();
 
         // TODO: Extract this as a proper plugin.
         modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app');
@@ -1497,17 +1485,6 @@ module.exports = {
         cordova.addDocumentEventHandler('menubutton');
         cordova.addDocumentEventHandler('searchbutton');
 
-        function bindButtonChannel(buttonName) {
-            // generic button bind used for volumeup/volumedown buttons
-            var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button');
-            volumeButtonChannel.onHasSubscribersChange = function() {
-                exec(null, null, "App", "overrideButton", [buttonName, this.numHandlers == 1]);
-            };
-        }
-        // Inject a listener for the volume buttons on the document.
-        bindButtonChannel('volumeup');
-        bindButtonChannel('volumedown');
-
         // Let native code know we are all done on the JS side.
         // Native code will then un-hide the WebView.
         channel.onCordovaReady.subscribe(function() {
@@ -1586,21 +1563,6 @@ module.exports = {
     },
 
     /**
-    * Override the default behavior of the Android volume button.
-    * If overridden, when the volume button is pressed, the "volume[up|down]button"
-    * JavaScript event will be fired.
-    *
-    * Note: The user should not have to call this method.  Instead, when the user
-    *       registers for the "volume[up|down]button" event, this is automatically done.
-    *
-    * @param button          volumeup, volumedown
-    * @param override        T=override, F=cancel override
-    */
-    overrideButton:function(button, override) {
-        exec(null, null, "App", "overrideButton", [button, override]);
-    },
-
-    /**
     * Exit and terminate the application.
     */
     exitApp:function() {
@@ -1693,11 +1655,11 @@ function handlePluginsObject(path, moduleList, finishPluginLoading) {
 function findCordovaPath() {
     var path = null;
     var scripts = document.getElementsByTagName('script');
-    var term = '/cordova.js';
+    var term = 'cordova.js';
     for (var n = scripts.length-1; n>-1; n--) {
         var src = scripts[n].src.replace(/\?.*$/, ''); // Strip any query param (CB-6007).
         if (src.indexOf(term) == (src.length - term.length)) {
-            path = src.substring(0, src.length - term.length) + '/';
+            path = src.substring(0, src.length - term.length);
             break;
         }
     }


[5/5] android commit: reverted accidental commits

Posted by st...@apache.org.
reverted accidental commits


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/8784ce45
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/8784ce45
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/8784ce45

Branch: refs/heads/3.5.x
Commit: 8784ce454c072b86360b1d8c87dcdf8c7df4609d
Parents: 2e65ac5
Author: Steven Gill <st...@gmail.com>
Authored: Wed Aug 20 16:30:32 2014 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Wed Aug 20 16:30:32 2014 -0700

----------------------------------------------------------------------
 framework/assets/www/cordova.js | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/8784ce45/framework/assets/www/cordova.js
----------------------------------------------------------------------
diff --git a/framework/assets/www/cordova.js b/framework/assets/www/cordova.js
index b2103fb..b3934c3 100644
--- a/framework/assets/www/cordova.js
+++ b/framework/assets/www/cordova.js
@@ -1,5 +1,9 @@
 // Platform: android
+<<<<<<< HEAD
+// 3.5.1
+=======
 // 3.5.0
+>>>>>>> parent of 5ed35ee... Update JS snapshot to version 3.5.0 (via coho)
 /*
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
@@ -19,7 +23,11 @@
  under the License.
 */
 ;(function() {
+<<<<<<< HEAD
+var CORDOVA_JS_BUILD_LABEL = '3.5.1';
+=======
 var CORDOVA_JS_BUILD_LABEL = '3.5.0';
+>>>>>>> parent of 5ed35ee... Update JS snapshot to version 3.5.0 (via coho)
 // file: src/scripts/require.js
 
 /*jshint -W079 */


[4/5] android commit: Revert "Set VERSION to 3.5.0 (via coho)"

Posted by st...@apache.org.
Revert "Set VERSION to 3.5.0 (via coho)"

This reverts commit 503c0480ed841df8def157bce1bc00d566b23368.


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/2e65ac53
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/2e65ac53
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/2e65ac53

Branch: refs/heads/3.5.x
Commit: 2e65ac53d73caefd947c7214d0ffed64bd2d888a
Parents: 66419af
Author: Steven Gill <st...@gmail.com>
Authored: Wed Aug 20 16:28:56 2014 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Wed Aug 20 16:28:56 2014 -0700

----------------------------------------------------------------------
 VERSION                                         |  2 +-
 bin/templates/cordova/version                   |  2 +-
 .../src/org/apache/cordova/CordovaWebView.java  |  2 +-
 package.json                                    | 40 ++++++++++----------
 4 files changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/2e65ac53/VERSION
----------------------------------------------------------------------
diff --git a/VERSION b/VERSION
index 1545d96..d5c0c99 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.5.0
+3.5.1

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/2e65ac53/bin/templates/cordova/version
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/version b/bin/templates/cordova/version
index f935529..5e6be24 100755
--- a/bin/templates/cordova/version
+++ b/bin/templates/cordova/version
@@ -20,6 +20,6 @@
 */
 
 // Coho updates this line:
-var VERSION = "3.5.0";
+var VERSION = "3.5.1";
 
 console.log(VERSION);

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/2e65ac53/framework/src/org/apache/cordova/CordovaWebView.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java
index c6a7023..86ef2ab 100755
--- a/framework/src/org/apache/cordova/CordovaWebView.java
+++ b/framework/src/org/apache/cordova/CordovaWebView.java
@@ -68,7 +68,7 @@ import android.widget.FrameLayout;
 public class CordovaWebView extends WebView {
 
     public static final String TAG = "CordovaWebView";
-    public static final String CORDOVA_VERSION = "3.5.0";
+    public static final String CORDOVA_VERSION = "3.5.1";
 
     private ArrayList<Integer> keyDownCodes = new ArrayList<Integer>();
     private ArrayList<Integer> keyUpCodes = new ArrayList<Integer>();

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/2e65ac53/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 12408e9..9c3c786 100644
--- a/package.json
+++ b/package.json
@@ -1,21 +1,21 @@
 {
-    "name": "cordova-android",
-    "version": "3.5.0",
-    "description": "cordova-android release",
-    "main": "bin/create",
-    "repository": {
-        "type": "git",
-        "url": "https://git-wip-us.apache.org/repos/asf/cordova-android.git"
-    },
-    "keywords": [
-        "android",
-        "cordova",
-        "apache"
-    ],
-    "author": "Apache Software Foundation",
-    "license": "Apache version 2.0",
-    "dependencies": {
-        "q": "^0.9.0",
-        "shelljs": "^0.2.6"
-    }
-}
\ No newline at end of file
+  "name": "cordova-android",
+  "version": "3.5.1",
+  "description": "cordova-android release",
+  "main": "bin/create",
+  "repository": {
+    "type": "git",
+    "url": "https://git-wip-us.apache.org/repos/asf/cordova-android.git"
+  },
+  "keywords": [
+    "android",
+    "cordova",
+    "apache"
+  ],
+  "author": "Apache Software Foundation",
+  "license": "Apache version 2.0",
+  "dependencies": {
+    "q": "^0.9.0",
+    "shelljs": "^0.2.6"
+  }
+}