http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/724ee4d7/javascript/cordova.qnx.js ---------------------------------------------------------------------- diff --git a/javascript/cordova.qnx.js b/javascript/cordova.qnx.js index 85d5b90..cf96df5 100644 --- a/javascript/cordova.qnx.js +++ b/javascript/cordova.qnx.js @@ -1,6 +1,6 @@ -// commit 73131811a6b0b9aa9fc2ebb36e6e969653643395 +// commit b58d6387cacaae999dc83778f794cf5900ae8dfe -// File generated at :: Thu Aug 23 2012 10:49:57 GMT-0400 (EDT) +// File generated at :: Thu Aug 23 2012 17:49:07 GMT-0700 (PDT) /* Licensed to the Apache Software Foundation (ASF) under one @@ -29,6 +29,10 @@ var require, (function () { var modules = {}; + // Stack of moduleIds currently being built. + var requireStack = []; + // Map of module ID -> index into requireStack of modules currently being built. + var inProgressModules = {}; function build(module) { var factory = module.factory; @@ -41,8 +45,21 @@ var require, require = function (id) { if (!modules[id]) { throw "module " + id + " not found"; + } else if (id in inProgressModules) { + var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id; + throw "Cycle in require graph: " + cycle; } - return modules[id].factory ? build(modules[id]) : modules[id].exports; + if (modules[id].factory) { + try { + inProgressModules[id] = requireStack.length; + requireStack.push(id); + return build(modules[id]); + } finally { + delete inProgressModules[id]; + requireStack.pop(); + } + } + return modules[id].exports; }; define = function (id, factory) { @@ -67,6 +84,7 @@ if (typeof module === "object" && typeof require === "function") { module.exports.require = require; module.exports.define = define; } + // file: lib/cordova.js define("cordova", function(require, exports, module) { var channel = require('cordova/channel'); @@ -207,10 +225,6 @@ var cordova = { window.dispatchEvent(evt); } }, - // TODO: this is Android only; think about how to do this better - shuttingDown:false, - UsePolling:false, - // END TODO // TODO: iOS only // This queue holds the currently executing command and all pending @@ -2928,7 +2942,6 @@ Media.prototype.stop = function() { var me = this; exec(function() { me._position = 0; - me.successCallback(); }, this.errorCallback, "Media", "stopPlayingAudio", [this.id]); }; @@ -2974,14 +2987,14 @@ Media.prototype.getCurrentPosition = function(success, fail) { * Start recording audio file. */ Media.prototype.startRecord = function() { - exec(this.successCallback, this.errorCallback, "Media", "startRecordingAudio", [this.id, this.src]); + exec(null, this.errorCallback, "Media", "startRecordingAudio", [this.id, this.src]); }; /** * Stop recording audio file. */ Media.prototype.stopRecord = function() { - exec(this.successCallback, this.errorCallback, "Media", "stopRecordingAudio", [this.id]); + exec(null, this.errorCallback, "Media", "stopRecordingAudio", [this.id]); }; /** @@ -3010,14 +3023,14 @@ Media.onStatus = function(id, msg, value) { var media = mediaObjects[id]; // If state update if (msg === Media.MEDIA_STATE) { + if (media.statusCallback) { + media.statusCallback(value); + } if (value === Media.MEDIA_STOPPED) { if (media.successCallback) { media.successCallback(); } } - if (media.statusCallback) { - media.statusCallback(value); - } } else if (msg === Media.MEDIA_DURATION) { media._duration = value; @@ -3091,28 +3104,6 @@ MediaFile.prototype.getFormatData = function(successCallback, errorCallback) { } }; -// TODO: can we axe this? -/** - * Casts a PluginResult message property (array of objects) to an array of MediaFile objects - * (used in Objective-C and Android) - * - * @param {PluginResult} pluginResult - */ -MediaFile.cast = function(pluginResult) { - var mediaFiles = []; - for (var i=0; i<pluginResult.message.length; i++) { - var mediaFile = new MediaFile(); - mediaFile.name = pluginResult.message[i].name; - mediaFile.fullPath = pluginResult.message[i].fullPath; - mediaFile.type = pluginResult.message[i].type; - mediaFile.lastModifiedDate = pluginResult.message[i].lastModifiedDate; - mediaFile.size = pluginResult.message[i].size; - mediaFiles.push(mediaFile); - } - pluginResult.message = mediaFiles; - return pluginResult; -}; - module.exports = MediaFile; }); @@ -3976,6 +3967,25 @@ module.exports = new Device(); }); +// file: lib/common/plugin/echo.js +define("cordova/plugin/echo", function(require, exports, module) { +var exec = require('cordova/exec'); + +/** + * Sends the given message through exec() to the Echo plugink, which sends it back to the successCallback. + * @param successCallback invoked with a FileSystem object + * @param errorCallback invoked if error occurs retrieving file system + * @param message The string to be echoed. + * @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'; + exec(successCallback, errorCallback, "Echo", action, [message]); +}; + + +}); + // file: lib/common/plugin/geolocation.js define("cordova/plugin/geolocation", function(require, exports, module) { var utils = require('cordova/utils'), @@ -4583,7 +4593,6 @@ module.exports = { }); - // file: lib/webworks/qnx/plugin/qnx/network.js define("cordova/plugin/qnx/network", function(require, exports, module) { var cordova = require('cordova'), @@ -5225,4 +5234,4 @@ document.addEventListener("webworksready", function () { }); -})(); +})(); \ No newline at end of file