Thành viên:MGA73/NonFreeOldVersions.js
//<source lang=javascript>/*global $, mw *//** * This script is meant to make it easier to remove template when non-free old versions are removed. * * To use it add this to you vector.js (or other) ---> importScript('Thành viên:MGA73/NonFreeOldVersions.js'); * * URL: https://www.search.com.vn/wiki/vi/Th%C3%A0nh_vi%C3%AAn:MGA73/NonFreeOldVersions.js * * It is based on some old code from https://www.search.com.vn/wiki/en/User:MGA73/nowcommonsreview.js * And I did not bother to clean it all up. * NowCommonsReview tagger * URL: http://en.wikipedia.org/wiki/User:MGA73/nowcommonsreview.js * Credits: * MGA73, ZooFari, Krinkle and Magog the Ogre * * Based on http://commons.wikimedia.org/wiki/User:ZooFari/licensereviewer.js by Patstuart */(function (window, $){ window.nonfreeoldversionsreview = "0.20 (2010-06-23)"; $.when(mw.loader.using( ["mediawiki.util"] ), $.ready.promise).then(function () { if (mw.config.get("wgNamespaceNumber") === 6) { var actions = [ // RemoveTemplate passed { fn: function (){ var needAppend = document.editform.wpTextbox1.value; document.editform.wpTextbox1.value = needAppend.replace(/\n{{([Oo]rphaned non-free revisions|[Tt]ập tin có phiên bản cũ không tự do)}}/g, ""); document.editform.wpSummary.value = "Dời bản mẫu {{Tập tin có phiên bản cũ không tự do}} ([[Thành viên:MGA73/NonFreeOldVersions.js ]])."; document.editform.wpMinoredit.checked = true; document.editform.submit(); }, name: "RemoveTemplateOK", displayName: "Remove template" }, // DoNotReduce failed { fn: function (){ var needAppend = document.editform.wpTextbox1.value;//// var reason = window.prompt("Reason for failed NowCommons review:","");// /* on cancel button, actually cancel */// if (reason !== null) { document.editform.wpTextbox1.value = needAppend.replace(/\n{{([Oo]rphaned non-free revisions|[Tt]ập tin có phiên bản cũ không tự do)}}/g, "\n{{KTD-không giảm độ phân giải}}"); document.editform.wpSummary.value = "Template {{Orphaned non-free revisions}} replaced with {{Non-free no reduce}}."; document.editform.wpMinoredit.checked = true; document.editform.submit();// } }, name: "DoNotReduce", displayName: "Replace with a do not reduce" } ]; // [review] link inserter// var html;// if (mw.config.get("wgCategories").join("|").match(/Wikipedia files reviewed on Wikimedia Commons/)){// // This page is in a reviewed category. Dont display links.// html = "<small>Already reviewed</small>";//// } else { // This NowCommons page isn't reviewed yet. Show links. html = actions.map(function (action){ return "[" + $("<a></a>").attr("href", mw.config.get("wgScript") + "?title=" + encodeURIComponent(mw.config.get("wgPageName")) + "&action=edit&functionName=" + action.name).text(action.displayName)[0].outerHTML + "]"; }).join(" ");// } $("div.nonfreeoldversions-reviewme").css("text-align", "center").html(html); // Link/Button maker actions.forEach(function (action){ //functionNameString, buttonDisplayName, callback if (mw.util.getParamValue("functionName") == action.name){ action.fn(true); } else { var _href; var callback; if (["edit", "submit"].indexOf(mw.config.get("wgAction")) > -1){ _href = "javascript:void(0);"; callback = action.fn; } else { _href = mw.config.get("wgScript") + "?title=" + encodeURIComponent(mw.config.get("wgPageName")) + "&action=edit&functionName=" + action.name; } // Add buttons [["cactions", "ca"], ["tb", "tb"]].forEach(function (actionData) { var node = mw.util.addPortletLink("p-" + actionData[0], _href, action.displayName, "ca-" + actionData[1], "", null, 0); if (callback) { $(node).click(callback); } }); } }); } });}(window, $));//</source>
🔥 Top keywords: Đài Truyền hình Kỹ thuật số VTCTrang ChínhGiỗ Tổ Hùng VươngTrương Mỹ LanĐặc biệt:Tìm kiếmHùng VươngVương Đình HuệUEFA Champions LeagueKuwaitChiến dịch Điện Biên PhủFacebookĐài Truyền hình Việt NamTrần Cẩm TúĐội tuyển bóng đá quốc gia KuwaitGoogle DịchViệt NamCúp bóng đá U-23 châu ÁCúp bóng đá U-23 châu Á 2024Real Madrid CFBảng xếp hạng bóng đá nam FIFACleopatra VIITô LâmTim CookNguyễn Phú TrọngHồ Chí MinhHai Bà TrưngManchester City F.C.VnExpressChủ tịch nước Cộng hòa xã hội chủ nghĩa Việt NamNguyễn Ngọc ThắngĐền HùngCúp bóng đá trong nhà châu Á 2024Võ Văn ThưởngOne PieceLịch sử Việt NamCuộc đua xe đạp toàn quốc tranh Cúp truyền hình Thành phố Hồ Chí Minh 2024Phạm Minh ChínhTikTokĐinh Tiên Hoàng