Widget:TalkToc:修订间差异

H萌娘,万物皆可H的百科全书!
跳到导航 跳到搜索
imported>=海豚=
(恢复=海豚=讨论)的编辑至Hice的最后版本)
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.hook('wikipage.content').add(function() {
   if (location.hostname.includes("mzh.moegirl.org")) return;
      if (!mw.config.get('talkTocLoaded')) {
    mw.loader.using(["oojs-ui"]).then(function() {
        mw.config.set('talkTocLoaded', window.setInterval(function() {
      if (!mw.config.get('talkTocLoaded', false)) {
          if (mw.config.get('talkTocStop')) return;
        mw.config.set('talkTocLoaded', true);
         if (!$('#talkTocBox')[0]) {
       if (!$('#talkTocBox')[0]) {
           console.debug('widgetTalkToc', 'initing');
          if (localStorage.getItem('widgetTalkToc') === 'disable') {
            var $toc = $('#toc'),
           $('body').addClass('widgetTalkTocDisable');
             $tocBox, $level2, $li, $svdDcs, $title, $toggle, $tocText,
           $('.toctitle').after('<' + 'div style="text-align: center;">[<' + 'a class="enableWidgetTalkToc">启用讨论页面整理工具<' + '/a>]<' + '/div>');
             appendToggleButton;
           $('.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的版本