User:Glacier Wolf/global.js

// ***************************************************************** // Custom edit buttons // ***************************************************************** // "Whine" button - initial idea by Jack, lots of helpful tweaks // by Splarka (http://www.wikia.com/wiki/User:Splarka) if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/3/3b/Button_template_alt.png", "speedTip": "", "tagOpen": "", "sampleText": "w:User:Glacier Wolf"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/2/28/Button_info.png", "speedTip": "Whine about protection (new wiki, main page)", "tagOpen": "Hi there, and congratulations on the new Wikia you've just founded! I see you've protected the main page of this wiki project. It's against Wikia's protection policy to protect the main page before any vandalism has happened. Full protection of the main page prevents a lot of constructive edits - not everyone tries to harm the project.", "tagClose": "" + "", "sampleText": "You can use the autoconfirm protection level to protect the main page from anonymous and very new users. It's a very common mistake to protect the main page unneccessarily. In most cases, main page protection does more bad than good. I'd suggest also reading Wikia's help page about the main page. Please consider reducing or completely removing the protection from the Main Page. Thanks in advance. "}; }

// function appendScript(url) { var scriptElem = document.createElement('script'); scriptElem.setAttribute('src',url); scriptElem.setAttribute('type','text/javascript'); document.getElementsByTagName('head')[0].appendChild(scriptElem); } importScriptPage('FastDelete/code.js', 'dev');

if(wgCanonicalNamespace=='Forum') addOnloadHook(forumTools) function forumTools { var titles = getElementsByClassName(document, 'td', 'forum_title'); if(titles.length==0) return addPortletLink('p-cactions','javascript:forumPrune','Topic links only','ca-frune','show just forum topic links'); }

function forumPrune { var ftable = getElementsByClassName(document, 'table', 'forumlist'); var links = ftable[0].getElementsByTagName('a'); for(var i=0;i < links.length;i++) { if(links[i].parentNode.className!='forum_title') { links[i].parentNode.removeChild(links[i]); } } }