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 === 'xlink') { elem.setAttribute('xlink:href', 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"))+"_"; pagename = mw.html.escape(mw.config.get("wgTitle")); 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); var link = document.getElementsByClassName("talk-button")[0]; adom('use', {xlink: "#wds-icons-comment-small"}, adom('svg', {classn: "wds-icon wds-icon-small"}, link));