Widget:TalkToc:修订间差异

H萌娘,万物皆可H的百科全书!
跳到导航 跳到搜索
imported>=海豚=
([InPageEdit] 没有编辑摘要 (编辑自Special:Diff/43080))
imported>=海豚=
无编辑摘要
第136行: 第136行:
          var self = $('#talkTocBox table'),
          var self = $('#talkTocBox table'),
            a = $('<' + 'a/>').text('');
            a = $('<' + 'a/>').text('');
          self.append('<' + 'caption/>').find('caption').append(mw.config.get('wgTitle') + '现有讨论串').append('').append(a).append('' + 'br>').append('(这里的讨论串不会被存档,无用及已解决的即时讨论会被定期删除)')
          self.append('<' + 'caption/>').find('caption').append(mw.config.get('wgTitle') + '现有讨论串').append('').append(a).append('' + '<br>').append('(这里的讨论串不会被存档,无用及已解决的即时讨论会被定期删除)')
            .end().append('<' + 'tbody/>');
            .end().append('<' + 'tbody/>');
          containers.not('.savedDiscussion').each(function(i) {
          containers.not('.savedDiscussion').each(function(i) {
第219行: 第219行:
            that.append(("<" + "td>&#32;<" + "/td>").repeat(4 - that.find("td").length));
            that.append(("<" + "td>&#32;<" + "/td>").repeat(4 - that.find("td").length));
          });
          });
          $('#talkTocBox caption').append('<' + 'br>[').append($('<' + 'a/>').addClass('cbutton')).append(']');
          $('#talkTocBox caption').append('<' + 'br>[').append($('<' + 'a/>').addClass('cbutton')).append('');
          $('#tocText').append('<' + 'br>[').append($('<' + 'a/>').addClass('cbutton')).append(']');
          $('#tocText').append('<' + 'br>').append($('<' + 'a/>').addClass('cbutton')).append('');
          $('.cbutton').on('click', function() {
          $('.cbutton').on('click', function() {
            if (!localStorage.wgTocStyle || localStorage.wgTocStyle !== 'list') {
            if (!localStorage.wgTocStyle || localStorage.wgTocStyle !== 'list') {
第226行: 第226行:
              $('#tocBox').show();
              $('#tocBox').show();
              localStorage.setItem('wgTocStyle', 'list');
              localStorage.setItem('wgTocStyle', 'list');
              $('.cbutton').text(' 点击切换至表格格式');
              $('.cbutton').text('');
              $(toclist.filter(function(l) {
              $(toclist.filter(function(l) {
                return l !== "tocBox";
                return l !== "tocBox";
              }).map(function(l) {
              }).map(function(l) {
                return 'a[href="#' + l + '"]';
                return 'a[href="#' + l + '"';
              }).join(', ')).attr("href", "#tocBox");
              }).join(', ')).attr("href", "#tocBox");
            } else {
            } else {
第236行: 第236行:
              $('#tocBox').hide();
              $('#tocBox').hide();
              localStorage.setItem('wgTocStyle', 'table');
              localStorage.setItem('wgTocStyle', 'table');
              $('.cbutton').text(' 点击切换至列表格式');
              $('.cbutton').text('');
              $(toclist.filter(function(l) {
              $(toclist.filter(function(l) {
                return l !== "talkTocBox";
                return l !== "talkTocBox";
              }).map(function(l) {
              }).map(function(l) {
                return 'a[href="#' + l + '"]';
                return 'a[href="#' + l + '"';
              }).join(', ')).attr("href", "#talkTocBox");
              }).join(', ')).attr("href", "#talkTocBox");
            }
            }
第246行: 第246行:
          if (!localStorage.wgTocStyle || localStorage.wgTocStyle !== 'list') {
          if (!localStorage.wgTocStyle || localStorage.wgTocStyle !== 'list') {
            $('#talkTocBox').show();
            $('#talkTocBox').show();
            $('.cbutton').text(' 点击切换至列表格式');
            $('.cbutton').text('');
            $(toclist.filter(function(l) {
            $(toclist.filter(function(l) {
              return l !== "talkTocBox";
              return l !== "talkTocBox";
            }).map(function(l) {
            }).map(function(l) {
              return 'a[href="#' + l + '"]';
              return 'a[href="#' + l + '"';
            }).join(', ')).attr("href", "#talkTocBox");
            }).join(', ')).attr("href", "#talkTocBox");
          } else {
          } else {
            $('#tocBox').show();
            $('#tocBox').show();
            $('.cbutton').text(' 点击切换至表格格式');
            $('.cbutton').text('');
            $(toclist.filter(function(l) {
            $(toclist.filter(function(l) {
              return l !== "tocBox";
              return l !== "tocBox";
            }).map(function(l) {
            }).map(function(l) {
              return 'a[href="#' + l + '"]';
              return 'a[href="#' + l + '"';
            }).join(', ')).attr("href", "#tocBox");
            }).join(', ')).attr("href", "#tocBox");
          }
          }
          $('.cbutton').parent().append(' [<' + 'a class="disableWidgetTalkToc"> 禁用讨论页面整理工具<' + '/a>]');
          $('.cbutton').parent().append(' <' + 'a class="disableWidgetTalkToc"><' + '/a>');
          $('.disableWidgetTalkToc').on('click', function() {
          $('.disableWidgetTalkToc').on('click', function() {
            localStorage.setItem('widgetTalkToc', 'disable');
            localStorage.setItem('widgetTalkToc', 'disable');

2020年5月1日 (五) 20:08的版本