You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2013/06/20 03:38:04 UTC
git commit: update cordova.js
Updated Branches:
refs/heads/master 883384932 -> a2800bb27
update cordova.js
Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/a2800bb2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/a2800bb2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/a2800bb2
Branch: refs/heads/master
Commit: a2800bb27d9f7cbed6cac4045ddcc867ca43ce89
Parents: 8833849
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Jun 19 18:37:20 2013 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Jun 19 18:37:20 2013 -0700
----------------------------------------------------------------------
windows8/template/www/cordova.js | 348 ++++++++++++++++++++--------------
1 file changed, 208 insertions(+), 140 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/a2800bb2/windows8/template/www/cordova.js
----------------------------------------------------------------------
diff --git a/windows8/template/www/cordova.js b/windows8/template/www/cordova.js
index 0337e06..521aa71 100644
--- a/windows8/template/www/cordova.js
+++ b/windows8/template/www/cordova.js
@@ -1,5 +1,5 @@
// Platform: windows8
-// 2.8.0rc1-0-g22bc4d8
+// 2.9.0rc1-0-g002f33d
/*
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 = '2.8.0rc1-0-g22bc4d8';
-// file: lib\scripts\require.js
+var CORDOVA_JS_BUILD_LABEL = '2.9.0rc1-0-g002f33d';
+// file: lib/scripts/require.js
var require,
define;
@@ -329,7 +329,7 @@ module.exports = cordova;
});
-// file: lib\common\argscheck.js
+// file: lib/common/argscheck.js
define("cordova/argscheck", function(require, exports, module) {
var exec = require('cordova/exec');
@@ -395,7 +395,7 @@ moduleExports.enableChecks = true;
});
-// file: lib\common\builder.js
+// file: lib/common/builder.js
define("cordova/builder", function(require, exports, module) {
var utils = require('cordova/utils');
@@ -508,7 +508,7 @@ exports.replaceHookForTesting = function() {};
});
-// file: lib\common\channel.js
+// file: lib/common/channel.js
define("cordova/channel", function(require, exports, module) {
var utils = require('cordova/utils'),
@@ -758,7 +758,7 @@ module.exports = channel;
});
-// file: lib\common\commandProxy.js
+// file: lib/common/commandProxy.js
define("cordova/commandProxy", function(require, exports, module) {
@@ -788,7 +788,7 @@ module.exports = {
};
});
-// file: lib\windows8\exec.js
+// file: lib/windows8/exec.js
define("cordova/exec", function(require, exports, module) {
var cordova = require('cordova');
@@ -831,7 +831,7 @@ module.exports = function(success, fail, service, action, args) {
});
-// file: lib\common\modulemapper.js
+// file: lib/common/modulemapper.js
define("cordova/modulemapper", function(require, exports, module) {
var builder = require('cordova/builder'),
@@ -932,7 +932,7 @@ exports.reset();
});
-// file: lib\windows8\platform.js
+// file: lib/windows8/platform.js
define("cordova/platform", function(require, exports, module) {
var cordova = require('cordova'),
@@ -989,7 +989,7 @@ module.exports = {
});
-// file: lib\common\plugin\Acceleration.js
+// file: lib/common/plugin/Acceleration.js
define("cordova/plugin/Acceleration", function(require, exports, module) {
var Acceleration = function(x, y, z, timestamp) {
@@ -1003,7 +1003,7 @@ module.exports = Acceleration;
});
-// file: lib\common\plugin\Camera.js
+// file: lib/common/plugin/Camera.js
define("cordova/plugin/Camera", function(require, exports, module) {
var argscheck = require('cordova/argscheck'),
@@ -1061,7 +1061,7 @@ module.exports = cameraExport;
});
-// file: lib\common\plugin\CameraConstants.js
+// file: lib/common/plugin/CameraConstants.js
define("cordova/plugin/CameraConstants", function(require, exports, module) {
module.exports = {
@@ -1099,7 +1099,7 @@ module.exports = {
});
-// file: lib\common\plugin\CameraPopoverHandle.js
+// file: lib/common/plugin/CameraPopoverHandle.js
define("cordova/plugin/CameraPopoverHandle", function(require, exports, module) {
var exec = require('cordova/exec');
@@ -1117,7 +1117,7 @@ module.exports = CameraPopoverHandle;
});
-// file: lib\common\plugin\CameraPopoverOptions.js
+// file: lib/common/plugin/CameraPopoverOptions.js
define("cordova/plugin/CameraPopoverOptions", function(require, exports, module) {
var Camera = require('cordova/plugin/CameraConstants');
@@ -1139,7 +1139,7 @@ module.exports = CameraPopoverOptions;
});
-// file: lib\common\plugin\CaptureAudioOptions.js
+// file: lib/common/plugin/CaptureAudioOptions.js
define("cordova/plugin/CaptureAudioOptions", function(require, exports, module) {
/**
@@ -1156,7 +1156,7 @@ module.exports = CaptureAudioOptions;
});
-// file: lib\common\plugin\CaptureError.js
+// file: lib/common/plugin/CaptureError.js
define("cordova/plugin/CaptureError", function(require, exports, module) {
/**
@@ -1181,7 +1181,7 @@ module.exports = CaptureError;
});
-// file: lib\common\plugin\CaptureImageOptions.js
+// file: lib/common/plugin/CaptureImageOptions.js
define("cordova/plugin/CaptureImageOptions", function(require, exports, module) {
/**
@@ -1196,7 +1196,7 @@ module.exports = CaptureImageOptions;
});
-// file: lib\common\plugin\CaptureVideoOptions.js
+// file: lib/common/plugin/CaptureVideoOptions.js
define("cordova/plugin/CaptureVideoOptions", function(require, exports, module) {
/**
@@ -1213,7 +1213,7 @@ module.exports = CaptureVideoOptions;
});
-// file: lib\common\plugin\CompassError.js
+// file: lib/common/plugin/CompassError.js
define("cordova/plugin/CompassError", function(require, exports, module) {
/**
@@ -1232,7 +1232,7 @@ module.exports = CompassError;
});
-// file: lib\common\plugin\CompassHeading.js
+// file: lib/common/plugin/CompassHeading.js
define("cordova/plugin/CompassHeading", function(require, exports, module) {
var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy, timestamp) {
@@ -1246,7 +1246,7 @@ module.exports = CompassHeading;
});
-// file: lib\common\plugin\ConfigurationData.js
+// file: lib/common/plugin/ConfigurationData.js
define("cordova/plugin/ConfigurationData", function(require, exports, module) {
/**
@@ -1267,7 +1267,7 @@ module.exports = ConfigurationData;
});
-// file: lib\common\plugin\Connection.js
+// file: lib/common/plugin/Connection.js
define("cordova/plugin/Connection", function(require, exports, module) {
/**
@@ -1286,7 +1286,7 @@ module.exports = {
});
-// file: lib\common\plugin\Contact.js
+// file: lib/common/plugin/Contact.js
define("cordova/plugin/Contact", function(require, exports, module) {
var argscheck = require('cordova/argscheck'),
@@ -1448,7 +1448,7 @@ module.exports = Contact;
});
-// file: lib\common\plugin\ContactAddress.js
+// file: lib/common/plugin/ContactAddress.js
define("cordova/plugin/ContactAddress", function(require, exports, module) {
/**
@@ -1479,7 +1479,7 @@ module.exports = ContactAddress;
});
-// file: lib\common\plugin\ContactError.js
+// file: lib/common/plugin/ContactError.js
define("cordova/plugin/ContactError", function(require, exports, module) {
/**
@@ -1506,7 +1506,7 @@ module.exports = ContactError;
});
-// file: lib\common\plugin\ContactField.js
+// file: lib/common/plugin/ContactField.js
define("cordova/plugin/ContactField", function(require, exports, module) {
/**
@@ -1528,7 +1528,7 @@ module.exports = ContactField;
});
-// file: lib\common\plugin\ContactFindOptions.js
+// file: lib/common/plugin/ContactFindOptions.js
define("cordova/plugin/ContactFindOptions", function(require, exports, module) {
/**
@@ -1547,7 +1547,7 @@ module.exports = ContactFindOptions;
});
-// file: lib\common\plugin\ContactName.js
+// file: lib/common/plugin/ContactName.js
define("cordova/plugin/ContactName", function(require, exports, module) {
/**
@@ -1573,7 +1573,7 @@ module.exports = ContactName;
});
-// file: lib\common\plugin\ContactOrganization.js
+// file: lib/common/plugin/ContactOrganization.js
define("cordova/plugin/ContactOrganization", function(require, exports, module) {
/**
@@ -1602,7 +1602,7 @@ module.exports = ContactOrganization;
});
-// file: lib\common\plugin\Coordinates.js
+// file: lib/common/plugin/Coordinates.js
define("cordova/plugin/Coordinates", function(require, exports, module) {
/**
@@ -1656,7 +1656,7 @@ module.exports = Coordinates;
});
-// file: lib\common\plugin\DirectoryEntry.js
+// file: lib/common/plugin/DirectoryEntry.js
define("cordova/plugin/DirectoryEntry", function(require, exports, module) {
var argscheck = require('cordova/argscheck'),
@@ -1747,7 +1747,7 @@ module.exports = DirectoryEntry;
});
-// file: lib\common\plugin\DirectoryReader.js
+// file: lib/common/plugin/DirectoryReader.js
define("cordova/plugin/DirectoryReader", function(require, exports, module) {
var exec = require('cordova/exec'),
@@ -1795,7 +1795,7 @@ module.exports = DirectoryReader;
});
-// file: lib\common\plugin\Entry.js
+// file: lib/common/plugin/Entry.js
define("cordova/plugin/Entry", function(require, exports, module) {
var argscheck = require('cordova/argscheck'),
@@ -2000,7 +2000,7 @@ module.exports = Entry;
});
-// file: lib\common\plugin\File.js
+// file: lib/common/plugin/File.js
define("cordova/plugin/File", function(require, exports, module) {
/**
@@ -2062,7 +2062,7 @@ module.exports = File;
});
-// file: lib\common\plugin\FileEntry.js
+// file: lib/common/plugin/FileEntry.js
define("cordova/plugin/FileEntry", function(require, exports, module) {
var utils = require('cordova/utils'),
@@ -2127,7 +2127,7 @@ module.exports = FileEntry;
});
-// file: lib\common\plugin\FileError.js
+// file: lib/common/plugin/FileError.js
define("cordova/plugin/FileError", function(require, exports, module) {
/**
@@ -2158,7 +2158,7 @@ module.exports = FileError;
});
-// file: lib\common\plugin\FileReader.js
+// file: lib/common/plugin/FileReader.js
define("cordova/plugin/FileReader", function(require, exports, module) {
var exec = require('cordova/exec'),
@@ -2226,11 +2226,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 = '';
@@ -2534,7 +2530,7 @@ module.exports = FileReader;
});
-// file: lib\common\plugin\FileSystem.js
+// file: lib/common/plugin/FileSystem.js
define("cordova/plugin/FileSystem", function(require, exports, module) {
var DirectoryEntry = require('cordova/plugin/DirectoryEntry');
@@ -2557,7 +2553,7 @@ module.exports = FileSystem;
});
-// file: lib\common\plugin\FileTransfer.js
+// file: lib/common/plugin/FileTransfer.js
define("cordova/plugin/FileTransfer", function(require, exports, module) {
var argscheck = require('cordova/argscheck'),
@@ -2749,7 +2745,7 @@ module.exports = FileTransfer;
});
-// file: lib\common\plugin\FileTransferError.js
+// file: lib/common/plugin/FileTransferError.js
define("cordova/plugin/FileTransferError", function(require, exports, module) {
/**
@@ -2773,7 +2769,7 @@ module.exports = FileTransferError;
});
-// file: lib\common\plugin\FileUploadOptions.js
+// file: lib/common/plugin/FileUploadOptions.js
define("cordova/plugin/FileUploadOptions", function(require, exports, module) {
/**
@@ -2799,7 +2795,7 @@ module.exports = FileUploadOptions;
});
-// file: lib\common\plugin\FileUploadResult.js
+// file: lib/common/plugin/FileUploadResult.js
define("cordova/plugin/FileUploadResult", function(require, exports, module) {
/**
@@ -2816,7 +2812,7 @@ module.exports = FileUploadResult;
});
-// file: lib\common\plugin\FileWriter.js
+// file: lib/common/plugin/FileWriter.js
define("cordova/plugin/FileWriter", function(require, exports, module) {
var exec = require('cordova/exec'),
@@ -2893,9 +2889,31 @@ FileWriter.prototype.abort = function() {
/**
* Writes data to the file
*
- * @param text to be written
+ * @param data text or blob to be written
*/
-FileWriter.prototype.write = function(text) {
+FileWriter.prototype.write = function(data) {
+
+ var isBinary = false;
+
+ // If we don't have Blob or ArrayBuffer support, don't bother.
+ if (typeof window.Blob !== 'undefined' && typeof window.ArrayBuffer !== 'undefined') {
+
+ // Check to see if the incoming data is a blob
+ if (data instanceof Blob) {
+ var that=this;
+ var fileReader = new FileReader();
+ fileReader.onload = function() {
+ // Call this method again, with the arraybuffer as argument
+ FileWriter.prototype.write.call(that, this.result);
+ };
+ fileReader.readAsArrayBuffer(data);
+ return;
+ }
+
+ // Mark data type for safer transport over the binary bridge
+ isBinary = (data instanceof ArrayBuffer);
+ }
+
// Throw an exception if we are already writing a file
if (this.readyState === FileWriter.WRITING) {
throw new FileError(FileError.INVALID_STATE_ERR);
@@ -2961,7 +2979,7 @@ FileWriter.prototype.write = function(text) {
if (typeof me.onwriteend === "function") {
me.onwriteend(new ProgressEvent("writeend", {"target":me}));
}
- }, "File", "write", [this.fileName, text, this.position]);
+ }, "File", "write", [this.fileName, data, this.position, isBinary]);
};
/**
@@ -3075,7 +3093,7 @@ module.exports = FileWriter;
});
-// file: lib\common\plugin\Flags.js
+// file: lib/common/plugin/Flags.js
define("cordova/plugin/Flags", function(require, exports, module) {
/**
@@ -3096,7 +3114,7 @@ module.exports = Flags;
});
-// file: lib\common\plugin\GlobalizationError.js
+// file: lib/common/plugin/GlobalizationError.js
define("cordova/plugin/GlobalizationError", function(require, exports, module) {
@@ -3122,7 +3140,7 @@ module.exports = GlobalizationError;
});
-// file: lib\common\plugin\InAppBrowser.js
+// file: lib/common/plugin/InAppBrowser.js
define("cordova/plugin/InAppBrowser", function(require, exports, module) {
var exec = require('cordova/exec');
@@ -3147,6 +3165,9 @@ InAppBrowser.prototype = {
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);
@@ -3198,7 +3219,7 @@ module.exports = function(strUrl, strWindowName, strWindowFeatures) {
});
-// file: lib\common\plugin\LocalFileSystem.js
+// file: lib/common/plugin/LocalFileSystem.js
define("cordova/plugin/LocalFileSystem", function(require, exports, module) {
var exec = require('cordova/exec');
@@ -3217,7 +3238,7 @@ module.exports = LocalFileSystem;
});
-// file: lib\common\plugin\Media.js
+// file: lib/common/plugin/Media.js
define("cordova/plugin/Media", function(require, exports, module) {
var argscheck = require('cordova/argscheck'),
@@ -3397,7 +3418,7 @@ module.exports = Media;
});
-// file: lib\common\plugin\MediaError.js
+// file: lib/common/plugin/MediaError.js
define("cordova/plugin/MediaError", function(require, exports, module) {
/**
@@ -3437,7 +3458,7 @@ module.exports = _MediaError;
});
-// file: lib\common\plugin\MediaFile.js
+// file: lib/common/plugin/MediaFile.js
define("cordova/plugin/MediaFile", function(require, exports, module) {
var utils = require('cordova/utils'),
@@ -3477,7 +3498,7 @@ module.exports = MediaFile;
});
-// file: lib\common\plugin\MediaFileData.js
+// file: lib/common/plugin/MediaFileData.js
define("cordova/plugin/MediaFileData", function(require, exports, module) {
/**
@@ -3501,7 +3522,7 @@ module.exports = MediaFileData;
});
-// file: lib\common\plugin\Metadata.js
+// file: lib/common/plugin/Metadata.js
define("cordova/plugin/Metadata", function(require, exports, module) {
/**
@@ -3517,7 +3538,7 @@ module.exports = Metadata;
});
-// file: lib\common\plugin\Position.js
+// file: lib/common/plugin/Position.js
define("cordova/plugin/Position", function(require, exports, module) {
var Coordinates = require('cordova/plugin/Coordinates');
@@ -3535,7 +3556,7 @@ module.exports = Position;
});
-// file: lib\common\plugin\PositionError.js
+// file: lib/common/plugin/PositionError.js
define("cordova/plugin/PositionError", function(require, exports, module) {
/**
@@ -3558,7 +3579,7 @@ module.exports = PositionError;
});
-// file: lib\common\plugin\ProgressEvent.js
+// file: lib/common/plugin/ProgressEvent.js
define("cordova/plugin/ProgressEvent", function(require, exports, module) {
// If ProgressEvent exists in global context, use it already, otherwise use our own polyfill
@@ -3610,7 +3631,7 @@ module.exports = ProgressEvent;
});
-// file: lib\common\plugin\accelerometer.js
+// file: lib/common/plugin/accelerometer.js
define("cordova/plugin/accelerometer", function(require, exports, module) {
/**
@@ -3765,7 +3786,7 @@ module.exports = accelerometer;
});
-// file: lib\common\plugin\accelerometer\symbols.js
+// file: lib/common/plugin/accelerometer/symbols.js
define("cordova/plugin/accelerometer/symbols", function(require, exports, module) {
@@ -3776,7 +3797,7 @@ modulemapper.defaults('cordova/plugin/accelerometer', 'navigator.accelerometer')
});
-// file: lib\common\plugin\battery.js
+// file: lib/common/plugin/battery.js
define("cordova/plugin/battery", function(require, exports, module) {
/**
@@ -3860,7 +3881,7 @@ module.exports = battery;
});
-// file: lib\common\plugin\battery\symbols.js
+// file: lib/common/plugin/battery/symbols.js
define("cordova/plugin/battery/symbols", function(require, exports, module) {
@@ -3870,7 +3891,7 @@ modulemapper.defaults('cordova/plugin/battery', 'navigator.battery');
});
-// file: lib\common\plugin\camera\symbols.js
+// file: lib/common/plugin/camera/symbols.js
define("cordova/plugin/camera/symbols", function(require, exports, module) {
@@ -3882,7 +3903,7 @@ modulemapper.defaults('cordova/plugin/CameraPopoverOptions', 'CameraPopoverOptio
});
-// file: lib\common\plugin\capture.js
+// file: lib/common/plugin/capture.js
define("cordova/plugin/capture", function(require, exports, module) {
var exec = require('cordova/exec'),
@@ -3960,7 +3981,7 @@ module.exports = new Capture();
});
-// file: lib\windows8\plugin\capture\symbols.js
+// file: lib/windows8/plugin/capture/symbols.js
define("cordova/plugin/capture/symbols", function(require, exports, module) {
var modulemapper = require('cordova/modulemapper');
@@ -3977,7 +3998,7 @@ modulemapper.merges('cordova/plugin/windows8/MediaFile', 'MediaFile');
});
-// file: lib\common\plugin\compass.js
+// file: lib/common/plugin/compass.js
define("cordova/plugin/compass", function(require, exports, module) {
var argscheck = require('cordova/argscheck'),
@@ -4064,7 +4085,7 @@ module.exports = compass;
});
-// file: lib\common\plugin\compass\symbols.js
+// file: lib/common/plugin/compass/symbols.js
define("cordova/plugin/compass/symbols", function(require, exports, module) {
@@ -4076,7 +4097,7 @@ modulemapper.clobbers('cordova/plugin/compass', 'navigator.compass');
});
-// file: lib\common\plugin\console-via-logger.js
+// file: lib/common/plugin/console-via-logger.js
define("cordova/plugin/console-via-logger", function(require, exports, module) {
//------------------------------------------------------------------------------
@@ -4248,7 +4269,7 @@ for (var key in console) {
});
-// file: lib\common\plugin\contacts.js
+// file: lib/common/plugin/contacts.js
define("cordova/plugin/contacts", function(require, exports, module) {
var argscheck = require('cordova/argscheck'),
@@ -4309,7 +4330,7 @@ module.exports = contacts;
});
-// file: lib\common\plugin\contacts\symbols.js
+// file: lib/common/plugin/contacts/symbols.js
define("cordova/plugin/contacts/symbols", function(require, exports, module) {
@@ -4326,7 +4347,7 @@ modulemapper.clobbers('cordova/plugin/ContactOrganization', 'ContactOrganization
});
-// file: lib\common\plugin\device.js
+// file: lib/common/plugin/device.js
define("cordova/plugin/device", function(require, exports, module) {
var argscheck = require('cordova/argscheck'),
@@ -4346,7 +4367,6 @@ function Device() {
this.available = false;
this.platform = null;
this.version = null;
- this.name = null;
this.uuid = null;
this.cordova = null;
this.model = null;
@@ -4362,7 +4382,6 @@ function Device() {
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;
@@ -4389,7 +4408,7 @@ module.exports = new Device();
});
-// file: lib\common\plugin\device\symbols.js
+// file: lib/common/plugin/device/symbols.js
define("cordova/plugin/device/symbols", function(require, exports, module) {
@@ -4399,7 +4418,7 @@ modulemapper.clobbers('cordova/plugin/device', 'device');
});
-// file: lib\common\plugin\echo.js
+// file: lib/common/plugin/echo.js
define("cordova/plugin/echo", function(require, exports, module) {
var exec = require('cordova/exec'),
@@ -4437,7 +4456,7 @@ module.exports = function(successCallback, errorCallback, message, forceAsync) {
});
-// file: lib\windows8\plugin\file\symbols.js
+// file: lib/windows8/plugin/file/symbols.js
define("cordova/plugin/file/symbols", function(require, exports, module) {
@@ -4450,7 +4469,7 @@ modulemapper.clobbers('cordova/plugin/FileReader', 'FileReader');
});
-// file: lib\common\plugin\file\symbolshelper.js
+// file: lib/common/plugin/file/symbolshelper.js
define("cordova/plugin/file/symbolshelper", function(require, exports, module) {
module.exports = function(exportFunc) {
@@ -4475,7 +4494,7 @@ module.exports = function(exportFunc) {
});
-// file: lib\common\plugin\filetransfer\symbols.js
+// file: lib/common/plugin/filetransfer/symbols.js
define("cordova/plugin/filetransfer/symbols", function(require, exports, module) {
@@ -4486,7 +4505,7 @@ modulemapper.clobbers('cordova/plugin/FileTransferError', 'FileTransferError');
});
-// file: lib\common\plugin\geolocation.js
+// file: lib/common/plugin/geolocation.js
define("cordova/plugin/geolocation", function(require, exports, module) {
var argscheck = require('cordova/argscheck'),
@@ -4682,7 +4701,7 @@ module.exports = geolocation;
});
-// file: lib\common\plugin\geolocation\symbols.js
+// file: lib/common/plugin/geolocation/symbols.js
define("cordova/plugin/geolocation/symbols", function(require, exports, module) {
@@ -4695,7 +4714,7 @@ modulemapper.clobbers('cordova/plugin/Coordinates', 'Coordinates');
});
-// file: lib\common\plugin\globalization.js
+// file: lib/common/plugin/globalization.js
define("cordova/plugin/globalization", function(require, exports, module) {
var argscheck = require('cordova/argscheck'),
@@ -5071,7 +5090,7 @@ module.exports = globalization;
});
-// file: lib\common\plugin\globalization\symbols.js
+// file: lib/common/plugin/globalization/symbols.js
define("cordova/plugin/globalization/symbols", function(require, exports, module) {
@@ -5082,7 +5101,7 @@ modulemapper.clobbers('cordova/plugin/GlobalizationError', 'GlobalizationError')
});
-// file: lib\common\plugin\logger.js
+// file: lib/common/plugin/logger.js
define("cordova/plugin/logger", function(require, exports, module) {
//------------------------------------------------------------------------------
@@ -5412,7 +5431,7 @@ document.addEventListener("deviceready", logger.__onDeviceReady, false);
});
-// file: lib\common\plugin\logger\symbols.js
+// file: lib/common/plugin/logger/symbols.js
define("cordova/plugin/logger/symbols", function(require, exports, module) {
@@ -5422,7 +5441,7 @@ modulemapper.clobbers('cordova/plugin/logger', 'cordova.logger');
});
-// file: lib\windows8\plugin\media\symbols.js
+// file: lib/windows8/plugin/media/symbols.js
define("cordova/plugin/media/symbols", function(require, exports, module) {
@@ -5433,7 +5452,7 @@ modulemapper.clobbers('cordova/plugin/MediaError', 'MediaError');
});
-// file: lib\common\plugin\network.js
+// file: lib/common/plugin/network.js
define("cordova/plugin/network", function(require, exports, module) {
var exec = require('cordova/exec'),
@@ -5505,7 +5524,7 @@ module.exports = me;
});
-// file: lib\common\plugin\networkstatus\symbols.js
+// file: lib/common/plugin/networkstatus/symbols.js
define("cordova/plugin/networkstatus/symbols", function(require, exports, module) {
@@ -5517,7 +5536,7 @@ modulemapper.defaults('cordova/plugin/Connection', 'Connection');
});
-// file: lib\common\plugin\notification.js
+// file: lib/common/plugin/notification.js
define("cordova/plugin/notification", function(require, exports, module) {
var exec = require('cordova/exec');
@@ -5620,7 +5639,7 @@ module.exports = {
});
-// file: lib\common\plugin\notification\symbols.js
+// file: lib/common/plugin/notification/symbols.js
define("cordova/plugin/notification/symbols", function(require, exports, module) {
@@ -5630,7 +5649,7 @@ modulemapper.defaults('cordova/plugin/notification', 'navigator.notification');
});
-// file: lib\common\plugin\requestFileSystem.js
+// file: lib/common/plugin/requestFileSystem.js
define("cordova/plugin/requestFileSystem", function(require, exports, module) {
var argscheck = require('cordova/argscheck'),
@@ -5676,7 +5695,7 @@ module.exports = requestFileSystem;
});
-// file: lib\common\plugin\resolveLocalFileSystemURI.js
+// file: lib/common/plugin/resolveLocalFileSystemURI.js
define("cordova/plugin/resolveLocalFileSystemURI", function(require, exports, module) {
var argscheck = require('cordova/argscheck'),
@@ -5725,7 +5744,7 @@ module.exports = function(uri, successCallback, errorCallback) {
});
-// file: lib\common\plugin\splashscreen.js
+// file: lib/common/plugin/splashscreen.js
define("cordova/plugin/splashscreen", function(require, exports, module) {
var exec = require('cordova/exec');
@@ -5743,7 +5762,7 @@ module.exports = splashscreen;
});
-// file: lib\common\plugin\splashscreen\symbols.js
+// file: lib/common/plugin/splashscreen/symbols.js
define("cordova/plugin/splashscreen/symbols", function(require, exports, module) {
@@ -5753,7 +5772,7 @@ modulemapper.clobbers('cordova/plugin/splashscreen', 'navigator.splashscreen');
});
-// file: lib\windows8\plugin\windows8\AccelerometerProxy.js
+// file: lib/windows8/plugin/windows8/AccelerometerProxy.js
define("cordova/plugin/windows8/AccelerometerProxy", function(require, exports, module) {
/*global Windows:true */
@@ -5807,7 +5826,7 @@ module.exports = {
require("cordova/commandProxy").add("Accelerometer",module.exports);
});
-// file: lib\windows8\plugin\windows8\CameraProxy.js
+// file: lib/windows8/plugin/windows8/CameraProxy.js
define("cordova/plugin/windows8/CameraProxy", function(require, exports, module) {
/*global Windows:true, URL:true */
@@ -6133,7 +6152,7 @@ require("cordova/commandProxy").add("Camera",module.exports);
});
-// file: lib\windows8\plugin\windows8\CaptureProxy.js
+// file: lib/windows8/plugin/windows8/CaptureProxy.js
define("cordova/plugin/windows8/CaptureProxy", function(require, exports, module) {
/*global Windows:true */
@@ -6278,7 +6297,7 @@ module.exports = {
require("cordova/commandProxy").add("Capture",module.exports);
});
-// file: lib\windows8\plugin\windows8\CompassProxy.js
+// file: lib/windows8/plugin/windows8/CompassProxy.js
define("cordova/plugin/windows8/CompassProxy", function(require, exports, module) {
/*global Windows:true */
@@ -6327,7 +6346,7 @@ module.exports = {
require("cordova/commandProxy").add("Compass",module.exports);
});
-// file: lib\windows8\plugin\windows8\ContactsProxy.js
+// file: lib/windows8/plugin/windows8/ContactsProxy.js
define("cordova/plugin/windows8/ContactsProxy", function(require, exports, module) {
var cordova = require('cordova');
@@ -6359,7 +6378,7 @@ module.exports = {
require("cordova/commandProxy").add("Contacts",module.exports);
});
-// file: lib\windows8\plugin\windows8\DeviceProxy.js
+// file: lib/windows8/plugin/windows8/DeviceProxy.js
define("cordova/plugin/windows8/DeviceProxy", function(require, exports, module) {
var cordova = require('cordova');
@@ -6403,7 +6422,7 @@ require("cordova/commandProxy").add("Device",module.exports);
});
-// file: lib\windows8\plugin\windows8\FileProxy.js
+// file: lib/windows8/plugin/windows8/FileProxy.js
define("cordova/plugin/windows8/FileProxy", function(require, exports, module) {
var cordova = require('cordova');
@@ -7233,7 +7252,7 @@ require("cordova/commandProxy").add("File",module.exports);
});
-// file: lib\windows8\plugin\windows8\FileTransferProxy.js
+// file: lib/windows8/plugin/windows8/FileTransferProxy.js
define("cordova/plugin/windows8/FileTransferProxy", function(require, exports, module) {
@@ -7327,7 +7346,7 @@ module.exports = {
require("cordova/commandProxy").add("FileTransfer",module.exports);
});
-// file: lib\windows8\plugin\windows8\MediaFile.js
+// file: lib/windows8/plugin/windows8/MediaFile.js
define("cordova/plugin/windows8/MediaFile", function(require, exports, module) {
/*global Windows:true */
@@ -7377,7 +7396,7 @@ module.exports = {
});
-// file: lib\windows8\plugin\windows8\MediaProxy.js
+// file: lib/windows8/plugin/windows8/MediaProxy.js
define("cordova/plugin/windows8/MediaProxy", function(require, exports, module) {
/*global Windows:true */
@@ -7544,7 +7563,7 @@ module.exports = {
require("cordova/commandProxy").add("Media",module.exports);
});
-// file: lib\windows8\plugin\windows8\NetworkStatusProxy.js
+// file: lib/windows8/plugin/windows8/NetworkStatusProxy.js
define("cordova/plugin/windows8/NetworkStatusProxy", function(require, exports, module) {
/*global Windows:true */
@@ -7615,7 +7634,7 @@ module.exports = {
require("cordova/commandProxy").add("NetworkStatus",module.exports);
});
-// file: lib\windows8\plugin\windows8\NotificationProxy.js
+// file: lib/windows8/plugin/windows8/NotificationProxy.js
define("cordova/plugin/windows8/NotificationProxy", function(require, exports, module) {
/*global Windows:true */
@@ -7722,7 +7741,7 @@ module.exports = {
require("cordova/commandProxy").add("Notification",module.exports);
});
-// file: lib\windows8\plugin\windows8\console.js
+// file: lib/windows8/plugin/windows8/console.js
define("cordova/plugin/windows8/console", function(require, exports, module) {
@@ -7753,7 +7772,7 @@ else if(console && console.log) {
});
-// file: lib\windows8\plugin\windows8\console\symbols.js
+// file: lib/windows8/plugin/windows8/console/symbols.js
define("cordova/plugin/windows8/console/symbols", function(require, exports, module) {
@@ -7763,7 +7782,7 @@ modulemapper.clobbers('cordova/plugin/windows8/console', 'navigator.console');
});
-// file: lib\windows8\plugin\windows8\notification\plugininit.js
+// file: lib/windows8/plugin/windows8/notification/plugininit.js
define("cordova/plugin/windows8/notification/plugininit", function(require, exports, module) {
window.alert = window.alert || require("cordova/plugin/notification").alert;
@@ -7772,7 +7791,7 @@ window.confirm = window.confirm || require("cordova/plugin/notification").confir
});
-// file: lib\common\symbols.js
+// file: lib/common/symbols.js
define("cordova/symbols", function(require, exports, module) {
var modulemapper = require('cordova/modulemapper');
@@ -7785,7 +7804,7 @@ modulemapper.clobbers('cordova/exec', 'Cordova.exec');
});
-// file: lib\common\utils.js
+// file: lib/common/utils.js
define("cordova/utils", function(require, exports, module) {
var utils = exports;
@@ -7956,9 +7975,14 @@ function UUIDcreatePart(length) {
});
window.cordova = require('cordova');
-// file: lib\scripts\bootstrap.js
+// 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];
@@ -8030,11 +8054,11 @@ window.cordova = require('cordova');
}(window));
-// file: lib\scripts\bootstrap-windows8.js
+// file: lib/scripts/bootstrap-windows8.js
require('cordova/channel').onNativeReady.fire();
-// file: lib\scripts\plugin_loader.js
+// file: lib/scripts/plugin_loader.js
// Tries to load all plugins' js-modules.
// This is an async process, but onDeviceReady is blocked on onPluginsReady.
@@ -8051,11 +8075,21 @@ require('cordova/channel').onNativeReady.fire();
}
}
+ function scriptErrorCallback(err) {
+ // Open Question: If a script path specified in cordova_plugins.js does not exist, do we fail for all?
+ // this is currently just continuing.
+ scriptCounter--;
+ if (scriptCounter === 0) {
+ onScriptLoadingComplete && onScriptLoadingComplete();
+ }
+ }
+
// Helper function to inject a <script> tag.
function injectScript(path) {
scriptCounter++;
var script = document.createElement("script");
script.onload = scriptLoadedCallback;
+ script.onerror = scriptErrorCallback;
script.src = path;
document.head.appendChild(script);
}
@@ -8067,10 +8101,10 @@ require('cordova/channel').onNativeReady.fire();
context.cordova.require('cordova/channel').onPluginsReady.fire();
}
- // Handler for the cordova_plugins.json content.
+ // Handler for the cordova_plugins.js content.
// See plugman's plugin_loader.js for the details of this object.
// This function is only called if the really is a plugins array that isn't empty.
- // Otherwise the XHR response handler will just call finishPluginLoading().
+ // Otherwise the onerror response handler will just call finishPluginLoading().
function handlePluginsObject(modules, path) {
// First create the callback for when all plugins are loaded.
var mapper = context.cordova.require('cordova/modulemapper');
@@ -8078,25 +8112,30 @@ require('cordova/channel').onNativeReady.fire();
// Loop through all the plugins and then through their clobbers and merges.
for (var i = 0; i < modules.length; i++) {
var module = modules[i];
- if (!module) continue;
+ if (module) {
+ try {
+ if (module.clobbers && module.clobbers.length) {
+ for (var j = 0; j < module.clobbers.length; j++) {
+ mapper.clobbers(module.id, module.clobbers[j]);
+ }
+ }
- if (module.clobbers && module.clobbers.length) {
- for (var j = 0; j < module.clobbers.length; j++) {
- mapper.clobbers(module.id, module.clobbers[j]);
- }
- }
+ if (module.merges && module.merges.length) {
+ for (var k = 0; k < module.merges.length; k++) {
+ mapper.merges(module.id, module.merges[k]);
+ }
+ }
- if (module.merges && module.merges.length) {
- for (var k = 0; k < module.merges.length; k++) {
- mapper.merges(module.id, module.merges[k]);
+ // Finally, if runs is truthy we want to simply require() the module.
+ // This can be skipped if it had any merges or clobbers, though,
+ // since the mapper will already have required the module.
+ if (module.runs && !(module.clobbers && module.clobbers.length) && !(module.merges && module.merges.length)) {
+ context.cordova.require(module.id);
+ }
+ }
+ catch(err) {
+ // error with module, most likely clobbers, should we continue?
}
- }
-
- // Finally, if runs is truthy we want to simply require() the module.
- // This can be skipped if it had any merges or clobbers, though,
- // since the mapper will already have required the module.
- if (module.runs && !(module.clobbers && module.clobbers.length) && !(module.merges && module.merges.length)) {
- context.cordova.require(module.id);
}
}
@@ -8120,6 +8159,33 @@ require('cordova/channel').onNativeReady.fire();
break;
}
}
+
+ var plugins_json = path + 'cordova_plugins.json';
+ var plugins_js = path + 'cordova_plugins.js';
+
+ // One some phones (Windows) this xhr.open throws an Access Denied exception
+ // So lets keep trying, but with a script tag injection technique instead of XHR
+ var injectPluginScript = function injectPluginScript() {
+ try {
+ var script = document.createElement("script");
+ script.onload = function(){
+ var list = cordova.require("cordova/plugin_list");
+ handlePluginsObject(list,path);
+ };
+ script.onerror = function() {
+ // 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();
+ };
+ script.src = plugins_js;
+ document.head.appendChild(script);
+
+ } catch(err){
+ finishPluginLoading();
+ }
+ }
+
+
// Try to XHR the cordova_plugins.json file asynchronously.
var xhr = new XMLHttpRequest();
xhr.onload = function() {
@@ -8138,14 +8204,16 @@ require('cordova/channel').onNativeReady.fire();
}
};
xhr.onerror = function() {
- finishPluginLoading();
+ // In this case, the json file was not present, but XHR was allowed,
+ // so we should still try the script injection technique with the js file
+ // in case that is there.
+ injectPluginScript();
};
- var plugins_json = path + 'cordova_plugins.json';
try { // we commented we were going to try, so let us actually try and catch
xhr.open('GET', plugins_json, true); // Async
xhr.send();
} catch(err){
- finishPluginLoading();
+ injectPluginScript();
}
}(window));