MediaWiki:Common.js

// for security function esc(str) { if(str === "") { return ""; } else { return mw.html.escape(str); } }

// shorten footer copyright link text $("#footer-info-copyright").children("a").first.text("CC BY-SA 4.0");

// default icon var defaultIcon = "https://upload.wikimedia.org/wikipedia/commons/a/a1/105_mm_Gun_Full_Tracked_Combat_Tank_M60_Base_Borden_2.jpg"; var infoIcon = "https://upload.wikimedia.org/wikipedia/commons/3/33/Info_icon_002.svg";

// add page create date to the right of the shortdesc // uses Template:Createdate which transcludes to a #createdate element which has a data attribute var createDate = $("#createdate"); var createShow = createDate.length? ("Page created on " + createDate.data("date")):"Unknown page creation date"; $("#contentSub").after(' ' + esc(createShow) + " ");

// add heading icon var headingIcon = $("#headingicon"); var headingShow = headingIcon.length? headingIcon.data("icon"): (mw.config.get("wgNamespaceNumber") === 0? defaultIcon:infoIcon); $("#firstHeading").prepend('');

// allows limited use of fieldset html tag in wikitext // var field; $(".fieldset").each(function(index, object) {	field = $(object);	field.html( '' + ' ' + esc(field.data("legend")) + " " + esc(field.data("content")) + " "	);	}); // deletes heading, shortdesc (content sub), and page name in title in main page if(mw.config.get("wgPageName") === "Political_History_Wiki:Main_page") { $("#firstHeading").css("display", "none"); $("#contentSub").css("display", "none"); $("#createdatesub").css("display", "none"); document.title = "Political History Wiki"; }