You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2014/06/03 23:46:54 UTC
[1/2] js commit: removed contacts hack,
added regex to handle geolocation
Repository: cordova-js
Updated Branches:
refs/heads/master 00ee00f39 -> 8434678b1
removed contacts hack, added regex to handle geolocation
Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/cc3c12fc
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/cc3c12fc
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/cc3c12fc
Branch: refs/heads/master
Commit: cc3c12fc331bb3d5d0c41e26915e6c4550fcb7da
Parents: 9cfeab7
Author: Steven Gill <st...@gmail.com>
Authored: Tue Jun 3 14:46:26 2014 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Tue Jun 3 14:46:26 2014 -0700
----------------------------------------------------------------------
tasks/lib/require-tr.js | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-js/blob/cc3c12fc/tasks/lib/require-tr.js
----------------------------------------------------------------------
diff --git a/tasks/lib/require-tr.js b/tasks/lib/require-tr.js
index 6b8c2e1..15e6265 100644
--- a/tasks/lib/require-tr.js
+++ b/tasks/lib/require-tr.js
@@ -48,9 +48,7 @@ var requireTr = {
data = data.replace(/modulemapper\.clobbers.*\n/,
util.format('navigator.app = require("%s/src/android/plugin/android/app")', root));
}
- if(file.match(/ios\/Contact.js$/)) {
- data = data.replace(/'\.\/ContactError'/, "'../ContactError'");
- }
+
this.queue(_updateRequires(data));
this.queue(null);
}
@@ -85,7 +83,7 @@ function _updateRequires(code) {
// check if function call is a require('module') call
if(node.expression.name === "require" && node.args.length === 1) {
var module = node.args[0].value;
- // make sure require only has one argument and that it starts with cordova (old style require.js)
+ // make sure require only has one argument and that it starts with cordova (old style require.js)
if(module !== undefined &&
module.indexOf("cordova") === 0) {
@@ -116,15 +114,21 @@ function _updateRequires(code) {
}
}
else if(module !== undefined && ( module.indexOf("org.apache.cordova") !== -1 ||
- module.indexOf("./") === 0 ) ) {
+ module.indexOf("./") === 0 || module.indexOf("../") === 0 ) ) {
var modules = requireTr.getModules();
- if(module.indexOf("./") === 0) {
- module = module.replace('/', '');
+
+ if(module.indexOf("../") === 0){
+ module = module.replace('../', '');
}
+ if(module.indexOf("./") === 0 ) {
+ module = module.replace('./', '');
+ }
+
for(var i = 0, j = modules.length ; i < j ; i++) {
- if(module === modules[i].symbol || modules[i].symbol.indexOf(module) != -1) {
- node.args[0].value = modules[i].path;
- break;
+ var regx = new RegExp ("\\."+ module + "$");
+ if(module === modules[i].symbol || modules[i].symbol.search(regx) != -1) {
+ node.args[0].value = modules[i].path;
+ break;
}
}
}
[2/2] js commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/cordova-js
Posted by st...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cordova-js
Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/8434678b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/8434678b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/8434678b
Branch: refs/heads/master
Commit: 8434678b17cd329f1639dd7a732d5f54a0a3c289
Parents: cc3c12f 00ee00f
Author: Steven Gill <st...@gmail.com>
Authored: Tue Jun 3 14:46:43 2014 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Tue Jun 3 14:46:43 2014 -0700
----------------------------------------------------------------------
CONTRIBUTING.md | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
----------------------------------------------------------------------