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/02/04 22:15:37 UTC
git commit: update to 2.4.0 js/version
Updated Branches:
refs/heads/master c2973d277 -> 671f17932
Updated Tags: refs/tags/2.4.0 [created] 671f17932
update to 2.4.0 js/version
Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/671f1793
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/671f1793
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/671f1793
Branch: refs/heads/master
Commit: 671f17932e21df35f75b82770f2b524952aa7f66
Parents: c2973d2
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Mon Feb 4 13:14:27 2013 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Mon Feb 4 13:14:27 2013 -0800
----------------------------------------------------------------------
windows8/VERSION | 2 +-
windows8/cordova-2.4.0.js | 251 ++++++++++-----
.../framework/Template-Cordova/cordova-2.4.0.js | 251 ++++++++++-----
.../samples/Media_Test/Media_Test/cordova-2.4.0.js | 251 ++++++++++-----
.../Notification Test/cordova-2.4.0.js | 251 ++++++++++-----
windows8/template/www/cordova-2.4.0.js | 251 ++++++++++-----
windows8/test/cordova-2.4.0.js | 251 ++++++++++-----
7 files changed, 1027 insertions(+), 481 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/671f1793/windows8/VERSION
----------------------------------------------------------------------
diff --git a/windows8/VERSION b/windows8/VERSION
index edf28ac..9183195 100644
--- a/windows8/VERSION
+++ b/windows8/VERSION
@@ -1 +1 @@
-2.4.0rc1
\ No newline at end of file
+2.4.0
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/671f1793/windows8/cordova-2.4.0.js
----------------------------------------------------------------------
diff --git a/windows8/cordova-2.4.0.js b/windows8/cordova-2.4.0.js
index f299b74..fdb6245 100644
--- a/windows8/cordova-2.4.0.js
+++ b/windows8/cordova-2.4.0.js
@@ -1,6 +1,8 @@
-// commit 7d5552049e33254eca3bda227af8a4892a7ce7c3
+// Platform: windows8
-// File generated at :: Mon Jan 21 2013 17:12:31 GMT-0800 (Pacific Standard Time)
+// commit ac725f6ae0bd655789771e2a40b8d60cb4c8c221
+
+// File generated at :: Mon Feb 04 2013 11:20:37 GMT-0800 (Pacific Standard Time)
/*
Licensed to the Apache Software Foundation (ASF) under one
@@ -78,6 +80,7 @@ var require,
delete modules[id];
};
+ define.moduleMap = modules;
})();
//Export for use in node
@@ -409,6 +412,8 @@ function assignOrWrapInDeprecateGetter(obj, key, value, message) {
if (message) {
utils.defineGetter(obj, key, function() {
console.log(message);
+ delete obj[key];
+ clobber(obj, key, value);
return value;
});
} else {
@@ -438,10 +443,6 @@ function include(parent, objects, clobber, merge) {
// Overwrite if not currently defined.
if (typeof parent[key] == 'undefined') {
assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- } else if (merge && typeof obj.path !== 'undefined') {
- // If merging, merge parent onto result
- recursiveMerge(result, parent[key]);
- parent[key] = result;
} else {
// Set result to what already exists, so we can build children into it if they exist.
result = parent[key];
@@ -467,19 +468,18 @@ function include(parent, objects, clobber, merge) {
function recursiveMerge(target, src) {
for (var prop in src) {
if (src.hasOwnProperty(prop)) {
- if (typeof target.prototype !== 'undefined' && target.prototype.constructor === target) {
+ if (target.prototype && target.prototype.constructor === target) {
// If the target object is a constructor override off prototype.
- target.prototype[prop] = src[prop];
+ clobber(target.prototype, prop, src[prop]);
} else {
- if (typeof src[prop] === 'object') {
- target[prop] = recursiveMerge(target[prop], src[prop]);
+ if (typeof src[prop] === 'object' && typeof target[prop] === 'object') {
+ recursiveMerge(target[prop], src[prop]);
} else {
clobber(target, prop, src[prop]);
}
}
}
}
- return target;
}
module.exports = {
@@ -491,7 +491,9 @@ module.exports = {
},
buildIntoAndMerge: function(objects, target) {
include(target, objects, true, true);
- }
+ },
+ recursiveMerge: recursiveMerge,
+ assignOrWrapInDeprecateGetter: assignOrWrapInDeprecateGetter
};
});
@@ -904,54 +906,9 @@ module.exports = {
device: {
path: 'cordova/plugin/device'
},
- DirectoryEntry: {
- path: 'cordova/plugin/DirectoryEntry'
- },
- DirectoryReader: {
- path: 'cordova/plugin/DirectoryReader'
- },
- Entry: {
- path: 'cordova/plugin/Entry'
- },
- File: {
- path: 'cordova/plugin/File'
- },
- FileEntry: {
- path: 'cordova/plugin/FileEntry'
- },
- FileError: {
- path: 'cordova/plugin/FileError'
- },
- FileReader: {
- path: 'cordova/plugin/FileReader'
- },
- FileSystem: {
- path: 'cordova/plugin/FileSystem'
- },
- FileTransfer: {
- path: 'cordova/plugin/FileTransfer'
- },
- FileTransferError: {
- path: 'cordova/plugin/FileTransferError'
- },
- FileUploadOptions: {
- path: 'cordova/plugin/FileUploadOptions'
- },
- FileUploadResult: {
- path: 'cordova/plugin/FileUploadResult'
- },
- FileWriter: {
- path: 'cordova/plugin/FileWriter'
- },
- Flags: {
- path: 'cordova/plugin/Flags'
- },
GlobalizationError: {
path: 'cordova/plugin/GlobalizationError'
},
- LocalFileSystem: {
- path: 'cordova/plugin/LocalFileSystem'
- },
Media: {
path: 'cordova/plugin/Media'
},
@@ -964,9 +921,6 @@ module.exports = {
MediaFileData:{
path: 'cordova/plugin/MediaFileData'
},
- Metadata:{
- path: 'cordova/plugin/Metadata'
- },
Position: {
path: 'cordova/plugin/Position'
},
@@ -975,12 +929,6 @@ module.exports = {
},
ProgressEvent: {
path: 'cordova/plugin/ProgressEvent'
- },
- requestFileSystem:{
- path: 'cordova/plugin/requestFileSystem'
- },
- resolveLocalFileSystemURI:{
- path: 'cordova/plugin/resolveLocalFileSystemURI'
}
},
clobbers: {
@@ -1039,6 +987,107 @@ module.exports = function(success, fail, service, action, args) {
});
+// file: lib\common\modulemapper.js
+define("cordova/modulemapper", function(require, exports, module) {
+
+var builder = require('cordova/builder'),
+ moduleMap = define.moduleMap,
+ symbolList,
+ deprecationMap;
+
+exports.reset = function() {
+ symbolList = [];
+ deprecationMap = {};
+};
+
+function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) {
+ if (!(moduleName in moduleMap)) {
+ throw new Error('Module ' + moduleName + ' does not exist.');
+ }
+ symbolList.push(strategy, moduleName, symbolPath);
+ if (opt_deprecationMessage) {
+ deprecationMap[symbolPath] = opt_deprecationMessage;
+ }
+}
+
+// Note: Android 2.3 does have Function.bind().
+exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+function prepareNamespace(symbolPath, context) {
+ if (!symbolPath) {
+ return context;
+ }
+ var parts = symbolPath.split('.');
+ var cur = context;
+ for (var i = 0, part; part = parts[i]; ++i) {
+ cur[part] = cur[part] || {};
+ }
+ return cur[parts[i-1]];
+}
+
+exports.mapModules = function(context) {
+ var origSymbols = {};
+ context.CDV_origSymbols = origSymbols;
+ for (var i = 0, len = symbolList.length; i < len; i += 3) {
+ var strategy = symbolList[i];
+ var moduleName = symbolList[i + 1];
+ var symbolPath = symbolList[i + 2];
+ var lastDot = symbolPath.lastIndexOf('.');
+ var namespace = symbolPath.substr(0, lastDot);
+ var lastName = symbolPath.substr(lastDot + 1);
+
+ var module = require(moduleName);
+ var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
+ var parentObj = prepareNamespace(namespace, context);
+ var target = parentObj[lastName];
+
+ if (strategy == 'm' && target) {
+ builder.recursiveMerge(target, module);
+ } else if ((strategy == 'd' && !target) || (strategy != 'd')) {
+ if (target) {
+ origSymbols[symbolPath] = target;
+ }
+ builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
+ }
+ }
+};
+
+exports.getOriginalSymbol = function(context, symbolPath) {
+ var origSymbols = context.CDV_origSymbols;
+ if (origSymbols && (symbolPath in origSymbols)) {
+ return origSymbols[symbolPath];
+ }
+ var parts = symbolPath.split('.');
+ var obj = context;
+ for (var i = 0; i < parts.length; ++i) {
+ obj = obj && obj[parts[i]];
+ }
+ return obj;
+};
+
+exports.loadMatchingModules = function(matchingRegExp) {
+ for (var k in moduleMap) {
+ if (matchingRegExp.exec(k)) {
+ require(k);
+ }
+ }
+};
+
+exports.reset();
+
+
+});
+
// file: lib\windows8\platform.js
define("cordova/platform", function(require, exports, module) {
@@ -1068,9 +1117,13 @@ require('cordova/plugin/windows8/NotificationProxy');
module.exports = {
id: "windows8",
initialize:function() {
+ var modulemapper = require('cordova/modulemapper');
+
+ modulemapper.loadMatchingModules(/cordova.*\/symbols$/);
+ modulemapper.mapModules(window);
window.alert = window.alert || require("cordova/plugin/notification").alert;
- window.confirm = window.confirm || require("cordova/plugin/notification").confirm;
+ window.confirm = window.confirm || require("cordova/plugin/notification").confirm;
var onWinJSReady = function () {
var app = WinJS.Application;
@@ -1130,12 +1183,6 @@ module.exports = {
}
}
},
- FileReader: {
- path: 'cordova/plugin/FileReader'
- },
- File: {
- path: 'cordova/plugin/File'
- },
MediaError: {
path: 'cordova/plugin/MediaError'
}
@@ -1421,6 +1468,7 @@ module.exports = {
CELL_2G: "2g",
CELL_3G: "3g",
CELL_4G: "4g",
+ CELL:"cellular",
NONE: "none"
};
@@ -2302,11 +2350,12 @@ module.exports = FileError;
define("cordova/plugin/FileReader", function(require, exports, module) {
var exec = require('cordova/exec'),
+ modulemapper = require('cordova/modulemapper'),
utils = require('cordova/utils'),
File = require('cordova/plugin/File'),
FileError = require('cordova/plugin/FileError'),
ProgressEvent = require('cordova/plugin/ProgressEvent'),
- origFileReader = this.FileReader;
+ origFileReader = modulemapper.getOriginalSymbol(this, 'FileReader');
/**
* This class reads the mobile device file system.
@@ -4294,6 +4343,45 @@ module.exports = function(successCallback, errorCallback, message, forceAsync) {
});
+// file: lib\windows8\plugin\file\symbols.js
+define("cordova/plugin/file/symbols", function(require, exports, module) {
+
+
+var modulemapper = require('cordova/modulemapper'),
+ symbolshelper = require('cordova/plugin/file/symbolshelper');
+
+symbolshelper(modulemapper.defaults);
+modulemapper.clobbers('cordova/plugin/File', 'File');
+modulemapper.clobbers('cordova/plugin/FileReader', 'FileReader');
+
+});
+
+// file: lib\common\plugin\file\symbolshelper.js
+define("cordova/plugin/file/symbolshelper", function(require, exports, module) {
+
+module.exports = function(exportFunc) {
+ exportFunc('cordova/plugin/DirectoryEntry', 'DirectoryEntry');
+ exportFunc('cordova/plugin/DirectoryReader', 'DirectoryReader');
+ exportFunc('cordova/plugin/Entry', 'Entry');
+ exportFunc('cordova/plugin/File', 'File');
+ exportFunc('cordova/plugin/FileEntry', 'FileEntry');
+ exportFunc('cordova/plugin/FileError', 'FileError');
+ exportFunc('cordova/plugin/FileReader', 'FileReader');
+ exportFunc('cordova/plugin/FileSystem', 'FileSystem');
+ exportFunc('cordova/plugin/FileTransfer', 'FileTransfer');
+ exportFunc('cordova/plugin/FileTransferError', 'FileTransferError');
+ exportFunc('cordova/plugin/FileUploadOptions', 'FileUploadOptions');
+ exportFunc('cordova/plugin/FileUploadResult', 'FileUploadResult');
+ exportFunc('cordova/plugin/FileWriter', 'FileWriter');
+ exportFunc('cordova/plugin/Flags', 'Flags');
+ exportFunc('cordova/plugin/LocalFileSystem', 'LocalFileSystem');
+ exportFunc('cordova/plugin/Metadata', 'Metadata');
+ exportFunc('cordova/plugin/requestFileSystem', 'requestFileSystem');
+ exportFunc('cordova/plugin/resolveLocalFileSystemURI', 'resolveLocalFileSystemURI');
+};
+
+});
+
// file: lib\common\plugin\geolocation.js
define("cordova/plugin/geolocation", function(require, exports, module) {
@@ -7211,7 +7299,7 @@ var alertStack = [];
module.exports = {
alert:function(win, loseX, args) {
-
+
if (isAlertShowing) {
var later = function () {
module.exports.alert(win, loseX, args);
@@ -7220,7 +7308,7 @@ module.exports = {
return;
}
isAlertShowing = true;
-
+
var message = args[0];
var _title = args[1];
var _buttonLabel = args[2];
@@ -7229,12 +7317,12 @@ module.exports = {
md.commands.append(new Windows.UI.Popups.UICommand(_buttonLabel));
md.showAsync().then(function() {
isAlertShowing = false;
- win && win();
+ win && win();
if (alertStack.length) {
setTimeout(alertStack.shift(), 0);
}
-
+
});
},
@@ -7271,7 +7359,7 @@ module.exports = {
if (alertStack.length) {
setTimeout(alertStack.shift(), 0);
}
-
+
});
},
@@ -7347,7 +7435,10 @@ var utils = exports;
*/
utils.defineGetterSetter = function(obj, key, getFunc, opt_setFunc) {
if (Object.defineProperty) {
- var desc = {get:getFunc};
+ var desc = {
+ get: getFunc,
+ configurable: true
+ };
if (opt_setFunc) {
desc.set = opt_setFunc;
}
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/671f1793/windows8/framework/Template-Cordova/cordova-2.4.0.js
----------------------------------------------------------------------
diff --git a/windows8/framework/Template-Cordova/cordova-2.4.0.js b/windows8/framework/Template-Cordova/cordova-2.4.0.js
index f299b74..fdb6245 100644
--- a/windows8/framework/Template-Cordova/cordova-2.4.0.js
+++ b/windows8/framework/Template-Cordova/cordova-2.4.0.js
@@ -1,6 +1,8 @@
-// commit 7d5552049e33254eca3bda227af8a4892a7ce7c3
+// Platform: windows8
-// File generated at :: Mon Jan 21 2013 17:12:31 GMT-0800 (Pacific Standard Time)
+// commit ac725f6ae0bd655789771e2a40b8d60cb4c8c221
+
+// File generated at :: Mon Feb 04 2013 11:20:37 GMT-0800 (Pacific Standard Time)
/*
Licensed to the Apache Software Foundation (ASF) under one
@@ -78,6 +80,7 @@ var require,
delete modules[id];
};
+ define.moduleMap = modules;
})();
//Export for use in node
@@ -409,6 +412,8 @@ function assignOrWrapInDeprecateGetter(obj, key, value, message) {
if (message) {
utils.defineGetter(obj, key, function() {
console.log(message);
+ delete obj[key];
+ clobber(obj, key, value);
return value;
});
} else {
@@ -438,10 +443,6 @@ function include(parent, objects, clobber, merge) {
// Overwrite if not currently defined.
if (typeof parent[key] == 'undefined') {
assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- } else if (merge && typeof obj.path !== 'undefined') {
- // If merging, merge parent onto result
- recursiveMerge(result, parent[key]);
- parent[key] = result;
} else {
// Set result to what already exists, so we can build children into it if they exist.
result = parent[key];
@@ -467,19 +468,18 @@ function include(parent, objects, clobber, merge) {
function recursiveMerge(target, src) {
for (var prop in src) {
if (src.hasOwnProperty(prop)) {
- if (typeof target.prototype !== 'undefined' && target.prototype.constructor === target) {
+ if (target.prototype && target.prototype.constructor === target) {
// If the target object is a constructor override off prototype.
- target.prototype[prop] = src[prop];
+ clobber(target.prototype, prop, src[prop]);
} else {
- if (typeof src[prop] === 'object') {
- target[prop] = recursiveMerge(target[prop], src[prop]);
+ if (typeof src[prop] === 'object' && typeof target[prop] === 'object') {
+ recursiveMerge(target[prop], src[prop]);
} else {
clobber(target, prop, src[prop]);
}
}
}
}
- return target;
}
module.exports = {
@@ -491,7 +491,9 @@ module.exports = {
},
buildIntoAndMerge: function(objects, target) {
include(target, objects, true, true);
- }
+ },
+ recursiveMerge: recursiveMerge,
+ assignOrWrapInDeprecateGetter: assignOrWrapInDeprecateGetter
};
});
@@ -904,54 +906,9 @@ module.exports = {
device: {
path: 'cordova/plugin/device'
},
- DirectoryEntry: {
- path: 'cordova/plugin/DirectoryEntry'
- },
- DirectoryReader: {
- path: 'cordova/plugin/DirectoryReader'
- },
- Entry: {
- path: 'cordova/plugin/Entry'
- },
- File: {
- path: 'cordova/plugin/File'
- },
- FileEntry: {
- path: 'cordova/plugin/FileEntry'
- },
- FileError: {
- path: 'cordova/plugin/FileError'
- },
- FileReader: {
- path: 'cordova/plugin/FileReader'
- },
- FileSystem: {
- path: 'cordova/plugin/FileSystem'
- },
- FileTransfer: {
- path: 'cordova/plugin/FileTransfer'
- },
- FileTransferError: {
- path: 'cordova/plugin/FileTransferError'
- },
- FileUploadOptions: {
- path: 'cordova/plugin/FileUploadOptions'
- },
- FileUploadResult: {
- path: 'cordova/plugin/FileUploadResult'
- },
- FileWriter: {
- path: 'cordova/plugin/FileWriter'
- },
- Flags: {
- path: 'cordova/plugin/Flags'
- },
GlobalizationError: {
path: 'cordova/plugin/GlobalizationError'
},
- LocalFileSystem: {
- path: 'cordova/plugin/LocalFileSystem'
- },
Media: {
path: 'cordova/plugin/Media'
},
@@ -964,9 +921,6 @@ module.exports = {
MediaFileData:{
path: 'cordova/plugin/MediaFileData'
},
- Metadata:{
- path: 'cordova/plugin/Metadata'
- },
Position: {
path: 'cordova/plugin/Position'
},
@@ -975,12 +929,6 @@ module.exports = {
},
ProgressEvent: {
path: 'cordova/plugin/ProgressEvent'
- },
- requestFileSystem:{
- path: 'cordova/plugin/requestFileSystem'
- },
- resolveLocalFileSystemURI:{
- path: 'cordova/plugin/resolveLocalFileSystemURI'
}
},
clobbers: {
@@ -1039,6 +987,107 @@ module.exports = function(success, fail, service, action, args) {
});
+// file: lib\common\modulemapper.js
+define("cordova/modulemapper", function(require, exports, module) {
+
+var builder = require('cordova/builder'),
+ moduleMap = define.moduleMap,
+ symbolList,
+ deprecationMap;
+
+exports.reset = function() {
+ symbolList = [];
+ deprecationMap = {};
+};
+
+function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) {
+ if (!(moduleName in moduleMap)) {
+ throw new Error('Module ' + moduleName + ' does not exist.');
+ }
+ symbolList.push(strategy, moduleName, symbolPath);
+ if (opt_deprecationMessage) {
+ deprecationMap[symbolPath] = opt_deprecationMessage;
+ }
+}
+
+// Note: Android 2.3 does have Function.bind().
+exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+function prepareNamespace(symbolPath, context) {
+ if (!symbolPath) {
+ return context;
+ }
+ var parts = symbolPath.split('.');
+ var cur = context;
+ for (var i = 0, part; part = parts[i]; ++i) {
+ cur[part] = cur[part] || {};
+ }
+ return cur[parts[i-1]];
+}
+
+exports.mapModules = function(context) {
+ var origSymbols = {};
+ context.CDV_origSymbols = origSymbols;
+ for (var i = 0, len = symbolList.length; i < len; i += 3) {
+ var strategy = symbolList[i];
+ var moduleName = symbolList[i + 1];
+ var symbolPath = symbolList[i + 2];
+ var lastDot = symbolPath.lastIndexOf('.');
+ var namespace = symbolPath.substr(0, lastDot);
+ var lastName = symbolPath.substr(lastDot + 1);
+
+ var module = require(moduleName);
+ var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
+ var parentObj = prepareNamespace(namespace, context);
+ var target = parentObj[lastName];
+
+ if (strategy == 'm' && target) {
+ builder.recursiveMerge(target, module);
+ } else if ((strategy == 'd' && !target) || (strategy != 'd')) {
+ if (target) {
+ origSymbols[symbolPath] = target;
+ }
+ builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
+ }
+ }
+};
+
+exports.getOriginalSymbol = function(context, symbolPath) {
+ var origSymbols = context.CDV_origSymbols;
+ if (origSymbols && (symbolPath in origSymbols)) {
+ return origSymbols[symbolPath];
+ }
+ var parts = symbolPath.split('.');
+ var obj = context;
+ for (var i = 0; i < parts.length; ++i) {
+ obj = obj && obj[parts[i]];
+ }
+ return obj;
+};
+
+exports.loadMatchingModules = function(matchingRegExp) {
+ for (var k in moduleMap) {
+ if (matchingRegExp.exec(k)) {
+ require(k);
+ }
+ }
+};
+
+exports.reset();
+
+
+});
+
// file: lib\windows8\platform.js
define("cordova/platform", function(require, exports, module) {
@@ -1068,9 +1117,13 @@ require('cordova/plugin/windows8/NotificationProxy');
module.exports = {
id: "windows8",
initialize:function() {
+ var modulemapper = require('cordova/modulemapper');
+
+ modulemapper.loadMatchingModules(/cordova.*\/symbols$/);
+ modulemapper.mapModules(window);
window.alert = window.alert || require("cordova/plugin/notification").alert;
- window.confirm = window.confirm || require("cordova/plugin/notification").confirm;
+ window.confirm = window.confirm || require("cordova/plugin/notification").confirm;
var onWinJSReady = function () {
var app = WinJS.Application;
@@ -1130,12 +1183,6 @@ module.exports = {
}
}
},
- FileReader: {
- path: 'cordova/plugin/FileReader'
- },
- File: {
- path: 'cordova/plugin/File'
- },
MediaError: {
path: 'cordova/plugin/MediaError'
}
@@ -1421,6 +1468,7 @@ module.exports = {
CELL_2G: "2g",
CELL_3G: "3g",
CELL_4G: "4g",
+ CELL:"cellular",
NONE: "none"
};
@@ -2302,11 +2350,12 @@ module.exports = FileError;
define("cordova/plugin/FileReader", function(require, exports, module) {
var exec = require('cordova/exec'),
+ modulemapper = require('cordova/modulemapper'),
utils = require('cordova/utils'),
File = require('cordova/plugin/File'),
FileError = require('cordova/plugin/FileError'),
ProgressEvent = require('cordova/plugin/ProgressEvent'),
- origFileReader = this.FileReader;
+ origFileReader = modulemapper.getOriginalSymbol(this, 'FileReader');
/**
* This class reads the mobile device file system.
@@ -4294,6 +4343,45 @@ module.exports = function(successCallback, errorCallback, message, forceAsync) {
});
+// file: lib\windows8\plugin\file\symbols.js
+define("cordova/plugin/file/symbols", function(require, exports, module) {
+
+
+var modulemapper = require('cordova/modulemapper'),
+ symbolshelper = require('cordova/plugin/file/symbolshelper');
+
+symbolshelper(modulemapper.defaults);
+modulemapper.clobbers('cordova/plugin/File', 'File');
+modulemapper.clobbers('cordova/plugin/FileReader', 'FileReader');
+
+});
+
+// file: lib\common\plugin\file\symbolshelper.js
+define("cordova/plugin/file/symbolshelper", function(require, exports, module) {
+
+module.exports = function(exportFunc) {
+ exportFunc('cordova/plugin/DirectoryEntry', 'DirectoryEntry');
+ exportFunc('cordova/plugin/DirectoryReader', 'DirectoryReader');
+ exportFunc('cordova/plugin/Entry', 'Entry');
+ exportFunc('cordova/plugin/File', 'File');
+ exportFunc('cordova/plugin/FileEntry', 'FileEntry');
+ exportFunc('cordova/plugin/FileError', 'FileError');
+ exportFunc('cordova/plugin/FileReader', 'FileReader');
+ exportFunc('cordova/plugin/FileSystem', 'FileSystem');
+ exportFunc('cordova/plugin/FileTransfer', 'FileTransfer');
+ exportFunc('cordova/plugin/FileTransferError', 'FileTransferError');
+ exportFunc('cordova/plugin/FileUploadOptions', 'FileUploadOptions');
+ exportFunc('cordova/plugin/FileUploadResult', 'FileUploadResult');
+ exportFunc('cordova/plugin/FileWriter', 'FileWriter');
+ exportFunc('cordova/plugin/Flags', 'Flags');
+ exportFunc('cordova/plugin/LocalFileSystem', 'LocalFileSystem');
+ exportFunc('cordova/plugin/Metadata', 'Metadata');
+ exportFunc('cordova/plugin/requestFileSystem', 'requestFileSystem');
+ exportFunc('cordova/plugin/resolveLocalFileSystemURI', 'resolveLocalFileSystemURI');
+};
+
+});
+
// file: lib\common\plugin\geolocation.js
define("cordova/plugin/geolocation", function(require, exports, module) {
@@ -7211,7 +7299,7 @@ var alertStack = [];
module.exports = {
alert:function(win, loseX, args) {
-
+
if (isAlertShowing) {
var later = function () {
module.exports.alert(win, loseX, args);
@@ -7220,7 +7308,7 @@ module.exports = {
return;
}
isAlertShowing = true;
-
+
var message = args[0];
var _title = args[1];
var _buttonLabel = args[2];
@@ -7229,12 +7317,12 @@ module.exports = {
md.commands.append(new Windows.UI.Popups.UICommand(_buttonLabel));
md.showAsync().then(function() {
isAlertShowing = false;
- win && win();
+ win && win();
if (alertStack.length) {
setTimeout(alertStack.shift(), 0);
}
-
+
});
},
@@ -7271,7 +7359,7 @@ module.exports = {
if (alertStack.length) {
setTimeout(alertStack.shift(), 0);
}
-
+
});
},
@@ -7347,7 +7435,10 @@ var utils = exports;
*/
utils.defineGetterSetter = function(obj, key, getFunc, opt_setFunc) {
if (Object.defineProperty) {
- var desc = {get:getFunc};
+ var desc = {
+ get: getFunc,
+ configurable: true
+ };
if (opt_setFunc) {
desc.set = opt_setFunc;
}
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/671f1793/windows8/samples/Media_Test/Media_Test/cordova-2.4.0.js
----------------------------------------------------------------------
diff --git a/windows8/samples/Media_Test/Media_Test/cordova-2.4.0.js b/windows8/samples/Media_Test/Media_Test/cordova-2.4.0.js
index f299b74..fdb6245 100644
--- a/windows8/samples/Media_Test/Media_Test/cordova-2.4.0.js
+++ b/windows8/samples/Media_Test/Media_Test/cordova-2.4.0.js
@@ -1,6 +1,8 @@
-// commit 7d5552049e33254eca3bda227af8a4892a7ce7c3
+// Platform: windows8
-// File generated at :: Mon Jan 21 2013 17:12:31 GMT-0800 (Pacific Standard Time)
+// commit ac725f6ae0bd655789771e2a40b8d60cb4c8c221
+
+// File generated at :: Mon Feb 04 2013 11:20:37 GMT-0800 (Pacific Standard Time)
/*
Licensed to the Apache Software Foundation (ASF) under one
@@ -78,6 +80,7 @@ var require,
delete modules[id];
};
+ define.moduleMap = modules;
})();
//Export for use in node
@@ -409,6 +412,8 @@ function assignOrWrapInDeprecateGetter(obj, key, value, message) {
if (message) {
utils.defineGetter(obj, key, function() {
console.log(message);
+ delete obj[key];
+ clobber(obj, key, value);
return value;
});
} else {
@@ -438,10 +443,6 @@ function include(parent, objects, clobber, merge) {
// Overwrite if not currently defined.
if (typeof parent[key] == 'undefined') {
assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- } else if (merge && typeof obj.path !== 'undefined') {
- // If merging, merge parent onto result
- recursiveMerge(result, parent[key]);
- parent[key] = result;
} else {
// Set result to what already exists, so we can build children into it if they exist.
result = parent[key];
@@ -467,19 +468,18 @@ function include(parent, objects, clobber, merge) {
function recursiveMerge(target, src) {
for (var prop in src) {
if (src.hasOwnProperty(prop)) {
- if (typeof target.prototype !== 'undefined' && target.prototype.constructor === target) {
+ if (target.prototype && target.prototype.constructor === target) {
// If the target object is a constructor override off prototype.
- target.prototype[prop] = src[prop];
+ clobber(target.prototype, prop, src[prop]);
} else {
- if (typeof src[prop] === 'object') {
- target[prop] = recursiveMerge(target[prop], src[prop]);
+ if (typeof src[prop] === 'object' && typeof target[prop] === 'object') {
+ recursiveMerge(target[prop], src[prop]);
} else {
clobber(target, prop, src[prop]);
}
}
}
}
- return target;
}
module.exports = {
@@ -491,7 +491,9 @@ module.exports = {
},
buildIntoAndMerge: function(objects, target) {
include(target, objects, true, true);
- }
+ },
+ recursiveMerge: recursiveMerge,
+ assignOrWrapInDeprecateGetter: assignOrWrapInDeprecateGetter
};
});
@@ -904,54 +906,9 @@ module.exports = {
device: {
path: 'cordova/plugin/device'
},
- DirectoryEntry: {
- path: 'cordova/plugin/DirectoryEntry'
- },
- DirectoryReader: {
- path: 'cordova/plugin/DirectoryReader'
- },
- Entry: {
- path: 'cordova/plugin/Entry'
- },
- File: {
- path: 'cordova/plugin/File'
- },
- FileEntry: {
- path: 'cordova/plugin/FileEntry'
- },
- FileError: {
- path: 'cordova/plugin/FileError'
- },
- FileReader: {
- path: 'cordova/plugin/FileReader'
- },
- FileSystem: {
- path: 'cordova/plugin/FileSystem'
- },
- FileTransfer: {
- path: 'cordova/plugin/FileTransfer'
- },
- FileTransferError: {
- path: 'cordova/plugin/FileTransferError'
- },
- FileUploadOptions: {
- path: 'cordova/plugin/FileUploadOptions'
- },
- FileUploadResult: {
- path: 'cordova/plugin/FileUploadResult'
- },
- FileWriter: {
- path: 'cordova/plugin/FileWriter'
- },
- Flags: {
- path: 'cordova/plugin/Flags'
- },
GlobalizationError: {
path: 'cordova/plugin/GlobalizationError'
},
- LocalFileSystem: {
- path: 'cordova/plugin/LocalFileSystem'
- },
Media: {
path: 'cordova/plugin/Media'
},
@@ -964,9 +921,6 @@ module.exports = {
MediaFileData:{
path: 'cordova/plugin/MediaFileData'
},
- Metadata:{
- path: 'cordova/plugin/Metadata'
- },
Position: {
path: 'cordova/plugin/Position'
},
@@ -975,12 +929,6 @@ module.exports = {
},
ProgressEvent: {
path: 'cordova/plugin/ProgressEvent'
- },
- requestFileSystem:{
- path: 'cordova/plugin/requestFileSystem'
- },
- resolveLocalFileSystemURI:{
- path: 'cordova/plugin/resolveLocalFileSystemURI'
}
},
clobbers: {
@@ -1039,6 +987,107 @@ module.exports = function(success, fail, service, action, args) {
});
+// file: lib\common\modulemapper.js
+define("cordova/modulemapper", function(require, exports, module) {
+
+var builder = require('cordova/builder'),
+ moduleMap = define.moduleMap,
+ symbolList,
+ deprecationMap;
+
+exports.reset = function() {
+ symbolList = [];
+ deprecationMap = {};
+};
+
+function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) {
+ if (!(moduleName in moduleMap)) {
+ throw new Error('Module ' + moduleName + ' does not exist.');
+ }
+ symbolList.push(strategy, moduleName, symbolPath);
+ if (opt_deprecationMessage) {
+ deprecationMap[symbolPath] = opt_deprecationMessage;
+ }
+}
+
+// Note: Android 2.3 does have Function.bind().
+exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+function prepareNamespace(symbolPath, context) {
+ if (!symbolPath) {
+ return context;
+ }
+ var parts = symbolPath.split('.');
+ var cur = context;
+ for (var i = 0, part; part = parts[i]; ++i) {
+ cur[part] = cur[part] || {};
+ }
+ return cur[parts[i-1]];
+}
+
+exports.mapModules = function(context) {
+ var origSymbols = {};
+ context.CDV_origSymbols = origSymbols;
+ for (var i = 0, len = symbolList.length; i < len; i += 3) {
+ var strategy = symbolList[i];
+ var moduleName = symbolList[i + 1];
+ var symbolPath = symbolList[i + 2];
+ var lastDot = symbolPath.lastIndexOf('.');
+ var namespace = symbolPath.substr(0, lastDot);
+ var lastName = symbolPath.substr(lastDot + 1);
+
+ var module = require(moduleName);
+ var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
+ var parentObj = prepareNamespace(namespace, context);
+ var target = parentObj[lastName];
+
+ if (strategy == 'm' && target) {
+ builder.recursiveMerge(target, module);
+ } else if ((strategy == 'd' && !target) || (strategy != 'd')) {
+ if (target) {
+ origSymbols[symbolPath] = target;
+ }
+ builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
+ }
+ }
+};
+
+exports.getOriginalSymbol = function(context, symbolPath) {
+ var origSymbols = context.CDV_origSymbols;
+ if (origSymbols && (symbolPath in origSymbols)) {
+ return origSymbols[symbolPath];
+ }
+ var parts = symbolPath.split('.');
+ var obj = context;
+ for (var i = 0; i < parts.length; ++i) {
+ obj = obj && obj[parts[i]];
+ }
+ return obj;
+};
+
+exports.loadMatchingModules = function(matchingRegExp) {
+ for (var k in moduleMap) {
+ if (matchingRegExp.exec(k)) {
+ require(k);
+ }
+ }
+};
+
+exports.reset();
+
+
+});
+
// file: lib\windows8\platform.js
define("cordova/platform", function(require, exports, module) {
@@ -1068,9 +1117,13 @@ require('cordova/plugin/windows8/NotificationProxy');
module.exports = {
id: "windows8",
initialize:function() {
+ var modulemapper = require('cordova/modulemapper');
+
+ modulemapper.loadMatchingModules(/cordova.*\/symbols$/);
+ modulemapper.mapModules(window);
window.alert = window.alert || require("cordova/plugin/notification").alert;
- window.confirm = window.confirm || require("cordova/plugin/notification").confirm;
+ window.confirm = window.confirm || require("cordova/plugin/notification").confirm;
var onWinJSReady = function () {
var app = WinJS.Application;
@@ -1130,12 +1183,6 @@ module.exports = {
}
}
},
- FileReader: {
- path: 'cordova/plugin/FileReader'
- },
- File: {
- path: 'cordova/plugin/File'
- },
MediaError: {
path: 'cordova/plugin/MediaError'
}
@@ -1421,6 +1468,7 @@ module.exports = {
CELL_2G: "2g",
CELL_3G: "3g",
CELL_4G: "4g",
+ CELL:"cellular",
NONE: "none"
};
@@ -2302,11 +2350,12 @@ module.exports = FileError;
define("cordova/plugin/FileReader", function(require, exports, module) {
var exec = require('cordova/exec'),
+ modulemapper = require('cordova/modulemapper'),
utils = require('cordova/utils'),
File = require('cordova/plugin/File'),
FileError = require('cordova/plugin/FileError'),
ProgressEvent = require('cordova/plugin/ProgressEvent'),
- origFileReader = this.FileReader;
+ origFileReader = modulemapper.getOriginalSymbol(this, 'FileReader');
/**
* This class reads the mobile device file system.
@@ -4294,6 +4343,45 @@ module.exports = function(successCallback, errorCallback, message, forceAsync) {
});
+// file: lib\windows8\plugin\file\symbols.js
+define("cordova/plugin/file/symbols", function(require, exports, module) {
+
+
+var modulemapper = require('cordova/modulemapper'),
+ symbolshelper = require('cordova/plugin/file/symbolshelper');
+
+symbolshelper(modulemapper.defaults);
+modulemapper.clobbers('cordova/plugin/File', 'File');
+modulemapper.clobbers('cordova/plugin/FileReader', 'FileReader');
+
+});
+
+// file: lib\common\plugin\file\symbolshelper.js
+define("cordova/plugin/file/symbolshelper", function(require, exports, module) {
+
+module.exports = function(exportFunc) {
+ exportFunc('cordova/plugin/DirectoryEntry', 'DirectoryEntry');
+ exportFunc('cordova/plugin/DirectoryReader', 'DirectoryReader');
+ exportFunc('cordova/plugin/Entry', 'Entry');
+ exportFunc('cordova/plugin/File', 'File');
+ exportFunc('cordova/plugin/FileEntry', 'FileEntry');
+ exportFunc('cordova/plugin/FileError', 'FileError');
+ exportFunc('cordova/plugin/FileReader', 'FileReader');
+ exportFunc('cordova/plugin/FileSystem', 'FileSystem');
+ exportFunc('cordova/plugin/FileTransfer', 'FileTransfer');
+ exportFunc('cordova/plugin/FileTransferError', 'FileTransferError');
+ exportFunc('cordova/plugin/FileUploadOptions', 'FileUploadOptions');
+ exportFunc('cordova/plugin/FileUploadResult', 'FileUploadResult');
+ exportFunc('cordova/plugin/FileWriter', 'FileWriter');
+ exportFunc('cordova/plugin/Flags', 'Flags');
+ exportFunc('cordova/plugin/LocalFileSystem', 'LocalFileSystem');
+ exportFunc('cordova/plugin/Metadata', 'Metadata');
+ exportFunc('cordova/plugin/requestFileSystem', 'requestFileSystem');
+ exportFunc('cordova/plugin/resolveLocalFileSystemURI', 'resolveLocalFileSystemURI');
+};
+
+});
+
// file: lib\common\plugin\geolocation.js
define("cordova/plugin/geolocation", function(require, exports, module) {
@@ -7211,7 +7299,7 @@ var alertStack = [];
module.exports = {
alert:function(win, loseX, args) {
-
+
if (isAlertShowing) {
var later = function () {
module.exports.alert(win, loseX, args);
@@ -7220,7 +7308,7 @@ module.exports = {
return;
}
isAlertShowing = true;
-
+
var message = args[0];
var _title = args[1];
var _buttonLabel = args[2];
@@ -7229,12 +7317,12 @@ module.exports = {
md.commands.append(new Windows.UI.Popups.UICommand(_buttonLabel));
md.showAsync().then(function() {
isAlertShowing = false;
- win && win();
+ win && win();
if (alertStack.length) {
setTimeout(alertStack.shift(), 0);
}
-
+
});
},
@@ -7271,7 +7359,7 @@ module.exports = {
if (alertStack.length) {
setTimeout(alertStack.shift(), 0);
}
-
+
});
},
@@ -7347,7 +7435,10 @@ var utils = exports;
*/
utils.defineGetterSetter = function(obj, key, getFunc, opt_setFunc) {
if (Object.defineProperty) {
- var desc = {get:getFunc};
+ var desc = {
+ get: getFunc,
+ configurable: true
+ };
if (opt_setFunc) {
desc.set = opt_setFunc;
}
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/671f1793/windows8/samples/Notification Test/Notification Test/cordova-2.4.0.js
----------------------------------------------------------------------
diff --git a/windows8/samples/Notification Test/Notification Test/cordova-2.4.0.js b/windows8/samples/Notification Test/Notification Test/cordova-2.4.0.js
index f299b74..fdb6245 100644
--- a/windows8/samples/Notification Test/Notification Test/cordova-2.4.0.js
+++ b/windows8/samples/Notification Test/Notification Test/cordova-2.4.0.js
@@ -1,6 +1,8 @@
-// commit 7d5552049e33254eca3bda227af8a4892a7ce7c3
+// Platform: windows8
-// File generated at :: Mon Jan 21 2013 17:12:31 GMT-0800 (Pacific Standard Time)
+// commit ac725f6ae0bd655789771e2a40b8d60cb4c8c221
+
+// File generated at :: Mon Feb 04 2013 11:20:37 GMT-0800 (Pacific Standard Time)
/*
Licensed to the Apache Software Foundation (ASF) under one
@@ -78,6 +80,7 @@ var require,
delete modules[id];
};
+ define.moduleMap = modules;
})();
//Export for use in node
@@ -409,6 +412,8 @@ function assignOrWrapInDeprecateGetter(obj, key, value, message) {
if (message) {
utils.defineGetter(obj, key, function() {
console.log(message);
+ delete obj[key];
+ clobber(obj, key, value);
return value;
});
} else {
@@ -438,10 +443,6 @@ function include(parent, objects, clobber, merge) {
// Overwrite if not currently defined.
if (typeof parent[key] == 'undefined') {
assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- } else if (merge && typeof obj.path !== 'undefined') {
- // If merging, merge parent onto result
- recursiveMerge(result, parent[key]);
- parent[key] = result;
} else {
// Set result to what already exists, so we can build children into it if they exist.
result = parent[key];
@@ -467,19 +468,18 @@ function include(parent, objects, clobber, merge) {
function recursiveMerge(target, src) {
for (var prop in src) {
if (src.hasOwnProperty(prop)) {
- if (typeof target.prototype !== 'undefined' && target.prototype.constructor === target) {
+ if (target.prototype && target.prototype.constructor === target) {
// If the target object is a constructor override off prototype.
- target.prototype[prop] = src[prop];
+ clobber(target.prototype, prop, src[prop]);
} else {
- if (typeof src[prop] === 'object') {
- target[prop] = recursiveMerge(target[prop], src[prop]);
+ if (typeof src[prop] === 'object' && typeof target[prop] === 'object') {
+ recursiveMerge(target[prop], src[prop]);
} else {
clobber(target, prop, src[prop]);
}
}
}
}
- return target;
}
module.exports = {
@@ -491,7 +491,9 @@ module.exports = {
},
buildIntoAndMerge: function(objects, target) {
include(target, objects, true, true);
- }
+ },
+ recursiveMerge: recursiveMerge,
+ assignOrWrapInDeprecateGetter: assignOrWrapInDeprecateGetter
};
});
@@ -904,54 +906,9 @@ module.exports = {
device: {
path: 'cordova/plugin/device'
},
- DirectoryEntry: {
- path: 'cordova/plugin/DirectoryEntry'
- },
- DirectoryReader: {
- path: 'cordova/plugin/DirectoryReader'
- },
- Entry: {
- path: 'cordova/plugin/Entry'
- },
- File: {
- path: 'cordova/plugin/File'
- },
- FileEntry: {
- path: 'cordova/plugin/FileEntry'
- },
- FileError: {
- path: 'cordova/plugin/FileError'
- },
- FileReader: {
- path: 'cordova/plugin/FileReader'
- },
- FileSystem: {
- path: 'cordova/plugin/FileSystem'
- },
- FileTransfer: {
- path: 'cordova/plugin/FileTransfer'
- },
- FileTransferError: {
- path: 'cordova/plugin/FileTransferError'
- },
- FileUploadOptions: {
- path: 'cordova/plugin/FileUploadOptions'
- },
- FileUploadResult: {
- path: 'cordova/plugin/FileUploadResult'
- },
- FileWriter: {
- path: 'cordova/plugin/FileWriter'
- },
- Flags: {
- path: 'cordova/plugin/Flags'
- },
GlobalizationError: {
path: 'cordova/plugin/GlobalizationError'
},
- LocalFileSystem: {
- path: 'cordova/plugin/LocalFileSystem'
- },
Media: {
path: 'cordova/plugin/Media'
},
@@ -964,9 +921,6 @@ module.exports = {
MediaFileData:{
path: 'cordova/plugin/MediaFileData'
},
- Metadata:{
- path: 'cordova/plugin/Metadata'
- },
Position: {
path: 'cordova/plugin/Position'
},
@@ -975,12 +929,6 @@ module.exports = {
},
ProgressEvent: {
path: 'cordova/plugin/ProgressEvent'
- },
- requestFileSystem:{
- path: 'cordova/plugin/requestFileSystem'
- },
- resolveLocalFileSystemURI:{
- path: 'cordova/plugin/resolveLocalFileSystemURI'
}
},
clobbers: {
@@ -1039,6 +987,107 @@ module.exports = function(success, fail, service, action, args) {
});
+// file: lib\common\modulemapper.js
+define("cordova/modulemapper", function(require, exports, module) {
+
+var builder = require('cordova/builder'),
+ moduleMap = define.moduleMap,
+ symbolList,
+ deprecationMap;
+
+exports.reset = function() {
+ symbolList = [];
+ deprecationMap = {};
+};
+
+function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) {
+ if (!(moduleName in moduleMap)) {
+ throw new Error('Module ' + moduleName + ' does not exist.');
+ }
+ symbolList.push(strategy, moduleName, symbolPath);
+ if (opt_deprecationMessage) {
+ deprecationMap[symbolPath] = opt_deprecationMessage;
+ }
+}
+
+// Note: Android 2.3 does have Function.bind().
+exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+function prepareNamespace(symbolPath, context) {
+ if (!symbolPath) {
+ return context;
+ }
+ var parts = symbolPath.split('.');
+ var cur = context;
+ for (var i = 0, part; part = parts[i]; ++i) {
+ cur[part] = cur[part] || {};
+ }
+ return cur[parts[i-1]];
+}
+
+exports.mapModules = function(context) {
+ var origSymbols = {};
+ context.CDV_origSymbols = origSymbols;
+ for (var i = 0, len = symbolList.length; i < len; i += 3) {
+ var strategy = symbolList[i];
+ var moduleName = symbolList[i + 1];
+ var symbolPath = symbolList[i + 2];
+ var lastDot = symbolPath.lastIndexOf('.');
+ var namespace = symbolPath.substr(0, lastDot);
+ var lastName = symbolPath.substr(lastDot + 1);
+
+ var module = require(moduleName);
+ var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
+ var parentObj = prepareNamespace(namespace, context);
+ var target = parentObj[lastName];
+
+ if (strategy == 'm' && target) {
+ builder.recursiveMerge(target, module);
+ } else if ((strategy == 'd' && !target) || (strategy != 'd')) {
+ if (target) {
+ origSymbols[symbolPath] = target;
+ }
+ builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
+ }
+ }
+};
+
+exports.getOriginalSymbol = function(context, symbolPath) {
+ var origSymbols = context.CDV_origSymbols;
+ if (origSymbols && (symbolPath in origSymbols)) {
+ return origSymbols[symbolPath];
+ }
+ var parts = symbolPath.split('.');
+ var obj = context;
+ for (var i = 0; i < parts.length; ++i) {
+ obj = obj && obj[parts[i]];
+ }
+ return obj;
+};
+
+exports.loadMatchingModules = function(matchingRegExp) {
+ for (var k in moduleMap) {
+ if (matchingRegExp.exec(k)) {
+ require(k);
+ }
+ }
+};
+
+exports.reset();
+
+
+});
+
// file: lib\windows8\platform.js
define("cordova/platform", function(require, exports, module) {
@@ -1068,9 +1117,13 @@ require('cordova/plugin/windows8/NotificationProxy');
module.exports = {
id: "windows8",
initialize:function() {
+ var modulemapper = require('cordova/modulemapper');
+
+ modulemapper.loadMatchingModules(/cordova.*\/symbols$/);
+ modulemapper.mapModules(window);
window.alert = window.alert || require("cordova/plugin/notification").alert;
- window.confirm = window.confirm || require("cordova/plugin/notification").confirm;
+ window.confirm = window.confirm || require("cordova/plugin/notification").confirm;
var onWinJSReady = function () {
var app = WinJS.Application;
@@ -1130,12 +1183,6 @@ module.exports = {
}
}
},
- FileReader: {
- path: 'cordova/plugin/FileReader'
- },
- File: {
- path: 'cordova/plugin/File'
- },
MediaError: {
path: 'cordova/plugin/MediaError'
}
@@ -1421,6 +1468,7 @@ module.exports = {
CELL_2G: "2g",
CELL_3G: "3g",
CELL_4G: "4g",
+ CELL:"cellular",
NONE: "none"
};
@@ -2302,11 +2350,12 @@ module.exports = FileError;
define("cordova/plugin/FileReader", function(require, exports, module) {
var exec = require('cordova/exec'),
+ modulemapper = require('cordova/modulemapper'),
utils = require('cordova/utils'),
File = require('cordova/plugin/File'),
FileError = require('cordova/plugin/FileError'),
ProgressEvent = require('cordova/plugin/ProgressEvent'),
- origFileReader = this.FileReader;
+ origFileReader = modulemapper.getOriginalSymbol(this, 'FileReader');
/**
* This class reads the mobile device file system.
@@ -4294,6 +4343,45 @@ module.exports = function(successCallback, errorCallback, message, forceAsync) {
});
+// file: lib\windows8\plugin\file\symbols.js
+define("cordova/plugin/file/symbols", function(require, exports, module) {
+
+
+var modulemapper = require('cordova/modulemapper'),
+ symbolshelper = require('cordova/plugin/file/symbolshelper');
+
+symbolshelper(modulemapper.defaults);
+modulemapper.clobbers('cordova/plugin/File', 'File');
+modulemapper.clobbers('cordova/plugin/FileReader', 'FileReader');
+
+});
+
+// file: lib\common\plugin\file\symbolshelper.js
+define("cordova/plugin/file/symbolshelper", function(require, exports, module) {
+
+module.exports = function(exportFunc) {
+ exportFunc('cordova/plugin/DirectoryEntry', 'DirectoryEntry');
+ exportFunc('cordova/plugin/DirectoryReader', 'DirectoryReader');
+ exportFunc('cordova/plugin/Entry', 'Entry');
+ exportFunc('cordova/plugin/File', 'File');
+ exportFunc('cordova/plugin/FileEntry', 'FileEntry');
+ exportFunc('cordova/plugin/FileError', 'FileError');
+ exportFunc('cordova/plugin/FileReader', 'FileReader');
+ exportFunc('cordova/plugin/FileSystem', 'FileSystem');
+ exportFunc('cordova/plugin/FileTransfer', 'FileTransfer');
+ exportFunc('cordova/plugin/FileTransferError', 'FileTransferError');
+ exportFunc('cordova/plugin/FileUploadOptions', 'FileUploadOptions');
+ exportFunc('cordova/plugin/FileUploadResult', 'FileUploadResult');
+ exportFunc('cordova/plugin/FileWriter', 'FileWriter');
+ exportFunc('cordova/plugin/Flags', 'Flags');
+ exportFunc('cordova/plugin/LocalFileSystem', 'LocalFileSystem');
+ exportFunc('cordova/plugin/Metadata', 'Metadata');
+ exportFunc('cordova/plugin/requestFileSystem', 'requestFileSystem');
+ exportFunc('cordova/plugin/resolveLocalFileSystemURI', 'resolveLocalFileSystemURI');
+};
+
+});
+
// file: lib\common\plugin\geolocation.js
define("cordova/plugin/geolocation", function(require, exports, module) {
@@ -7211,7 +7299,7 @@ var alertStack = [];
module.exports = {
alert:function(win, loseX, args) {
-
+
if (isAlertShowing) {
var later = function () {
module.exports.alert(win, loseX, args);
@@ -7220,7 +7308,7 @@ module.exports = {
return;
}
isAlertShowing = true;
-
+
var message = args[0];
var _title = args[1];
var _buttonLabel = args[2];
@@ -7229,12 +7317,12 @@ module.exports = {
md.commands.append(new Windows.UI.Popups.UICommand(_buttonLabel));
md.showAsync().then(function() {
isAlertShowing = false;
- win && win();
+ win && win();
if (alertStack.length) {
setTimeout(alertStack.shift(), 0);
}
-
+
});
},
@@ -7271,7 +7359,7 @@ module.exports = {
if (alertStack.length) {
setTimeout(alertStack.shift(), 0);
}
-
+
});
},
@@ -7347,7 +7435,10 @@ var utils = exports;
*/
utils.defineGetterSetter = function(obj, key, getFunc, opt_setFunc) {
if (Object.defineProperty) {
- var desc = {get:getFunc};
+ var desc = {
+ get: getFunc,
+ configurable: true
+ };
if (opt_setFunc) {
desc.set = opt_setFunc;
}
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/671f1793/windows8/template/www/cordova-2.4.0.js
----------------------------------------------------------------------
diff --git a/windows8/template/www/cordova-2.4.0.js b/windows8/template/www/cordova-2.4.0.js
index f299b74..fdb6245 100644
--- a/windows8/template/www/cordova-2.4.0.js
+++ b/windows8/template/www/cordova-2.4.0.js
@@ -1,6 +1,8 @@
-// commit 7d5552049e33254eca3bda227af8a4892a7ce7c3
+// Platform: windows8
-// File generated at :: Mon Jan 21 2013 17:12:31 GMT-0800 (Pacific Standard Time)
+// commit ac725f6ae0bd655789771e2a40b8d60cb4c8c221
+
+// File generated at :: Mon Feb 04 2013 11:20:37 GMT-0800 (Pacific Standard Time)
/*
Licensed to the Apache Software Foundation (ASF) under one
@@ -78,6 +80,7 @@ var require,
delete modules[id];
};
+ define.moduleMap = modules;
})();
//Export for use in node
@@ -409,6 +412,8 @@ function assignOrWrapInDeprecateGetter(obj, key, value, message) {
if (message) {
utils.defineGetter(obj, key, function() {
console.log(message);
+ delete obj[key];
+ clobber(obj, key, value);
return value;
});
} else {
@@ -438,10 +443,6 @@ function include(parent, objects, clobber, merge) {
// Overwrite if not currently defined.
if (typeof parent[key] == 'undefined') {
assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- } else if (merge && typeof obj.path !== 'undefined') {
- // If merging, merge parent onto result
- recursiveMerge(result, parent[key]);
- parent[key] = result;
} else {
// Set result to what already exists, so we can build children into it if they exist.
result = parent[key];
@@ -467,19 +468,18 @@ function include(parent, objects, clobber, merge) {
function recursiveMerge(target, src) {
for (var prop in src) {
if (src.hasOwnProperty(prop)) {
- if (typeof target.prototype !== 'undefined' && target.prototype.constructor === target) {
+ if (target.prototype && target.prototype.constructor === target) {
// If the target object is a constructor override off prototype.
- target.prototype[prop] = src[prop];
+ clobber(target.prototype, prop, src[prop]);
} else {
- if (typeof src[prop] === 'object') {
- target[prop] = recursiveMerge(target[prop], src[prop]);
+ if (typeof src[prop] === 'object' && typeof target[prop] === 'object') {
+ recursiveMerge(target[prop], src[prop]);
} else {
clobber(target, prop, src[prop]);
}
}
}
}
- return target;
}
module.exports = {
@@ -491,7 +491,9 @@ module.exports = {
},
buildIntoAndMerge: function(objects, target) {
include(target, objects, true, true);
- }
+ },
+ recursiveMerge: recursiveMerge,
+ assignOrWrapInDeprecateGetter: assignOrWrapInDeprecateGetter
};
});
@@ -904,54 +906,9 @@ module.exports = {
device: {
path: 'cordova/plugin/device'
},
- DirectoryEntry: {
- path: 'cordova/plugin/DirectoryEntry'
- },
- DirectoryReader: {
- path: 'cordova/plugin/DirectoryReader'
- },
- Entry: {
- path: 'cordova/plugin/Entry'
- },
- File: {
- path: 'cordova/plugin/File'
- },
- FileEntry: {
- path: 'cordova/plugin/FileEntry'
- },
- FileError: {
- path: 'cordova/plugin/FileError'
- },
- FileReader: {
- path: 'cordova/plugin/FileReader'
- },
- FileSystem: {
- path: 'cordova/plugin/FileSystem'
- },
- FileTransfer: {
- path: 'cordova/plugin/FileTransfer'
- },
- FileTransferError: {
- path: 'cordova/plugin/FileTransferError'
- },
- FileUploadOptions: {
- path: 'cordova/plugin/FileUploadOptions'
- },
- FileUploadResult: {
- path: 'cordova/plugin/FileUploadResult'
- },
- FileWriter: {
- path: 'cordova/plugin/FileWriter'
- },
- Flags: {
- path: 'cordova/plugin/Flags'
- },
GlobalizationError: {
path: 'cordova/plugin/GlobalizationError'
},
- LocalFileSystem: {
- path: 'cordova/plugin/LocalFileSystem'
- },
Media: {
path: 'cordova/plugin/Media'
},
@@ -964,9 +921,6 @@ module.exports = {
MediaFileData:{
path: 'cordova/plugin/MediaFileData'
},
- Metadata:{
- path: 'cordova/plugin/Metadata'
- },
Position: {
path: 'cordova/plugin/Position'
},
@@ -975,12 +929,6 @@ module.exports = {
},
ProgressEvent: {
path: 'cordova/plugin/ProgressEvent'
- },
- requestFileSystem:{
- path: 'cordova/plugin/requestFileSystem'
- },
- resolveLocalFileSystemURI:{
- path: 'cordova/plugin/resolveLocalFileSystemURI'
}
},
clobbers: {
@@ -1039,6 +987,107 @@ module.exports = function(success, fail, service, action, args) {
});
+// file: lib\common\modulemapper.js
+define("cordova/modulemapper", function(require, exports, module) {
+
+var builder = require('cordova/builder'),
+ moduleMap = define.moduleMap,
+ symbolList,
+ deprecationMap;
+
+exports.reset = function() {
+ symbolList = [];
+ deprecationMap = {};
+};
+
+function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) {
+ if (!(moduleName in moduleMap)) {
+ throw new Error('Module ' + moduleName + ' does not exist.');
+ }
+ symbolList.push(strategy, moduleName, symbolPath);
+ if (opt_deprecationMessage) {
+ deprecationMap[symbolPath] = opt_deprecationMessage;
+ }
+}
+
+// Note: Android 2.3 does have Function.bind().
+exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+function prepareNamespace(symbolPath, context) {
+ if (!symbolPath) {
+ return context;
+ }
+ var parts = symbolPath.split('.');
+ var cur = context;
+ for (var i = 0, part; part = parts[i]; ++i) {
+ cur[part] = cur[part] || {};
+ }
+ return cur[parts[i-1]];
+}
+
+exports.mapModules = function(context) {
+ var origSymbols = {};
+ context.CDV_origSymbols = origSymbols;
+ for (var i = 0, len = symbolList.length; i < len; i += 3) {
+ var strategy = symbolList[i];
+ var moduleName = symbolList[i + 1];
+ var symbolPath = symbolList[i + 2];
+ var lastDot = symbolPath.lastIndexOf('.');
+ var namespace = symbolPath.substr(0, lastDot);
+ var lastName = symbolPath.substr(lastDot + 1);
+
+ var module = require(moduleName);
+ var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
+ var parentObj = prepareNamespace(namespace, context);
+ var target = parentObj[lastName];
+
+ if (strategy == 'm' && target) {
+ builder.recursiveMerge(target, module);
+ } else if ((strategy == 'd' && !target) || (strategy != 'd')) {
+ if (target) {
+ origSymbols[symbolPath] = target;
+ }
+ builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
+ }
+ }
+};
+
+exports.getOriginalSymbol = function(context, symbolPath) {
+ var origSymbols = context.CDV_origSymbols;
+ if (origSymbols && (symbolPath in origSymbols)) {
+ return origSymbols[symbolPath];
+ }
+ var parts = symbolPath.split('.');
+ var obj = context;
+ for (var i = 0; i < parts.length; ++i) {
+ obj = obj && obj[parts[i]];
+ }
+ return obj;
+};
+
+exports.loadMatchingModules = function(matchingRegExp) {
+ for (var k in moduleMap) {
+ if (matchingRegExp.exec(k)) {
+ require(k);
+ }
+ }
+};
+
+exports.reset();
+
+
+});
+
// file: lib\windows8\platform.js
define("cordova/platform", function(require, exports, module) {
@@ -1068,9 +1117,13 @@ require('cordova/plugin/windows8/NotificationProxy');
module.exports = {
id: "windows8",
initialize:function() {
+ var modulemapper = require('cordova/modulemapper');
+
+ modulemapper.loadMatchingModules(/cordova.*\/symbols$/);
+ modulemapper.mapModules(window);
window.alert = window.alert || require("cordova/plugin/notification").alert;
- window.confirm = window.confirm || require("cordova/plugin/notification").confirm;
+ window.confirm = window.confirm || require("cordova/plugin/notification").confirm;
var onWinJSReady = function () {
var app = WinJS.Application;
@@ -1130,12 +1183,6 @@ module.exports = {
}
}
},
- FileReader: {
- path: 'cordova/plugin/FileReader'
- },
- File: {
- path: 'cordova/plugin/File'
- },
MediaError: {
path: 'cordova/plugin/MediaError'
}
@@ -1421,6 +1468,7 @@ module.exports = {
CELL_2G: "2g",
CELL_3G: "3g",
CELL_4G: "4g",
+ CELL:"cellular",
NONE: "none"
};
@@ -2302,11 +2350,12 @@ module.exports = FileError;
define("cordova/plugin/FileReader", function(require, exports, module) {
var exec = require('cordova/exec'),
+ modulemapper = require('cordova/modulemapper'),
utils = require('cordova/utils'),
File = require('cordova/plugin/File'),
FileError = require('cordova/plugin/FileError'),
ProgressEvent = require('cordova/plugin/ProgressEvent'),
- origFileReader = this.FileReader;
+ origFileReader = modulemapper.getOriginalSymbol(this, 'FileReader');
/**
* This class reads the mobile device file system.
@@ -4294,6 +4343,45 @@ module.exports = function(successCallback, errorCallback, message, forceAsync) {
});
+// file: lib\windows8\plugin\file\symbols.js
+define("cordova/plugin/file/symbols", function(require, exports, module) {
+
+
+var modulemapper = require('cordova/modulemapper'),
+ symbolshelper = require('cordova/plugin/file/symbolshelper');
+
+symbolshelper(modulemapper.defaults);
+modulemapper.clobbers('cordova/plugin/File', 'File');
+modulemapper.clobbers('cordova/plugin/FileReader', 'FileReader');
+
+});
+
+// file: lib\common\plugin\file\symbolshelper.js
+define("cordova/plugin/file/symbolshelper", function(require, exports, module) {
+
+module.exports = function(exportFunc) {
+ exportFunc('cordova/plugin/DirectoryEntry', 'DirectoryEntry');
+ exportFunc('cordova/plugin/DirectoryReader', 'DirectoryReader');
+ exportFunc('cordova/plugin/Entry', 'Entry');
+ exportFunc('cordova/plugin/File', 'File');
+ exportFunc('cordova/plugin/FileEntry', 'FileEntry');
+ exportFunc('cordova/plugin/FileError', 'FileError');
+ exportFunc('cordova/plugin/FileReader', 'FileReader');
+ exportFunc('cordova/plugin/FileSystem', 'FileSystem');
+ exportFunc('cordova/plugin/FileTransfer', 'FileTransfer');
+ exportFunc('cordova/plugin/FileTransferError', 'FileTransferError');
+ exportFunc('cordova/plugin/FileUploadOptions', 'FileUploadOptions');
+ exportFunc('cordova/plugin/FileUploadResult', 'FileUploadResult');
+ exportFunc('cordova/plugin/FileWriter', 'FileWriter');
+ exportFunc('cordova/plugin/Flags', 'Flags');
+ exportFunc('cordova/plugin/LocalFileSystem', 'LocalFileSystem');
+ exportFunc('cordova/plugin/Metadata', 'Metadata');
+ exportFunc('cordova/plugin/requestFileSystem', 'requestFileSystem');
+ exportFunc('cordova/plugin/resolveLocalFileSystemURI', 'resolveLocalFileSystemURI');
+};
+
+});
+
// file: lib\common\plugin\geolocation.js
define("cordova/plugin/geolocation", function(require, exports, module) {
@@ -7211,7 +7299,7 @@ var alertStack = [];
module.exports = {
alert:function(win, loseX, args) {
-
+
if (isAlertShowing) {
var later = function () {
module.exports.alert(win, loseX, args);
@@ -7220,7 +7308,7 @@ module.exports = {
return;
}
isAlertShowing = true;
-
+
var message = args[0];
var _title = args[1];
var _buttonLabel = args[2];
@@ -7229,12 +7317,12 @@ module.exports = {
md.commands.append(new Windows.UI.Popups.UICommand(_buttonLabel));
md.showAsync().then(function() {
isAlertShowing = false;
- win && win();
+ win && win();
if (alertStack.length) {
setTimeout(alertStack.shift(), 0);
}
-
+
});
},
@@ -7271,7 +7359,7 @@ module.exports = {
if (alertStack.length) {
setTimeout(alertStack.shift(), 0);
}
-
+
});
},
@@ -7347,7 +7435,10 @@ var utils = exports;
*/
utils.defineGetterSetter = function(obj, key, getFunc, opt_setFunc) {
if (Object.defineProperty) {
- var desc = {get:getFunc};
+ var desc = {
+ get: getFunc,
+ configurable: true
+ };
if (opt_setFunc) {
desc.set = opt_setFunc;
}
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/671f1793/windows8/test/cordova-2.4.0.js
----------------------------------------------------------------------
diff --git a/windows8/test/cordova-2.4.0.js b/windows8/test/cordova-2.4.0.js
index f299b74..fdb6245 100644
--- a/windows8/test/cordova-2.4.0.js
+++ b/windows8/test/cordova-2.4.0.js
@@ -1,6 +1,8 @@
-// commit 7d5552049e33254eca3bda227af8a4892a7ce7c3
+// Platform: windows8
-// File generated at :: Mon Jan 21 2013 17:12:31 GMT-0800 (Pacific Standard Time)
+// commit ac725f6ae0bd655789771e2a40b8d60cb4c8c221
+
+// File generated at :: Mon Feb 04 2013 11:20:37 GMT-0800 (Pacific Standard Time)
/*
Licensed to the Apache Software Foundation (ASF) under one
@@ -78,6 +80,7 @@ var require,
delete modules[id];
};
+ define.moduleMap = modules;
})();
//Export for use in node
@@ -409,6 +412,8 @@ function assignOrWrapInDeprecateGetter(obj, key, value, message) {
if (message) {
utils.defineGetter(obj, key, function() {
console.log(message);
+ delete obj[key];
+ clobber(obj, key, value);
return value;
});
} else {
@@ -438,10 +443,6 @@ function include(parent, objects, clobber, merge) {
// Overwrite if not currently defined.
if (typeof parent[key] == 'undefined') {
assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- } else if (merge && typeof obj.path !== 'undefined') {
- // If merging, merge parent onto result
- recursiveMerge(result, parent[key]);
- parent[key] = result;
} else {
// Set result to what already exists, so we can build children into it if they exist.
result = parent[key];
@@ -467,19 +468,18 @@ function include(parent, objects, clobber, merge) {
function recursiveMerge(target, src) {
for (var prop in src) {
if (src.hasOwnProperty(prop)) {
- if (typeof target.prototype !== 'undefined' && target.prototype.constructor === target) {
+ if (target.prototype && target.prototype.constructor === target) {
// If the target object is a constructor override off prototype.
- target.prototype[prop] = src[prop];
+ clobber(target.prototype, prop, src[prop]);
} else {
- if (typeof src[prop] === 'object') {
- target[prop] = recursiveMerge(target[prop], src[prop]);
+ if (typeof src[prop] === 'object' && typeof target[prop] === 'object') {
+ recursiveMerge(target[prop], src[prop]);
} else {
clobber(target, prop, src[prop]);
}
}
}
}
- return target;
}
module.exports = {
@@ -491,7 +491,9 @@ module.exports = {
},
buildIntoAndMerge: function(objects, target) {
include(target, objects, true, true);
- }
+ },
+ recursiveMerge: recursiveMerge,
+ assignOrWrapInDeprecateGetter: assignOrWrapInDeprecateGetter
};
});
@@ -904,54 +906,9 @@ module.exports = {
device: {
path: 'cordova/plugin/device'
},
- DirectoryEntry: {
- path: 'cordova/plugin/DirectoryEntry'
- },
- DirectoryReader: {
- path: 'cordova/plugin/DirectoryReader'
- },
- Entry: {
- path: 'cordova/plugin/Entry'
- },
- File: {
- path: 'cordova/plugin/File'
- },
- FileEntry: {
- path: 'cordova/plugin/FileEntry'
- },
- FileError: {
- path: 'cordova/plugin/FileError'
- },
- FileReader: {
- path: 'cordova/plugin/FileReader'
- },
- FileSystem: {
- path: 'cordova/plugin/FileSystem'
- },
- FileTransfer: {
- path: 'cordova/plugin/FileTransfer'
- },
- FileTransferError: {
- path: 'cordova/plugin/FileTransferError'
- },
- FileUploadOptions: {
- path: 'cordova/plugin/FileUploadOptions'
- },
- FileUploadResult: {
- path: 'cordova/plugin/FileUploadResult'
- },
- FileWriter: {
- path: 'cordova/plugin/FileWriter'
- },
- Flags: {
- path: 'cordova/plugin/Flags'
- },
GlobalizationError: {
path: 'cordova/plugin/GlobalizationError'
},
- LocalFileSystem: {
- path: 'cordova/plugin/LocalFileSystem'
- },
Media: {
path: 'cordova/plugin/Media'
},
@@ -964,9 +921,6 @@ module.exports = {
MediaFileData:{
path: 'cordova/plugin/MediaFileData'
},
- Metadata:{
- path: 'cordova/plugin/Metadata'
- },
Position: {
path: 'cordova/plugin/Position'
},
@@ -975,12 +929,6 @@ module.exports = {
},
ProgressEvent: {
path: 'cordova/plugin/ProgressEvent'
- },
- requestFileSystem:{
- path: 'cordova/plugin/requestFileSystem'
- },
- resolveLocalFileSystemURI:{
- path: 'cordova/plugin/resolveLocalFileSystemURI'
}
},
clobbers: {
@@ -1039,6 +987,107 @@ module.exports = function(success, fail, service, action, args) {
});
+// file: lib\common\modulemapper.js
+define("cordova/modulemapper", function(require, exports, module) {
+
+var builder = require('cordova/builder'),
+ moduleMap = define.moduleMap,
+ symbolList,
+ deprecationMap;
+
+exports.reset = function() {
+ symbolList = [];
+ deprecationMap = {};
+};
+
+function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) {
+ if (!(moduleName in moduleMap)) {
+ throw new Error('Module ' + moduleName + ' does not exist.');
+ }
+ symbolList.push(strategy, moduleName, symbolPath);
+ if (opt_deprecationMessage) {
+ deprecationMap[symbolPath] = opt_deprecationMessage;
+ }
+}
+
+// Note: Android 2.3 does have Function.bind().
+exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) {
+ addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
+};
+
+function prepareNamespace(symbolPath, context) {
+ if (!symbolPath) {
+ return context;
+ }
+ var parts = symbolPath.split('.');
+ var cur = context;
+ for (var i = 0, part; part = parts[i]; ++i) {
+ cur[part] = cur[part] || {};
+ }
+ return cur[parts[i-1]];
+}
+
+exports.mapModules = function(context) {
+ var origSymbols = {};
+ context.CDV_origSymbols = origSymbols;
+ for (var i = 0, len = symbolList.length; i < len; i += 3) {
+ var strategy = symbolList[i];
+ var moduleName = symbolList[i + 1];
+ var symbolPath = symbolList[i + 2];
+ var lastDot = symbolPath.lastIndexOf('.');
+ var namespace = symbolPath.substr(0, lastDot);
+ var lastName = symbolPath.substr(lastDot + 1);
+
+ var module = require(moduleName);
+ var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
+ var parentObj = prepareNamespace(namespace, context);
+ var target = parentObj[lastName];
+
+ if (strategy == 'm' && target) {
+ builder.recursiveMerge(target, module);
+ } else if ((strategy == 'd' && !target) || (strategy != 'd')) {
+ if (target) {
+ origSymbols[symbolPath] = target;
+ }
+ builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
+ }
+ }
+};
+
+exports.getOriginalSymbol = function(context, symbolPath) {
+ var origSymbols = context.CDV_origSymbols;
+ if (origSymbols && (symbolPath in origSymbols)) {
+ return origSymbols[symbolPath];
+ }
+ var parts = symbolPath.split('.');
+ var obj = context;
+ for (var i = 0; i < parts.length; ++i) {
+ obj = obj && obj[parts[i]];
+ }
+ return obj;
+};
+
+exports.loadMatchingModules = function(matchingRegExp) {
+ for (var k in moduleMap) {
+ if (matchingRegExp.exec(k)) {
+ require(k);
+ }
+ }
+};
+
+exports.reset();
+
+
+});
+
// file: lib\windows8\platform.js
define("cordova/platform", function(require, exports, module) {
@@ -1068,9 +1117,13 @@ require('cordova/plugin/windows8/NotificationProxy');
module.exports = {
id: "windows8",
initialize:function() {
+ var modulemapper = require('cordova/modulemapper');
+
+ modulemapper.loadMatchingModules(/cordova.*\/symbols$/);
+ modulemapper.mapModules(window);
window.alert = window.alert || require("cordova/plugin/notification").alert;
- window.confirm = window.confirm || require("cordova/plugin/notification").confirm;
+ window.confirm = window.confirm || require("cordova/plugin/notification").confirm;
var onWinJSReady = function () {
var app = WinJS.Application;
@@ -1130,12 +1183,6 @@ module.exports = {
}
}
},
- FileReader: {
- path: 'cordova/plugin/FileReader'
- },
- File: {
- path: 'cordova/plugin/File'
- },
MediaError: {
path: 'cordova/plugin/MediaError'
}
@@ -1421,6 +1468,7 @@ module.exports = {
CELL_2G: "2g",
CELL_3G: "3g",
CELL_4G: "4g",
+ CELL:"cellular",
NONE: "none"
};
@@ -2302,11 +2350,12 @@ module.exports = FileError;
define("cordova/plugin/FileReader", function(require, exports, module) {
var exec = require('cordova/exec'),
+ modulemapper = require('cordova/modulemapper'),
utils = require('cordova/utils'),
File = require('cordova/plugin/File'),
FileError = require('cordova/plugin/FileError'),
ProgressEvent = require('cordova/plugin/ProgressEvent'),
- origFileReader = this.FileReader;
+ origFileReader = modulemapper.getOriginalSymbol(this, 'FileReader');
/**
* This class reads the mobile device file system.
@@ -4294,6 +4343,45 @@ module.exports = function(successCallback, errorCallback, message, forceAsync) {
});
+// file: lib\windows8\plugin\file\symbols.js
+define("cordova/plugin/file/symbols", function(require, exports, module) {
+
+
+var modulemapper = require('cordova/modulemapper'),
+ symbolshelper = require('cordova/plugin/file/symbolshelper');
+
+symbolshelper(modulemapper.defaults);
+modulemapper.clobbers('cordova/plugin/File', 'File');
+modulemapper.clobbers('cordova/plugin/FileReader', 'FileReader');
+
+});
+
+// file: lib\common\plugin\file\symbolshelper.js
+define("cordova/plugin/file/symbolshelper", function(require, exports, module) {
+
+module.exports = function(exportFunc) {
+ exportFunc('cordova/plugin/DirectoryEntry', 'DirectoryEntry');
+ exportFunc('cordova/plugin/DirectoryReader', 'DirectoryReader');
+ exportFunc('cordova/plugin/Entry', 'Entry');
+ exportFunc('cordova/plugin/File', 'File');
+ exportFunc('cordova/plugin/FileEntry', 'FileEntry');
+ exportFunc('cordova/plugin/FileError', 'FileError');
+ exportFunc('cordova/plugin/FileReader', 'FileReader');
+ exportFunc('cordova/plugin/FileSystem', 'FileSystem');
+ exportFunc('cordova/plugin/FileTransfer', 'FileTransfer');
+ exportFunc('cordova/plugin/FileTransferError', 'FileTransferError');
+ exportFunc('cordova/plugin/FileUploadOptions', 'FileUploadOptions');
+ exportFunc('cordova/plugin/FileUploadResult', 'FileUploadResult');
+ exportFunc('cordova/plugin/FileWriter', 'FileWriter');
+ exportFunc('cordova/plugin/Flags', 'Flags');
+ exportFunc('cordova/plugin/LocalFileSystem', 'LocalFileSystem');
+ exportFunc('cordova/plugin/Metadata', 'Metadata');
+ exportFunc('cordova/plugin/requestFileSystem', 'requestFileSystem');
+ exportFunc('cordova/plugin/resolveLocalFileSystemURI', 'resolveLocalFileSystemURI');
+};
+
+});
+
// file: lib\common\plugin\geolocation.js
define("cordova/plugin/geolocation", function(require, exports, module) {
@@ -7211,7 +7299,7 @@ var alertStack = [];
module.exports = {
alert:function(win, loseX, args) {
-
+
if (isAlertShowing) {
var later = function () {
module.exports.alert(win, loseX, args);
@@ -7220,7 +7308,7 @@ module.exports = {
return;
}
isAlertShowing = true;
-
+
var message = args[0];
var _title = args[1];
var _buttonLabel = args[2];
@@ -7229,12 +7317,12 @@ module.exports = {
md.commands.append(new Windows.UI.Popups.UICommand(_buttonLabel));
md.showAsync().then(function() {
isAlertShowing = false;
- win && win();
+ win && win();
if (alertStack.length) {
setTimeout(alertStack.shift(), 0);
}
-
+
});
},
@@ -7271,7 +7359,7 @@ module.exports = {
if (alertStack.length) {
setTimeout(alertStack.shift(), 0);
}
-
+
});
},
@@ -7347,7 +7435,10 @@ var utils = exports;
*/
utils.defineGetterSetter = function(obj, key, getFunc, opt_setFunc) {
if (Object.defineProperty) {
- var desc = {get:getFunc};
+ var desc = {
+ get: getFunc,
+ configurable: true
+ };
if (opt_setFunc) {
desc.set = opt_setFunc;
}