Widget:TalkToc:修订间差异

H萌娘,万物皆可H的百科全书!
跳到导航 跳到搜索
imported>=海豚=
无编辑摘要
imported>=海豚=
无编辑摘要
第2行: 第2行:
window.RLQ = window.RLQ || [];
window.RLQ = window.RLQ || [];
window.RLQ.push(function() {
window.RLQ.push(function() {
    if (location.hostname.includes("mzh.moegirl.org")) return;
    if (location.hostname.includes("m.hmoegirl.com")) return;
    mw.loader.using(["oojs-ui"]).then(function() {
    mw.loader.using(["oojs-ui"]).then(function() {
      if (!mw.config.get('talkTocLoaded', false)) {
      if (!mw.config.get('talkTocLoaded', false)) {
第97行: 第97行:


          /* 业务处理*/
          /* 业务处理*/
         //添加存档讨论串标题toggle按钮
 
         if ($svdDcs[0]) {
           $toggle.append($('<' + 'a/>', {
             text: '显示已被存档标题',
             'class': 'toggleButton',
             href: 'javascript:void(0);',
             on: {
               click: function() {
                 if ($svdDcs.hasClass('hiddenDiscussion')) {
                   $svdDcs.removeClass('hiddenDiscussion');
                   $(this).text('隐藏已被存档标题');
                 } else {
                   $svdDcs.addClass('hiddenDiscussion');
                   $(this).text('显示已被存档标题');
                 }
               }
             }
           }));
           $tocText.append("<" + "div class='tocText'>(有下划线标题是已被存档标题)<" + "/div>");
         }
          //添加二三四五级标题toggle按钮和标题数量
          //添加二三四五级标题toggle按钮和标题数量
          appendToggleButton($level2, $toggle, '显示段落', '隐藏段落', function() {
          appendToggleButton($level2, $toggle, '显示段落', '隐藏段落', function() {
第147行: 第128行:
                if (!href) return;
                if (!href) return;
                var link = new mw.Uri(href);
                var link = new mw.Uri(href);
                if (link.host !== 'zh.moegirl.org') this.userNameErrorReason = "link.host !== 'zh.moegirl.org'";
                if (link.host !== 'www.hmoegirl.com') this.userNameErrorReason = "link.host !== 'www.hmoegirl.com'";
                else if (/^\/api\.php/i.test(link.path)) this.userNameErrorReason = "!!/^\\/api\\.php/i.test(link.path)";
                else if (/^\/api\.php/i.test(link.path)) this.userNameErrorReason = "!!/^\\/api\\.php/i.test(link.path)";
                else if (!link.query.title && /\.php$/i.test(link.path)) this.userNameErrorReason = "!!(!link.query.title && /\\.php$/i.test(link.path))";
                else if (!link.query.title && /\.php$/i.test(link.path)) this.userNameErrorReason = "!!(!link.query.title && /\\.php$/i.test(link.path))";

2020年3月25日 (三) 11:16的版本