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 2014/01/30 00:47:54 UTC
[1/2] ios commit: Update JS snapshot to version 3.4.0-rc1 (via coho)
Updated Branches:
refs/heads/3.4.x [created] 084731636
Update JS snapshot to version 3.4.0-rc1 (via coho)
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/d62ab27f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/d62ab27f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/d62ab27f
Branch: refs/heads/3.4.x
Commit: d62ab27fd8d70206291b28e9fd7586b4d3472a6d
Parents: fb96a97
Author: Shazron Abdullah <sh...@apache.org>
Authored: Wed Jan 29 15:46:37 2014 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Wed Jan 29 15:46:37 2014 -0800
----------------------------------------------------------------------
CordovaLib/cordova.js | 108 +++++++++++++++++++++++++++++++--------------
1 file changed, 75 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/d62ab27f/CordovaLib/cordova.js
----------------------------------------------------------------------
diff --git a/CordovaLib/cordova.js b/CordovaLib/cordova.js
index 63c0798..1ea091f 100644
--- a/CordovaLib/cordova.js
+++ b/CordovaLib/cordova.js
@@ -1,5 +1,5 @@
// Platform: ios
-// 3.4.0-dev-c13f84f
+// 3.4.0-rc1
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -19,8 +19,8 @@
under the License.
*/
;(function() {
-var CORDOVA_JS_BUILD_LABEL = '3.4.0-dev-c13f84f';
-// file: lib/scripts/require.js
+var CORDOVA_JS_BUILD_LABEL = '3.4.0-rc1';
+// file: src/scripts/require.js
/*jshint -W079 */
/*jshint -W020 */
@@ -98,7 +98,7 @@ if (typeof module === "object" && typeof require === "function") {
module.exports.define = define;
}
-// file: lib/cordova.js
+// file: src/cordova.js
define("cordova", function(require, exports, module) {
@@ -316,7 +316,7 @@ module.exports = cordova;
});
-// file: lib/common/argscheck.js
+// file: src/common/argscheck.js
define("cordova/argscheck", function(require, exports, module) {
var exec = require('cordova/exec');
@@ -382,7 +382,7 @@ moduleExports.enableChecks = true;
});
-// file: lib/common/base64.js
+// file: src/common/base64.js
define("cordova/base64", function(require, exports, module) {
var base64 = exports;
@@ -438,7 +438,7 @@ function uint8ToBase64(rawData) {
});
-// file: lib/common/builder.js
+// file: src/common/builder.js
define("cordova/builder", function(require, exports, module) {
var utils = require('cordova/utils');
@@ -551,7 +551,7 @@ exports.replaceHookForTesting = function() {};
});
-// file: lib/common/channel.js
+// file: src/common/channel.js
define("cordova/channel", function(require, exports, module) {
var utils = require('cordova/utils'),
@@ -792,27 +792,35 @@ module.exports = channel;
});
-// file: lib/ios/exec.js
+// file: src/ios/exec.js
define("cordova/exec", function(require, exports, module) {
/**
* Creates a gap bridge iframe used to notify the native code about queued
* commands.
- *
- * @private
*/
var cordova = require('cordova'),
channel = require('cordova/channel'),
utils = require('cordova/utils'),
base64 = require('cordova/base64'),
+ // XHR mode does not work on iOS 4.2.
+ // XHR mode's main advantage is working around a bug in -webkit-scroll, which
+ // doesn't exist only on iOS 5.x devices.
+ // IFRAME_NAV is the fastest.
+ // IFRAME_HASH could be made to enable synchronous bridge calls if we wanted this feature.
jsToNativeModes = {
IFRAME_NAV: 0,
XHR_NO_PAYLOAD: 1,
XHR_WITH_PAYLOAD: 2,
- XHR_OPTIONAL_PAYLOAD: 3
+ XHR_OPTIONAL_PAYLOAD: 3,
+ IFRAME_HASH_NO_PAYLOAD: 4,
+ // Bundling the payload turns out to be slower. Probably since it has to be URI encoded / decoded.
+ IFRAME_HASH_WITH_PAYLOAD: 5
},
bridgeMode,
execIframe,
+ execHashIframe,
+ hashToggle = 1,
execXhr,
requestCount = 0,
vcHeaderValue = null,
@@ -826,11 +834,18 @@ function createExecIframe() {
return iframe;
}
+function createHashIframe() {
+ var ret = createExecIframe();
+ // Hash changes don't work on about:blank, so switch it to file:///.
+ ret.contentWindow.history.replaceState(null, null, 'file:///#');
+ return ret;
+}
+
function shouldBundleCommandJson() {
- if (bridgeMode == jsToNativeModes.XHR_WITH_PAYLOAD) {
+ if (bridgeMode === jsToNativeModes.XHR_WITH_PAYLOAD) {
return true;
}
- if (bridgeMode == jsToNativeModes.XHR_OPTIONAL_PAYLOAD) {
+ if (bridgeMode === jsToNativeModes.XHR_OPTIONAL_PAYLOAD) {
var payloadLength = 0;
for (var i = 0; i < commandQueue.length; ++i) {
payloadLength += commandQueue[i].length;
@@ -891,11 +906,11 @@ function convertMessageToArgsNativeToJs(message) {
}
function iOSExec() {
- // XHR mode does not work on iOS 4.2, so default to IFRAME_NAV for such devices.
- // XHR mode's main advantage is working around a bug in -webkit-scroll, which
- // doesn't exist in 4.X devices anyways.
+ // Use XHR for iOS 5 to work around a bug in -webkit-scroll.
+ // Use IFRAME_NAV elsewhere since it's faster and XHR bridge
+ // seems to have bugs in newer OS's (CB-3900, CB-3359, CB-5457, CB-4970, CB-4998, CB-5134)
if (bridgeMode === undefined) {
- bridgeMode = navigator.userAgent.indexOf(' 4_') == -1 ? jsToNativeModes.XHR_NO_PAYLOAD : jsToNativeModes.IFRAME_NAV;
+ bridgeMode = navigator.userAgent.indexOf(' 5_') == -1 ? jsToNativeModes.IFRAME_NAV: jsToNativeModes.XHR_NO_PAYLOAD;
}
var successCallback, failCallback, service, action, actionArgs, splitCommand;
@@ -950,7 +965,10 @@ function iOSExec() {
// Also, if there is already a command in the queue, then we've already
// poked the native side, so there is no reason to do so again.
if (!isInContextOfEvalJs && commandQueue.length == 1) {
- if (bridgeMode != jsToNativeModes.IFRAME_NAV) {
+ switch (bridgeMode) {
+ case jsToNativeModes.XHR_NO_PAYLOAD:
+ case jsToNativeModes.XHR_WITH_PAYLOAD:
+ case jsToNativeModes.XHR_OPTIONAL_PAYLOAD:
// This prevents sending an XHR when there is already one being sent.
// This should happen only in rare circumstances (refer to unit tests).
if (execXhr && execXhr.readyState != 4) {
@@ -971,8 +989,28 @@ function iOSExec() {
execXhr.setRequestHeader('cmds', iOSExec.nativeFetchMessages());
}
execXhr.send(null);
- } else {
+ break;
+ case jsToNativeModes.IFRAME_HASH_NO_PAYLOAD:
+ case jsToNativeModes.IFRAME_HASH_WITH_PAYLOAD:
+ execHashIframe = execHashIframe || createHashIframe();
+ // Check if they've removed it from the DOM, and put it back if so.
+ if (!execHashIframe.contentWindow) {
+ execHashIframe = createHashIframe();
+ }
+ // The delegate method is called only when the hash changes, so toggle it back and forth.
+ hashToggle = hashToggle ^ 3;
+ var hashValue = '%0' + hashToggle;
+ if (bridgeMode === jsToNativeModes.IFRAME_HASH_WITH_PAYLOAD) {
+ hashValue += iOSExec.nativeFetchMessages();
+ }
+ execHashIframe.contentWindow.location.hash = hashValue;
+ break;
+ default:
execIframe = execIframe || createExecIframe();
+ // Check if they've removed it from the DOM, and put it back if so.
+ if (!execIframe.contentWindow) {
+ execIframe = createExecIframe();
+ }
execIframe.src = "gap://ready";
}
}
@@ -1024,7 +1062,7 @@ module.exports = iOSExec;
});
-// file: lib/common/exec/proxy.js
+// file: src/common/exec/proxy.js
define("cordova/exec/proxy", function(require, exports, module) {
@@ -1054,7 +1092,7 @@ module.exports = {
};
});
-// file: lib/common/init.js
+// file: src/common/init.js
define("cordova/init", function(require, exports, module) {
var channel = require('cordova/channel');
@@ -1168,7 +1206,7 @@ channel.join(function() {
});
-// file: lib/common/modulemapper.js
+// file: src/common/modulemapper.js
define("cordova/modulemapper", function(require, exports, module) {
var builder = require('cordova/builder'),
@@ -1269,7 +1307,7 @@ exports.reset();
});
-// file: lib/ios/platform.js
+// file: src/ios/platform.js
define("cordova/platform", function(require, exports, module) {
module.exports = {
@@ -1282,10 +1320,11 @@ module.exports = {
});
-// file: lib/common/pluginloader.js
+// file: src/common/pluginloader.js
define("cordova/pluginloader", function(require, exports, module) {
var modulemapper = require('cordova/modulemapper');
+var urlutil = require('cordova/urlutil');
// Helper function to inject a <script> tag.
function injectScript(url, onload, onerror) {
@@ -1354,11 +1393,14 @@ function handlePluginsObject(path, moduleList, finishPluginLoading) {
}
function injectPluginScript(pathPrefix, finishPluginLoading) {
- injectScript(pathPrefix + 'cordova_plugins.js', function(){
+ var pluginPath = pathPrefix + 'cordova_plugins.js';
+
+ injectScript(pluginPath, function() {
try {
var moduleList = require("cordova/plugin_list");
handlePluginsObject(pathPrefix, moduleList, finishPluginLoading);
- } catch (e) {
+ }
+ catch (e) {
// Error loading cordova_plugins.js, file not found or something
// this is an acceptable error, pre-3.0.0, so we just move on.
finishPluginLoading();
@@ -1395,24 +1437,24 @@ exports.load = function(callback) {
});
-// file: lib/common/urlutil.js
+// file: src/common/urlutil.js
define("cordova/urlutil", function(require, exports, module) {
-var urlutil = exports;
-var anchorEl = document.createElement('a');
/**
* For already absolute URLs, returns what is passed in.
* For relative URLs, converts them to absolute ones.
*/
-urlutil.makeAbsolute = function(url) {
+exports.makeAbsolute = function makeAbsolute(url) {
+ var anchorEl = document.createElement('a');
anchorEl.href = url;
return anchorEl.href;
};
+
});
-// file: lib/common/utils.js
+// file: src/common/utils.js
define("cordova/utils", function(require, exports, module) {
var utils = exports;
@@ -1583,7 +1625,7 @@ function UUIDcreatePart(length) {
});
window.cordova = require('cordova');
-// file: lib/scripts/bootstrap.js
+// file: src/scripts/bootstrap.js
require('cordova/init');
[2/2] ios commit: Set VERSION to 3.4.0-rc1 (via coho)
Posted by sh...@apache.org.
Set VERSION to 3.4.0-rc1 (via coho)
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/08473163
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/08473163
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/08473163
Branch: refs/heads/3.4.x
Commit: 0847316368c36238256817bdf4c5eb19325aab90
Parents: d62ab27
Author: Shazron Abdullah <sh...@apache.org>
Authored: Wed Jan 29 15:46:38 2014 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Wed Jan 29 15:46:38 2014 -0800
----------------------------------------------------------------------
CordovaLib/VERSION | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/08473163/CordovaLib/VERSION
----------------------------------------------------------------------
diff --git a/CordovaLib/VERSION b/CordovaLib/VERSION
index 688932a..ee13a2b 100644
--- a/CordovaLib/VERSION
+++ b/CordovaLib/VERSION
@@ -1 +1 @@
-3.4.0-dev
+3.4.0-rc1