You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/06/30 02:45:45 UTC

[GitHub] szha closed pull request #11404: [MXNET-595] Install page not loading properly in Internet Explorer

szha closed pull request #11404: [MXNET-595] Install page not loading properly in Internet Explorer
URL: https://github.com/apache/incubator-mxnet/pull/11404
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docs/_static/js/navbar.js b/docs/_static/js/navbar.js
index 2a27c50bbc0..0384194fa2d 100644
--- a/docs/_static/js/navbar.js
+++ b/docs/_static/js/navbar.js
@@ -4,8 +4,8 @@ var DOC_TITLE = ['/faq/', '/tutorials/', '/architecture/', '/model_zoo/'];
 var APISubmenu, versionSubmenu, docSubmenu, communitySubmenu;
 $("#burgerMenu").children().each(function () {
     if($(this).children().first().html() == 'API') APISubmenu = $(this).clone();
-    if($(this).children().first().html().startsWith('Versions')) versionSubmenu = $(this).clone();
-    if($(this).children().first().html().startsWith('Community')) communitySubmenu = $(this).clone();
+    if($(this).children().first().html().indexOf('Versions') == 0) versionSubmenu = $(this).clone();
+    if($(this).children().first().html().indexOf('Community') == 0) communitySubmenu = $(this).clone();
     if($(this).children().first().html() == 'Docs') docSubmenu= $(this).clone();
 });
 
diff --git a/docs/_static/js/options.js b/docs/_static/js/options.js
index a1e40fe6c30..eb82b113c63 100644
--- a/docs/_static/js/options.js
+++ b/docs/_static/js/options.js
@@ -8,9 +8,19 @@ $(document).ready(function () {
     function label(lbl) {
         return lbl.replace(/[ .]/g, '-').toLowerCase();
     }
+   
+    function urlSearchParams(searchString) {
+        let urlDict = new Map();
+        let searchParams = searchString.substring(1).split("&");
+        searchParams.forEach(function(element) {
+            kvPair = element.split("=");
+            urlDict.set(kvPair[0], kvPair[1]);
+        });
+        return urlDict;
+    }
 
     function setSelects(){
-        let urlParams = new URLSearchParams(window.location.search);
+        let urlParams = urlSearchParams(window.location.search);
         if (urlParams.get('version'))
             versionSelect = urlParams.get('version');
         $('li a:contains(' + versionSelect + ')').parent().siblings().removeClass('active');
@@ -33,8 +43,8 @@ $(document).ready(function () {
         $('button:contains(' + environSelect + ')').siblings().removeClass('active');
         $('button:contains(' + environSelect + ')').addClass('active');
         showContent();
-        if (window.location.href.includes("/install/index.html")) {
-            if (versionSelect.includes(defaultVersion)) {
+        if (window.location.href.indexOf("/install/index.html") >= 0) {
+            if (versionSelect.indexOf(defaultVersion) >= 0) {
                 history.pushState(null, null, '/install/index.html?platform=' + platformSelect + '&language=' + languageSelect + '&processor=' + processorSelect);
             } else {
                 history.pushState(null, null, '/install/index.html?version=' + versionSelect + '&platform=' + platformSelect + '&language=' + languageSelect + '&processor=' + processorSelect);
@@ -56,18 +66,18 @@ $(document).ready(function () {
     setSelects();
     function setContent() {
         var el = $(this);
-        let urlParams = new URLSearchParams(window.location.search);
+        let urlParams = urlSearchParams(window.location.search);
         el.siblings().removeClass('active');
         el.addClass('active');
         if ($(this).hasClass("versions")) {
             $('.current-version').html( $(this).text() + ' <span class="caret"></span></button>' );
-            if (!$(this).text().includes(defaultVersion)) {
-                if (!window.location.search.includes("version")) {
+            if ($(this).text().indexOf(defaultVersion) < 0) {
+                if (window.location.search.indexOf("version") < 0) {
                     history.pushState(null, null, '/install/index.html' + window.location.search.concat( '&version=' + $(this).text() ));
                 } else {
                     history.pushState(null, null, '/install/index.html' + window.location.search.replace( urlParams.get('version'), $(this).text() ));
                 }
-            } else if (window.location.search.includes("version")) {
+            } else if (window.location.search.indexOf("version") >= 0) {
                   history.pushState(null, null, '/install/index.html' + window.location.search.replace( 'version', 'prev' ));
               }
         }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services