diff --git a/quantecon_book_theme/__init__.py b/quantecon_book_theme/__init__.py index 29ca9d4..4be9ac5 100644 --- a/quantecon_book_theme/__init__.py +++ b/quantecon_book_theme/__init__.py @@ -10,7 +10,7 @@ from .launch import add_hub_urls -__version__ = "0.2.9" +__version__ = "0.3.0" """quantecon-book-theme version""" SPHINX_LOGGER = logging.getLogger(__name__) diff --git a/quantecon_book_theme/static/quantecon-book-theme.fa158abee848e210c6313605023688a6.js b/quantecon_book_theme/static/quantecon-book-theme.15b0c36fffe88f468997fa7b698991d3.js similarity index 96% rename from quantecon_book_theme/static/quantecon-book-theme.fa158abee848e210c6313605023688a6.js rename to quantecon_book_theme/static/quantecon-book-theme.15b0c36fffe88f468997fa7b698991d3.js index 4bf8dc3..0238135 100644 --- a/quantecon_book_theme/static/quantecon-book-theme.fa158abee848e210c6313605023688a6.js +++ b/quantecon_book_theme/static/quantecon-book-theme.15b0c36fffe88f468997fa7b698991d3.js @@ -1,7 +1,7 @@ document.addEventListener("DOMContentLoaded",function(){(function(){var method;var noop=function(){};var methods=['assert','clear','count','debug','dir','dirxml','error','exception','group','groupCollapsed','groupEnd','info','log','markTimeline','profile','profileEnd','table','time','timeEnd','timeline','timelineEnd','timeStamp','trace','warn'];var length=methods.length;var console=(window.console=window.console||{});while(length--){method=methods[length];if(!console[method]){console[method]=noop;}}}());feather.replace();var $window=$(window),$head=$('head'),$body=$('body'),$sidebar=$('.qe-sidebar'),$sidebarToggle=$('.btn__sidebar');function setContrast(){var setContrast=localStorage.setContrast;if(setContrast==1){$body.addClass('dark-theme');$('.btn__contrast').addClass('btn-active');}} setContrast();$('.btn__contrast').on('click',function(event){event.preventDefault();event.stopPropagation();if($(this).hasClass('btn-active')){$(this).removeClass('btn-active');localStorage.setContrast=0;$body.removeClass('dark-theme');}else{$(this).addClass('btn-active');localStorage.setContrast=1;$body.addClass('dark-theme');}});function setSidebar(){var setSidebar=localStorage.setSidebar;if((setSidebar==1)&&($sidebar.hasClass('persistent'))&&($(window).width()>1340)){openSidebar();}} -setSidebar();function openSidebar(){$sidebarToggle.addClass('btn-active');$sidebar.removeClass('inactive');$(".toolbar svg.feather.feather-menu").replaceWith(feather.icons.x.toSvg());localStorage.setSidebar=1;} -function closeSidebar(){$sidebarToggle.removeClass('btn-active');$sidebar.addClass('inactive');$(".toolbar svg.feather.feather-x").replaceWith(feather.icons.menu.toSvg());localStorage.setSidebar=0;} +setSidebar();function openSidebar(){$sidebarToggle.addClass('btn-active');$sidebar.removeClass('inactive');$(".qe-toolbar svg.feather.feather-menu").replaceWith(feather.icons.x.toSvg());localStorage.setSidebar=1;} +function closeSidebar(){$sidebarToggle.removeClass('btn-active');$sidebar.addClass('inactive');$(".qe-toolbar svg.feather.feather-x").replaceWith(feather.icons.menu.toSvg());localStorage.setSidebar=0;} $(document).on('click','.btn__sidebar',function(event){event.preventDefault();event.stopPropagation();if($sidebar.hasClass('inactive')){openSidebar();}else{closeSidebar();} if(window.innerWidth<=1340){$(document.body).on('click',function(e){if(!$(event.target).is('.sidebar *')){closeSidebar();$body.off('click');}});}});$('.btn__top').on('click',function(event){event.preventDefault();event.stopPropagation();$('html, body').animate({scrollTop:0},'slow');});$('.btn__fullscreen').on('click',function(){event.preventDefault();event.stopPropagation();$(this).toggleClass('btn-active');if(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement){if(document.exitFullscreen){document.exitFullscreen();}else if(document.msExitFullscreen){document.msExitFullscreen();}else if(document.mozCancelFullScreen){document.mozCancelFullScreen();}else if(document.webkitExitFullscreen){document.webkitExitFullscreen();}}else{if(document.documentElement.requestFullscreen){document.documentElement.requestFullscreen();}else if(document.documentElement.webkitRequestFullscreen){document.documentElement.webkitRequestFullscreen();}else if(document.documentElement.mozRequestFullScreen){document.documentElement.mozRequestFullScreen();}else if(document.documentElement.msRequestFullscreen){document.documentElement.msRequestFullscreen();}}});function setFontSize(){var toolbarFont=localStorage.toolbarFont;if(toolbarFont==1){$('html').addClass('font-plus');}else if(toolbarFont==-1){$('html').addClass('font-minus');}else{$('html').removeClass('font-plus');$('html').removeClass('font-minus');localStorage.toolbarFont=0;}} setFontSize();$('.btn__plus').on('click',function(event){event.preventDefault();event.stopPropagation();var toolbarFont=parseInt(localStorage.getItem('toolbarFont'))+1;if(toolbarFont>0){toolbarFont=1;} diff --git a/src/js/quantecon-book-theme.js b/src/js/quantecon-book-theme.js index 049f53c..44cc8e8 100644 --- a/src/js/quantecon-book-theme.js +++ b/src/js/quantecon-book-theme.js @@ -77,13 +77,13 @@ document.addEventListener("DOMContentLoaded", function(){ function openSidebar() { $sidebarToggle.addClass('btn-active'); $sidebar.removeClass('inactive'); - $(".toolbar svg.feather.feather-menu").replaceWith(feather.icons.x.toSvg()); + $(".qe-toolbar svg.feather.feather-menu").replaceWith(feather.icons.x.toSvg()); localStorage.setSidebar = 1; } function closeSidebar() { $sidebarToggle.removeClass('btn-active'); $sidebar.addClass('inactive'); - $(".toolbar svg.feather.feather-x").replaceWith(feather.icons.menu.toSvg()); + $(".qe-toolbar svg.feather.feather-x").replaceWith(feather.icons.menu.toSvg()); localStorage.setSidebar = 0; }