User:Bongolium500/common.js

window.CollapsiblePageToolsCollapsed = false; importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:CollapsiblePageTools.js',        'u:dev:MediaWiki:CollapseGlobalNavButton.js',        'u:dev:InputUsername/code.js'    ] });

function adom(el, atts) { var elem = document.createElement(el); for (attname in atts) { if (attname === 'textContent' || attname === 'textc') { var textnode = document.createTextNode(atts[attname]); elem.appendChild(textnode); }		else if (attname === 'className' || attname === 'classn') { elem.setAttribute('class', atts[attname]); }		else if (attname === 'datatrackinglabel') { elem.setAttribute('data-tracking-label', atts[attname]); }		else { elem.setAttribute(attname, atts[attname]); }	}	if (arguments[2] == null) { return elem; }	else { var nexttoappend = elem; for (var i=2; i < arguments.length; i++) { // > var argtemp = arguments[i]; if (typeof argtemp === 'string') { argtemp = document.getElementById(argtemp); }			argtemp.appendChild(nexttoappend); nexttoappend = argtemp; }

return nexttoappend; } }

var header = document.getElementsByClassName("page-header__actions")[0]; namespace = mw.html.escape(mw.config.get("wgCanonicalNamespace"))+"_"; namespaceNum = mw.config.get("wgNamespaceNumber"); pagename = mw.html.escape(mw.config.get("wgTitle"));

if (namespaceNum !== -1 && namespaceNum%2 === 0) { adom('a', {href: "http://tardis.fandom.com/wiki/"+namespace+"Talk:"+pagename, title: "Go to the talk page", classn: "wds-button wds-is-text page-header__action-button has-label talk-button", id: "ca-talk", textc: "Talk"}, header); }