Server IP : 85.214.239.14 / Your IP : 3.128.201.40 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/share/javascript/sphinxdoc/1.0/ |
Upload File : |
/* * sidebar.js * ~~~~~~~~~~ * * This script makes the Sphinx sidebar collapsible. * * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton * used to collapse and expand the sidebar. * * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden * and the width of the sidebar and the margin-left of the document * are decreased. When the sidebar is expanded the opposite happens. * This script saves a per-browser/per-session cookie used to * remember the position of the sidebar among the pages. * Once the browser is closed the cookie is deleted and the position * reset to the default (expanded). * * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ const initialiseSidebar = () => { // global elements used by the functions. const bodyWrapper = document.getElementsByClassName("bodywrapper")[0] const sidebar = document.getElementsByClassName("sphinxsidebar")[0] const sidebarWrapper = document.getElementsByClassName('sphinxsidebarwrapper')[0] const sidebarButton = document.getElementById("sidebarbutton") const sidebarArrow = sidebarButton.querySelector('span') // for some reason, the document has no sidebar; do not run into errors if (typeof sidebar === "undefined") return; const flipArrow = element => element.innerText = (element.innerText === "»") ? "«" : "»" const collapse_sidebar = () => { bodyWrapper.style.marginLeft = ".8em"; sidebar.style.width = ".8em" sidebarWrapper.style.display = "none" flipArrow(sidebarArrow) sidebarButton.title = _('Expand sidebar') window.localStorage.setItem("sidebar", "collapsed") } const expand_sidebar = () => { bodyWrapper.style.marginLeft = "" sidebar.style.removeProperty("width") sidebarWrapper.style.display = "" flipArrow(sidebarArrow) sidebarButton.title = _('Collapse sidebar') window.localStorage.setItem("sidebar", "expanded") } sidebarButton.addEventListener("click", () => { (sidebarWrapper.style.display === "none") ? expand_sidebar() : collapse_sidebar() }) if (!window.localStorage.getItem("sidebar")) return const value = window.localStorage.getItem("sidebar") if (value === "collapsed") collapse_sidebar(); else if (value === "expanded") expand_sidebar(); } if (document.readyState !== "loading") initialiseSidebar() else document.addEventListener("DOMContentLoaded", initialiseSidebar)