You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by lx...@apache.org on 2017/08/14 21:21:55 UTC

[incubator-mxnet-site] branch asf-site updated: Fix TOC (#7)

This is an automated email from the ASF dual-hosted git repository.

lxn2 pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet-site.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new c6c9721  Fix TOC (#7)
c6c9721 is described below

commit c6c972124d0446ba84ec45faefe094d4c6aa380d
Author: Yao Wang <ke...@gmail.com>
AuthorDate: Mon Aug 14 14:21:53 2017 -0700

    Fix TOC (#7)
---
 _static/js/sidebar.js                 | 10 +++++++++-
 versions/master/_static/js/sidebar.js | 10 +++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/_static/js/sidebar.js b/_static/js/sidebar.js
index 1df628c..4260706 100644
--- a/_static/js/sidebar.js
+++ b/_static/js/sidebar.js
@@ -42,7 +42,15 @@ function render_lefttoc() {
         for(var i = 0; i < TITLE_WITH_LANG.length; ++i) {
             var path = TITLE_WITH_LANG[i];
             if (url.indexOf(path) != -1) {
-                var urlPath = 'http://' + window.location.host + path;
+                urlElem = url.split('/');
+                version = '';
+                for (var j = 0; j < urlElem.length; ++j) {
+                    if(urlElem[j] == 'versions') {
+                        version = '/versions/' + urlElem[j + 1];
+                        break;
+                    }
+                }
+                var urlPath = 'https://' + window.location.host + version +  path;
                 $.get(urlPath + indexTrailing, null, function(data) {
                     var currentText = $($.parseHTML(data)).find('.leftsidebar >  .sphinxsidebarwrapper > ul.current > li.current > a').html();
                     if (isAPI) {
diff --git a/versions/master/_static/js/sidebar.js b/versions/master/_static/js/sidebar.js
index 1df628c..4260706 100644
--- a/versions/master/_static/js/sidebar.js
+++ b/versions/master/_static/js/sidebar.js
@@ -42,7 +42,15 @@ function render_lefttoc() {
         for(var i = 0; i < TITLE_WITH_LANG.length; ++i) {
             var path = TITLE_WITH_LANG[i];
             if (url.indexOf(path) != -1) {
-                var urlPath = 'http://' + window.location.host + path;
+                urlElem = url.split('/');
+                version = '';
+                for (var j = 0; j < urlElem.length; ++j) {
+                    if(urlElem[j] == 'versions') {
+                        version = '/versions/' + urlElem[j + 1];
+                        break;
+                    }
+                }
+                var urlPath = 'https://' + window.location.host + version +  path;
                 $.get(urlPath + indexTrailing, null, function(data) {
                     var currentText = $($.parseHTML(data)).find('.leftsidebar >  .sphinxsidebarwrapper > ul.current > li.current > a').html();
                     if (isAPI) {

-- 
To stop receiving notification emails like this one, please contact
['"commits@mxnet.apache.org" <co...@mxnet.apache.org>'].