“MediaWiki:Common.js”的版本间的差异
跳到导航
跳到搜索
(没有差异)
|
2019年8月13日 (二) 00:40的最新版本
/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */
/* Any JavaScript here will be loaded for all users on every page load. */
/* Full width of content when no TOC */
/*
$(function () {
var hasTOC = $('#toc').length;
if (!hasTOC) {
$('#mw-content-text').css('padding-right', '0');
}
}());
*/
/*
//collaps default the TOC on opening an pages
function hideToc() {
var toc = document.getElementById('toc').getElementsByTagName('ul')[0];
var toggleLink = document.getElementById('togglelink');
toc.style.display = 'none';
}
hideToc();
*/
/*
// The enclosed code runs only after the page has been loaded and parsed.
window.addEventListener('DOMContentLoaded', function() {
try {
// Detect whether the page's TOC is being displayed.
if (document.getElementById('toc').getElementsByTagName('ul')[0].style.display != 'none') {
// Use MW's toggleToc() to hide TOC, change "hide/show" link text, and set cookie.
toggleToc();
}
} catch (exception) {
// Probably this page doesn't have a TOC, ignore the exception to prevent console clutter.
}
}, false);
*/
window.addEventListener('DOMContentLoaded', function() { try {
if (document.getElementById('toc').getElementsByTagName('ul')[0].style.display != 'none') { toggleToc(); }
} catch (exception) {} }, false);