updated from master
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/9aaa152b Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/9aaa152b Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/9aaa152b Branch: refs/heads/master Commit: 9aaa152b9abbb93ac4c6a18e7099c6dd3464c40a Parents: a2b8ebf e52d4fc Author: Steven Gill <[email protected]> Authored: Mon Jun 10 17:15:05 2013 -0700 Committer: Steven Gill <[email protected]> Committed: Mon Jun 10 17:15:05 2013 -0700 ---------------------------------------------------------------------- .reviewboardrc | 8 + README.md | 51 +- bin/check_reqs.bat | 19 +- bin/create | 11 +- bin/create.js | 42 - bin/templates/cordova/build.bat | 18 +- bin/templates/cordova/clean.bat | 16 + bin/templates/cordova/cordova.bat | 4 +- bin/templates/cordova/lib/install-device.bat | 18 +- bin/templates/cordova/lib/install-emulator.bat | 18 +- bin/templates/cordova/lib/list-devices.bat | 18 +- .../cordova/lib/list-emulator-images.bat | 18 +- .../cordova/lib/list-started-emulators.bat | 18 +- bin/templates/cordova/lib/start-emulator.bat | 18 +- bin/templates/cordova/log.bat | 16 + bin/templates/cordova/run.bat | 18 +- bin/templates/cordova/version | 2 +- bin/update | 10 +- bin/update.js | 42 - framework/.classpath | 1 - framework/assets/www/cordova.js | 1530 +++++++++++++++++- framework/build.xml | 16 - framework/res/xml/config.xml | 29 +- framework/src/org/apache/cordova/Config.java | 5 +- .../src/org/apache/cordova/CordovaActivity.java | 45 +- .../org/apache/cordova/CordovaChromeClient.java | 3 +- .../src/org/apache/cordova/CordovaWebView.java | 6 +- framework/src/org/apache/cordova/Device.java | 2 +- .../src/org/apache/cordova/FileHelper.java | 70 +- .../cordova/IceCreamCordovaWebViewClient.java | 48 +- framework/src/org/apache/cordova/JSONUtils.java | 18 + .../org/apache/cordova/api/CallbackContext.java | 18 + .../apache/cordova/api/CordovaInterface.java | 2 +- .../org/apache/cordova/api/CordovaPlugin.java | 14 - .../org/apache/cordova/api/DataResource.java | 141 -- .../apache/cordova/api/DataResourceContext.java | 31 - .../org/apache/cordova/api/PluginManager.java | 29 - test/README.md | 20 + test/res/xml/config.xml | 18 + 39 files changed, 1909 insertions(+), 502 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-android/blob/9aaa152b/framework/assets/www/cordova.js ---------------------------------------------------------------------- diff --cc framework/assets/www/cordova.js index f3c20a7,3730047..aece2e6 --- a/framework/assets/www/cordova.js +++ b/framework/assets/www/cordova.js @@@ -1,5 -1,5 +1,5 @@@ // Platform: android - // 2.7.0rc1-84-gdba3744 -// 2.8.0rc1-0-g22bc4d8 ++// 2.7.0rc1-84-g62c5786 /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@@ -19,7 -19,7 +19,7 @@@ under the License. */ ;(function() { - var CORDOVA_JS_BUILD_LABEL = '2.7.0rc1-84-gdba3744'; -var CORDOVA_JS_BUILD_LABEL = '2.8.0rc1-0-g22bc4d8'; ++var CORDOVA_JS_BUILD_LABEL = '2.7.0rc1-84-g62c5786'; // file: lib/scripts/require.js var require, @@@ -1897,11 -2396,11 +2396,7 @@@ function initRead(reader, file) reader._error = null; reader._readyState = FileReader.LOADING; -- if (typeof file == 'string') { -- // Deprecated in Cordova 2.4. -- console.warn('Using a string argument with FileReader.readAs functions is deprecated.'); -- reader._fileName = file; -- } else if (typeof file.fullPath == 'string') { ++ if (typeof file.fullPath == 'string') { reader._fileName = file.fullPath; } else { reader._fileName = ''; @@@ -2793,6 -3292,82 +3288,85 @@@ module.exports = GlobalizationError }); + // file: lib/common/plugin/InAppBrowser.js + define("cordova/plugin/InAppBrowser", function(require, exports, module) { + + var exec = require('cordova/exec'); + var channel = require('cordova/channel'); + var modulemapper = require('cordova/modulemapper'); + + function InAppBrowser() { + this.channels = { + 'loadstart': channel.create('loadstart'), + 'loadstop' : channel.create('loadstop'), + 'loaderror' : channel.create('loaderror'), + 'exit' : channel.create('exit') + }; + } + + InAppBrowser.prototype = { + _eventHandler: function (event) { + if (event.type in this.channels) { + this.channels[event.type].fire(event); + } + }, + close: function (eventname) { + exec(null, null, "InAppBrowser", "close", []); + }, ++ show: function (eventname) { ++ exec(null, null, "InAppBrowser", "show", []); ++ }, + addEventListener: function (eventname,f) { + if (eventname in this.channels) { + this.channels[eventname].subscribe(f); + } + }, + removeEventListener: function(eventname, f) { + if (eventname in this.channels) { + this.channels[eventname].unsubscribe(f); + } + }, + + executeScript: function(injectDetails, cb) { + if (injectDetails.code) { + exec(cb, null, "InAppBrowser", "injectScriptCode", [injectDetails.code, !!cb]); + } else if (injectDetails.file) { + exec(cb, null, "InAppBrowser", "injectScriptFile", [injectDetails.file, !!cb]); + } else { + throw new Error('executeScript requires exactly one of code or file to be specified'); + } + }, + + insertCSS: function(injectDetails, cb) { + if (injectDetails.code) { + exec(cb, null, "InAppBrowser", "injectStyleCode", [injectDetails.code, !!cb]); + } else if (injectDetails.file) { + exec(cb, null, "InAppBrowser", "injectStyleFile", [injectDetails.file, !!cb]); + } else { + throw new Error('insertCSS requires exactly one of code or file to be specified'); + } + } + }; + + module.exports = function(strUrl, strWindowName, strWindowFeatures) { + var iab = new InAppBrowser(); + var cb = function(eventname) { + iab._eventHandler(eventname); + }; + + // Don't catch calls that write to existing frames (e.g. named iframes). + if (window.frames && window.frames[strWindowName]) { + var origOpenFunc = modulemapper.getOriginalSymbol(window, 'open'); + return origOpenFunc.apply(window, arguments); + } + + exec(cb, cb, "InAppBrowser", "open", [strUrl, strWindowName, strWindowFeatures]); + return iab; + }; + + + }); + // file: lib/common/plugin/LocalFileSystem.js define("cordova/plugin/LocalFileSystem", function(require, exports, module) { @@@ -3289,6 -4071,6 +4070,10 @@@ module.exports = // file: lib/android/plugin/android/nativeapiprovider.js define("cordova/plugin/android/nativeapiprovider", function(require, exports, module) { ++/** ++ * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi. ++ */ ++ var nativeApi = this._cordovaNative || require('cordova/plugin/android/promptbasednativeapi'); var currentApi = nativeApi; @@@ -3308,6 -4149,6 +4152,11 @@@ module.exports = // file: lib/android/plugin/android/promptbasednativeapi.js define("cordova/plugin/android/promptbasednativeapi", function(require, exports, module) { ++/** ++ * Implements the API of ExposedJsApi.java, but uses prompt() to communicate. ++ * This is used only on the 2.3 simulator, where addJavascriptInterface() is broken. ++ */ ++ module.exports = { exec: function(service, action, callbackId, argsJson) { return prompt(argsJson, 'gap:'+JSON.stringify([service, action, callbackId])); @@@ -3948,7 -5072,7 +5080,6 @@@ function Device() this.available = false; this.platform = null; this.version = null; -- this.name = null; this.uuid = null; this.cordova = null; this.model = null; @@@ -3964,7 -5088,7 +5095,6 @@@ me.available = true; me.platform = info.platform; me.version = info.version; -- me.name = info.name; me.uuid = info.uuid; me.cordova = buildLabel; me.model = info.model; @@@ -5191,6 -6676,6 +6682,11 @@@ window.cordova = require('cordova') // file: lib/scripts/bootstrap.js (function (context) { ++ if (context._cordovaJsLoaded) { ++ throw new Error('cordova.js included multiple times.'); ++ } ++ context._cordovaJsLoaded = true; ++ var channel = require('cordova/channel'); var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady]; http://git-wip-us.apache.org/repos/asf/cordova-android/blob/9aaa152b/framework/res/xml/config.xml ----------------------------------------------------------------------
