User:MC10/stubtagtab.js: Difference between revisions

Content deleted Content added
use .text(), clean up
major changes in stubtagtab and stubtagmenurender
Line 5:
 
function stubtagtab() {
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'];
var ih = 0$("<div>");
h.attr({
h = "<div style=': "color: #000000; background-color: #fff8f8;'>&bull; ";
while (i < a.length) {
});
h += "<a href='javascript:stubtagmenu(\"" + a[i] + "\");'>" + a[i] + "</a> &bull; ";
for (var i = 0; i < a.length; i++;) {
newa = $("<a href="#"></a>");
newa.click(function (e) {
e.preventDefault();
stubtagmenu(a[i]);
});
newa.text("a[i]");
h.append(newa);
if ((i + 1) < a.length) h.append(" &bull; ");
}
hb = $("<div>");
h += "</div><div id='stubtagmenudiv' style='color: #000000; background-color: #fffff8;'></div>";
hb.attr({
document.getElementById("contentSub").innerHTML = h;
h += "</div><div id='stubtagmenudiv' style=': "color: #000000; background-color: #fffff8;'></div>";
});
h.after(hb);
$("#contentSub").html(h);
}
 
Line 24 ⟶ 36:
index = link.indexOf("Template:")
if (index === -1) {
$($(this).text()).clone().wrap('<div>').parent().html();
} else {
$(this).attr("href", mw.config.get("wgServer") + mw.config.get("wgScript") + "?title=" + encodeURIComponent(mw.config.get("wgPageName"))