User:JediRogue/monobook.js

// ***** ADDITIONAL LINKS *****

function addBar { document.getElementById('p-navigation').innerHTML += ' '+ ' '+  ' Admin links '+ ' '+ 'Deletion Candidates'+ 'Banning Candidates'+ 'Logs'+ 'Problem Reports</li>'+ '</ul> '; } //Close addBar addOnloadHook(addBar); //Call addBar on load

//WIKISWAP

function importScript(page, lang) { var url = wgScriptPath + '/index.php?title=' + encodeURIComponent(page.replace(' ','_')) + '&action=raw&ctype=text/javascript&dontcountme=s'; if (lang) url = 'http://' + lang + '.wikipedia.org' + url; var s = document.createElement('script'); s.src = url; s.type='text/javascript'; document.getElementsByTagName('head')[0].appendChild(s); }

//WikiSwap importScript('User:AT/wikiswap.js');

//FULL/CONCISE SWAP. /*

function toggleConcise{ var atts = document.getElementById('full-desc').attributes; var styleHandle; for(var i=atts.length-1; i>=0; i--) { if(atts[i].name = "style") styleHandle=atts[i]; } if(styleHandle.value.contains('visibility:hidden')) styleHandle.value.replace('visibility:hidden', 'visibility:visible'); else styleHandle.value.replace('visibility:visible', 'visibility:hidden');

//bad repeated code. var atts2 = document.getElementById('concise-desc').attributes; var styleHandle2; for(var i=atts.length-1; i>=0; i--) { if(atts2[i].name = "style") styleHandle2=atts[i]; } if(styleHandle2.value.contains('visibility:hidden')) styleHandle2.value.replace('visibility:hidden', 'visibility:visible'); else styleHandle2.value.replace('visibility:visible', 'visibility:hidden'); } addOnloadHook(toggleConcise);

//create buttons function createToggleButton{ var Button    = document.createElement( "span" ); var ButtonLink = document.createElement( "a" ); var ButtonText = document.createTextNode( "toggle concise" );

Button.style.styleFloat = "left"; Button.style.cssFloat = "right"; Button.style.fontWeight = "normal"; Button.style.textAlign = "right"; Button.style.width = "6em";

ButtonLink.setAttribute( "id", "toggleConciseButton" + tableIndex ); ButtonLink.setAttribute( "href", "javascript:toggleConcise" ); ButtonLink.appendChild( ButtonText );

Button.appendChild( document.createTextNode( "[" ) ); Button.appendChild( ButtonLink ); Button.appendChild( document.createTextNode( "]" ) ); var space = document.getElementById('toggle-button'); space.insertBefore( Button, space.childNodes[0] );

} addOnloadHook( createToggleButton );