diff --git a/docs/_includes/navigation.html b/docs/_includes/navigation.html index 5a1ebe313..247608183 100755 --- a/docs/_includes/navigation.html +++ b/docs/_includes/navigation.html @@ -17,7 +17,7 @@ -
+
+
+
+ +
+
+
+ +
+ +
diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index a9f309377..283e77782 100755 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -4,22 +4,22 @@ - + - + {% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %} {% if site.author %}{% endif %} - + - + - + - + @@ -27,25 +27,27 @@ - + + - + + - + {% if page.url == "/" %} {% endif %} - + {% include navigation.html %} -
+
{% include sidebar.html %} @@ -55,7 +57,7 @@
- + {% include footer.html %} @@ -68,7 +70,7 @@ {% endif %} - + {% include headers.html %} {% include tags.html %} {% include scrolltop.html %} diff --git a/docs/assets/css/header.css b/docs/assets/css/header.css new file mode 100644 index 000000000..af4c7eab6 --- /dev/null +++ b/docs/assets/css/header.css @@ -0,0 +1,29 @@ +.md-header-nav__button.md-logo * { + position: inherit; +} +.md-header-nav .dropdown { + margin: 1.6rem 0 0 -2rem; +} +.md-flex__cell--shrink .dropdown-item, .md-flex__cell--shrink .dropdown-item:hover { + color:#262626; +} +.dropdown-toggle { + opacity: 0.6; +} +.dropdown-note { + display: block; + width: 100%; + padding: .25rem 1.5rem; + clear: both; + font-weight: 400; + color: #999; + text-align: inherit; + white-space: nowrap; + background-color: transparent; + border: 0; +} +.md-nav__dropdown { + display: block; + padding: 1.2rem; + text-align: center; +} \ No newline at end of file diff --git a/docs/assets/js/index.js b/docs/assets/js/index.js index 609c9f300..7a35d42fd 100644 --- a/docs/assets/js/index.js +++ b/docs/assets/js/index.js @@ -4,7 +4,7 @@ excluded_in_search: true --- $(document).ready(function(){ $('.md-header').attr('data-md-state', 'none'); - + $(window).scroll(function() { if ($(window).scrollTop() > 20) { $('.md-header').attr('data-md-state', 'shadow'); @@ -12,4 +12,37 @@ $(document).ready(function(){ $('.md-header').attr('data-md-state', 'none'); } }); -}); \ No newline at end of file + + if (typeof(window.DOC_VERSIONS) == "undefined") { + window.DOC_VERSIONS = ["dev"]; + } + var url_parts = /(.*:\/\/[^/]+\/)(.+?)(\/.*)/.exec(window.location.href); + + $(".dropdown > a").text(url_parts[2]); + $.each(DOC_VERSIONS, function(index, value) { + if(value == url_parts[2]) { + // mobile + $("select#version-selector").append( + $('')); + return; + } + // desktop + $(".dropdown > div.dropdown-menu").append( + $('' + value + '')); + // mobile + $("select#version-selector").append( + $('')); + }); + + $(".dropdown > div.dropdown-menu > a").on("click", function() { + var target_version = $(this).text().trim(); + if (target_version == url_parts[2]) return; + window.location.href = url_parts[1] + target_version + url_parts[3]; + }); + + $("select#version-selector").change(function() { + var target_version = $("select#version-selector option:selected").text(); + if (target_version == url_parts[2]) return; + window.location.href = url_parts[1] + target_version + url_parts[3]; + }); +}); diff --git a/docs/jekyll-build b/docs/jekyll-build index 543fdd498..acdf4a036 100755 --- a/docs/jekyll-build +++ b/docs/jekyll-build @@ -8,7 +8,7 @@ cd $DIR bundle exec jekyll build > $OUTPUT 2>&1 if [[ $? != 0 ]]; then - rm $OUTPUT + rm -fr $OUTPUT gem install bundler bundle install else