User:Sannse/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:Sannse/forumtools.js&action=raw&ctype=text/javascript&dontcountme=s'); 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'); appendScript('http://www.wikia.com/index.php?title=User:Sannse/Imagelisttools.js&action=raw&ctype=text/javascript&dontcountme=s'); } // ***************************************************************** // 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': 'from Articles for speedy deletion', 'label': 'Speedy'};

// ================================================================================ // START Automated deletion button script system // ================================================================================ // Adds customizable one-click deletion buttons to any deletable page. if(wgNamespaceNumber != -1) addOnloadHook(addDeleteButtons) function addDeleteButtons { if(!document.getElementById('ca-delete')) return var url=document.getElementById('ca-delete').firstChild.href if(document.getElementById('content').innerHTML.indexOf('submitdelete')!=-1) { alert('Warning: &submitdelete link detected. Be careful clicking anything'); } if(wgNamespaceNumber == 6) addPortletLink('p-cactions', url + '&submitdelete=true&wpReason=' + encodeURIComponent('Unused image') ,'fastdelete image','ca-delete1'); }

addOnloadHook(checkdelete); function checkdelete { if(queryString('submitdelete')=='true') { var btn = (document.getElementById('mw-filedelete-submit')) ? document.getElementById('mw-filedelete-submit') : document.getElementById('wpConfirmB') btn.click; } }

function queryString(p) { var re = RegExp('[&?]' + p + '=([^&]*)'); var matches; if (matches = re.exec(document.location)) { try { return decodeURI(matches[1]); } catch (e) { } }  return null; } // ================================================================================ // END Automated deletion button script system // ================================================================================

if(wgNamespaceNumber!=-1) addOnloadHook(function { addPortletLink('p-cactions','/wiki/Special:Prefixindex/' + escape(wgPageName),'Subpages','ca-subpages','Show subages of ' + wgPageName); });

//