User:Cizagna/global.js

// ***************************************************************** // Load various external scripts // ***************************************************************** function appendScript(url) { var scriptElem = document.createElement('script'); scriptElem.setAttribute('src',url); scriptElem.setAttribute('type','text/javascript'); document.getElementsByTagName('head')[0].appendChild(scriptElem); } appendScript('http://www.wikia.com/index.php?title=User:Splarka/contribtools.js&action=raw&ctype=text/javascript&dontcountme=s'); appendScript('http://www.wikia.com/index.php?title=User:Splarka/fastdelete.js&action=raw&ctype=text/javascript&dontcountme=s') if(skin == "monobook") appendScript('http://en.wikipedia.org/w/index.php?title=User:Zocky/SearchBox.js&action=raw&ctype=text/javascript&dontcountme=s')

// ***************************************************************** // &bot=1 on contribs pages. // ***************************************************************** function hiderollback { var botlink = document.location.href; if(botlink.indexOf('?')==-1) { botlink += '?bot=1'; } else { botlink += '&bot=1'; } addPortletLink('p-cactions', botlink, '&bot=1', 'ca-bot'); } if((skin == "monobook")&&(wgCanonicalSpecialPageName == 'Contributions')) addOnloadHook(hiderollback)

// ***************************************************************** // Custom edit buttons // ***************************************************************** if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/3/3c/Button_pre.png", "speedTip": " tag", "tagOpen": " \n", "tagClose": "\n ", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/2/23/Button_code.png", "speedTip": " ", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/7/7b/Button_pre_nowiki.png", "speedTip": " tags", "tagOpen": " \n", "tagClose": "\n ", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/7/73/Button_code_nowiki.png", "speedTip": " ", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/c/ce/Button_ampersand_lt-gt_semicolon.png", "speedTip": "&lt;tag here&gt;", "tagOpen": "&lt;", "tagClose": "&gt;", "sampleText": ""}; }

// ***************************************************************** // Duplicate #p-cactions at bottom // *****************************************************************

//function morelinks { // var tabs = document.getElementById('p-cactions').cloneNode(true); // tabs.id = 'mytabs'; // var listitems = tabs.getElementsByTagName('LI'); // for (i=0;i<listitems.length;i++) { //   if(listitems[i].id) listitems[i].id = 'mytabs-' + listitems[i].id; // } //  document.getElementById('column-content').appendChild(tabs); //} //if(skin == "monobook") addOnloadHook(morelinks)

// ***************************************************************** // Custom automatic delete buttons // ***************************************************************** // Adds customizable one-click deletion buttons to any deletable page. // Requires w:User:Splarka/fastdelete.js in appendScript;

var fdButtons = []; fdButtons[fdButtons.length] = { 'summary': 'spam', 'label': 'spam'};

// enable closing in-article ad function addCloseLink(ad) { var rac = document.getElementById('realAdsContainer'); var bc = document.getElementById('bodyContent'); var adspace = document.getElementById('adSpace' + ad.id.substring(6,10)); if ((ad.parentNode == rac) && (ad.childNodes.length > 0)) { var ac = document.createElement('div'); ac.style.cursor = 'pointer'; ac.style.fontSize ='11px'; ac.style.color = '#00c'; ac.style.lineHeight ='14px'; ac.style.position = 'absolute'; ac.style.right = '16px'; ac.onclick = function { rac.removeChild(ad); bc.removeChild(adspace) }; ac.appendChild(document.createTextNode('Close ad')); ad.insertBefore(ac,ad.firstChild); } } addOnloadHook(   function  {        addCloseLink(document.getElementById('realAd0'));        addCloseLink(document.getElementById('realAd1'));    } );