Content deleted Content added
fix stubtagmenu |
reformat code |
||
Line 4:
// Edited version [[User:MC10/stubtagtab.js]]
function
var h, hb, newa;
// A list of subpages of WikiProject Stub sorting/Stub types/ that are relevant to this
var a = ['Commerce', 'Culture', 'Education', 'Geography', 'Government, law, and politics', 'History', 'Leisure', 'Military and weaponry', 'Miscellaneous', 'Organizations', 'People', 'Religion, mythology, faiths, and beliefs', 'Science', 'Sports', 'Technology', 'Transport'];
h = $("<div>");
h.
"background-color": "#fff8f8 });
for (var i = 0; i < a.length; i++) {
Line 16 ⟶ 17:
newa.click(function (e) {
e.preventDefault();
});
newa.text(a[i]);
h.append(newa);
if ((i + 1) < a.length)
h.append(" • "); }
hb = $("<div>");
hb.
"background-color": "#fffff8 });
h.after(hb);
Line 30 ⟶ 33:
}
function
var parseData = $(data.parse.text["*"]);
parseData.find("a").each(function () {
Line 45 ⟶ 48:
}
function
// Fetch the relevant subpage of the WikiProject
$.ajax({
url: mw.config.get("wgServer") + mw.config.get("wgScriptPath") + '/api.php?action=parse&prop=text&text=' + encodeURIComponent('__NOTOC____NOEDITSECTION__{{Wikipedia:WikiProject Stub sorting/Stub types/' +
dataType: "json", // "text"
success:
});
}
$(function () {
if (mw.config.get("wgNamespaceNumber") === 0 && mw.config.get("wgAction") === "view" && document.getElementById("ca-edit")) {
$(portletLink).click(function (e) {
e.preventDefault();
stubTagTab()
});
}
if (___location.href.indexOf("&autoaddstubtag=") !== -1 && document.getElementById('wpTextbox1') != null) {
|