MediaWiki:Common.js:修订间差异

imported>AnnAngela
无编辑摘要
imported>=海豚=
修复注释内列表和列表侧边距
第128行: 第128行:
         });
         });
     }
     }
        //注释内列表
        $(".reference-text > ul,.reference-text > ol").each(function() {
            if (this.parentElement.childNodes[0] === this) { $(this).addClass("listInRef"); }
        });
        //列表侧边距
        setInterval(function() {
            $(".mw-parser-output ul, .mw-parser-output ol").not(".margin-left-set").each(function() {
                if (/none.+none/i.test($(this).css("list-style")) || $(this).is(".gallery")) {
                    if ($(this).parent().is("li") && $(this).parent().parent().is("ul,ol")) { $(this).css("margin-left", "1.2em"); } else { $(this).css("margin-left", "0.2em"); }
                } else if ($(this).is("ol")) {
                    var l = $(this).children("li").length;
                    if ($(this).attr("start")) { l += parseInt($(this).attr("start")); }
                    $(this).css("margin-left", (l + "").length * 0.5 + 1.2 + "em");
                } else { $(this).css("margin-left", "1.2em"); }
                $(this).addClass("margin-left-set");
            });
        }, 200);
     //R18警告
     //R18警告
     function r18Warning() {
     function r18Warning() {