User:QwerpQwertus/userscript.js

var Config.portletArea = 'right-navigation'; var Config.portletId  = 'p-infoscript';//p-twinkle var Config.portletName = 'Info'; var Config.portletType = 'menu'; var Config.portletNext = 'p-search';

{if (skin=="vector") appendCSS( "div div.extraMenu h5 span { background-position: 90% 50%;} div.extraMenu h5 a { padding-left: 0.4em; padding-right: 0.4em; width:auto; } div.extraMenu h5 a span {display:inline-block; font-size:0.8em; height:2.5em; font-weight: normal; padding-top: 1.25em; margin-right:14px; }" ); else if (skin=="modern") appendCSS("#mw_contentwrapper div.portlet { overflow:hidden; height:1.5em; margin:0 0 0 14em; padding:0; } #mw_contentwrapper div.portlet h5 {display:none;} #mw_contentwrapper div.portlet div.pBody {margin:0; padding:0;} #mw_contentwrapper div.portlet div.pBody ul { display:inline; margin:0; } #mw_contentwrapper div.portlet div.pBody ul li { display:block; float:left; height:1.5em; margin:0 0.5em; padding:0 0.2em; text-transform:lowercase; } #mw_contentwrapper div.portlet div.pBody ul li a { text-decoration:underline;} #mw_contentwrapper div.portlet div.pBody ul li.selected a { text-decoration:none;}"); twAddPortlet.styleAdded = true; } function twAddPortletLink( href, text, id, tooltip, accesskey, nextnode ) {	if (TwinkleConfig.portletArea) twAddPortlet(TwinkleConfig.portletArea, TwinkleConfig.portletId, TwinkleConfig.portletName, TwinkleConfig.portletType, TwinkleConfig.portletNext); mw.util.addPortletLink( TwinkleConfig.portletId, href, text, id, tooltip, accesskey, nextnode ); } */ function twAddPortlet( navigation, id, text, type, nextnodeid ) {	//sanity checks, and get required DOM nodes var root = document.getElementById( navigation ); if ( !root ) return null; var item = document.getElementById( id ); if (item) {		if (item.parentNode && item.parentNode==root) return item; return null; }	var nextnode; if (nextnodeid) nextnode = document.getElementById(nextnodeid); //Add styles we might need. if (!twAddPortlet.styleAdded) { 	if (skin=="vector") appendCSS( "div div.extraMenu h5 span { background-position: 90% 50%;} div.extraMenu h5 a { padding-left: 0.4em; padding-right: 0.4em; width:auto; } div.extraMenu h5 a span {display:inline-block; font-size:0.8em; height:2.5em; font-weight: normal; padding-top: 1.25em; margin-right:14px; }" ); else if (skin=="modern") appendCSS("#mw_contentwrapper div.portlet { overflow:hidden; height:1.5em; margin:0 0 0 14em; padding:0; } #mw_contentwrapper div.portlet h5 {display:none;} #mw_contentwrapper div.portlet div.pBody {margin:0; padding:0;} #mw_contentwrapper div.portlet div.pBody ul { display:inline; margin:0; } #mw_contentwrapper div.portlet div.pBody ul li { display:block; float:left; height:1.5em; margin:0 0.5em; padding:0 0.2em; text-transform:lowercase; } #mw_contentwrapper div.portlet div.pBody ul li a { text-decoration:underline;} #mw_contentwrapper div.portlet div.pBody ul li.selected a { text-decoration:none;}"); twAddPortlet.styleAdded = true; }	//verify/normalize input type = skin=="vector" && type=="menu" && (navigation=="left-navigation" || navigation=="right-navigation")?"menu":""; var outerDivClass; var innerDivClass; switch (skin) {		case "vector": if (navigation!="portal" && navigation!="left-navigation" && navigation!="right-navigation") navigation="mw-panel"; outerDivClass = navigation=="mw-panel"?"portal":(type=="menu"?"vectorMenu extraMenu":"vectorTabs extraMenu"); innerDivClass = navigation=="mw-panel"?'body':(type=='menu'?'menu':''); break; case "modern": if (navigation!="mw_portlets" && navigation!="mw_contentwrapper") navigation="mw_portlets"; outerDivClass = "portlet"; innerDivClass = "pBody"; break; default: navigation="column-one"; outerDivClass = "portlet"; innerDivClass = "pBody"; break; }	//Build the DOM elements. var outerDiv = document.createElement( 'div' ); outerDiv.className = outerDivClass+" emptyPortlet"; outerDiv.id = id; var nextnode; if ( nextnode && nextnode.parentNode==root ) root.insertBefore( outerDiv, nextnode ); else root.appendChild( outerDiv ); var h5 = document.createElement( 'h5' ); if (type=='menu') {		var span = document.createElement( 'span' ); span.appendChild( document.createTextNode( text ) ); h5.appendChild( span ); var a = document.createElement( 'a' ); a.href = "#"; var span = document.createElement( 'span' ); span.appendChild( document.createTextNode( text ) ); a.appendChild( span ); h5.appendChild( a ); }	else h5.appendChild( document.createTextNode( text ) ); outerDiv.appendChild( h5 ); var innerDiv = document.createElement( 'div' ); //not strictly necessary with type vectorTabs, or other skins. innerDiv.className = innerDivClass; outerDiv.appendChild(innerDiv); var ul = document.createElement( 'ul' ); innerDiv.appendChild( ul ); return outerDiv; } //Build a portlet menu if it doesn't exist yet, and add the portlet link. function twAddPortletLink( href, text, id, tooltip, accesskey, nextnode ) {	if (TwinkleConfig.portletArea) twAddPortlet(TwinkleConfig.portletArea, TwinkleConfig.portletId, TwinkleConfig.portletName, TwinkleConfig.portletType, TwinkleConfig.portletNext); mw.util.addPortletLink( TwinkleConfig.portletId, href, text, id, tooltip, accesskey, nextnode ); }