You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2015/11/10 02:01:53 UTC
[1/2] ios commit: Removed wk-webview exec and some linting
Repository: cordova-ios
Updated Branches:
refs/heads/master 4a0bb3a8c -> 361816225
Removed wk-webview exec and some linting
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/21a71fe8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/21a71fe8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/21a71fe8
Branch: refs/heads/master
Commit: 21a71fe89ffe575d1b70ce51aa9957777ac23f17
Parents: 4a0bb3a
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Nov 6 17:53:29 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Nov 6 17:53:29 2015 -0800
----------------------------------------------------------------------
cordova-js-src/exec.js | 72 ++++++++++-----------------------------------
1 file changed, 16 insertions(+), 56 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/21a71fe8/cordova-js-src/exec.js
----------------------------------------------------------------------
diff --git a/cordova-js-src/exec.js b/cordova-js-src/exec.js
index d5354b1..11c6f55 100644
--- a/cordova-js-src/exec.js
+++ b/cordova-js-src/exec.js
@@ -19,25 +19,16 @@
*
*/
+/*global require, module, atob, document */
+
/**
* Creates a gap bridge iframe used to notify the native code about queued
* commands.
*/
var cordova = require('cordova'),
- channel = require('cordova/channel'),
utils = require('cordova/utils'),
base64 = require('cordova/base64'),
- jsToNativeModes = {
- IFRAME_NAV: 0, // Default. Uses a new iframe for each poke.
- WK_WEBVIEW_BINDING: 1 // Only way that works for WKWebView :)
- },
- bridgeMode,
execIframe,
- execHashIframe,
- hashToggle = 1,
- execXhr,
- requestCount = 0,
- vcHeaderValue = null,
commandQueue = [], // Contains pending JS->Native messages.
isInContextOfEvalJs = 0,
failSafeTimerId = 0;
@@ -92,17 +83,10 @@ function convertMessageToArgsNativeToJs(message) {
}
function iOSExec() {
- if (bridgeMode === undefined) {
- bridgeMode = jsToNativeModes.IFRAME_NAV;
- }
-
- if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova && window.webkit.messageHandlers.cordova.postMessage) {
- bridgeMode = jsToNativeModes.WK_WEBVIEW_BINDING;
- }
- var successCallback, failCallback, service, action, actionArgs, splitCommand;
+ var successCallback, failCallback, service, action, actionArgs;
var callbackId = null;
- if (typeof arguments[0] !== "string") {
+ if (typeof arguments[0] !== 'string') {
// FORMAT ONE
successCallback = arguments[0];
failCallback = arguments[1];
@@ -136,21 +120,17 @@ function iOSExec() {
var command = [callbackId, service, action, actionArgs];
- if (bridgeMode === jsToNativeModes.WK_WEBVIEW_BINDING) {
- window.webkit.messageHandlers.cordova.postMessage(command);
- } else {
- // Stringify and queue the command. We stringify to command now to
- // effectively clone the command arguments in case they are mutated before
- // the command is executed.
- commandQueue.push(JSON.stringify(command));
-
- // If we're in the context of a stringByEvaluatingJavaScriptFromString call,
- // then the queue will be flushed when it returns; no need for a poke.
- // 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) {
- pokeNative();
- }
+ // Stringify and queue the command. We stringify to command now to
+ // effectively clone the command arguments in case they are mutated before
+ // the command is executed.
+ commandQueue.push(JSON.stringify(command));
+
+ // If we're in the context of a stringByEvaluatingJavaScriptFromString call,
+ // then the queue will be flushed when it returns; no need for a poke.
+ // 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) {
+ pokeNative();
}
}
@@ -184,21 +164,6 @@ function pokeNative() {
}, 50); // Making this > 0 improves performance (marginally) in the normal case (where it doesn't fire).
}
-iOSExec.jsToNativeModes = jsToNativeModes;
-
-iOSExec.setJsToNativeBridgeMode = function(mode) {
- // Remove the iFrame since it may be no longer required, and its existence
- // can trigger browser bugs.
- // https://issues.apache.org/jira/browse/CB-593
- if (execIframe) {
- if (execIframe.parentNode) {
- execIframe.parentNode.removeChild(execIframe);
- }
- execIframe = null;
- }
- bridgeMode = mode;
-};
-
iOSExec.nativeFetchMessages = function() {
// Stop listing for window detatch once native side confirms poke.
if (failSafeTimerId) {
@@ -221,12 +186,7 @@ iOSExec.nativeCallback = function(callbackId, status, message, keepCallback, deb
function nc2() {
cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
}
- // CB-8468
- if (debug) {
- setTimeout(nc2, 0);
- } else {
- nc2();
- }
+ setTimeout(nc2, 0);
});
};
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/2] ios commit: Update cordova.js
Posted by pu...@apache.org.
Update cordova.js
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/36181622
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/36181622
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/36181622
Branch: refs/heads/master
Commit: 3618162251e21f1ec6d7d83be403a984152a4c55
Parents: 21a71fe
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Mon Nov 9 16:04:43 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Mon Nov 9 16:04:43 2015 -0800
----------------------------------------------------------------------
CordovaLib/cordova.js | 78 +++++++++++-----------------------------------
1 file changed, 19 insertions(+), 59 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/36181622/CordovaLib/cordova.js
----------------------------------------------------------------------
diff --git a/CordovaLib/cordova.js b/CordovaLib/cordova.js
index 5469497..0bda072 100644
--- a/CordovaLib/cordova.js
+++ b/CordovaLib/cordova.js
@@ -1,5 +1,5 @@
// Platform: ios
-// 7703d38498920bdcfadd574e475553a26fc490e5
+// 8e9610fe33fc743fcaf5d920064f0deb2cad1715
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -817,28 +817,19 @@ module.exports = channel;
});
-// file: /Users/shaz/Documents/Git/Apache/cordova-ios/cordova-js-src/exec.js
+// file: /Repos/cordova/cordova-ios/cordova-js-src/exec.js
define("cordova/exec", function(require, exports, module) {
+/*global require, module, atob, document */
+
/**
* Creates a gap bridge iframe used to notify the native code about queued
* commands.
*/
var cordova = require('cordova'),
- channel = require('cordova/channel'),
utils = require('cordova/utils'),
base64 = require('cordova/base64'),
- jsToNativeModes = {
- IFRAME_NAV: 0, // Default. Uses a new iframe for each poke.
- WK_WEBVIEW_BINDING: 1 // Only way that works for WKWebView :)
- },
- bridgeMode,
execIframe,
- execHashIframe,
- hashToggle = 1,
- execXhr,
- requestCount = 0,
- vcHeaderValue = null,
commandQueue = [], // Contains pending JS->Native messages.
isInContextOfEvalJs = 0,
failSafeTimerId = 0;
@@ -893,17 +884,10 @@ function convertMessageToArgsNativeToJs(message) {
}
function iOSExec() {
- if (bridgeMode === undefined) {
- bridgeMode = jsToNativeModes.IFRAME_NAV;
- }
-
- if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova && window.webkit.messageHandlers.cordova.postMessage) {
- bridgeMode = jsToNativeModes.WK_WEBVIEW_BINDING;
- }
- var successCallback, failCallback, service, action, actionArgs, splitCommand;
+ var successCallback, failCallback, service, action, actionArgs;
var callbackId = null;
- if (typeof arguments[0] !== "string") {
+ if (typeof arguments[0] !== 'string') {
// FORMAT ONE
successCallback = arguments[0];
failCallback = arguments[1];
@@ -937,21 +921,17 @@ function iOSExec() {
var command = [callbackId, service, action, actionArgs];
- if (bridgeMode === jsToNativeModes.WK_WEBVIEW_BINDING) {
- window.webkit.messageHandlers.cordova.postMessage(command);
- } else {
- // Stringify and queue the command. We stringify to command now to
- // effectively clone the command arguments in case they are mutated before
- // the command is executed.
- commandQueue.push(JSON.stringify(command));
-
- // If we're in the context of a stringByEvaluatingJavaScriptFromString call,
- // then the queue will be flushed when it returns; no need for a poke.
- // 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) {
- pokeNative();
- }
+ // Stringify and queue the command. We stringify to command now to
+ // effectively clone the command arguments in case they are mutated before
+ // the command is executed.
+ commandQueue.push(JSON.stringify(command));
+
+ // If we're in the context of a stringByEvaluatingJavaScriptFromString call,
+ // then the queue will be flushed when it returns; no need for a poke.
+ // 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) {
+ pokeNative();
}
}
@@ -985,21 +965,6 @@ function pokeNative() {
}, 50); // Making this > 0 improves performance (marginally) in the normal case (where it doesn't fire).
}
-iOSExec.jsToNativeModes = jsToNativeModes;
-
-iOSExec.setJsToNativeBridgeMode = function(mode) {
- // Remove the iFrame since it may be no longer required, and its existence
- // can trigger browser bugs.
- // https://issues.apache.org/jira/browse/CB-593
- if (execIframe) {
- if (execIframe.parentNode) {
- execIframe.parentNode.removeChild(execIframe);
- }
- execIframe = null;
- }
- bridgeMode = mode;
-};
-
iOSExec.nativeFetchMessages = function() {
// Stop listing for window detatch once native side confirms poke.
if (failSafeTimerId) {
@@ -1022,12 +987,7 @@ iOSExec.nativeCallback = function(callbackId, status, message, keepCallback, deb
function nc2() {
cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
}
- // CB-8468
- if (debug) {
- setTimeout(nc2, 0);
- } else {
- nc2();
- }
+ setTimeout(nc2, 0);
});
};
@@ -1527,7 +1487,7 @@ exports.reset();
});
-// file: /Users/shaz/Documents/Git/Apache/cordova-ios/cordova-js-src/platform.js
+// file: /Repos/cordova/cordova-ios/cordova-js-src/platform.js
define("cordova/platform", function(require, exports, module) {
module.exports = {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org