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

//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 ButtonText = document.createTextNode( "toggle concise" ); var space = document.getElementById('toggle-button'); var button = createElement('a', [], {'id':'test', 'style':'color:red;', 'href':'javascript:toggleConcise'}); button.appendChild(ButtonText); space.appendChild(Button); } addOnloadHook( createToggleButton );

//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');