Widget:TalkToc:修订间差异
跳到导航
跳到搜索
imported>=海豚= |
imported>=海豚= 无编辑摘要 |
||
第1行: | 第1行: | ||
<noinclude> </noinclude><includeonly><!--{if !isset($wgTalkToc) || !$wgTalkToc}--><!--{assign var="wgTalkToc" value=true scope="global"}--><script> | <noinclude>Only for [[Talk:讨论版]] & [[Talk:提问求助区]]</noinclude><includeonly><!--{if !isset($wgTalkToc) || !$wgTalkToc}--><!--{assign var="wgTalkToc" value=true scope="global"}--><script> | ||
window.RLQ = window.RLQ || []; | window.RLQ = window.RLQ || []; | ||
window.RLQ.push(function() { | window.RLQ.push(function() { | ||
mw. | if (location.hostname.includes("mzh.moegirl.org")) return; | ||
if (!mw.config.get('talkTocLoaded')) { | mw.loader.using(["oojs-ui"]).then(function() { | ||
mw.config.set('talkTocLoaded', | if (!mw.config.get('talkTocLoaded', false)) { | ||
if ( | mw.config.set('talkTocLoaded', true); | ||
if (!$('#talkTocBox')[0]) { | |||
if (localStorage.getItem('widgetTalkToc') === 'disable') { | |||
var $toc = $('#toc'), | $('body').addClass('widgetTalkTocDisable'); | ||
$('.toctitle').after('<' + 'div style="text-align: center;">[<' + 'a class="enableWidgetTalkToc">启用讨论页面整理工具<' + '/a>]<' + '/div>'); | |||
$('.enableWidgetTalkToc').on('click', function() { | |||
localStorage.setItem('widgetTalkToc', 'enable'); | |||
$(this).text('启用成功!刷新页面中……'); | |||
setTimeout(location.reload.bind(location), 150); | |||
}); | |||
return; | |||
} | |||
$('body').addClass('widgetTalkTocEnable'); | |||
var toclist = ['tocBox', 'talkTocBox', 'toc'], | |||
bgcolor = $('body').css('background-color'), | |||
$toc = $('#toc'), | |||
titlereg = {}, | |||
$tocBox, $level2, $li, $svdDcs, $title, $toggle, $tocText, | |||
appendToggleButton; | |||
/* 预处理 */ | /* 预处理 */ |
2020年3月25日 (三) 12:06的版本
Only for Talk:讨论版 & Talk:提问求助区