📚 The CoCalc Library - books, templates and other resources
License: OTHER
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"sphinx-rtd-theme":[function(require,module,exports){1var jQuery = (typeof(window) != 'undefined') ? window.jQuery : require('jquery');23// Sphinx theme nav state4function ThemeNav () {56var nav = {7navBar: null,8win: null,9winScroll: false,10winResize: false,11linkScroll: false,12winPosition: 0,13winHeight: null,14docHeight: null,15isRunning: null16};1718nav.enable = function () {19var self = this;2021jQuery(function ($) {22self.init($);2324self.reset();25self.win.on('hashchange', self.reset);2627// Set scroll monitor28self.win.on('scroll', function () {29if (!self.linkScroll) {30self.winScroll = true;31}32});33setInterval(function () { if (self.winScroll) self.onScroll(); }, 25);3435// Set resize monitor36self.win.on('resize', function () {37self.winResize = true;38});39setInterval(function () { if (self.winResize) self.onResize(); }, 25);40self.onResize();41});42};4344nav.init = function ($) {45var doc = $(document),46self = this;4748this.navBar = $('div.wy-side-scroll:first');49this.win = $(window);5051// Set up javascript UX bits52$(document)53// Shift nav in mobile when clicking the menu.54.on('click', "[data-toggle='wy-nav-top']", function() {55$("[data-toggle='wy-nav-shift']").toggleClass("shift");56$("[data-toggle='rst-versions']").toggleClass("shift");57})5859// Nav menu link click operations60.on('click', ".wy-menu-vertical .current ul li a", function() {61var target = $(this);62// Close menu when you click a link.63$("[data-toggle='wy-nav-shift']").removeClass("shift");64$("[data-toggle='rst-versions']").toggleClass("shift");65// Handle dynamic display of l3 and l4 nav lists66self.toggleCurrent(target);67self.hashChange();68})69.on('click', "[data-toggle='rst-current-version']", function() {70$("[data-toggle='rst-versions']").toggleClass("shift-up");71})7273// Make tables responsive74$("table.docutils:not(.field-list)")75.wrap("<div class='wy-table-responsive'></div>");7677// Add expand links to all parents of nested ul78$('.wy-menu-vertical ul').not('.simple').siblings('a').each(function () {79var link = $(this);80expand = $('<span class="toctree-expand"></span>');81expand.on('click', function (ev) {82self.toggleCurrent(link);83ev.stopPropagation();84return false;85});86link.prepend(expand);87});88};8990nav.reset = function () {91// Get anchor from URL and open up nested nav92var anchor = encodeURI(window.location.hash);93if (anchor) {94try {95var link = $('.wy-menu-vertical')96.find('[href="' + anchor + '"]');97$('.wy-menu-vertical li.toctree-l1 li.current')98.removeClass('current');99link.closest('li.toctree-l2').addClass('current');100link.closest('li.toctree-l3').addClass('current');101link.closest('li.toctree-l4').addClass('current');102}103catch (err) {104console.log("Error expanding nav for anchor", err);105}106}107};108109nav.onScroll = function () {110this.winScroll = false;111var newWinPosition = this.win.scrollTop(),112winBottom = newWinPosition + this.winHeight,113navPosition = this.navBar.scrollTop(),114newNavPosition = navPosition + (newWinPosition - this.winPosition);115if (newWinPosition < 0 || winBottom > this.docHeight) {116return;117}118this.navBar.scrollTop(newNavPosition);119this.winPosition = newWinPosition;120};121122nav.onResize = function () {123this.winResize = false;124this.winHeight = this.win.height();125this.docHeight = $(document).height();126};127128nav.hashChange = function () {129this.linkScroll = true;130this.win.one('hashchange', function () {131this.linkScroll = false;132});133};134135nav.toggleCurrent = function (elem) {136var parent_li = elem.closest('li');137parent_li.siblings('li.current').removeClass('current');138parent_li.siblings().find('li.current').removeClass('current');139parent_li.find('> ul li.current').removeClass('current');140parent_li.toggleClass('current');141}142143return nav;144};145146module.exports.ThemeNav = ThemeNav();147148if (typeof(window) != 'undefined') {149window.SphinxRtdTheme = { StickyNav: module.exports.ThemeNav };150}151152},{"jquery":"jquery"}]},{},["sphinx-rtd-theme"]);153154155