Skip to content
This repository has been archived by the owner on Apr 18, 2019. It is now read-only.

Commit

Permalink
Update VERSION to 3.5.0-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanhiggins committed Jan 24, 2014
1 parent 73d3c30 commit 171c8f9
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 47 deletions.
2 changes: 1 addition & 1 deletion blackberry10/VERSION
@@ -1 +1 @@
3.4.0-dev
3.5.0-dev
106 changes: 60 additions & 46 deletions 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
Expand All @@ -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 */
Expand Down Expand Up @@ -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) {


Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -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'),
Expand All @@ -816,23 +816,49 @@ 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) {
var uri = service + "/" + action,
request = new RemoteFunctionCall(uri),
callbackId = service + cordova.callbackId++,
proxy,
response,
name,
didSucceed;

Expand All @@ -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) {


Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1468,7 +1482,7 @@ function UUIDcreatePart(length) {
});

window.cordova = require('cordova');
// file: lib/scripts/bootstrap.js
// file: src/scripts/bootstrap.js

require('cordova/init');

Expand Down

0 comments on commit 171c8f9

Please sign in to comment.