You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2015/03/06 05:01:37 UTC
[01/19] ios commit: CB-8254 - Enable use of .xcconfig when building
for emulator
Repository: cordova-ios
Updated Branches:
refs/heads/4.0.x 4d5de4219 -> c0085a8c8
CB-8254 - Enable use of .xcconfig when building for emulator
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/875d699d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/875d699d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/875d699d
Branch: refs/heads/4.0.x
Commit: 875d699dc2c03c065082677ea8ee8d80efec4cc6
Parents: fd941c3
Author: Shazron Abdullah <sh...@apache.org>
Authored: Thu Feb 5 11:51:48 2015 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Thu Feb 5 11:51:48 2015 -0800
----------------------------------------------------------------------
bin/templates/scripts/cordova/lib/build.js | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/875d699d/bin/templates/scripts/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/build.js b/bin/templates/scripts/cordova/lib/build.js
index b7a6bd0..02d8113 100644
--- a/bin/templates/scripts/cordova/lib/build.js
+++ b/bin/templates/scripts/cordova/lib/build.js
@@ -110,6 +110,7 @@ function getXcodeArgs(projectName, projectPath, configuration, isDevice) {
];
} else { // emulator
xcodebuildArgs = [
+ '-xcconfig', path.join(__dirname, '..', 'build-' + configuration.toLowerCase() + '.xcconfig'),
'-project', projectName + '.xcodeproj',
'ARCHS="i386"',
'-target', projectName ,
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[16/19] ios commit: Fix Q include in check_reqs.js (close #132)
Posted by ag...@apache.org.
Fix Q include in check_reqs.js (close #132)
The npm package is q (lowercase) but was being required as Q (uppercase). For
most people this probably works fine due to case insensitive filesystems, but
if your Mac is configured to be case-sensitive or you're on Linux, this script
would generate an error and prevent building.
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/8e6d5c33
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/8e6d5c33
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/8e6d5c33
Branch: refs/heads/4.0.x
Commit: 8e6d5c3344b0e9376dfcf4e245117aaa46f945d1
Parents: 4575b36
Author: Darryl Pogue <dv...@gmail.com>
Authored: Sat Feb 28 16:09:43 2015 -0800
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Mar 2 09:50:38 2015 -0500
----------------------------------------------------------------------
bin/lib/check_reqs.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e6d5c33/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index 6b4cce5..be6d82d 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -22,7 +22,7 @@
sub:true, laxcomma:true, laxbreak:true
*/
-var Q = require('Q'),
+var Q = require('q'),
os = require('os'),
shell = require('shelljs'),
versions = require('./versions');
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[10/19] ios commit: CB-8436 Remove more bad quotes from build command
Posted by ag...@apache.org.
CB-8436 Remove more bad quotes from build command
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/74224252
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/74224252
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/74224252
Branch: refs/heads/4.0.x
Commit: 74224252487b15ef2698d785ca1ee2464cd77c5c
Parents: 2bef65e
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Feb 17 09:37:55 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Feb 17 09:37:55 2015 -0500
----------------------------------------------------------------------
bin/templates/scripts/cordova/lib/build.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/74224252/bin/templates/scripts/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/build.js b/bin/templates/scripts/cordova/lib/build.js
index e081959..153a4ec 100644
--- a/bin/templates/scripts/cordova/lib/build.js
+++ b/bin/templates/scripts/cordova/lib/build.js
@@ -112,12 +112,12 @@ function getXcodeArgs(projectName, projectPath, configuration, isDevice) {
xcodebuildArgs = [
'-xcconfig', path.join(__dirname, '..', 'build-' + configuration.toLowerCase() + '.xcconfig'),
'-project', projectName + '.xcodeproj',
- 'ARCHS="i386"',
+ 'ARCHS=i386',
'-target', projectName ,
'-configuration', configuration,
'-sdk', 'iphonesimulator',
'build',
- 'VALID_ARCHS="i386"',
+ 'VALID_ARCHS=i386',
'CONFIGURATION_BUILD_DIR=' + path.join(projectPath, 'build', 'emulator'),
'SHARED_PRECOMPS_DIR=' + path.join(projectPath, 'build', 'sharedpch')
];
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[17/19] ios commit: CB-8586 - Update ios-deploy minimum version to
1.4.0
Posted by ag...@apache.org.
CB-8586 - Update ios-deploy minimum version to 1.4.0
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/43fe56af
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/43fe56af
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/43fe56af
Branch: refs/heads/4.0.x
Commit: 43fe56afbf59e7bdda763864ad7a30b3c48c403a
Parents: 8e6d5c3
Author: Shazron Abdullah <sh...@apache.org>
Authored: Mon Mar 2 16:39:32 2015 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Mar 2 16:39:32 2015 -0800
----------------------------------------------------------------------
bin/lib/check_reqs.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/43fe56af/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index be6d82d..2f5897e 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -34,7 +34,7 @@ var IOS_SIM_NOT_FOUND_MESSAGE = 'ios-sim was not found. Please download, build a
' or greater from https://github.com/phonegap/ios-sim into your path.' +
' Or \'npm install -g ios-sim\' using node.js: http://nodejs.org';
-var IOS_DEPLOY_MIN_VERSION = '1.2.0';
+var IOS_DEPLOY_MIN_VERSION = '1.4.0';
var IOS_DEPLOY_NOT_FOUND_MESSAGE = 'ios-deploy was not found. Please download, build and install version ' + IOS_DEPLOY_MIN_VERSION +
' or greater from https://github.com/phonegap/ios-deploy into your path.' +
' Or \'npm install -g ios-deploy\' using node.js: http://nodejs.org';
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[04/19] ios commit: CB-8417 renamed platform_modules into
cordova-js-src
Posted by ag...@apache.org.
CB-8417 renamed platform_modules into cordova-js-src
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/338ee71f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/338ee71f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/338ee71f
Branch: refs/heads/4.0.x
Commit: 338ee71f966ab7fdc1ccde02e5086febbc82b70c
Parents: 8b3c89b
Author: Steve Gill <st...@gmail.com>
Authored: Fri Feb 6 17:35:15 2015 -0800
Committer: Steve Gill <st...@gmail.com>
Committed: Fri Feb 6 17:35:15 2015 -0800
----------------------------------------------------------------------
cordova-js-src/exec.js | 323 ++++++++++++++++++++++++++++++++++++++
cordova-js-src/platform.js | 28 ++++
platform_modules/exec.js | 323 --------------------------------------
platform_modules/platform.js | 28 ----
4 files changed, 351 insertions(+), 351 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/338ee71f/cordova-js-src/exec.js
----------------------------------------------------------------------
diff --git a/cordova-js-src/exec.js b/cordova-js-src/exec.js
new file mode 100644
index 0000000..32a3f8b
--- /dev/null
+++ b/cordova-js-src/exec.js
@@ -0,0 +1,323 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/**
+ * 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'),
+ // 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, // Default. Uses a new iframe for each poke.
+ // XHR bridge appears to be flaky sometimes: CB-3900, CB-3359, CB-5457, CB-4970, CB-4998, CB-5134
+ XHR_NO_PAYLOAD: 1, // About the same speed as IFRAME_NAV. Performance not about the same as IFRAME_NAV, but more variable.
+ XHR_WITH_PAYLOAD: 2, // Flakey, and not as performant
+ XHR_OPTIONAL_PAYLOAD: 3, // Flakey, and not as performant
+ IFRAME_HASH_NO_PAYLOAD: 4, // Not fully baked. A bit faster than IFRAME_NAV, but risks jank since poke happens synchronously.
+ IFRAME_HASH_WITH_PAYLOAD: 5, // Slower than no payload. Maybe since it has to be URI encoded / decoded.
+ WK_WEBVIEW_BINDING: 6 // 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;
+
+function shouldBundleCommandJson() {
+ if (bridgeMode === jsToNativeModes.XHR_WITH_PAYLOAD) {
+ return true;
+ }
+ if (bridgeMode === jsToNativeModes.XHR_OPTIONAL_PAYLOAD) {
+ var payloadLength = 0;
+ for (var i = 0; i < commandQueue.length; ++i) {
+ payloadLength += commandQueue[i].length;
+ }
+ // The value here was determined using the benchmark within CordovaLibApp on an iPad 3.
+ return payloadLength < 4500;
+ }
+ return false;
+}
+
+function massageArgsJsToNative(args) {
+ if (!args || utils.typeName(args) != 'Array') {
+ return args;
+ }
+ var ret = [];
+ args.forEach(function(arg, i) {
+ if (utils.typeName(arg) == 'ArrayBuffer') {
+ ret.push({
+ 'CDVType': 'ArrayBuffer',
+ 'data': base64.fromArrayBuffer(arg)
+ });
+ } else {
+ ret.push(arg);
+ }
+ });
+ return ret;
+}
+
+function massageMessageNativeToJs(message) {
+ if (message.CDVType == 'ArrayBuffer') {
+ var stringToArrayBuffer = function(str) {
+ var ret = new Uint8Array(str.length);
+ for (var i = 0; i < str.length; i++) {
+ ret[i] = str.charCodeAt(i);
+ }
+ return ret.buffer;
+ };
+ var base64ToArrayBuffer = function(b64) {
+ return stringToArrayBuffer(atob(b64));
+ };
+ message = base64ToArrayBuffer(message.data);
+ }
+ return message;
+}
+
+function convertMessageToArgsNativeToJs(message) {
+ var args = [];
+ if (!message || !message.hasOwnProperty('CDVType')) {
+ args.push(message);
+ } else if (message.CDVType == 'MultiPart') {
+ message.messages.forEach(function(e) {
+ args.push(massageMessageNativeToJs(e));
+ });
+ } else {
+ args.push(massageMessageNativeToJs(message));
+ }
+ return args;
+}
+
+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 callbackId = null;
+ if (typeof arguments[0] !== "string") {
+ // FORMAT ONE
+ successCallback = arguments[0];
+ failCallback = arguments[1];
+ service = arguments[2];
+ action = arguments[3];
+ actionArgs = arguments[4];
+
+ // Since we need to maintain backwards compatibility, we have to pass
+ // an invalid callbackId even if no callback was provided since plugins
+ // will be expecting it. The Cordova.exec() implementation allocates
+ // an invalid callbackId and passes it even if no callbacks were given.
+ callbackId = 'INVALID';
+ } else {
+ // FORMAT TWO, REMOVED
+ try {
+ splitCommand = arguments[0].split(".");
+ action = splitCommand.pop();
+ service = splitCommand.join(".");
+ actionArgs = Array.prototype.splice.call(arguments, 1);
+
+ console.log('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' +
+ "cordova.exec(null, null, \"" + service + "\", \"" + action + "\"," + JSON.stringify(actionArgs) + ");"
+ );
+ return;
+ } catch (e) {}
+ }
+
+ // If actionArgs is not provided, default to an empty array
+ actionArgs = actionArgs || [];
+
+ // Register the callbacks and add the callbackId to the positional
+ // arguments if given.
+ if (successCallback || failCallback) {
+ callbackId = service + cordova.callbackId++;
+ cordova.callbacks[callbackId] =
+ {success:successCallback, fail:failCallback};
+ }
+
+ actionArgs = massageArgsJsToNative(actionArgs);
+
+ var command = [callbackId, service, action, actionArgs];
+
+ // 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 (bridgeMode === jsToNativeModes.WK_WEBVIEW_BINDING) {
+ window.webkit.messageHandlers.cordova.postMessage(command);
+ } else {
+ // 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();
+ }
+ }
+}
+
+function pokeNative() {
+ switch (bridgeMode) {
+ case jsToNativeModes.XHR_NO_PAYLOAD:
+ case jsToNativeModes.XHR_WITH_PAYLOAD:
+ case jsToNativeModes.XHR_OPTIONAL_PAYLOAD:
+ pokeNativeViaXhr();
+ break;
+ default: // iframe-based.
+ pokeNativeViaIframe();
+ }
+}
+
+function pokeNativeViaXhr() {
+ // 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) {
+ execXhr = null;
+ }
+ // Re-using the XHR improves exec() performance by about 10%.
+ execXhr = execXhr || new XMLHttpRequest();
+ // Changing this to a GET will make the XHR reach the URIProtocol on 4.2.
+ // For some reason it still doesn't work though...
+ // Add a timestamp to the query param to prevent caching.
+ execXhr.open('HEAD', "/!gap_exec?" + (+new Date()), true);
+ if (!vcHeaderValue) {
+ vcHeaderValue = /.*\((.*)\)$/.exec(navigator.userAgent)[1];
+ }
+ execXhr.setRequestHeader('vc', vcHeaderValue);
+ execXhr.setRequestHeader('rc', ++requestCount);
+ if (shouldBundleCommandJson()) {
+ execXhr.setRequestHeader('cmds', iOSExec.nativeFetchMessages());
+ }
+ execXhr.send(null);
+}
+
+function pokeNativeViaIframe() {
+ // CB-5488 - Don't attempt to create iframe before document.body is available.
+ if (!document.body) {
+ setTimeout(pokeNativeViaIframe);
+ return;
+ }
+ if (bridgeMode === jsToNativeModes.IFRAME_HASH_NO_PAYLOAD || bridgeMode === jsToNativeModes.IFRAME_HASH_WITH_PAYLOAD) {
+ // TODO: This bridge mode doesn't properly support being removed from the DOM (CB-7735)
+ if (!execHashIframe) {
+ execHashIframe = document.createElement('iframe');
+ execHashIframe.style.display = 'none';
+ document.body.appendChild(execHashIframe);
+ // Hash changes don't work on about:blank, so switch it to file:///.
+ execHashIframe.contentWindow.history.replaceState(null, null, 'file:///#');
+ }
+ // 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;
+ } else {
+ // Check if they've removed it from the DOM, and put it back if so.
+ if (execIframe && execIframe.contentWindow) {
+ execIframe.contentWindow.location = 'gap://ready';
+ } else {
+ execIframe = document.createElement('iframe');
+ execIframe.style.display = 'none';
+ execIframe.src = 'gap://ready';
+ document.body.appendChild(execIframe);
+ }
+ // Use a timer to protect against iframe being unloaded during the poke (CB-7735).
+ // This makes the bridge ~ 7% slower, but works around the poke getting lost
+ // when the iframe is removed from the DOM.
+ // An onunload listener could be used in the case where the iframe has just been
+ // created, but since unload events fire only once, it doesn't work in the normal
+ // case of iframe reuse (where unload will have already fired due to the attempted
+ // navigation of the page).
+ failSafeTimerId = setTimeout(function() {
+ if (commandQueue.length) {
+ 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) {
+ clearTimeout(failSafeTimerId);
+ failSafeTimerId = 0;
+ }
+ // Each entry in commandQueue is a JSON string already.
+ if (!commandQueue.length) {
+ return '';
+ }
+ var json = '[' + commandQueue.join(',') + ']';
+ commandQueue.length = 0;
+ return json;
+};
+
+iOSExec.nativeCallback = function(callbackId, status, message, keepCallback) {
+ return iOSExec.nativeEvalAndFetch(function() {
+ var success = status === 0 || status === 1;
+ var args = convertMessageToArgsNativeToJs(message);
+ cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
+ });
+};
+
+iOSExec.nativeEvalAndFetch = function(func) {
+ // This shouldn't be nested, but better to be safe.
+ isInContextOfEvalJs++;
+ try {
+ func();
+ return iOSExec.nativeFetchMessages();
+ } finally {
+ isInContextOfEvalJs--;
+ }
+};
+
+module.exports = iOSExec;
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/338ee71f/cordova-js-src/platform.js
----------------------------------------------------------------------
diff --git a/cordova-js-src/platform.js b/cordova-js-src/platform.js
new file mode 100644
index 0000000..36529ba
--- /dev/null
+++ b/cordova-js-src/platform.js
@@ -0,0 +1,28 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+module.exports = {
+ id: 'ios',
+ bootstrap: function() {
+ require('cordova/channel').onNativeReady.fire();
+ }
+};
+
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/338ee71f/platform_modules/exec.js
----------------------------------------------------------------------
diff --git a/platform_modules/exec.js b/platform_modules/exec.js
deleted file mode 100644
index 32a3f8b..0000000
--- a/platform_modules/exec.js
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * 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'),
- // 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, // Default. Uses a new iframe for each poke.
- // XHR bridge appears to be flaky sometimes: CB-3900, CB-3359, CB-5457, CB-4970, CB-4998, CB-5134
- XHR_NO_PAYLOAD: 1, // About the same speed as IFRAME_NAV. Performance not about the same as IFRAME_NAV, but more variable.
- XHR_WITH_PAYLOAD: 2, // Flakey, and not as performant
- XHR_OPTIONAL_PAYLOAD: 3, // Flakey, and not as performant
- IFRAME_HASH_NO_PAYLOAD: 4, // Not fully baked. A bit faster than IFRAME_NAV, but risks jank since poke happens synchronously.
- IFRAME_HASH_WITH_PAYLOAD: 5, // Slower than no payload. Maybe since it has to be URI encoded / decoded.
- WK_WEBVIEW_BINDING: 6 // 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;
-
-function shouldBundleCommandJson() {
- if (bridgeMode === jsToNativeModes.XHR_WITH_PAYLOAD) {
- return true;
- }
- if (bridgeMode === jsToNativeModes.XHR_OPTIONAL_PAYLOAD) {
- var payloadLength = 0;
- for (var i = 0; i < commandQueue.length; ++i) {
- payloadLength += commandQueue[i].length;
- }
- // The value here was determined using the benchmark within CordovaLibApp on an iPad 3.
- return payloadLength < 4500;
- }
- return false;
-}
-
-function massageArgsJsToNative(args) {
- if (!args || utils.typeName(args) != 'Array') {
- return args;
- }
- var ret = [];
- args.forEach(function(arg, i) {
- if (utils.typeName(arg) == 'ArrayBuffer') {
- ret.push({
- 'CDVType': 'ArrayBuffer',
- 'data': base64.fromArrayBuffer(arg)
- });
- } else {
- ret.push(arg);
- }
- });
- return ret;
-}
-
-function massageMessageNativeToJs(message) {
- if (message.CDVType == 'ArrayBuffer') {
- var stringToArrayBuffer = function(str) {
- var ret = new Uint8Array(str.length);
- for (var i = 0; i < str.length; i++) {
- ret[i] = str.charCodeAt(i);
- }
- return ret.buffer;
- };
- var base64ToArrayBuffer = function(b64) {
- return stringToArrayBuffer(atob(b64));
- };
- message = base64ToArrayBuffer(message.data);
- }
- return message;
-}
-
-function convertMessageToArgsNativeToJs(message) {
- var args = [];
- if (!message || !message.hasOwnProperty('CDVType')) {
- args.push(message);
- } else if (message.CDVType == 'MultiPart') {
- message.messages.forEach(function(e) {
- args.push(massageMessageNativeToJs(e));
- });
- } else {
- args.push(massageMessageNativeToJs(message));
- }
- return args;
-}
-
-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 callbackId = null;
- if (typeof arguments[0] !== "string") {
- // FORMAT ONE
- successCallback = arguments[0];
- failCallback = arguments[1];
- service = arguments[2];
- action = arguments[3];
- actionArgs = arguments[4];
-
- // Since we need to maintain backwards compatibility, we have to pass
- // an invalid callbackId even if no callback was provided since plugins
- // will be expecting it. The Cordova.exec() implementation allocates
- // an invalid callbackId and passes it even if no callbacks were given.
- callbackId = 'INVALID';
- } else {
- // FORMAT TWO, REMOVED
- try {
- splitCommand = arguments[0].split(".");
- action = splitCommand.pop();
- service = splitCommand.join(".");
- actionArgs = Array.prototype.splice.call(arguments, 1);
-
- console.log('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' +
- "cordova.exec(null, null, \"" + service + "\", \"" + action + "\"," + JSON.stringify(actionArgs) + ");"
- );
- return;
- } catch (e) {}
- }
-
- // If actionArgs is not provided, default to an empty array
- actionArgs = actionArgs || [];
-
- // Register the callbacks and add the callbackId to the positional
- // arguments if given.
- if (successCallback || failCallback) {
- callbackId = service + cordova.callbackId++;
- cordova.callbacks[callbackId] =
- {success:successCallback, fail:failCallback};
- }
-
- actionArgs = massageArgsJsToNative(actionArgs);
-
- var command = [callbackId, service, action, actionArgs];
-
- // 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 (bridgeMode === jsToNativeModes.WK_WEBVIEW_BINDING) {
- window.webkit.messageHandlers.cordova.postMessage(command);
- } else {
- // 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();
- }
- }
-}
-
-function pokeNative() {
- switch (bridgeMode) {
- case jsToNativeModes.XHR_NO_PAYLOAD:
- case jsToNativeModes.XHR_WITH_PAYLOAD:
- case jsToNativeModes.XHR_OPTIONAL_PAYLOAD:
- pokeNativeViaXhr();
- break;
- default: // iframe-based.
- pokeNativeViaIframe();
- }
-}
-
-function pokeNativeViaXhr() {
- // 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) {
- execXhr = null;
- }
- // Re-using the XHR improves exec() performance by about 10%.
- execXhr = execXhr || new XMLHttpRequest();
- // Changing this to a GET will make the XHR reach the URIProtocol on 4.2.
- // For some reason it still doesn't work though...
- // Add a timestamp to the query param to prevent caching.
- execXhr.open('HEAD', "/!gap_exec?" + (+new Date()), true);
- if (!vcHeaderValue) {
- vcHeaderValue = /.*\((.*)\)$/.exec(navigator.userAgent)[1];
- }
- execXhr.setRequestHeader('vc', vcHeaderValue);
- execXhr.setRequestHeader('rc', ++requestCount);
- if (shouldBundleCommandJson()) {
- execXhr.setRequestHeader('cmds', iOSExec.nativeFetchMessages());
- }
- execXhr.send(null);
-}
-
-function pokeNativeViaIframe() {
- // CB-5488 - Don't attempt to create iframe before document.body is available.
- if (!document.body) {
- setTimeout(pokeNativeViaIframe);
- return;
- }
- if (bridgeMode === jsToNativeModes.IFRAME_HASH_NO_PAYLOAD || bridgeMode === jsToNativeModes.IFRAME_HASH_WITH_PAYLOAD) {
- // TODO: This bridge mode doesn't properly support being removed from the DOM (CB-7735)
- if (!execHashIframe) {
- execHashIframe = document.createElement('iframe');
- execHashIframe.style.display = 'none';
- document.body.appendChild(execHashIframe);
- // Hash changes don't work on about:blank, so switch it to file:///.
- execHashIframe.contentWindow.history.replaceState(null, null, 'file:///#');
- }
- // 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;
- } else {
- // Check if they've removed it from the DOM, and put it back if so.
- if (execIframe && execIframe.contentWindow) {
- execIframe.contentWindow.location = 'gap://ready';
- } else {
- execIframe = document.createElement('iframe');
- execIframe.style.display = 'none';
- execIframe.src = 'gap://ready';
- document.body.appendChild(execIframe);
- }
- // Use a timer to protect against iframe being unloaded during the poke (CB-7735).
- // This makes the bridge ~ 7% slower, but works around the poke getting lost
- // when the iframe is removed from the DOM.
- // An onunload listener could be used in the case where the iframe has just been
- // created, but since unload events fire only once, it doesn't work in the normal
- // case of iframe reuse (where unload will have already fired due to the attempted
- // navigation of the page).
- failSafeTimerId = setTimeout(function() {
- if (commandQueue.length) {
- 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) {
- clearTimeout(failSafeTimerId);
- failSafeTimerId = 0;
- }
- // Each entry in commandQueue is a JSON string already.
- if (!commandQueue.length) {
- return '';
- }
- var json = '[' + commandQueue.join(',') + ']';
- commandQueue.length = 0;
- return json;
-};
-
-iOSExec.nativeCallback = function(callbackId, status, message, keepCallback) {
- return iOSExec.nativeEvalAndFetch(function() {
- var success = status === 0 || status === 1;
- var args = convertMessageToArgsNativeToJs(message);
- cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
- });
-};
-
-iOSExec.nativeEvalAndFetch = function(func) {
- // This shouldn't be nested, but better to be safe.
- isInContextOfEvalJs++;
- try {
- func();
- return iOSExec.nativeFetchMessages();
- } finally {
- isInContextOfEvalJs--;
- }
-};
-
-module.exports = iOSExec;
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/338ee71f/platform_modules/platform.js
----------------------------------------------------------------------
diff --git a/platform_modules/platform.js b/platform_modules/platform.js
deleted file mode 100644
index 36529ba..0000000
--- a/platform_modules/platform.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-module.exports = {
- id: 'ios',
- bootstrap: function() {
- require('cordova/channel').onNativeReady.fire();
- }
-};
-
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[18/19] ios commit: CB-7747 Update project template with new
whitelist settings
Posted by ag...@apache.org.
CB-7747 Update project template with new whitelist settings
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/4f02fcae
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/4f02fcae
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/4f02fcae
Branch: refs/heads/4.0.x
Commit: 4f02fcae9f1f05ef6efbb46705ee915e5460793f
Parents: 43fe56a
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Mar 5 22:48:09 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Mar 5 22:48:09 2015 -0500
----------------------------------------------------------------------
bin/templates/project/__PROJECT_NAME__/config.xml | 18 +++++++++++++++---
bin/templates/project/www/index.html | 11 +++++------
2 files changed, 20 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/4f02fcae/bin/templates/project/__PROJECT_NAME__/config.xml
----------------------------------------------------------------------
diff --git a/bin/templates/project/__PROJECT_NAME__/config.xml b/bin/templates/project/__PROJECT_NAME__/config.xml
index 149e8fd..985ae7f 100644
--- a/bin/templates/project/__PROJECT_NAME__/config.xml
+++ b/bin/templates/project/__PROJECT_NAME__/config.xml
@@ -30,11 +30,23 @@
Apache Cordova Team
</author>
- <access origin="*"/>
-
- <!-- <content src="http://mysite.com/myapp.html" /> for external pages -->
<content src="index.html" />
+ <!-- Whitelist docs: https://github.com/apache/cordova-plugin-whitelist -->
+ <access origin="*" />
+ <!-- Grant certain URLs the ability to launch external applications. This
+ behaviour is set to match that of Cordova versions before 3.6.0, and
+ should be reviewed before launching an application in production. It
+ may be changed in the future. -->
+ <allow-intent href="http://*/*" />
+ <allow-intent href="https://*/*" />
+ <allow-intent href="tel:*" />
+ <allow-intent href="sms:*" />
+ <allow-intent href="mailto:*" />
+ <allow-intent href="geo:*" />
+ <allow-intent href="itms:*" />
+ <allow-intent href="itms-apps:*" />
+
<!-- Preferences for iOS -->
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="BackupWebStorage" value="cloud" />
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/4f02fcae/bin/templates/project/www/index.html
----------------------------------------------------------------------
diff --git a/bin/templates/project/www/index.html b/bin/templates/project/www/index.html
index 1ec4720..af4f11c 100755
--- a/bin/templates/project/www/index.html
+++ b/bin/templates/project/www/index.html
@@ -19,12 +19,11 @@
-->
<html>
<head>
- <meta charset="utf-8" />
- <meta name="format-detection" content="telephone=no" />
- <meta name="msapplication-tap-highlight" content="no" />
- <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
- <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
- <link rel="stylesheet" type="text/css" href="css/index.css" />
+ <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: blob: https://ssl.gstatic.com/accessibility/javascript/android/; style-src 'self' 'unsafe-inline'">
+ <meta name="format-detection" content="telephone=no">
+ <meta name="msapplication-tap-highlight" content="no">
+ <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
+ <link rel="stylesheet" type="text/css" href="css/index.css">
<title>Hello World</title>
</head>
<body>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[19/19] ios commit: Merge branch 'master' into 4.0.x
Posted by ag...@apache.org.
Merge branch 'master' into 4.0.x
Conflicts:
CordovaLib/CordovaLib.xcodeproj/project.pbxproj
CordovaLib/VERSION
package.json
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/c0085a8c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/c0085a8c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/c0085a8c
Branch: refs/heads/4.0.x
Commit: c0085a8c8b0986de67d2a497663e94292eb05c1a
Parents: 4d5de42 4f02fca
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Mar 5 23:00:00 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Mar 5 23:00:00 2015 -0500
----------------------------------------------------------------------
.jshintignore | 2 +
.jshintrc | 10 +
.travis.yml | 5 +-
CordovaLib/Classes/CDVAvailability.h | 3 +-
CordovaLib/Classes/CDVHandleOpenURL.h | 27 ++
CordovaLib/Classes/CDVHandleOpenURL.m | 74 +++++
CordovaLib/Classes/CDVViewController.m | 7 +-
CordovaLib/CordovaLib.xcodeproj/project.pbxproj | 6 +
CordovaLib/cordova.js | 19 +-
RELEASENOTES.md | 29 +-
bin/lib/check_reqs.js | 4 +-
bin/lib/create.js | 25 +-
bin/lib/versions.js | 6 +-
.../__PROJECT_NAME__/Classes/AppDelegate.m | 37 +--
.../project/__PROJECT_NAME__/config.xml | 19 +-
bin/templates/project/www/index.html | 11 +-
bin/templates/scripts/cordova/defaults.xml | 5 -
bin/templates/scripts/cordova/lib/build.js | 43 +--
bin/templates/scripts/cordova/lib/clean.js | 2 +-
bin/templates/scripts/cordova/lib/run.js | 46 +--
bin/templates/scripts/cordova/version | 2 +-
bin/uncrustify.sh | 9 +-
cordova-js-src/exec.js | 323 +++++++++++++++++++
cordova-js-src/platform.js | 28 ++
hooks/pre-commit | 5 -
package.json | 9 +-
tests/.jshintrc | 11 +
tests/CordovaLibTests/CordovaLibApp/config.xml | 1 -
tests/spec/cordovalib.spec.js | 2 +-
29 files changed, 646 insertions(+), 124 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/c0085a8c/CordovaLib/Classes/CDVHandleOpenURL.h
----------------------------------------------------------------------
diff --cc CordovaLib/Classes/CDVHandleOpenURL.h
index 0000000,24f461f..f9b0bff
mode 000000,100644..100644
--- a/CordovaLib/Classes/CDVHandleOpenURL.h
+++ b/CordovaLib/Classes/CDVHandleOpenURL.h
@@@ -1,0 -1,28 +1,27 @@@
+ /*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+ #import "CDVPlugin.h"
+
+ @interface CDVHandleOpenURL : CDVPlugin
+
+ @property (nonatomic, strong) NSURL* url;
+ @property (nonatomic, assign) BOOL pageLoaded;
+
+ @end
-
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/c0085a8c/CordovaLib/Classes/CDVHandleOpenURL.m
----------------------------------------------------------------------
diff --cc CordovaLib/Classes/CDVHandleOpenURL.m
index 0000000,e5dcdd5..b0f5878
mode 000000,100644..100644
--- a/CordovaLib/Classes/CDVHandleOpenURL.m
+++ b/CordovaLib/Classes/CDVHandleOpenURL.m
@@@ -1,0 -1,74 +1,74 @@@
+ /*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+ #import "CDVHandleOpenURL.h"
+ #import "CDV.h"
+
+ @implementation CDVHandleOpenURL
+
+ - (void)pluginInitialize
+ {
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationLaunchedWithUrl:) name:CDVPluginHandleOpenURLNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationPageDidLoad:) name:CDVPageDidLoadNotification object:nil];
+ }
+
+ - (void)applicationLaunchedWithUrl:(NSNotification*)notification
+ {
- NSURL *url = [notification object];
++ NSURL* url = [notification object];
++
+ self.url = url;
-
++
+ // warm-start handler
+ if (self.pageLoaded) {
+ [self processOpenUrl:self.url pageLoaded:YES];
+ self.url = nil;
+ }
+ }
+
+ - (void)applicationPageDidLoad:(NSNotification*)notification
+ {
+ // cold-start handler
-
++
+ self.pageLoaded = YES;
+
+ if (self.url) {
+ [self processOpenUrl:self.url pageLoaded:YES];
+ self.url = nil;
+ }
+ }
+
+ - (void)processOpenUrl:(NSURL*)url pageLoaded:(BOOL)pageLoaded
+ {
+ if (!pageLoaded) {
+ // query the webview for readystate
+ NSString* readyState = [self.webView stringByEvaluatingJavaScriptFromString:@"document.readyState"];
+ pageLoaded = [readyState isEqualToString:@"loaded"] || [readyState isEqualToString:@"complete"];
+ }
-
++
+ if (pageLoaded) {
+ // calls into javascript global function 'handleOpenURL'
- NSString* jsString = [NSString stringWithFormat:@"document.addEventListener('deviceready',function(){if (typeof handleOpenURL === 'function') { handleOpenURL(\"%@\");}});", url];
++ NSString* jsString = [NSString stringWithFormat:@"document.addEventListener('deviceready',function(){if (typeof handleOpenURL === 'function') { handleOpenURL(\"%@\");}});", url];
+ [self.webView stringByEvaluatingJavaScriptFromString:jsString];
+ } else {
+ // save for when page has loaded
+ self.url = url;
+ }
+ }
+
-
+ @end
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/c0085a8c/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --cc CordovaLib/Classes/CDVViewController.m
index eb056ce,6d81e8d..f368ceb
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@@ -339,7 -340,7 +340,7 @@@
}
NSString* decelerationSetting = [self settingForKey:@"UIWebViewDecelerationSpeed"];
-- if (![@"fast" isEqualToString:decelerationSetting]) {
++ if (![@"fast" isEqualToString : decelerationSetting]) {
[self.webView.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal];
}
@@@ -459,7 -460,9 +460,9 @@@
[CDVTimer stop:@"TotalPluginStartup"];
}
-
+
+ [self registerPlugin:[[CDVHandleOpenURL alloc] initWithWebView:self.webView] withClassName:NSStringFromClass([CDVHandleOpenURL class])];
-
++
// /////////////////
NSURL* appURL = [self appUrl];
@@@ -827,7 -830,7 +830,7 @@@
+ (NSString*)applicationDocumentsDirectory
{
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
-- NSString* basePath = (([paths count] > 0) ? ([paths objectAtIndex : 0]) : nil);
++ NSString* basePath = (([paths count] > 0) ? ([paths objectAtIndex:0]) : nil);
return basePath;
}
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/c0085a8c/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --cc CordovaLib/CordovaLib.xcodeproj/project.pbxproj
index 8513f5e,c6b0f23..e91ade2
--- a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
+++ b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
@@@ -20,7 -24,12 +20,9 @@@
30C684961407044B004C1A8E /* CDVURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 30C684931407044A004C1A8E /* CDVURLProtocol.m */; };
30E33AF213A7E24B00594D64 /* CDVPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E33AF013A7E24B00594D64 /* CDVPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; };
30E33AF313A7E24B00594D64 /* CDVPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 30E33AF113A7E24B00594D64 /* CDVPlugin.m */; };
- 30E563CF13E217EC00C949AA /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E563CD13E217EC00C949AA /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
30E563D013E217EC00C949AA /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 30E563CE13E217EC00C949AA /* NSMutableArray+QueueAdditions.m */; };
+ 30E6B8CD1A8ADD900025B9EE /* CDVHandleOpenURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E6B8CB1A8ADD900025B9EE /* CDVHandleOpenURL.h */; };
+ 30E6B8CE1A8ADD900025B9EE /* CDVHandleOpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 30E6B8CC1A8ADD900025B9EE /* CDVHandleOpenURL.m */; };
- 30F3930B169F839700B22307 /* CDVJSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 30F39309169F839700B22307 /* CDVJSON.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 30F3930C169F839700B22307 /* CDVJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F3930A169F839700B22307 /* CDVJSON.m */; };
30F5EBAB14CA26E700987760 /* CDVCommandDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 30F5EBA914CA26E700987760 /* CDVCommandDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
7E14B5A81705050A0032169E /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E14B5A61705050A0032169E /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; };
7E14B5A91705050A0032169E /* CDVTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E14B5A71705050A0032169E /* CDVTimer.m */; };
@@@ -60,12 -78,31 +62,14 @@@
30E33AF113A7E24B00594D64 /* CDVPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVPlugin.m; path = Classes/CDVPlugin.m; sourceTree = "<group>"; };
30E563CD13E217EC00C949AA /* NSMutableArray+QueueAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSMutableArray+QueueAdditions.h"; path = "Classes/NSMutableArray+QueueAdditions.h"; sourceTree = "<group>"; };
30E563CE13E217EC00C949AA /* NSMutableArray+QueueAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSMutableArray+QueueAdditions.m"; path = "Classes/NSMutableArray+QueueAdditions.m"; sourceTree = "<group>"; };
+ 30E6B8CB1A8ADD900025B9EE /* CDVHandleOpenURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVHandleOpenURL.h; path = Classes/CDVHandleOpenURL.h; sourceTree = "<group>"; };
+ 30E6B8CC1A8ADD900025B9EE /* CDVHandleOpenURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVHandleOpenURL.m; path = Classes/CDVHandleOpenURL.m; sourceTree = "<group>"; };
- 30F39309169F839700B22307 /* CDVJSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVJSON.h; path = Classes/CDVJSON.h; sourceTree = "<group>"; };
- 30F3930A169F839700B22307 /* CDVJSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVJSON.m; path = Classes/CDVJSON.m; sourceTree = "<group>"; };
30F5EBA914CA26E700987760 /* CDVCommandDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVCommandDelegate.h; path = Classes/CDVCommandDelegate.h; sourceTree = "<group>"; };
- 686357AA141002F100DF4CF2 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
- 686357AC141002F100DF4CF2 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
- 686357AE141002F100DF4CF2 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
- 686357CC14100AAD00DF4CF2 /* AddressBookUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBookUI.framework; path = System/Library/Frameworks/AddressBookUI.framework; sourceTree = SDKROOT; };
- 686357CE14100ADA00DF4CF2 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
- 686357CF14100ADB00DF4CF2 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
- 686357D014100ADE00DF4CF2 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
- 686357D214100AE700DF4CF2 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
- 686357D414100AF200DF4CF2 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
- 686357DC14100B1600DF4CF2 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; };
68A32D7114102E1C006B237C /* libCordova.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCordova.a; sourceTree = BUILT_PRODUCTS_DIR; };
- 68A32D7414103017006B237C /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; };
7E14B5A61705050A0032169E /* CDVTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVTimer.h; path = Classes/CDVTimer.h; sourceTree = "<group>"; };
7E14B5A71705050A0032169E /* CDVTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVTimer.m; path = Classes/CDVTimer.m; sourceTree = "<group>"; };
- 7E22B88419E4C0210026F95E /* CDVAvailabilityDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVAvailabilityDeprecated.h; path = Classes/CDVAvailabilityDeprecated.h; sourceTree = "<group>"; };
- 8220B5C316D5427E00EC3921 /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; };
8852C43614B65FD800F0E735 /* CDVViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVViewController.h; path = Classes/CDVViewController.h; sourceTree = "<group>"; };
8852C43714B65FD800F0E735 /* CDVViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVViewController.m; path = Classes/CDVViewController.m; sourceTree = "<group>"; };
- 8887FD281090FBE7009987E8 /* NSDictionary+Extensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSDictionary+Extensions.h"; path = "Classes/NSDictionary+Extensions.h"; sourceTree = "<group>"; };
- 8887FD291090FBE7009987E8 /* NSDictionary+Extensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSDictionary+Extensions.m"; path = "Classes/NSDictionary+Extensions.m"; sourceTree = "<group>"; };
8887FD341090FBE7009987E8 /* CDVInvokedUrlCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVInvokedUrlCommand.h; path = Classes/CDVInvokedUrlCommand.h; sourceTree = "<group>"; };
8887FD351090FBE7009987E8 /* CDVInvokedUrlCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVInvokedUrlCommand.m; path = Classes/CDVInvokedUrlCommand.m; sourceTree = "<group>"; };
8887FD501090FBE7009987E8 /* NSData+Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSData+Base64.h"; path = "Classes/NSData+Base64.h"; sourceTree = "<group>"; };
@@@ -176,23 -269,33 +180,24 @@@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
- 8887FD681090FBE7009987E8 /* NSDictionary+Extensions.h in Headers */,
- 8887FD741090FBE7009987E8 /* CDVInvokedUrlCommand.h in Headers */,
- 8887FD8F1090FBE7009987E8 /* NSData+Base64.h in Headers */,
- 1F92F4A01314023E0046367C /* CDVPluginResult.h in Headers */,
+ 301F2F2A14F3C9CA003FE9FC /* CDV.h in Headers */,
+ 30392E4E14F4FCAB00B9E0B8 /* CDVAvailability.h in Headers */,
+ EB6A98401A729CD70013FCDB /* CDVAvailabilityDeprecated.h in Headers */,
30E33AF213A7E24B00594D64 /* CDVPlugin.h in Headers */,
+ 1F92F4A01314023E0046367C /* CDVPluginResult.h in Headers */,
+ 30E6B8CD1A8ADD900025B9EE /* CDVHandleOpenURL.h in Headers */,
- 302965BC13A94E9D007046C5 /* CDVDebug.h in Headers */,
- 30E563CF13E217EC00C949AA /* NSMutableArray+QueueAdditions.h in Headers */,
- 30C684801406CB38004C1A8E /* CDVWhitelist.h in Headers */,
- 30C684941407044B004C1A8E /* CDVURLProtocol.h in Headers */,
8852C43A14B65FD800F0E735 /* CDVViewController.h in Headers */,
30F5EBAB14CA26E700987760 /* CDVCommandDelegate.h in Headers */,
- 301F2F2A14F3C9CA003FE9FC /* CDV.h in Headers */,
- 30392E4E14F4FCAB00B9E0B8 /* CDVAvailability.h in Headers */,
- 7E22B88519E4C0210026F95E /* CDVAvailabilityDeprecated.h in Headers */,
+ 30C684941407044B004C1A8E /* CDVURLProtocol.h in Headers */,
+ 8887FD741090FBE7009987E8 /* CDVInvokedUrlCommand.h in Headers */,
+ 30C684801406CB38004C1A8E /* CDVWhitelist.h in Headers */,
3034979C1513D56A0090E688 /* CDVLocalStorage.h in Headers */,
- 3062D120151D0EDB000D9128 /* UIDevice+Extensions.h in Headers */,
- EBA3557315ABD38C00F4DE24 /* NSArray+Comparisons.h in Headers */,
- EB3B3547161CB44D003DBE7D /* CDVCommandQueue.h in Headers */,
- EB3B357C161F2A45003DBE7D /* CDVCommandDelegateImpl.h in Headers */,
- 1B701028177A61CF00AE11F4 /* CDVShared.h in Headers */,
3073E9ED1656D51200957977 /* CDVScreenOrientationDelegate.h in Headers */,
+ 7E14B5A81705050A0032169E /* CDVTimer.h in Headers */,
F858FBC6166009A8007DA594 /* CDVConfigParser.h in Headers */,
- 30F3930B169F839700B22307 /* CDVJSON.h in Headers */,
- EBFF4DBD16D3FE2E008F452B /* CDVWebViewDelegate.h in Headers */,
EB96673B16A8970A00D86CDF /* CDVUserAgentUtil.h in Headers */,
- 7E14B5A81705050A0032169E /* CDVTimer.h in Headers */,
+ EBFF4DBD16D3FE2E008F452B /* CDVWebViewDelegate.h in Headers */,
+ EB6A98571A77FA430013FCDB /* NSData+Base64.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@@ -263,7 -369,9 +268,8 @@@
EB6A98541A77EE470013FCDB /* CDVJSON_private.m in Sources */,
EB3B357D161F2A45003DBE7D /* CDVCommandDelegateImpl.m in Sources */,
F858FBC7166009A8007DA594 /* CDVConfigParser.m in Sources */,
- 30F3930C169F839700B22307 /* CDVJSON.m in Sources */,
EB96673C16A8970A00D86CDF /* CDVUserAgentUtil.m in Sources */,
+ 30E6B8CE1A8ADD900025B9EE /* CDVHandleOpenURL.m in Sources */,
EBFF4DBC16D3FE2E008F452B /* CDVWebViewDelegate.m in Sources */,
7E14B5A91705050A0032169E /* CDVTimer.m in Sources */,
);
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/c0085a8c/package.json
----------------------------------------------------------------------
diff --cc package.json
index 52dcd8c,2b330f0..c301d69
--- a/package.json
+++ b/package.json
@@@ -23,5 -24,9 +24,9 @@@
"shelljs": "^0.2.6",
"coffee-script": "^1.7.1",
"nodeunit": "^0.8.7"
+ },
+ "devDependencies": {
+ "jshint": "^2.6.0",
+ "uncrustify": "^0.6.1"
}
-}
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[08/19] ios commit: Updating version to 3.8.0
Posted by ag...@apache.org.
Updating version to 3.8.0
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/9c5cf26d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/9c5cf26d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/9c5cf26d
Branch: refs/heads/4.0.x
Commit: 9c5cf26d9ce728696740cd448d32d0589b998ef3
Parents: 8dcc9dd
Author: Shazron Abdullah <sh...@apache.org>
Authored: Fri Feb 13 17:05:32 2015 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Feb 13 17:05:32 2015 -0800
----------------------------------------------------------------------
CordovaLib/Classes/CDVAvailability.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/9c5cf26d/CordovaLib/Classes/CDVAvailability.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVAvailability.h b/CordovaLib/Classes/CDVAvailability.h
index 1d37be0..71e20b9 100644
--- a/CordovaLib/Classes/CDVAvailability.h
+++ b/CordovaLib/Classes/CDVAvailability.h
@@ -54,6 +54,7 @@
#define __CORDOVA_3_5_0 30500
#define __CORDOVA_3_6_0 30600
#define __CORDOVA_3_7_0 30700
+#define __CORDOVA_3_8_0 30800
#define __CORDOVA_NA 99999 /* not available */
/*
@@ -64,7 +65,7 @@
#endif
*/
#ifndef CORDOVA_VERSION_MIN_REQUIRED
- #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_3_7_0
+ #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_3_8_0
#endif
/*
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[09/19] ios commit: CB-8436 Remove unneeded "" when composing
xcodebuild arguments (close #130)
Posted by ag...@apache.org.
CB-8436 Remove unneeded "" when composing xcodebuild arguments (close #130)
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/2bef65e3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/2bef65e3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/2bef65e3
Branch: refs/heads/4.0.x
Commit: 2bef65e31a20a63848c01401d6bbee25c6ba47f2
Parents: 9c5cf26
Author: Fatme Havaluova <Fa...@telerik.com>
Authored: Thu Feb 5 18:20:40 2015 +0200
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Feb 17 09:36:48 2015 -0500
----------------------------------------------------------------------
bin/templates/scripts/cordova/lib/build.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/2bef65e3/bin/templates/scripts/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/build.js b/bin/templates/scripts/cordova/lib/build.js
index ff3d625..e081959 100644
--- a/bin/templates/scripts/cordova/lib/build.js
+++ b/bin/templates/scripts/cordova/lib/build.js
@@ -99,12 +99,12 @@ function getXcodeArgs(projectName, projectPath, configuration, isDevice) {
xcodebuildArgs = [
'-xcconfig', path.join(__dirname, '..', 'build-' + configuration.toLowerCase() + '.xcconfig'),
'-project', projectName + '.xcodeproj',
- 'ARCHS="armv7 armv7s arm64"',
+ 'ARCHS=armv7 armv7s arm64',
'-target', projectName,
'-configuration', configuration,
'-sdk', 'iphoneos',
'build',
- 'VALID_ARCHS="armv7 armv7s arm64"',
+ 'VALID_ARCHS=armv7 armv7s arm64',
'CONFIGURATION_BUILD_DIR=' + path.join(projectPath, 'build', 'device'),
'SHARED_PRECOMPS_DIR=' + path.join(projectPath, 'build', 'sharedpch')
];
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[05/19] ios commit: CB-8435 Enable jshint for iOS platform
Posted by ag...@apache.org.
CB-8435 Enable jshint for iOS platform
Signed-off-by: Shazron Abdullah <sh...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/f7a88814
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/f7a88814
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/f7a88814
Branch: refs/heads/4.0.x
Commit: f7a888140951e1952acd40f3ec54d13726f2fae4
Parents: 338ee71
Author: Murat Sutunc <mu...@microsoft.com>
Authored: Thu Feb 5 12:03:37 2015 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Feb 13 15:39:02 2015 -0800
----------------------------------------------------------------------
.jshintignore | 2 ++
.jshintrc | 10 ++++++
.travis.yml | 5 ++-
bin/lib/create.js | 25 +++++++-------
bin/lib/versions.js | 6 ++--
bin/templates/scripts/cordova/lib/build.js | 34 +++++++++---------
bin/templates/scripts/cordova/lib/clean.js | 2 +-
bin/templates/scripts/cordova/lib/run.js | 46 ++++++++++++-------------
package.json | 9 +++--
tests/.jshintrc | 11 ++++++
tests/spec/cordovalib.spec.js | 2 +-
11 files changed, 91 insertions(+), 61 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/.jshintignore
----------------------------------------------------------------------
diff --git a/.jshintignore b/.jshintignore
new file mode 100644
index 0000000..e87aa4b
--- /dev/null
+++ b/.jshintignore
@@ -0,0 +1,2 @@
+bin/node_modules/*
+bin/templates/project/*
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/.jshintrc
----------------------------------------------------------------------
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..89a121c
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,10 @@
+{
+ "node": true
+ , "bitwise": true
+ , "undef": true
+ , "trailing": true
+ , "quotmark": true
+ , "indent": 4
+ , "unused": "vars"
+ , "latedef": "nofunc"
+}
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 74f77cc..31a8812 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,7 @@
language: objective-c
sudo: false
-install: npm install
+install:
+- npm install
+- npm install ios-sim
+- npm install ios-deploy
script: "npm test"
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/bin/lib/create.js
----------------------------------------------------------------------
diff --git a/bin/lib/create.js b/bin/lib/create.js
index ec762ac..cbffd63 100755
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -26,18 +26,18 @@ var shell = require('shelljs'),
ROOT = path.join(__dirname, '..', '..');
function createHelp() {
- console.log("Usage: $0 [--link] [--cli] <path_to_new_project> <package_name> <project_name> [<project_template_dir>]");
- console.log(" --link (optional): Link directly against the shared copy of the CordovaLib instead of a copy of it.");
- console.log(" --cli (optional): Use the CLI-project template.");
- console.log(" <path_to_new_project>: Path to your new Cordova iOS project");
- console.log(" <package_name>: Package name, following reverse-domain style convention");
- console.log(" <project_name>: Project name");
- console.log(" <project_template_dir>: Path to project template (override).");
+ console.log('Usage: $0 [--link] [--cli] <path_to_new_project> <package_name> <project_name> [<project_template_dir>]');
+ console.log(' --link (optional): Link directly against the shared copy of the CordovaLib instead of a copy of it.');
+ console.log(' --cli (optional): Use the CLI-project template.');
+ console.log(' <path_to_new_project>: Path to your new Cordova iOS project');
+ console.log(' <package_name>: Package name, following reverse-domain style convention');
+ console.log(' <project_name>: Project name');
+ console.log(' <project_template_dir>: Path to project template (override).');
}
function updateSubprojectHelp() {
- console.log('Updates the subproject path of the CordovaLib entry to point to this script\'s version of Cordova.')
- console.log("Usage: CordovaVersion/bin/update_cordova_project path/to/your/app.xcodeproj [path/to/CordovaLib.xcodeproj]");
+ console.log('Updates the subproject path of the CordovaLib entry to point to this script\'s version of Cordova.');
+ console.log('Usage: CordovaVersion/bin/update_cordova_project path/to/your/app.xcodeproj [path/to/CordovaLib.xcodeproj]');
}
function setShellFatal(value, func) {
@@ -103,10 +103,10 @@ function detectProjectName(projectDir) {
for (var i = 0; i < files.length; ++i) {
var m = /(.*)\.xcodeproj$/.exec(files[i]);
if (m) {
- return m[1]
+ return m[1];
}
}
- throw new Exception('Could not find an .xcodeproj directory within ' + projectDir);
+ throw new Error('Could not find an .xcodeproj directory within ' + projectDir);
}
function AbsParentPath(_path) {
@@ -146,7 +146,6 @@ exports.createProject = function(project_path, package_name, project_name, opts)
var use_shared = !!opts.link;
var use_cli = !!opts.cli;
var bin_dir = path.join(ROOT, 'bin'),
- cordovalib_dir = path.join(ROOT, 'CordovaLib'),
project_parent = path.dirname(project_path);
var project_template_dir = opts.project_template_dir || path.join(bin_dir, 'templates', 'project');
@@ -205,7 +204,7 @@ exports.createProject = function(project_path, package_name, project_name, opts)
console.log(generateDoneMessage('create', use_shared));
return Q.resolve();
-}
+};
exports.updateProject = function(projectPath, opts) {
var projectName = detectProjectName(projectPath);
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/bin/lib/versions.js
----------------------------------------------------------------------
diff --git a/bin/lib/versions.js b/bin/lib/versions.js
index 78f3ec5..e22e499 100755
--- a/bin/lib/versions.js
+++ b/bin/lib/versions.js
@@ -49,7 +49,7 @@ exports.get_apple_ios_version = function() {
}, function(stderr) {
return Q.reject(stderr);
});
-}
+};
exports.get_apple_osx_version = function() {
var d = Q.defer();
@@ -78,7 +78,7 @@ exports.get_apple_osx_version = function() {
}, function(stderr) {
return Q.reject(stderr);
});
-}
+};
exports.get_apple_xcode_version = function() {
var d = Q.defer();
@@ -158,7 +158,7 @@ exports.compareVersions = function (version1, version2) {
// Number constructor is strict enough and will return NaN
// if conversion fails. In this case we won't be able to compare versions properly
if (isNaN(parsed)) {
- throw "Version should contain only numbers and dots";
+ throw 'Version should contain only numbers and dots';
}
return parsed;
});
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/bin/templates/scripts/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/build.js b/bin/templates/scripts/cordova/lib/build.js
index 02d8113..ff3d625 100644
--- a/bin/templates/scripts/cordova/lib/build.js
+++ b/bin/templates/scripts/cordova/lib/build.js
@@ -51,9 +51,9 @@ module.exports.run = function (argv) {
}).then(function (projectName) {
var configuration = args.release ? 'Release' : 'Debug';
- console.log("Building project : " + path.join(projectPath, projectName + '.xcodeproj'));
- console.log("\tConfiguration : " + configuration);
- console.log("\tPlatform : " + (args.device ? 'device' : 'emulator'));
+ console.log('Building project : ' + path.join(projectPath, projectName + '.xcodeproj'));
+ console.log('\tConfiguration : ' + configuration);
+ console.log('\tPlatform : ' + (args.device ? 'device' : 'emulator'));
var xcodebuildArgs = getXcodeArgs(projectName, projectPath, configuration, args.device);
return spawn('xcodebuild', xcodebuildArgs, projectPath);
@@ -72,7 +72,7 @@ function findXCodeProjectIn(projectPath) {
});
if (xcodeProjFiles.length === 0) {
- return Q.reject("No Xcode project found in " + projectPath);
+ return Q.reject('No Xcode project found in ' + projectPath);
}
if (xcodeProjFiles.length > 1) {
console.warn('Found multiple .xcodeproj directories in \n' +
@@ -127,22 +127,22 @@ function getXcodeArgs(projectName, projectPath, configuration, isDevice) {
// help/usage function
module.exports.help = function help() {
- console.log("");
- console.log("Usage: build [ --debug | --release ] [--archs=\"<list of architectures...>\"] [--device | --simulator]");
- console.log(" --help : Displays this dialog.");
- console.log(" --debug : Builds project in debug mode. (Default)");
- console.log(" --release : Builds project in release mode.");
- console.log(" -r : Shortcut :: builds project in release mode.");
+ console.log('');
+ console.log('Usage: build [ --debug | --release ] [--archs=\"<list of architectures...>\"] [--device | --simulator]');
+ console.log(' --help : Displays this dialog.');
+ console.log(' --debug : Builds project in debug mode. (Default)');
+ console.log(' --release : Builds project in release mode.');
+ console.log(' -r : Shortcut :: builds project in release mode.');
// TODO: add support for building different archs
// console.log(" --archs : Builds project binaries for specific chip architectures (`anycpu`, `arm`, `x86`, `x64`).");
- console.log(" --device, --simulator");
- console.log(" : Specifies, what type of project to build");
- console.log("examples:");
- console.log(" build ");
- console.log(" build --debug");
- console.log(" build --release");
+ console.log(' --device, --simulator');
+ console.log(' : Specifies, what type of project to build');
+ console.log('examples:');
+ console.log(' build ');
+ console.log(' build --debug');
+ console.log(' build --release');
// TODO: add support for building different archs
// console.log(" build --release --archs=\"armv7\"");
- console.log("");
+ console.log('');
process.exit(0);
};
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/bin/templates/scripts/cordova/lib/clean.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/clean.js b/bin/templates/scripts/cordova/lib/clean.js
index 75ac18e..6d955cf 100644
--- a/bin/templates/scripts/cordova/lib/clean.js
+++ b/bin/templates/scripts/cordova/lib/clean.js
@@ -33,7 +33,7 @@ module.exports.run = function() {
})[0];
if (!projectName) {
- return Q.reject("No Xcode project found in " + projectPath);
+ return Q.reject('No Xcode project found in ' + projectPath);
}
return check_reqs.run().then(function() {
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/bin/templates/scripts/cordova/lib/run.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/run.js b/bin/templates/scripts/cordova/lib/run.js
index 53153fc..151cad2 100644
--- a/bin/templates/scripts/cordova/lib/run.js
+++ b/bin/templates/scripts/cordova/lib/run.js
@@ -36,9 +36,9 @@ module.exports.run = function (argv) {
// but still valid since they can be passed down to build command
var args = nopt({
// "archs": String, // TODO: add support for building different archs
- "list": Boolean,
- "nobuild": Boolean,
- "device": Boolean, "emulator": Boolean, "target": String
+ 'list': Boolean,
+ 'nobuild': Boolean,
+ 'device': Boolean, 'emulator': Boolean, 'target': String
}, {}, argv);
// Validate args
@@ -48,10 +48,10 @@ module.exports.run = function (argv) {
// validate target device for ios-sim
// Valid values for "--target" (case sensitive):
- var validTargets = ["iPhone-4s", "iPhone-5", "iPhone-5s", "iPhone-6-Plus", "iPhone-6",
- "iPad-2", "iPad-Retina", "iPad-Air", "Resizable-iPhone", "Resizable-iPad"];
+ var validTargets = ['iPhone-4s', 'iPhone-5', 'iPhone-5s', 'iPhone-6-Plus', 'iPhone-6',
+ 'iPad-2', 'iPad-Retina', 'iPad-Air', 'Resizable-iPhone', 'Resizable-iPad'];
if (args.target && validTargets.indexOf(args.target) < 0 ) {
- return Q.reject(args.target + " is not a valid target for emulator");
+ return Q.reject(args.target + ' is not a valid target for emulator');
}
// support for CB-8168 `cordova/run --list`
@@ -136,7 +136,7 @@ function deployToSim(appPath, target) {
function listDevices() {
return require('./list-devices').run()
.then(function (devices) {
- console.log("Available iOS Devices:");
+ console.log('Available iOS Devices:');
devices.forEach(function (device) {
console.log('\t' + device);
});
@@ -146,7 +146,7 @@ function listDevices() {
function listEmulators() {
return require('./list-emulator-images').run()
.then(function (emulators) {
- console.log("Available iOS Virtual Devices:");
+ console.log('Available iOS Virtual Devices:');
emulators.forEach(function (emulator) {
console.log('\t' + emulator);
});
@@ -154,24 +154,24 @@ function listEmulators() {
}
module.exports.help = function () {
- console.log("\nUsage: run [ --device | [ --emulator [ --target=<id> ] ] ] [ --debug | --release | --nobuild ]");
+ console.log('\nUsage: run [ --device | [ --emulator [ --target=<id> ] ] ] [ --debug | --release | --nobuild ]');
// TODO: add support for building different archs
// console.log(" [ --archs=\"<list of target architectures>\" ] ");
- console.log(" --device : Deploys and runs the project on the connected device.");
- console.log(" --emulator : Deploys and runs the project on an emulator.");
- console.log(" --target=<id> : Deploys and runs the project on the specified target.");
- console.log(" --debug : Builds project in debug mode. (Passed down to build command, if necessary)");
- console.log(" --release : Builds project in release mode. (Passed down to build command, if necessary)");
- console.log(" --nobuild : Uses pre-built package, or errors if project is not built.");
+ console.log(' --device : Deploys and runs the project on the connected device.');
+ console.log(' --emulator : Deploys and runs the project on an emulator.');
+ console.log(' --target=<id> : Deploys and runs the project on the specified target.');
+ console.log(' --debug : Builds project in debug mode. (Passed down to build command, if necessary)');
+ console.log(' --release : Builds project in release mode. (Passed down to build command, if necessary)');
+ console.log(' --nobuild : Uses pre-built package, or errors if project is not built.');
// TODO: add support for building different archs
// console.log(" --archs : Specific chip architectures (`anycpu`, `arm`, `x86`, `x64`).");
- console.log("");
- console.log("Examples:");
- console.log(" run");
- console.log(" run --device");
- console.log(" run --emulator --target=\"iPhone-6-Plus\"");
- console.log(" run --device --release");
- console.log(" run --emulator --debug");
- console.log("");
+ console.log('');
+ console.log('Examples:');
+ console.log(' run');
+ console.log(' run --device');
+ console.log(' run --emulator --target=\"iPhone-6-Plus\"');
+ console.log(' run --device --release');
+ console.log(' run --emulator --debug');
+ console.log('');
process.exit(0);
};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 1714e4d..2f4b5d4 100644
--- a/package.json
+++ b/package.json
@@ -13,8 +13,10 @@
"apache"
],
"scripts": {
- "test": "npm run jasmine",
- "jasmine": "jasmine-node --captureExceptions --color tests/spec"
+ "test": "npm run jshint && npm run jasmine",
+ "jasmine": "jasmine-node --captureExceptions --color tests/spec",
+ "jshint": "node node_modules/jshint/bin/jshint bin && node node_modules/jshint/bin/jshint tests"
+
},
"author": "Apache Software Foundation",
"license": "Apache Version 2.0",
@@ -23,5 +25,8 @@
"shelljs": "^0.2.6",
"coffee-script": "^1.7.1",
"nodeunit": "^0.8.7"
+ },
+ "devDependencies": {
+ "jshint": "^2.6.0"
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/tests/.jshintrc
----------------------------------------------------------------------
diff --git a/tests/.jshintrc b/tests/.jshintrc
new file mode 100644
index 0000000..17eae32
--- /dev/null
+++ b/tests/.jshintrc
@@ -0,0 +1,11 @@
+{
+ "node": true
+ , "bitwise": true
+ , "undef": true
+ , "trailing": true
+ , "quotmark": true
+ , "indent": 4
+ , "unused": "vars"
+ , "latedef": "nofunc"
+ , "jasmine": true
+}
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/tests/spec/cordovalib.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/cordovalib.spec.js b/tests/spec/cordovalib.spec.js
index dc581ff..10cd696 100644
--- a/tests/spec/cordovalib.spec.js
+++ b/tests/spec/cordovalib.spec.js
@@ -36,7 +36,7 @@ describe('cordova-lib', function() {
return_code = shell.exec(command).code;
// if iOS Simulator is running, kill it
- if (return_code == 0) { // found
+ if (return_code === 0) { // found
shell.echo('iOS Simulator is running, we\'re going to kill it.');
return_code = shell.exec('killall "iOS Simulator"').code;
expect(return_code).toBe(0);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[07/19] ios commit: CB-8084 - Allow for a way to disable push
notification delegate methods (through xcconfig). Style fixup using
uncrustify.
Posted by ag...@apache.org.
CB-8084 - Allow for a way to disable push notification delegate methods (through xcconfig). Style fixup using uncrustify.
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/8dcc9dd6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/8dcc9dd6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/8dcc9dd6
Branch: refs/heads/4.0.x
Commit: 8dcc9dd626c523e6e217dd7e8ce43d0af849fa3a
Parents: ed54ddf
Author: Shazron Abdullah <sh...@apache.org>
Authored: Fri Feb 13 16:53:49 2015 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Feb 13 16:53:49 2015 -0800
----------------------------------------------------------------------
.../__PROJECT_NAME__/Classes/AppDelegate.m | 37 +++++++++++---------
1 file changed, 20 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8dcc9dd6/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
----------------------------------------------------------------------
diff --git a/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m b/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
index c52a838..3cb3198 100644
--- a/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
+++ b/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
@@ -113,24 +113,27 @@
[[NSNotificationCenter defaultCenter] postNotificationName:CDVLocalNotification object:notification];
}
-- (void) application:(UIApplication*)application
- didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
-{
- // re-post ( broadcast )
- NSString* token = [[[[deviceToken description]
- stringByReplacingOccurrencesOfString:@"<" withString:@""]
- stringByReplacingOccurrencesOfString:@">" withString:@""]
- stringByReplacingOccurrencesOfString:@" " withString:@""];
-
- [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotification object:token];
-}
+#ifndef DISABLE_PUSH_NOTIFICATIONS
+
+ - (void) application:(UIApplication*)application
+ didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
+ {
+ // re-post ( broadcast )
+ NSString* token = [[[[deviceToken description]
+ stringByReplacingOccurrencesOfString:@"<" withString:@""]
+ stringByReplacingOccurrencesOfString:@">" withString:@""]
+ stringByReplacingOccurrencesOfString:@" " withString:@""];
+
+ [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotification object:token];
+ }
-- (void) application:(UIApplication*)application
- didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
-{
- // re-post ( broadcast )
- [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error];
-}
+ - (void) application:(UIApplication*)application
+ didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
+ {
+ // re-post ( broadcast )
+ [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error];
+ }
+#endif
- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
{
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[12/19] ios commit: CB-8506 - modify uncrustify npm install
instructions
Posted by ag...@apache.org.
CB-8506 - modify uncrustify npm install instructions
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/a395f5fe
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/a395f5fe
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/a395f5fe
Branch: refs/heads/4.0.x
Commit: a395f5fec41c66d893acc86b0930877392a4d6a9
Parents: 2588a80
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Wed Feb 18 16:40:20 2015 -0700
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Wed Feb 18 16:40:20 2015 -0700
----------------------------------------------------------------------
bin/uncrustify.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/a395f5fe/bin/uncrustify.sh
----------------------------------------------------------------------
diff --git a/bin/uncrustify.sh b/bin/uncrustify.sh
index 10ba377..2c37fb6 100755
--- a/bin/uncrustify.sh
+++ b/bin/uncrustify.sh
@@ -34,8 +34,8 @@ function Usage() {
function VerifyEnv() {
if ! which "$EXE" > /dev/null; then
- echo "uncrustify binary not found. Please ensure that it is in your PATH."
- echo "Install via homebrew using: brew install uncrustify"
+ echo "uncrustify binary not found in the cordova-ios repo."
+ echo "In the repo root, install via npm: npm install"
exit 1
fi
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[15/19] ios commit: Update RELEASENOTES for 3.8.0
Posted by ag...@apache.org.
Update RELEASENOTES for 3.8.0
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/4575b369
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/4575b369
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/4575b369
Branch: refs/heads/4.0.x
Commit: 4575b3694dcb76f13e21ca0d3bba3d18668ae7a5
Parents: b07c174
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Thu Feb 19 15:31:53 2015 -0700
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Thu Feb 19 15:32:17 2015 -0700
----------------------------------------------------------------------
RELEASENOTES.md | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/4575b369/RELEASENOTES.md
----------------------------------------------------------------------
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 23d6194..68762b7 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -20,11 +20,36 @@
-->
## Release Notes for Cordova (iOS) ##
-Update these notes using: git log --pretty=format:'* %s' --topo-order --no-merges origin/3.6.x..HEAD
+Update these notes using: git log --pretty=format:'* %s' --topo-order --no-merges origin/3.7.x..HEAD
Cordova is a static library that enables developers to include the Cordova API in their iOS application projects easily, and also create new Cordova-based iOS application projects through the command-line.
-### 3.7.0 (201411XX) ###
+### 3.8.0 (201502XX) ###
+
+* CB-8436 Remove more bad quotes from build command
+* CB-8436 Remove unneeded "" when composing xcodebuild arguments (closes #130)
+* CB-8084 Allow for a way to disable push notification delegate methods (through xcconfig). Style fixup using uncrustify.
+* CB-7606 handleOpenURL not working correctly on cold start (handler not evaluated yet) and warm start
+* CB-8435 Enable jshint for iOS platform
+* CB-8417 moved platform specific js into platform
+* CB-8336 Remove plugin prefs from iOS defaults.xml
+* CB-8254 Enable use of .xcconfig when building for emulator
+* CB-8351 Deprecate all non-prefixed class extensions
+* CB-8358 Make --link an alias for --shared plus some code simplification.
+* CB-8197 Convert all bash scripts to node.js (closes #126)
+* CB-8314 Speed up Travis CI (close #125)
+* CB-8036 Don't exclude bin/node_modules from npm pack (via .gitignore)
+* CB-7872 Fix CODE_SIGN_RESOURCE_RULES_PATH being set wrong in xcconfig (closes #120)
+* CB-8168 `cordova/run --list` support for iOS (closes #122)
+* CB-8044 support for --nobuild flag in run script
+* CB-6637 Removed - request:isFragmentIdentifierToRequest: deprecated method in CDVWebViewDelegate (closes #121)
+* CB-8002 (CB-7735) Update cordova.js to include bridge fix
+* CB-5706 convert some of the bash scripts to nodejs (closes #118)
+* CB-8506 Use npm version of uncrustify in cordova-ios (devDependency only)
+* Have CordovaLib classes import CDVJSON_private.h rather than CDVJSON.h
+* Trim down checked-in node_module files to minimal set
+
+### 3.7.0 (20141106) ###
* CB-7882 - viewDidUnload instance method is missing [super viewDidUnload] call
* CB-7872 - XCode 6.1's xcrun PackageApplication fails at packaging / resigning Cordova applications (closes #115)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[02/19] ios commit: CB-8336 - Remove plugin prefs from iOS
defaults.xml
Posted by ag...@apache.org.
CB-8336 - Remove plugin prefs from iOS defaults.xml
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/fe221840
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/fe221840
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/fe221840
Branch: refs/heads/4.0.x
Commit: fe2218409d03e6c19143699db325b87acd630813
Parents: 875d699
Author: Shazron Abdullah <sh...@apache.org>
Authored: Thu Feb 5 11:57:59 2015 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Thu Feb 5 11:57:59 2015 -0800
----------------------------------------------------------------------
bin/templates/project/__PROJECT_NAME__/config.xml | 1 -
bin/templates/scripts/cordova/defaults.xml | 5 -----
tests/CordovaLibTests/CordovaLibApp/config.xml | 1 -
3 files changed, 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/fe221840/bin/templates/project/__PROJECT_NAME__/config.xml
----------------------------------------------------------------------
diff --git a/bin/templates/project/__PROJECT_NAME__/config.xml b/bin/templates/project/__PROJECT_NAME__/config.xml
index 1fcc8d7..149e8fd 100644
--- a/bin/templates/project/__PROJECT_NAME__/config.xml
+++ b/bin/templates/project/__PROJECT_NAME__/config.xml
@@ -43,7 +43,6 @@
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="SuppressesIncrementalRendering" value="false" />
- <preference name="TopActivityIndicator" value="gray" />
<preference name="GapBetweenPages" value="0" />
<preference name="PageLength" value="0" />
<preference name="PaginationBreakingMode" value="page" /> <!-- page, column -->
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/fe221840/bin/templates/scripts/cordova/defaults.xml
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/defaults.xml b/bin/templates/scripts/cordova/defaults.xml
index 18cf8a8..c98d846 100644
--- a/bin/templates/scripts/cordova/defaults.xml
+++ b/bin/templates/scripts/cordova/defaults.xml
@@ -23,17 +23,12 @@
<!-- Preferences for iOS -->
<preference name="AllowInlineMediaPlayback" value="false" />
- <preference name="AutoHideSplashScreen" value="true" />
<preference name="BackupWebStorage" value="cloud" />
<preference name="DisallowOverscroll" value="false" />
<preference name="EnableViewportScale" value="false" />
- <preference name="FadeSplashScreen" value="true" />
- <preference name="FadeSplashScreenDuration" value=".25" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
- <preference name="ShowSplashScreenSpinner" value="true" />
<preference name="SuppressesIncrementalRendering" value="false" />
- <preference name="TopActivityIndicator" value="gray" />
<preference name="GapBetweenPages" value="0" />
<preference name="PageLength" value="0" />
<preference name="PaginationBreakingMode" value="page" /> <!-- page, column -->
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/fe221840/tests/CordovaLibTests/CordovaLibApp/config.xml
----------------------------------------------------------------------
diff --git a/tests/CordovaLibTests/CordovaLibApp/config.xml b/tests/CordovaLibTests/CordovaLibApp/config.xml
index 1fcc8d7..149e8fd 100644
--- a/tests/CordovaLibTests/CordovaLibApp/config.xml
+++ b/tests/CordovaLibTests/CordovaLibApp/config.xml
@@ -43,7 +43,6 @@
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="SuppressesIncrementalRendering" value="false" />
- <preference name="TopActivityIndicator" value="gray" />
<preference name="GapBetweenPages" value="0" />
<preference name="PageLength" value="0" />
<preference name="PaginationBreakingMode" value="page" /> <!-- page, column -->
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[11/19] ios commit: CB-8506 - Use npm version of uncrustify in
cordova-ios
Posted by ag...@apache.org.
CB-8506 - Use npm version of uncrustify in cordova-ios
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/2588a805
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/2588a805
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/2588a805
Branch: refs/heads/4.0.x
Commit: 2588a805758ac979cf88ab8d733cb78bd61b645a
Parents: 7422425
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Wed Feb 18 15:44:20 2015 -0700
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Wed Feb 18 15:44:20 2015 -0700
----------------------------------------------------------------------
bin/uncrustify.sh | 5 +++--
hooks/pre-commit | 5 -----
package.json | 3 ++-
3 files changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/2588a805/bin/uncrustify.sh
----------------------------------------------------------------------
diff --git a/bin/uncrustify.sh b/bin/uncrustify.sh
index 3c23230..10ba377 100755
--- a/bin/uncrustify.sh
+++ b/bin/uncrustify.sh
@@ -20,6 +20,7 @@
SCRIPT_PATH=$(dirname $0)
CONFIG="$SCRIPT_PATH/uncrustify.cfg"
+EXE="$SCRIPT_PATH/../node_modules/.bin/uncrustify"
function Usage() {
echo "Formats code using uncrustify."
@@ -32,7 +33,7 @@ function Usage() {
}
function VerifyEnv() {
- if ! which uncrustify > /dev/null; then
+ if ! which "$EXE" > /dev/null; then
echo "uncrustify binary not found. Please ensure that it is in your PATH."
echo "Install via homebrew using: brew install uncrustify"
exit 1
@@ -77,7 +78,7 @@ elif [[ "$1" = "--all" ]]; then
files=$(find .)
FilterAndRun $files
elif [[ "$1" = "--check-file" ]]; then
- uncrustify -q -l OC -c "$CONFIG" -f "$2" | cmp --quiet - "$2"
+ "$EXE" -q -l OC -c "$CONFIG" -f "$2" | cmp --quiet - "$2"
elif [[ "$1" = "--filter" ]]; then
FilterFileList "$@"
elif [[ "$1" = -* ]]; then
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/2588a805/hooks/pre-commit
----------------------------------------------------------------------
diff --git a/hooks/pre-commit b/hooks/pre-commit
index 1611f52..bcff748 100755
--- a/hooks/pre-commit
+++ b/hooks/pre-commit
@@ -24,11 +24,6 @@ PATH=$PATH:/usr/local/bin:/usr/local/sbin
exec 1>&2
test $SKIP_UNCRUSTIFY && exit 0
-if [[ "$(uncrustify --version | cut -d' ' -f2)" != 0.60 ]]; then
- echo "Please install version 0.60 of uncrustify."
- exit 1
-fi
-
RET=0
files=$(bin/uncrustify.sh --filter $(git diff --cached --name-only))
MSGS=
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/2588a805/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 2f4b5d4..6c84626 100644
--- a/package.json
+++ b/package.json
@@ -27,6 +27,7 @@
"nodeunit": "^0.8.7"
},
"devDependencies": {
- "jshint": "^2.6.0"
+ "jshint": "^2.6.0",
+ "uncrustify": "^0.6.1"
}
}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[13/19] ios commit: Set VERSION to 3.9.0-dev (via coho)
Posted by ag...@apache.org.
Set VERSION to 3.9.0-dev (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/c0cdca05
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/c0cdca05
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/c0cdca05
Branch: refs/heads/4.0.x
Commit: c0cdca058ff12647b82f994024216fbafc578581
Parents: a395f5f
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Thu Feb 19 15:18:41 2015 -0700
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Thu Feb 19 15:18:41 2015 -0700
----------------------------------------------------------------------
CordovaLib/VERSION | 2 +-
bin/templates/scripts/cordova/version | 2 +-
package.json | 3 +--
3 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/c0cdca05/CordovaLib/VERSION
----------------------------------------------------------------------
diff --git a/CordovaLib/VERSION b/CordovaLib/VERSION
index d4da33b..724ee60 100644
--- a/CordovaLib/VERSION
+++ b/CordovaLib/VERSION
@@ -1 +1 @@
-3.8.0-dev
+3.9.0-dev
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/c0cdca05/bin/templates/scripts/cordova/version
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/version b/bin/templates/scripts/cordova/version
index 566a73b..b10a59c 100755
--- a/bin/templates/scripts/cordova/version
+++ b/bin/templates/scripts/cordova/version
@@ -25,6 +25,6 @@
Note: it does not work if the --shared option was used to create the project.
*/
-var VERSION = "3.8.0-dev";
+var VERSION="3.9.0-dev"
console.log(VERSION);
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/c0cdca05/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 6c84626..2b330f0 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "cordova-ios",
- "version": "3.8.0-dev",
+ "version": "3.9.0-dev",
"description": "cordova-ios release",
"main": "bin/create",
"repository": {
@@ -16,7 +16,6 @@
"test": "npm run jshint && npm run jasmine",
"jasmine": "jasmine-node --captureExceptions --color tests/spec",
"jshint": "node node_modules/jshint/bin/jshint bin && node node_modules/jshint/bin/jshint tests"
-
},
"author": "Apache Software Foundation",
"license": "Apache Version 2.0",
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[06/19] ios commit: CB-7606 - handleOpenURL not working correctly on
cold start (handler not evaluated yet) and warm start
Posted by ag...@apache.org.
CB-7606 - handleOpenURL not working correctly on cold start (handler not evaluated yet) and warm start
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/ed54ddf2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/ed54ddf2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/ed54ddf2
Branch: refs/heads/4.0.x
Commit: ed54ddf2cc6e2b746a406e15e99f549846cd171b
Parents: f7a8881
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Tue Feb 10 16:51:54 2015 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Feb 13 16:06:59 2015 -0800
----------------------------------------------------------------------
CordovaLib/Classes/CDVHandleOpenURL.h | 28 ++++++++
CordovaLib/Classes/CDVHandleOpenURL.m | 74 ++++++++++++++++++++
CordovaLib/Classes/CDVViewController.m | 5 +-
CordovaLib/CordovaLib.xcodeproj/project.pbxproj | 8 +++
.../__PROJECT_NAME__/Classes/AppDelegate.m | 2 -
5 files changed, 114 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/ed54ddf2/CordovaLib/Classes/CDVHandleOpenURL.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVHandleOpenURL.h b/CordovaLib/Classes/CDVHandleOpenURL.h
new file mode 100644
index 0000000..24f461f
--- /dev/null
+++ b/CordovaLib/Classes/CDVHandleOpenURL.h
@@ -0,0 +1,28 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVPlugin.h"
+
+@interface CDVHandleOpenURL : CDVPlugin
+
+@property (nonatomic, strong) NSURL* url;
+@property (nonatomic, assign) BOOL pageLoaded;
+
+@end
+
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/ed54ddf2/CordovaLib/Classes/CDVHandleOpenURL.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVHandleOpenURL.m b/CordovaLib/Classes/CDVHandleOpenURL.m
new file mode 100644
index 0000000..e5dcdd5
--- /dev/null
+++ b/CordovaLib/Classes/CDVHandleOpenURL.m
@@ -0,0 +1,74 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVHandleOpenURL.h"
+#import "CDV.h"
+
+@implementation CDVHandleOpenURL
+
+- (void)pluginInitialize
+{
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationLaunchedWithUrl:) name:CDVPluginHandleOpenURLNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationPageDidLoad:) name:CDVPageDidLoadNotification object:nil];
+}
+
+- (void)applicationLaunchedWithUrl:(NSNotification*)notification
+{
+ NSURL *url = [notification object];
+ self.url = url;
+
+ // warm-start handler
+ if (self.pageLoaded) {
+ [self processOpenUrl:self.url pageLoaded:YES];
+ self.url = nil;
+ }
+}
+
+- (void)applicationPageDidLoad:(NSNotification*)notification
+{
+ // cold-start handler
+
+ self.pageLoaded = YES;
+
+ if (self.url) {
+ [self processOpenUrl:self.url pageLoaded:YES];
+ self.url = nil;
+ }
+}
+
+- (void)processOpenUrl:(NSURL*)url pageLoaded:(BOOL)pageLoaded
+{
+ if (!pageLoaded) {
+ // query the webview for readystate
+ NSString* readyState = [self.webView stringByEvaluatingJavaScriptFromString:@"document.readyState"];
+ pageLoaded = [readyState isEqualToString:@"loaded"] || [readyState isEqualToString:@"complete"];
+ }
+
+ if (pageLoaded) {
+ // calls into javascript global function 'handleOpenURL'
+ NSString* jsString = [NSString stringWithFormat:@"document.addEventListener('deviceready',function(){if (typeof handleOpenURL === 'function') { handleOpenURL(\"%@\");}});", url];
+ [self.webView stringByEvaluatingJavaScriptFromString:jsString];
+ } else {
+ // save for when page has loaded
+ self.url = url;
+ }
+}
+
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/ed54ddf2/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index eb056ce..6d81e8d 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -24,6 +24,7 @@
#import "CDVUserAgentUtil.h"
#import "CDVWebViewDelegate.h"
#import <AVFoundation/AVFoundation.h>
+#import "CDVHandleOpenURL.h"
#define degreesToRadian(x) (M_PI * (x) / 180.0)
@@ -459,7 +460,9 @@
[CDVTimer stop:@"TotalPluginStartup"];
}
-
+
+ [self registerPlugin:[[CDVHandleOpenURL alloc] initWithWebView:self.webView] withClassName:NSStringFromClass([CDVHandleOpenURL class])];
+
// /////////////////
NSURL* appURL = [self appUrl];
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/ed54ddf2/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
index f3ef82a..c6b0f23 100644
--- a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
+++ b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
@@ -26,6 +26,8 @@
30E33AF313A7E24B00594D64 /* CDVPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 30E33AF113A7E24B00594D64 /* CDVPlugin.m */; };
30E563CF13E217EC00C949AA /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E563CD13E217EC00C949AA /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
30E563D013E217EC00C949AA /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 30E563CE13E217EC00C949AA /* NSMutableArray+QueueAdditions.m */; };
+ 30E6B8CD1A8ADD900025B9EE /* CDVHandleOpenURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E6B8CB1A8ADD900025B9EE /* CDVHandleOpenURL.h */; };
+ 30E6B8CE1A8ADD900025B9EE /* CDVHandleOpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 30E6B8CC1A8ADD900025B9EE /* CDVHandleOpenURL.m */; };
30F3930B169F839700B22307 /* CDVJSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 30F39309169F839700B22307 /* CDVJSON.h */; settings = {ATTRIBUTES = (Public, ); }; };
30F3930C169F839700B22307 /* CDVJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F3930A169F839700B22307 /* CDVJSON.m */; };
30F5EBAB14CA26E700987760 /* CDVCommandDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 30F5EBA914CA26E700987760 /* CDVCommandDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -76,6 +78,8 @@
30E33AF113A7E24B00594D64 /* CDVPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVPlugin.m; path = Classes/CDVPlugin.m; sourceTree = "<group>"; };
30E563CD13E217EC00C949AA /* NSMutableArray+QueueAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSMutableArray+QueueAdditions.h"; path = "Classes/NSMutableArray+QueueAdditions.h"; sourceTree = "<group>"; };
30E563CE13E217EC00C949AA /* NSMutableArray+QueueAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSMutableArray+QueueAdditions.m"; path = "Classes/NSMutableArray+QueueAdditions.m"; sourceTree = "<group>"; };
+ 30E6B8CB1A8ADD900025B9EE /* CDVHandleOpenURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVHandleOpenURL.h; path = Classes/CDVHandleOpenURL.h; sourceTree = "<group>"; };
+ 30E6B8CC1A8ADD900025B9EE /* CDVHandleOpenURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVHandleOpenURL.m; path = Classes/CDVHandleOpenURL.m; sourceTree = "<group>"; };
30F39309169F839700B22307 /* CDVJSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVJSON.h; path = Classes/CDVJSON.h; sourceTree = "<group>"; };
30F3930A169F839700B22307 /* CDVJSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVJSON.m; path = Classes/CDVJSON.m; sourceTree = "<group>"; };
30F5EBA914CA26E700987760 /* CDVCommandDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVCommandDelegate.h; path = Classes/CDVCommandDelegate.h; sourceTree = "<group>"; };
@@ -194,6 +198,8 @@
888700D710922F56009987E8 /* Commands */ = {
isa = PBXGroup;
children = (
+ 30E6B8CB1A8ADD900025B9EE /* CDVHandleOpenURL.h */,
+ 30E6B8CC1A8ADD900025B9EE /* CDVHandleOpenURL.m */,
7E22B88419E4C0210026F95E /* CDVAvailabilityDeprecated.h */,
EBFF4DBA16D3FE2E008F452B /* CDVWebViewDelegate.m */,
EBFF4DBB16D3FE2E008F452B /* CDVWebViewDelegate.h */,
@@ -268,6 +274,7 @@
8887FD8F1090FBE7009987E8 /* NSData+Base64.h in Headers */,
1F92F4A01314023E0046367C /* CDVPluginResult.h in Headers */,
30E33AF213A7E24B00594D64 /* CDVPlugin.h in Headers */,
+ 30E6B8CD1A8ADD900025B9EE /* CDVHandleOpenURL.h in Headers */,
302965BC13A94E9D007046C5 /* CDVDebug.h in Headers */,
30E563CF13E217EC00C949AA /* NSMutableArray+QueueAdditions.h in Headers */,
30C684801406CB38004C1A8E /* CDVWhitelist.h in Headers */,
@@ -364,6 +371,7 @@
F858FBC7166009A8007DA594 /* CDVConfigParser.m in Sources */,
30F3930C169F839700B22307 /* CDVJSON.m in Sources */,
EB96673C16A8970A00D86CDF /* CDVUserAgentUtil.m in Sources */,
+ 30E6B8CE1A8ADD900025B9EE /* CDVHandleOpenURL.m in Sources */,
EBFF4DBC16D3FE2E008F452B /* CDVWebViewDelegate.m in Sources */,
7E14B5A91705050A0032169E /* CDVTimer.m in Sources */,
);
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/ed54ddf2/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
----------------------------------------------------------------------
diff --git a/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m b/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
index fe4a7a0..c52a838 100644
--- a/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
+++ b/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
@@ -99,8 +99,6 @@
return NO;
}
- [self.viewController processOpenUrl:url];
-
// all plugins will get the notification, and their handlers will be called
[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[14/19] ios commit: Update JS snapshot to version 3.9.0-dev (via coho)
Posted by ag...@apache.org.
Update JS snapshot to version 3.9.0-dev (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/b07c1742
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/b07c1742
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/b07c1742
Branch: refs/heads/4.0.x
Commit: b07c174250842b023c20762839f66b05d87d21cf
Parents: c0cdca0
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Thu Feb 19 15:18:43 2015 -0700
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Thu Feb 19 15:18:43 2015 -0700
----------------------------------------------------------------------
CordovaLib/cordova.js | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/b07c1742/CordovaLib/cordova.js
----------------------------------------------------------------------
diff --git a/CordovaLib/cordova.js b/CordovaLib/cordova.js
index 9588ca4..62407ca 100644
--- a/CordovaLib/cordova.js
+++ b/CordovaLib/cordova.js
@@ -1,5 +1,5 @@
// Platform: ios
-// 227d83a122733fdf0300ffe75507a221bcef2b06
+// fc4db9145934bd0053161cbf9ffc0caf83b770c6
/*
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.8.0-dev';
+var PLATFORM_VERSION_BUILD_LABEL = '3.9.0-dev';
// file: src/scripts/require.js
/*jshint -W079 */
@@ -284,10 +284,16 @@ var cordova = {
if (callback) {
if (isSuccess && status == cordova.callbackStatus.OK) {
callback.success && callback.success.apply(null, args);
- } else {
+ } else if (!isSuccess) {
callback.fail && callback.fail.apply(null, args);
}
-
+ /*
+ else
+ Note, this case is intentionally not caught.
+ this can happen if isSuccess is true, but callbackStatus is NO_RESULT
+ which is used to remove a callback from the list without calling the callbacks
+ typically keepCallback is false in this case
+ */
// Clear callback if not expecting any more results
if (!keepCallback) {
delete cordova.callbacks[callbackId];
@@ -586,7 +592,6 @@ var utils = require('cordova/utils'),
* onDeviceReady* User event fired to indicate that Cordova is ready
* onResume User event fired to indicate a start/resume lifecycle event
* onPause User event fired to indicate a pause lifecycle event
- * onDestroy* Internal event fired when app is being destroyed (User should use window.onunload event, not this one).
*
* The events marked with an * are sticky. Once they have fired, they will stay in the fired state.
* All listeners that subscribe after the event is fired will be executed right away.
@@ -798,9 +803,6 @@ channel.create('onResume');
// Event to indicate a pause lifecycle event
channel.create('onPause');
-// Event to indicate a destroy lifecycle event
-channel.createSticky('onDestroy');
-
// Channels that must fire before "deviceready" is fired.
channel.waitForInitialization('onCordovaReady');
channel.waitForInitialization('onDOMContentLoaded');
@@ -827,6 +829,7 @@ var cordova = require('cordova'),
// IFRAME_HASH could be made to enable synchronous bridge calls if we wanted this feature.
jsToNativeModes = {
IFRAME_NAV: 0, // Default. Uses a new iframe for each poke.
+ // XHR bridge appears to be flaky sometimes: CB-3900, CB-3359, CB-5457, CB-4970, CB-4998, CB-5134
XHR_NO_PAYLOAD: 1, // About the same speed as IFRAME_NAV. Performance not about the same as IFRAME_NAV, but more variable.
XHR_WITH_PAYLOAD: 2, // Flakey, and not as performant
XHR_OPTIONAL_PAYLOAD: 3, // Flakey, and not as performant
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[03/19] ios commit: CB-8417 moved platform specific js into platform
Posted by ag...@apache.org.
CB-8417 moved platform specific js into platform
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/8b3c89b6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/8b3c89b6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/8b3c89b6
Branch: refs/heads/4.0.x
Commit: 8b3c89b646026ccfe2903230f3ea9066911fe9f8
Parents: fe22184
Author: Steve Gill <st...@gmail.com>
Authored: Fri Feb 6 16:45:54 2015 -0800
Committer: Steve Gill <st...@gmail.com>
Committed: Fri Feb 6 16:45:54 2015 -0800
----------------------------------------------------------------------
platform_modules/exec.js | 323 ++++++++++++++++++++++++++++++++++++++
platform_modules/platform.js | 28 ++++
2 files changed, 351 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8b3c89b6/platform_modules/exec.js
----------------------------------------------------------------------
diff --git a/platform_modules/exec.js b/platform_modules/exec.js
new file mode 100644
index 0000000..32a3f8b
--- /dev/null
+++ b/platform_modules/exec.js
@@ -0,0 +1,323 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/**
+ * 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'),
+ // 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, // Default. Uses a new iframe for each poke.
+ // XHR bridge appears to be flaky sometimes: CB-3900, CB-3359, CB-5457, CB-4970, CB-4998, CB-5134
+ XHR_NO_PAYLOAD: 1, // About the same speed as IFRAME_NAV. Performance not about the same as IFRAME_NAV, but more variable.
+ XHR_WITH_PAYLOAD: 2, // Flakey, and not as performant
+ XHR_OPTIONAL_PAYLOAD: 3, // Flakey, and not as performant
+ IFRAME_HASH_NO_PAYLOAD: 4, // Not fully baked. A bit faster than IFRAME_NAV, but risks jank since poke happens synchronously.
+ IFRAME_HASH_WITH_PAYLOAD: 5, // Slower than no payload. Maybe since it has to be URI encoded / decoded.
+ WK_WEBVIEW_BINDING: 6 // 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;
+
+function shouldBundleCommandJson() {
+ if (bridgeMode === jsToNativeModes.XHR_WITH_PAYLOAD) {
+ return true;
+ }
+ if (bridgeMode === jsToNativeModes.XHR_OPTIONAL_PAYLOAD) {
+ var payloadLength = 0;
+ for (var i = 0; i < commandQueue.length; ++i) {
+ payloadLength += commandQueue[i].length;
+ }
+ // The value here was determined using the benchmark within CordovaLibApp on an iPad 3.
+ return payloadLength < 4500;
+ }
+ return false;
+}
+
+function massageArgsJsToNative(args) {
+ if (!args || utils.typeName(args) != 'Array') {
+ return args;
+ }
+ var ret = [];
+ args.forEach(function(arg, i) {
+ if (utils.typeName(arg) == 'ArrayBuffer') {
+ ret.push({
+ 'CDVType': 'ArrayBuffer',
+ 'data': base64.fromArrayBuffer(arg)
+ });
+ } else {
+ ret.push(arg);
+ }
+ });
+ return ret;
+}
+
+function massageMessageNativeToJs(message) {
+ if (message.CDVType == 'ArrayBuffer') {
+ var stringToArrayBuffer = function(str) {
+ var ret = new Uint8Array(str.length);
+ for (var i = 0; i < str.length; i++) {
+ ret[i] = str.charCodeAt(i);
+ }
+ return ret.buffer;
+ };
+ var base64ToArrayBuffer = function(b64) {
+ return stringToArrayBuffer(atob(b64));
+ };
+ message = base64ToArrayBuffer(message.data);
+ }
+ return message;
+}
+
+function convertMessageToArgsNativeToJs(message) {
+ var args = [];
+ if (!message || !message.hasOwnProperty('CDVType')) {
+ args.push(message);
+ } else if (message.CDVType == 'MultiPart') {
+ message.messages.forEach(function(e) {
+ args.push(massageMessageNativeToJs(e));
+ });
+ } else {
+ args.push(massageMessageNativeToJs(message));
+ }
+ return args;
+}
+
+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 callbackId = null;
+ if (typeof arguments[0] !== "string") {
+ // FORMAT ONE
+ successCallback = arguments[0];
+ failCallback = arguments[1];
+ service = arguments[2];
+ action = arguments[3];
+ actionArgs = arguments[4];
+
+ // Since we need to maintain backwards compatibility, we have to pass
+ // an invalid callbackId even if no callback was provided since plugins
+ // will be expecting it. The Cordova.exec() implementation allocates
+ // an invalid callbackId and passes it even if no callbacks were given.
+ callbackId = 'INVALID';
+ } else {
+ // FORMAT TWO, REMOVED
+ try {
+ splitCommand = arguments[0].split(".");
+ action = splitCommand.pop();
+ service = splitCommand.join(".");
+ actionArgs = Array.prototype.splice.call(arguments, 1);
+
+ console.log('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' +
+ "cordova.exec(null, null, \"" + service + "\", \"" + action + "\"," + JSON.stringify(actionArgs) + ");"
+ );
+ return;
+ } catch (e) {}
+ }
+
+ // If actionArgs is not provided, default to an empty array
+ actionArgs = actionArgs || [];
+
+ // Register the callbacks and add the callbackId to the positional
+ // arguments if given.
+ if (successCallback || failCallback) {
+ callbackId = service + cordova.callbackId++;
+ cordova.callbacks[callbackId] =
+ {success:successCallback, fail:failCallback};
+ }
+
+ actionArgs = massageArgsJsToNative(actionArgs);
+
+ var command = [callbackId, service, action, actionArgs];
+
+ // 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 (bridgeMode === jsToNativeModes.WK_WEBVIEW_BINDING) {
+ window.webkit.messageHandlers.cordova.postMessage(command);
+ } else {
+ // 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();
+ }
+ }
+}
+
+function pokeNative() {
+ switch (bridgeMode) {
+ case jsToNativeModes.XHR_NO_PAYLOAD:
+ case jsToNativeModes.XHR_WITH_PAYLOAD:
+ case jsToNativeModes.XHR_OPTIONAL_PAYLOAD:
+ pokeNativeViaXhr();
+ break;
+ default: // iframe-based.
+ pokeNativeViaIframe();
+ }
+}
+
+function pokeNativeViaXhr() {
+ // 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) {
+ execXhr = null;
+ }
+ // Re-using the XHR improves exec() performance by about 10%.
+ execXhr = execXhr || new XMLHttpRequest();
+ // Changing this to a GET will make the XHR reach the URIProtocol on 4.2.
+ // For some reason it still doesn't work though...
+ // Add a timestamp to the query param to prevent caching.
+ execXhr.open('HEAD', "/!gap_exec?" + (+new Date()), true);
+ if (!vcHeaderValue) {
+ vcHeaderValue = /.*\((.*)\)$/.exec(navigator.userAgent)[1];
+ }
+ execXhr.setRequestHeader('vc', vcHeaderValue);
+ execXhr.setRequestHeader('rc', ++requestCount);
+ if (shouldBundleCommandJson()) {
+ execXhr.setRequestHeader('cmds', iOSExec.nativeFetchMessages());
+ }
+ execXhr.send(null);
+}
+
+function pokeNativeViaIframe() {
+ // CB-5488 - Don't attempt to create iframe before document.body is available.
+ if (!document.body) {
+ setTimeout(pokeNativeViaIframe);
+ return;
+ }
+ if (bridgeMode === jsToNativeModes.IFRAME_HASH_NO_PAYLOAD || bridgeMode === jsToNativeModes.IFRAME_HASH_WITH_PAYLOAD) {
+ // TODO: This bridge mode doesn't properly support being removed from the DOM (CB-7735)
+ if (!execHashIframe) {
+ execHashIframe = document.createElement('iframe');
+ execHashIframe.style.display = 'none';
+ document.body.appendChild(execHashIframe);
+ // Hash changes don't work on about:blank, so switch it to file:///.
+ execHashIframe.contentWindow.history.replaceState(null, null, 'file:///#');
+ }
+ // 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;
+ } else {
+ // Check if they've removed it from the DOM, and put it back if so.
+ if (execIframe && execIframe.contentWindow) {
+ execIframe.contentWindow.location = 'gap://ready';
+ } else {
+ execIframe = document.createElement('iframe');
+ execIframe.style.display = 'none';
+ execIframe.src = 'gap://ready';
+ document.body.appendChild(execIframe);
+ }
+ // Use a timer to protect against iframe being unloaded during the poke (CB-7735).
+ // This makes the bridge ~ 7% slower, but works around the poke getting lost
+ // when the iframe is removed from the DOM.
+ // An onunload listener could be used in the case where the iframe has just been
+ // created, but since unload events fire only once, it doesn't work in the normal
+ // case of iframe reuse (where unload will have already fired due to the attempted
+ // navigation of the page).
+ failSafeTimerId = setTimeout(function() {
+ if (commandQueue.length) {
+ 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) {
+ clearTimeout(failSafeTimerId);
+ failSafeTimerId = 0;
+ }
+ // Each entry in commandQueue is a JSON string already.
+ if (!commandQueue.length) {
+ return '';
+ }
+ var json = '[' + commandQueue.join(',') + ']';
+ commandQueue.length = 0;
+ return json;
+};
+
+iOSExec.nativeCallback = function(callbackId, status, message, keepCallback) {
+ return iOSExec.nativeEvalAndFetch(function() {
+ var success = status === 0 || status === 1;
+ var args = convertMessageToArgsNativeToJs(message);
+ cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
+ });
+};
+
+iOSExec.nativeEvalAndFetch = function(func) {
+ // This shouldn't be nested, but better to be safe.
+ isInContextOfEvalJs++;
+ try {
+ func();
+ return iOSExec.nativeFetchMessages();
+ } finally {
+ isInContextOfEvalJs--;
+ }
+};
+
+module.exports = iOSExec;
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8b3c89b6/platform_modules/platform.js
----------------------------------------------------------------------
diff --git a/platform_modules/platform.js b/platform_modules/platform.js
new file mode 100644
index 0000000..36529ba
--- /dev/null
+++ b/platform_modules/platform.js
@@ -0,0 +1,28 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+module.exports = {
+ id: 'ios',
+ bootstrap: function() {
+ require('cordova/channel').onNativeReady.fire();
+ }
+};
+
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org