cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject js commit: CB-6539 Future proof the WinJS include
Date Mon, 28 Apr 2014 21:47:05 GMT
Repository: cordova-js
Updated Branches:
  refs/heads/master 9c165de7c -> c893a4725


CB-6539 Future proof the WinJS include


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/c893a472
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/c893a472
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/c893a472

Branch: refs/heads/master
Commit: c893a47254111e26d8b11f28972793491d83c4cf
Parents: 9c165de
Author: Jesse MacFadyen <purplecabbage@gmail.com>
Authored: Mon Apr 28 14:46:59 2014 -0700
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
Committed: Mon Apr 28 14:46:59 2014 -0700

----------------------------------------------------------------------
 src/windows8/platform.js | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/c893a472/src/windows8/platform.js
----------------------------------------------------------------------
diff --git a/src/windows8/platform.js b/src/windows8/platform.js
index fc82161..d21e5c8 100755
--- a/src/windows8/platform.js
+++ b/src/windows8/platform.js
@@ -47,9 +47,16 @@ module.exports = {
         };
 
         if (!window.WinJS) {
-            // <script src="//Microsoft.WinJS.1.0/js/base.js"></script>
+            // <script src="//Microsoft.WinJS.1.0/js/base.js"></script> 
             var scriptElem = document.createElement("script");
-            scriptElem.src = "//Microsoft.WinJS.1.0/js/base.js";
+            if (navigator.appVersion.indexOf("MSAppHost/2.0;") > -1) { 
+                // windows 8.1 + IE 11
+                scriptElem.src = "//Microsoft.WinJS.2.0/js/base.js";
+            }
+            else {  
+                // windows 8.0 + IE 10
+                scriptElem.src = "//Microsoft.WinJS.1.0/js/base.js"; 
+            }
             scriptElem.addEventListener("load", onWinJSReady);
             document.head.appendChild(scriptElem);
         }


Mime
View raw message