Content deleted Content added
use % to represent jQuery variables, escape template, more compatibility fixes |
more fixes |
||
Line 6:
(function ($) { // Wrap with anonymous function
function stubTagTab() {
var $h, $hb, $newa
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']; // A list of subpages of WikiProject Stub sorting/Stub types/ that are relevant to this
$h = $("<div></div>");
$h.css({
Line 40 ⟶ 39:
var $parseData = $(data.parse.text["*"]);
$parseData.find("a").each(function () {
var $link = $(this).attr("href"),
index = link.indexOf("Template:")
if (index === -1) {
Line 53 ⟶ 52:
} else {
$(this).attr("href", mw.config.get("wgServer") + mw.config.get("wgScript") + "?title=" + encodeURIComponent(mw.config.get("wgPageName"))
+ "&action=edit&autoaddstubtag=" + encodeURIComponent($link.slice(index + 9)));
}
});
|