MediaWiki:Gadget-FlowthreadTOC.js:修订间差异

H萌娘,万物皆可H的百科全书!
跳到导航 跳到搜索
imported>=海豚=
(创建页面,内容为“$(function() { if ($('#toc')[0] && mw.config.exists('wgFlowThreadConfig')) { //同时存在Flowthread评论栏和目录的页面的目录添加Flowthread评论…”)
 
imported>=海豚=
无编辑摘要
 
第1行: 第1行:
$(function() {
$(function() {
    if ($('#toc')[0] && mw.config.exists('wgFlowThreadConfig')) { //同时存在Flowthread评论栏和目录的页面 目录添加Flowthread评论栏链接
    if ($('#toc')[0] && mw.config.exists('wgFlowThreadConfig')) { //同时存在Flowthread评论栏和目录的页面 ,在 目录添加Flowthread评论栏链接
     $('.comment-container-top:not([disabled]), .comment-container').first().attr('id', 'FlowthreadContainer');
      $('#toc li.toclevel-1:last').after('<li class="toclevel-1"><a href="#flowthread"><span class="tocnumber">' + (parseInt($('#toc li.toclevel-1 span.tocnumber:last').text()) + 1) + '</span> <span class="toctext">评论栏</span></a></li>');
      $('#toc li.toclevel-1:last').after('<li class="toclevel-1"><a id="jump2FlowthreadContainer" href="#FlowthreadContainer"><span class="tocnumber">' + (parseInt($('#toc li.toclevel-1 span.tocnumber:last').text()) + 1) + '</span> <span class="toctext">评论栏</span></a></li>');
     $('#jump2FlowthreadContainer').on('click', function() {
       $('.comment-container-top:not([disabled]), .comment-container').first().attr('id', 'FlowthreadContainer');
     });
    }
    }
});
});

2021年5月14日 (五) 20:47的最新版本

$(function() {
    if ($('#toc')[0] && mw.config.exists('wgFlowThreadConfig')) { //同时存在Flowthread评论栏和目录的页面,在目录添加Flowthread评论栏链接
        $('#toc li.toclevel-1:last').after('<li class="toclevel-1"><a href="#flowthread"><span class="tocnumber">' + (parseInt($('#toc li.toclevel-1 span.tocnumber:last').text()) + 1) + '</span> <span class="toctext">评论栏</span></a></li>');
    }
});