Thành viên:Mxn/main page.js

$(function () {if (mw.config.get("wgPageName").indexOf("Thành_viên:Mxn/Trang_Chính_4") != 0) {    return;}// Tải bảng kiểu.//importStylesheet("Thành viên:Mxn/main page.css");// Làm cho trang giống như Trang Chính thật.if (mw.config.get("wgPageName") == "Thành_viên:Mxn/Trang_Chính_4") {    $("#ca-nstab-user a").text("Trang Chính");    $("body").addClass("ns-0").removeClass("ns-2");    if (mw.config.get("wgAction") == "view") {        $("#firstHeading, #siteSub, #contentSub, #mp-instructions").hide();    }}// Ẩn nền của một số phần tử để hiển thị gradien trong Internet Explorer.var prof = $.client.profile();var isLegacyMsie = prof.name == "msie" && parseInt(prof.versionBase) <= 9;if (isLegacyMsie) {    $(".mp-box-bg-fade, .mp-box-header, .mp-ellipsis").css("background-color", "transparent");}// Hiện cửa sổ để miêu tả Hình ảnh chọn lọc.mw.loader.using("jquery.ui", function () {    $("#mp-tfp-click-cover a, #mp-tfp .mp-box-bg a").removeAttr("title").click(function (evt) {        evt.preventDefault();                var imgLink = $("#mp-tfp-img-placeholder a");        if (!$("#mp-tfp-img-placeholder a").html().length) {            var url = $("#mp-tfp-img-placeholder").data("src");            var imgAttrs = {                src: url,            };            // //upload.wikimedia.org/wikipedia/commons/3/34/AlsterPanorama.jpg            // //upload.wikimedia.org/wikipedia/commons/thumb/3/34/AlsterPanorama.jpg/500px-AlsterPanorama.jpg            // //upload.wikimedia.org/wikipedia/vi/b/bc/Wiki.png            // //upload.wikimedia.org/wikipedia/vi/thumb/b/bc/Wiki.png/87px-Wiki.png            var width = url.match(/\/\/upload.wikimedia.org\/wikipedia\/\w+\/thumb\/[0-9a-z]\/[0-9a-z]{2}\/([^/]+)\/(\d+)px-\1/i);            if (width && width[2]) imgAttrs["width"] = width[2];                        imgLink.html(mw.html.element("img", imgAttrs));        }        $("#mp-tfp-dialog").dialog({            closeText: "Đóng",            modal: true,            width: 600,        });    });});mw.loader.using("jquery.tipsy", function () {    // Hiện mẹo vặt khi đưa con trỏ lên các dự án liên quan.    $("#mp-sister a").tipsy({        title: function () {            return "<div class='mp-sister-tip'>" +                $(this).siblings(".mp-sister-desc").text() +                " <cite>" + $(this).children("img").attr("alt") + "</cite>" +                "</div>";        },        html: true,        offset: isLegacyMsie ? 0 : -10,    });});// Bổ sung liên kết “thêm” ở cuối danh sách liên kết liên wiki.var interwikiPage = "Wikipedia:Phiên bản ngôn ngữ";$("#p-lang ul").append(mw.html.element("li", {    id: "interwiki-completelist",}));$("#interwiki-completelist").css("font-weight", "bold").append(mw.html.element("a", {    href: mw.util.getUrl(interwikiPage),    title: interwikiPage,}, "Danh sách đầy đủ"));});