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 2014/04/28 23:47:05 UTC

js commit: CB-6539 Future proof the WinJS include

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 <pu...@gmail.com>
Authored: Mon Apr 28 14:46:59 2014 -0700
Committer: Jesse MacFadyen <pu...@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);
         }