incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deedu...@apache.org
Subject [2/2] spec commit: Load cordova-js only once.
Date Thu, 10 May 2012 20:45:56 GMT
Load cordova-js only once.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/commit/0335483d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/tree/0335483d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/diff/0335483d

Branch: refs/heads/master
Commit: 0335483d52158d56f77e810f763deb9998e97ff0
Parents: c3225a5
Author: Drew Walters <deedubbu@apache.org>
Authored: Wed May 9 15:12:12 2012 -0500
Committer: Drew Walters <deedubbu@apache.org>
Committed: Wed May 9 15:12:12 2012 -0500

----------------------------------------------------------------------
 cordova.js |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/blob/0335483d/cordova.js
----------------------------------------------------------------------
diff --git a/cordova.js b/cordova.js
index a8bfdcf..5a15cfc 100755
--- a/cordova.js
+++ b/cordova.js
@@ -1,9 +1,10 @@
-document.write('<script type="text/javascript" charset="utf-8" src="../../cordova-1.7.0.js"></script>');
-document.write('<script type="text/javascript" charset="utf-8" src="../cordova-1.7.0.js"></script>');
-document.write('<script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>');
+var VERSION='1.7.0';
+var scripts = document.getElementsByTagName('script');
+var cordovaPath = scripts[scripts.length - 1].src.replace('cordova.js', 'cordova-'+VERSION+'.js');
+
+document.write('<script type="text/javascript" charset="utf-8" src="' + cordovaPath +
'"></script>');
 
 function backHome() {
-	
 	if (window.device && device.platform && device.platform.toLowerCase() ==
'android') {
             navigator.app.backHistory();
 	}


Mime
View raw message