You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bh...@apache.org on 2014/01/24 16:27:32 UTC
webworks commit: Update VERSION to 3.5.0-dev
Updated Branches:
refs/heads/master 73d3c307e -> 171c8f9a2
Update VERSION to 3.5.0-dev
Project: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/commit/171c8f9a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/171c8f9a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/171c8f9a
Branch: refs/heads/master
Commit: 171c8f9a205fe666104e06fa457879647039af11
Parents: 73d3c30
Author: Bryan Higgins <br...@bryanhiggins.net>
Authored: Fri Jan 24 10:26:20 2014 -0500
Committer: Bryan Higgins <br...@bryanhiggins.net>
Committed: Fri Jan 24 10:26:20 2014 -0500
----------------------------------------------------------------------
blackberry10/VERSION | 2 +-
blackberry10/javascript/cordova.blackberry10.js | 106 +++++++++++--------
2 files changed, 61 insertions(+), 47 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/171c8f9a/blackberry10/VERSION
----------------------------------------------------------------------
diff --git a/blackberry10/VERSION b/blackberry10/VERSION
index 688932a..414a102 100644
--- a/blackberry10/VERSION
+++ b/blackberry10/VERSION
@@ -1 +1 @@
-3.4.0-dev
+3.5.0-dev
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/171c8f9a/blackberry10/javascript/cordova.blackberry10.js
----------------------------------------------------------------------
diff --git a/blackberry10/javascript/cordova.blackberry10.js b/blackberry10/javascript/cordova.blackberry10.js
index 545395d..47bb131 100644
--- a/blackberry10/javascript/cordova.blackberry10.js
+++ b/blackberry10/javascript/cordova.blackberry10.js
@@ -1,5 +1,5 @@
// Platform: blackberry10
-// 3.4.0-dev-286dff2
+// 3.5.0-dev-ba3190d
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -19,8 +19,8 @@
under the License.
*/
;(function() {
-var CORDOVA_JS_BUILD_LABEL = '3.4.0-dev-286dff2';
-// file: lib/scripts/require.js
+var CORDOVA_JS_BUILD_LABEL = '3.5.0-dev-ba3190d';
+// file: src/scripts/require.js
/*jshint -W079 */
/*jshint -W020 */
@@ -98,7 +98,7 @@ if (typeof module === "object" && typeof require === "function") {
module.exports.define = define;
}
-// file: lib/cordova.js
+// file: src/cordova.js
define("cordova", function(require, exports, module) {
@@ -316,7 +316,7 @@ module.exports = cordova;
});
-// file: lib/common/argscheck.js
+// file: src/common/argscheck.js
define("cordova/argscheck", function(require, exports, module) {
var exec = require('cordova/exec');
@@ -382,7 +382,7 @@ moduleExports.enableChecks = true;
});
-// file: lib/common/base64.js
+// file: src/common/base64.js
define("cordova/base64", function(require, exports, module) {
var base64 = exports;
@@ -438,7 +438,7 @@ function uint8ToBase64(rawData) {
});
-// file: lib/common/builder.js
+// file: src/common/builder.js
define("cordova/builder", function(require, exports, module) {
var utils = require('cordova/utils');
@@ -551,7 +551,7 @@ exports.replaceHookForTesting = function() {};
});
-// file: lib/common/channel.js
+// file: src/common/channel.js
define("cordova/channel", function(require, exports, module) {
var utils = require('cordova/utils'),
@@ -792,7 +792,7 @@ module.exports = channel;
});
-// file: lib/blackberry10/exec.js
+// file: src/blackberry10/exec.js
define("cordova/exec", function(require, exports, module) {
var cordova = require('cordova'),
@@ -816,15 +816,42 @@ function RemoteFunctionCall(functionUri) {
params[name] = encodeURIComponent(JSON.stringify(value));
};
- this.makeSyncCall = function () {
+ this.makeAsyncCall = function () {
var requestUri = composeUri(),
- request = createXhrRequest(requestUri, false),
- response;
+ request = new XMLHttpRequest(),
+ didSucceed,
+ response,
+ fail = function () {
+ var callbackId = JSON.parse(decodeURIComponent(params.callbackId));
+ response = JSON.parse(decodeURIComponent(request.responseText) || "null");
+ cordova.callbacks[callbackId].fail && cordova.callbacks[callbackId].fail(response.msg, response);
+ delete cordova.callbacks[callbackId];
+ };
+
+ request.open("POST", requestUri, true /* async */);
+ request.setRequestHeader("Content-Type", "application/json");
+ request.timeout = 1000; // Timeout in 1000ms
+ request.ontimeout = fail;
+ request.onerror = fail;
+
+ request.onload = function () {
+ response = JSON.parse(decodeURIComponent(request.responseText) || "null");
+ if (request.status === 200) {
+ didSucceed = response.code === cordova.callbackStatus.OK || response.code === cordova.callbackStatus.NO_RESULT;
+ cordova.callbackFromNative(
+ JSON.parse(decodeURIComponent(params.callbackId)),
+ didSucceed,
+ response.code,
+ [ didSucceed ? response.data : response.msg ],
+ !!response.keepCallback
+ );
+ } else {
+ fail();
+ }
+ };
+
request.send(JSON.stringify(params));
- response = JSON.parse(decodeURIComponent(request.responseText) || "null");
- return response;
};
-
}
module.exports = function (success, fail, service, action, args) {
@@ -832,7 +859,6 @@ module.exports = function (success, fail, service, action, args) {
request = new RemoteFunctionCall(uri),
callbackId = service + cordova.callbackId++,
proxy,
- response,
name,
didSucceed;
@@ -856,31 +882,15 @@ module.exports = function (success, fail, service, action, args) {
request.addParam(name, args[name]);
}
}
-
- response = request.makeSyncCall();
- if (response.code < 0) {
- if (fail) {
- fail(response.msg, response);
- }
- delete cordova.callbacks[callbackId];
- } else {
- didSucceed = response.code === cordova.callbackStatus.OK || response.code === cordova.callbackStatus.NO_RESULT;
- cordova.callbackFromNative(
- callbackId,
- didSucceed,
- response.code,
- [ didSucceed ? response.data : response.msg ],
- !!response.keepCallback
- );
- }
+ request.makeAsyncCall();
}
};
});
-// file: lib/common/exec/proxy.js
+// file: src/common/exec/proxy.js
define("cordova/exec/proxy", function(require, exports, module) {
@@ -910,7 +920,7 @@ module.exports = {
};
});
-// file: lib/common/init.js
+// file: src/common/init.js
define("cordova/init", function(require, exports, module) {
var channel = require('cordova/channel');
@@ -1024,7 +1034,7 @@ channel.join(function() {
});
-// file: lib/common/modulemapper.js
+// file: src/common/modulemapper.js
define("cordova/modulemapper", function(require, exports, module) {
var builder = require('cordova/builder'),
@@ -1125,7 +1135,7 @@ exports.reset();
});
-// file: lib/blackberry10/platform.js
+// file: src/blackberry10/platform.js
define("cordova/platform", function(require, exports, module) {
module.exports = {
@@ -1167,10 +1177,11 @@ module.exports = {
});
-// file: lib/common/pluginloader.js
+// file: src/common/pluginloader.js
define("cordova/pluginloader", function(require, exports, module) {
var modulemapper = require('cordova/modulemapper');
+var urlutil = require('cordova/urlutil');
// Helper function to inject a <script> tag.
function injectScript(url, onload, onerror) {
@@ -1239,11 +1250,14 @@ function handlePluginsObject(path, moduleList, finishPluginLoading) {
}
function injectPluginScript(pathPrefix, finishPluginLoading) {
- injectScript(pathPrefix + 'cordova_plugins.js', function(){
+ var pluginPath = pathPrefix + 'cordova_plugins.js';
+
+ injectScript(pluginPath, function() {
try {
var moduleList = require("cordova/plugin_list");
handlePluginsObject(pathPrefix, moduleList, finishPluginLoading);
- } catch (e) {
+ }
+ catch (e) {
// Error loading cordova_plugins.js, file not found or something
// this is an acceptable error, pre-3.0.0, so we just move on.
finishPluginLoading();
@@ -1280,24 +1294,24 @@ exports.load = function(callback) {
});
-// file: lib/common/urlutil.js
+// file: src/common/urlutil.js
define("cordova/urlutil", function(require, exports, module) {
-var urlutil = exports;
-var anchorEl = document.createElement('a');
/**
* For already absolute URLs, returns what is passed in.
* For relative URLs, converts them to absolute ones.
*/
-urlutil.makeAbsolute = function(url) {
+exports.makeAbsolute = function makeAbsolute(url) {
+ var anchorEl = document.createElement('a');
anchorEl.href = url;
return anchorEl.href;
};
+
});
-// file: lib/common/utils.js
+// file: src/common/utils.js
define("cordova/utils", function(require, exports, module) {
var utils = exports;
@@ -1468,7 +1482,7 @@ function UUIDcreatePart(length) {
});
window.cordova = require('cordova');
-// file: lib/scripts/bootstrap.js
+// file: src/scripts/bootstrap.js
require('cordova/init');