全站通知:

用户:123855714/BwikiBlackList.js

来自bilibili游戏中心 - WIKI
跳到导航 跳到搜索

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
  • Opera:Ctrl-F5
var BBL={
    ver:"v1.0.35",
    dataGlobal:{},
    dataPartial:{},
    init:function(){
        this.getList();
        this.check(this.dataGlobal,0);
        this.check(this.dataPartial,1);
        console.log("%c BwikiBlackList %c%s", "color: #fff; padding: 5px 0; background: #222;", "padding: 5px 6px 5px 5px; background: #aaa;", this.ver);
    },
    getList:function(){
        $.ajax({
            type:"get",
            url:mw.config.values.wgServer.concat("/wiki/","MediaWiki:BwikiBlackList.json","?action=raw"),
            async:false,
            success:function(e){
                BBL.dataGlobal = JSON.parse(e);
            },
            error:function(e){
                //no list
            }
        });
        $.ajax({
            type:"get",
            url:mw.config.values.wgServer.concat(mw.config.values.wgCookiePath,"MediaWiki:BwikiBlackList.json","?action=raw"),
            async:false,
            success:function(e){
                BBL.dataPartial = JSON.parse(e);
            },
            error:function(e){
                //no list
            }
        });
    },
    check:function(data, g){
        $("#biliContributors .detail-follow").each(function(){
            try{
                if(data[0].uid.indexOf($(this).attr("fid"))>-1){
                    $(this).parents(".rank-item-wrap").hide();
                    BBL.refresh();
                }else{
                    if(g==1){
                        if(data[wgArticleId].uid.indexOf($(this).attr("fid"))>-1){
                            $(this).parents(".rank-item-wrap").hide();
                            BBL.refresh();
                        }
                    }
                }
            }catch(e){}
        });
    },
    refresh:function(){
        var tmp_s = /^([^\d])(\d+)(.+)$/.exec($("#biliContributors .rank-num").html());
        tmp_s = tmp_s[1]+(Number(tmp_s[2])-1)+tmp_s[3];
        $("#biliContributors .rank-num").html(tmp_s);
    }
}
BBL.init();