User:Blow of Light/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/stripsource.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') appendScript('http://www.wikia.com/index.php?title=User:Splarka/interwikitools.js&action=raw&ctype=text/javascript&dontcountme=s') appendScript('http://en.wikipedia.org/w/index.php?title=User:Zocky/SearchBox.js&action=raw&ctype=text/javascript&dontcountme=s') appendScript('http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js&action=raw&ctype=text/javascript&dontcountme=s') popupAdminLinks=true; appendScript('http://commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-QuickDelete.js&action=raw&ctype=text/javascript&dontcountme=s') appendScript('http://commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-EnhancedUndelete.js&action=raw&ctype=text/javascript&dontcountme=s')

// ***************************************************************** // 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': 'unneeded', 'label': 'del-unnecessary'}; fdButtons[fdButtons.length] = { 'summary': 'test page', 'label': 'del-testpage'}; fdButtons[fdButtons.length] = { 'summary': 'vandalism', 'label': 'del-vandalism'}; fdButtons[fdButtons.length] = { 'summary': 'blatant_advertising', 'label': 'del-spam'}; fdButtons[fdButtons.length] = { 'summary': 'nn', 'label': 'del-nn'};

appendScript('http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js&action=raw&ctype=txt/javascript&dontcountme=s');

// document.write(''); function modulobusqueda {  if (typeof ms_Activa_Modulobusqueda == 'undefined') { ms_Activa_Modulobusqueda = true;} if (!msActivarModulo(ms_Activa_Modulobusqueda)) return; var btSearch = " "; for (i=0; i<misbuscadores.length; i++) {     if (misbuscadores[i].proy == msProyectoCod || misbuscadores[i].proy == "0") {        var direccion = misbuscadores[i].url; var nombre = misbuscadores[i].nom; var caption = msStringU(misbuscadores[i].tt); if (caption != "") btSearch += buttonCode(caption, nombre, direccion,"") else btSearch += " "; }  }   var boxSearch; switch (skin) { case "monobook"    : boxSearch = document.getElementById("searchform"); break; case "cologneblue" : boxSearch = document.getElementById("searchform2"); break; }  if (boxSearch) boxSearch.innerHTML += btSearch+" "; } function buttonCode(titulo, texto, inicio, fin) {   return ' '; } function goSearch(inicio, fin) {  var Qs = ''; var text; switch (skin) { case "monobook"    : text = document.getElementById("searchInput"); break; case "cologneblue" : text = document.getElementById("searchInput2"); break; }  if (escape(text.value) == '') {       if (wgNamespaceNumber == -1) Qs = wgUserName ;      //Si es una página Especial else { Qs = get_subpage_title.replace(/_/g, ' '); Qs = Qs.substring(Qs.indexOf(':')+ 1, Qs.length); } }  else { Qs = text.value;} window.open(inicio + Qs + fin); } if (window.addEventListener) window.addEventListener("load",modulobusqueda,false); else if (window.attachEvent) window.attachEvent("onload",modulobusqueda); // function moduloBusqueda { var btSearch = ' '; btSearch += buttonCode('onclick="goSearch(0)" value="es" title="Spanish Wikipedia"'); btSearch += buttonCode('onclick="goSearch(1)" value="de" title="German Wikipedia"'); btSearch += buttonCode('onclick="goSearch(2)" value="en" title="English Wikipedia"'); btSearch += buttonCode('onclick="goSearch(3)" value="C" title="Commons"'); btSearch += buttonCode('onclick="goSearch(4)" value="D" title="Wiktionary"'); btSearch += buttonCode('onclick="goSearch(5)" value="N" title="Wikinews"'); btSearch += ' '; var boxSearch = document.getElementById("searchform"); if (boxSearch) boxSearch.innerHTML += btSearch; } function goSearch(i) { urls = new Array(    "http://es.wikipedia.org/wiki/",     "http://de.wikipedia.org/wiki/",    "http://en.wikipedia.org/wiki/",    "http://commons.wikimedia.org/wiki/",    "http://en.wiktionary.org/wiki/",    "http://en.wikinews.org/wiki/"  ); var text = document.getElementById("searchInput"); window.open(urls[i] + escape(text.value)); } function buttonCode(strCode) { return ' '; } addOnloadHook(moduloBusqueda); function nuevaCaja { var l = document.getElementById("column-one"); if (l) { l.innerHTML = l.innerHTML + ' '   + ' My shorcuts ' + ' '   + '   ' + '    My monobook.js' + '    My monobook.css' + '    IRC' + '    <a href="http://codesnippets.wikia.com/wiki/Code_Snippets_Wiki:Sandbox">Sandbox</a></li>' + '  </ul>' + ' '   + ' ';  } } addOnloadHook(nuevaCaja); //////////STATUS CHANGER // Creator: Misza13 // Credits: Voyagerfan5761 for some minor improvements addOnloadHook(function { var subpage = "/Status";  var scheme = "/StatusTemplate";  var linkprefix = wgServer+wgScript+"?title=User:";  //Add the links  addLink("p-personal", linkprefix+wgUserName+subpage+"&action=edit&newstatus=in", "In", "pt-status-in", "I'm in!", "", "pt-logout");  addLink("p-personal", linkprefix+wgUserName+subpage+"&action=edit&newstatus=busy", "Busy", "pt-status-busy", "I'm busy!", "", "pt-logout");  addLink("p-personal", linkprefix+wgUserName+subpage+"&action=edit&newstatus=out", "Out", "pt-status-out", "I'm out!", "", "pt-logout");  if (location.href.indexOf("&action=edit&newstatus=") == -1) return; //Are we here to auto-edit the status?  //Get new status  statusRegExp = /&action=edit&newstatus=(.*)/;  status = statusRegExp.exec(location.href)[1];  //Modify the form  document.getElementById('wpTextbox1').value = "";  document.getElementById('wpSummary').value = "Status using Monobook-suite: "+status; document.getElementById('wpMinoredit').checked = true; //Submit it! document.getElementById('editform').submit; }); // //////////////////////////////////////////////////////////////// // =-=-=- HELPER FUNCTIONS -=-=-=- function addlilink(tabs, url, name, id, title, key){   var na = document.createElement('a');    na.href = url;    na.appendChild(document.createTextNode(name));    var li = document.createElement('li');    if(id) li.id = id;    li.appendChild(na);    tabs.appendChild(li);    if(id)    {        if(key && title)        {            ta[id] = [key, title];        }        else if(key)        {            ta[id] = [key, ];        }        else if(title)        {            ta[id] = [, title];        }    }    // re-render the title and accesskeys from existing code in wikibits.js    akeytt;    return li; } function addToolboxLink(url, name, id, title){    var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];    addlilink(tb, url, name, id, title); } function addTab(url, name, id, title, key) { return addPortletLink('p-cactions', url, name, id, title, key); } function addLink(where, url, name, id, title, key, after){ var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); if(id) li.id = id; li.appendChild(na); var tabs = document.getElementById(where).getElementsByTagName('ul')[0]; if(after) { tabs.insertBefore(li,document.getElementById(after)); } else { tabs.appendChild(li); }   if(id) { if(key && title) { ta[id] = [key, title]; } else if(key) { ta[id] = [key, '']; } else if(title) { ta[id] = ['', title];} }   // re-render the title and accesskeys from existing code in wikibits.js    akeytt; return li; } function addlimenu(tabs, name, id) {   var na = document.createElement('a'); na.href = '#'; var mn = document.createElement('ul'); na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); li.id = id; li.className = 'tabmenu'; li.appendChild(na); li.appendChild(mn); tabs.appendChild(li); return li; } function addnavbox_link(URL,Name,ID) { var portlet = document.getElementById('p-navigation'); var links = portlet.getElementsByTagName('ul')[0]; links.innerHTML += '<a href="' + URL + '">' + Name + '</a></li>'; } /////////////////////////////////////////////