You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2013/02/27 03:14:14 UTC
bada-wac commit: Updating bada-wac JS, VERSION to 2.5.0
Updated Branches:
refs/heads/master a5e05ba01 -> 9acb1d39a
Updating bada-wac JS, VERSION to 2.5.0
Project: http://git-wip-us.apache.org/repos/asf/cordova-bada-wac/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-bada-wac/commit/9acb1d39
Tree: http://git-wip-us.apache.org/repos/asf/cordova-bada-wac/tree/9acb1d39
Diff: http://git-wip-us.apache.org/repos/asf/cordova-bada-wac/diff/9acb1d39
Branch: refs/heads/master
Commit: 9acb1d39ab3df1132d317bf07aef45cc43c58577
Parents: a5e05ba
Author: Anis Kadri <an...@gmail.com>
Authored: Tue Feb 26 18:14:12 2013 -0800
Committer: Anis Kadri <an...@gmail.com>
Committed: Tue Feb 26 18:14:12 2013 -0800
----------------------------------------------------------------------
Res/cordova.js | 168 +++++++++++++++++++++++++++++++++++---------------
VERSION | 2 +-
2 files changed, 118 insertions(+), 52 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-bada-wac/blob/9acb1d39/Res/cordova.js
----------------------------------------------------------------------
diff --git a/Res/cordova.js b/Res/cordova.js
index 63882cb..98c4de4 100644
--- a/Res/cordova.js
+++ b/Res/cordova.js
@@ -1,8 +1,8 @@
// Platform: bada
-// commit efdf3eaf7dd4e641f45494c7472757e0f493c99f
+// commit 54660e97952c558518cad8c4eecc67cfa42b2993
-// File generated at :: Tue Feb 19 2013 23:24:38 GMT-0800 (PST)
+// File generated at :: Tue Feb 26 2013 18:14:09 GMT-0800 (PST)
/*
Licensed to the Apache Software Foundation (ASF) under one
@@ -262,7 +262,7 @@ var cordova = {
*/
callbackSuccess: function(callbackId, args) {
try {
- cordova.callbackFromNative(callbackId, true, args.status, args.message, args.keepCallback);
+ cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback);
} catch (e) {
console.log("Error in error callback: " + callbackId + " = "+e);
}
@@ -275,7 +275,7 @@ var cordova = {
// TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative.
// Derive success from status.
try {
- cordova.callbackFromNative(callbackId, false, args.status, args.message, args.keepCallback);
+ cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback);
} catch (e) {
console.log("Error in error callback: " + callbackId + " = "+e);
}
@@ -284,13 +284,13 @@ var cordova = {
/**
* Called by native code when returning the result from an action.
*/
- callbackFromNative: function(callbackId, success, status, message, keepCallback) {
+ callbackFromNative: function(callbackId, success, status, args, keepCallback) {
var callback = cordova.callbacks[callbackId];
if (callback) {
if (success && status == cordova.callbackStatus.OK) {
- callback.success && callback.success(message);
+ callback.success && callback.success.apply(null, args);
} else if (!success) {
- callback.fail && callback.fail(message);
+ callback.fail && callback.fail.apply(null, args);
}
// Clear callback if not expecting any more results
@@ -724,6 +724,10 @@ channel.createSticky('onCordovaInfoReady');
// Event to indicate that the connection property has been set.
channel.createSticky('onCordovaConnectionReady');
+// Event to indicate that all automatically loaded JS plugins are loaded and ready.
+// This is used in conjunction with the automatic plugin JS loading CLI prototype.
+channel.createSticky('onPluginsReady');
+
// Event to indicate that Cordova is ready
channel.createSticky('onDeviceReady');
@@ -937,7 +941,8 @@ define("cordova/plugin/Camera", function(require, exports, module) {
var argscheck = require('cordova/argscheck'),
exec = require('cordova/exec'),
- Camera = require('cordova/plugin/CameraConstants');
+ Camera = require('cordova/plugin/CameraConstants'),
+ CameraPopoverHandle = require('cordova/plugin/CameraPopoverHandle');
var cameraExport = {};
@@ -977,6 +982,7 @@ cameraExport.getPicture = function(successCallback, errorCallback, options) {
mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions];
exec(successCallback, errorCallback, "Camera", "takePicture", args);
+ return new CameraPopoverHandle();
};
cameraExport.cleanup = function(successCallback, errorCallback) {
@@ -1021,6 +1027,24 @@ module.exports = {
});
+// file: lib/common/plugin/CameraPopoverHandle.js
+define("cordova/plugin/CameraPopoverHandle", function(require, exports, module) {
+
+var exec = require('cordova/exec');
+
+/**
+ * A handle to an image picker popover.
+ */
+var CameraPopoverHandle = function() {
+ this.setPosition = function(popoverOptions) {
+ console.log('CameraPopoverHandle.setPosition is only supported on iOS.');
+ };
+};
+
+module.exports = CameraPopoverHandle;
+
+});
+
// file: lib/common/plugin/CameraPopoverOptions.js
define("cordova/plugin/CameraPopoverOptions", function(require, exports, module) {
@@ -2444,7 +2468,7 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro
}
var fail = errorCallback && function(e) {
- var error = new FileTransferError(e.code, e.source, e.target, e.http_status);
+ var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body);
errorCallback(error);
};
@@ -2494,7 +2518,7 @@ FileTransfer.prototype.download = function(source, target, successCallback, erro
};
var fail = errorCallback && function(e) {
- var error = new FileTransferError(e.code, e.source, e.target, e.http_status);
+ var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body);
errorCallback(error);
};
@@ -4136,7 +4160,7 @@ Device.prototype.getDeviceInfo = function(success, fail, args) {
me.platform = os_vendor + " " + os_name;
me.version = os_version;
me.uuid = uuid;
- me.cordova = "2.4.0";
+ me.cordova = "2.5.0";
success(me);
}
};
@@ -4795,7 +4819,8 @@ modulemapper.merges('cordova/plugin/bada/device', 'navigator.device');
// file: lib/common/plugin/echo.js
define("cordova/plugin/echo", function(require, exports, module) {
-var exec = require('cordova/exec');
+var exec = require('cordova/exec'),
+ utils = require('cordova/utils');
/**
* Sends the given message through exec() to the Echo plugin, which sends it back to the successCallback.
@@ -4805,11 +4830,25 @@ var exec = require('cordova/exec');
* @param forceAsync Whether to force an async return value (for testing native->js bridge).
*/
module.exports = function(successCallback, errorCallback, message, forceAsync) {
- var action = forceAsync ? 'echoAsync' : 'echo';
- if (!forceAsync && message.constructor == ArrayBuffer) {
- action = 'echoArrayBuffer';
+ var action = 'echo';
+ var messageIsMultipart = (utils.typeName(message) == "Array");
+ var args = messageIsMultipart ? message : [message];
+
+ if (utils.typeName(message) == 'ArrayBuffer') {
+ if (forceAsync) {
+ console.warn('Cannot echo ArrayBuffer with forced async, falling back to sync.');
+ }
+ action += 'ArrayBuffer';
+ } else if (messageIsMultipart) {
+ if (forceAsync) {
+ console.warn('Cannot echo MultiPart Array with forced async, falling back to sync.');
+ }
+ action += 'MultiPart';
+ } else if (forceAsync) {
+ action += 'Async';
}
- exec(successCallback, errorCallback, "Echo", action, [message]);
+
+ exec(successCallback, errorCallback, "Echo", action, args);
};
@@ -4851,6 +4890,17 @@ module.exports = function(exportFunc) {
});
+// file: lib/common/plugin/filetransfer/symbols.js
+define("cordova/plugin/filetransfer/symbols", function(require, exports, module) {
+
+
+var modulemapper = require('cordova/modulemapper');
+
+modulemapper.clobbers('cordova/plugin/FileTransfer', 'FileTransfer');
+modulemapper.clobbers('cordova/plugin/FileTransferError', 'FileTransferError');
+
+});
+
// file: lib/common/plugin/geolocation.js
define("cordova/plugin/geolocation", function(require, exports, module) {
@@ -6242,44 +6292,26 @@ window.cordova = require('cordova');
(function (context) {
// Replace navigator before any modules are required(), to ensure it happens as soon as possible.
// We replace it so that properties that can't be clobbered can instead be overridden.
- if (context.navigator) {
+ function replaceNavigator(origNavigator) {
var CordovaNavigator = function() {};
- CordovaNavigator.prototype = context.navigator;
- context.navigator = new CordovaNavigator();
- }
-
- var channel = require("cordova/channel"),
- _self = {
- boot: function () {
- /**
- * Create all cordova objects once page has fully loaded and native side is ready.
- */
- channel.join(function() {
- var builder = require('cordova/builder'),
- platform = require('cordova/platform');
-
- builder.buildIntoButDoNotClobber(platform.defaults, context);
- builder.buildIntoAndClobber(platform.clobbers, context);
- builder.buildIntoAndMerge(platform.merges, context);
-
- // Call the platform-specific initialization
- platform.initialize();
-
- // Fire event to notify that all objects are created
- channel.onCordovaReady.fire();
-
- // Fire onDeviceReady event once all constructors have run and
- // cordova info has been received from native side.
- channel.join(function() {
- require('cordova').fireDocumentEvent('deviceready');
- }, channel.deviceReadyChannelsArray);
-
- }, [ channel.onDOMContentLoaded, channel.onNativeReady ]);
+ CordovaNavigator.prototype = origNavigator;
+ var newNavigator = new CordovaNavigator();
+ // This work-around really only applies to new APIs that are newer than Function.bind.
+ // Without it, APIs such as getGamepads() break.
+ if (CordovaNavigator.bind) {
+ for (var key in origNavigator) {
+ if (typeof origNavigator[key] == 'function') {
+ newNavigator[key] = origNavigator[key].bind(origNavigator);
+ }
}
- };
+ }
+ return newNavigator;
+ }
+ if (context.navigator) {
+ context.navigator = replaceNavigator(context.navigator);
+ }
- // boot up once native side is ready
- channel.onNativeReady.subscribe(_self.boot);
+ var channel = require("cordova/channel");
// _nativeReady is global variable that the native side can set
// to signify that the native code is ready. It is a global since
@@ -6288,6 +6320,40 @@ window.cordova = require('cordova');
channel.onNativeReady.fire();
}
+ /**
+ * Create all cordova objects once page has fully loaded and native side is ready.
+ */
+ var joinEvents = [ channel.onDOMContentLoaded, channel.onNativeReady ];
+
+ // If this property is set to something truthy, join on onPluginsReady too.
+ // This property is set by the automatic JS installation prototype in cordova-cli,
+ // and will be removed when the prototype either becomes mainline or is dropped.
+ if (window.__onPluginsLoadedHack) {
+ joinEvents.push(channel.onPluginsReady);
+ }
+
+ channel.join(function() {
+ var builder = require('cordova/builder'),
+ platform = require('cordova/platform');
+
+ builder.buildIntoButDoNotClobber(platform.defaults, context);
+ builder.buildIntoAndClobber(platform.clobbers, context);
+ builder.buildIntoAndMerge(platform.merges, context);
+
+ // Call the platform-specific initialization
+ platform.initialize();
+
+ // Fire event to notify that all objects are created
+ channel.onCordovaReady.fire();
+
+ // Fire onDeviceReady event once all constructors have run and
+ // cordova info has been received from native side.
+ channel.join(function() {
+ require('cordova').fireDocumentEvent('deviceready');
+ }, channel.deviceReadyChannelsArray);
+
+ }, joinEvents);
+
}(window));
// file: lib/scripts/bootstrap-bada.js
http://git-wip-us.apache.org/repos/asf/cordova-bada-wac/blob/9acb1d39/VERSION
----------------------------------------------------------------------
diff --git a/VERSION b/VERSION
index aa0822f..437459c 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.5.0rc1
+2.5.0