/usr/share/doc/mapproxy/html/_static/bootstrap-sphinx.js is in mapproxy-doc 1.9.0-3+deb9u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | (function ($) {
/**
* Patch TOC list.
*
* Will mutate the underlying span to have a correct ul for nav.
*
* @param $span: Span containing nested UL"s to mutate.
* @param minLevel: Starting level for nested lists. (1: global, 2: local).
*/
var patchToc = function ($ul, minLevel) {
var findA,
patchTables,
$localLi;
// Find all a "internal" tags, traversing recursively.
findA = function ($elem, level) {
level = level || 0;
var $items = $elem.find("> li > a.internal, > ul, > li > ul");
// Iterate everything in order.
$items.each(function (index, item) {
var $item = $(item),
tag = item.tagName.toLowerCase(),
$childrenLi = $item.children("li"),
$parentLi = $($item.parent("li"), $item.parent().parent("li"));
// Add dropdowns if more children and above minimum level.
if (tag === "ul" && level >= minLevel && $childrenLi.length > 0) {
$parentLi
.addClass("dropdown-submenu")
.children("a").first().attr("tabindex", -1);
$item.addClass("dropdown-menu");
}
findA($item, level + 1);
});
};
findA($ul);
};
/**
* Patch all tables to remove ``docutils`` class and add Bootstrap base
* ``table`` class.
*/
patchTables = function () {
$("table.docutils")
.removeClass("docutils")
.addClass("table")
.attr("border", 0);
};
$(window).load(function () {
/*
* Scroll the window to avoid the topnav bar
* https://github.com/twbs/bootstrap/issues/1768
*/
if ($("#navbar.navbar-fixed-top").length > 0) {
var navHeight = $("#navbar").height(),
shiftWindow = function() { scrollBy(0, -navHeight - 10); };
if (location.hash) {
setTimeout(shiftWindow, 1);
}
window.addEventListener("hashchange", shiftWindow);
}
});
$(document).ready(function () {
// Add styling, structure to TOC"s.
$(".dropdown-menu").each(function () {
$(this).find("ul").each(function (index, item){
var $item = $(item);
$item.addClass("unstyled");
});
});
// Global TOC.
if ($("ul.globaltoc li").length) {
patchToc($("ul.globaltoc"), 1);
} else {
// Remove Global TOC.
$(".globaltoc-container").remove();
}
// Local TOC.
$(".bs-sidenav ul").addClass("nav nav-list");
$(".bs-sidenav > ul > li > a").addClass("nav-header");
// Local TOC.
patchToc($("ul.localtoc"), 2);
// Mutate sub-lists (for bs-2.3.0).
$(".dropdown-menu ul").not(".dropdown-menu").each(function () {
var $ul = $(this),
$parent = $ul.parent(),
tag = $parent[0].tagName.toLowerCase(),
$kids = $ul.children().detach();
// Replace list with items if submenu header.
if (tag === "ul") {
$ul.replaceWith($kids);
} else if (tag === "li") {
// Insert into previous list.
$parent.after($kids);
$ul.remove();
}
});
// Add divider in page TOC.
$localLi = $("ul.localtoc li");
if ($localLi.length > 2) {
$localLi.first().after("<li class=\"divider\"></li>");
}
// Patch tables.
patchTables();
// Add Note, Warning styles. (BS v2,3 compatible).
$(".admonition").addClass("alert alert-info")
.filter(".warning, .caution")
.removeClass("alert-info")
.addClass("alert-warning").end()
.filter(".error, .danger")
.removeClass("alert-info")
.addClass("alert-danger alert-error").end();
// Inline code styles to Bootstrap style.
$("tt.docutils.literal").not(".xref").each(function (i, e) {
// ignore references
if (!$(e).parent().hasClass("reference")) {
$(e).replaceWith(function () {
return $("<code />").html($(this).html());
});
}});
// Update sourcelink to remove outerdiv (fixes appearance in navbar).
var $srcLink = $(".nav #sourcelink");
$srcLink.parent().html($srcLink.html());
});
}(window.$jqTheme || window.jQuery));
|