User:Greyman/global.js

/* */

/*********** Load external scripts ***********/ PurgeButtonText = 'P'; importScriptPage('PurgeButton/code.js', 'dev');

/* importScriptPage('User:Splarka/fastdelete.js', 'www'); */ importScriptPage('FastDelete/code.js', 'dev');

// Adds customizable one-click deletion buttons to any deletable page.

var fdButtons = []; if( wgCityId == '12760'){ fdButtons[fdButtons.length] = { 'summary': '2.1 CSD', 'label': 'SD'}; fdButtons[fdButtons.length] = { 'summary': '1.3 Spam', 'label': 'S'}; fdButtons[fdButtons.length] = { 'summary': '1.7 Vandalism', 'label': 'V'}; fdButtons[fdButtons.length] = { 'summary': '1.2 Nonsense', 'label': 'N'};

} else { fdButtons[fdButtons.length] = { 'summary': 'Marked for speedy deletion', 'label': 'SD'}; fdButtons[fdButtons.length] = { 'summary': 'Housekeeping; spam', 'label': 'S'}; fdButtons[fdButtons.length] = { 'summary': 'Marked for deletion - ', 'label': 'I'}; fdButtons[fdButtons.length] = { 'summary': 'Housekeeping', 'label': 'H'};

}

// ***************************************************************** // ************* END: Custom automatic delete buttons ************** // *****************************************************************

if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/cdnforces/images/c/cd/Button_mdash.png", "speedTip": "Insert &mdash;", "tagOpen": "&mdash;", "tagClose": "", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images4.wikia.nocookie.net/cdnforces/images/2/2d/Button_ndash.png", "speedTip": "Insert –", "tagOpen": "–", "tagClose": "", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images4.wikia.nocookie.net/cdnforces/images/b/bc/Button_bull.png", "speedTip": "Insert &bull;", "tagOpen": "&bull;", "tagClose": "", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/cdnforces/images/4/4b/Button_nbsp.png", "speedTip": "Insert ", "tagOpen": " ", "tagClose": "", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images3.wikia.nocookie.net/cdnforces/images/c/c8/Button_redirect.png", "speedTip": "Redirect", "tagOpen": "#REDIRECT ",    "tagClose": "", "sampleText": "Insert text"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images4.wikia.nocookie.net/cdnforces/images/c/c9/Button_strike.png", "speedTip": "Strike", "tagOpen": " ", "tagClose": " ", "sampleText": "Strike-through text"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/cdnforces/images/1/13/Button_enter.png", "speedTip": "Line break", "tagOpen": " ", "tagClose": "", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images3.wikia.nocookie.net/cdnforces/images/8/8e/Button_defaultsort2.png", "speedTip": "Insert default sort tag", "tagOpen": "", "sampleText": "Insert text here"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images3.wikia.nocookie.net/cdnforces/images/1/11/Button_category.png", "speedTip": "Add a category", "tagOpen": "[[Category:",    "tagClose": "]]", "sampleText": "Insert category here"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/cdnforces/images/e/e1/Button_Quotesbutton.png", "speedTip": "Insert quote template", "tagOpen": """,   "tagClose": "" ", "sampleText": "Insert quote here"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images3.wikia.nocookie.net/cdnforces/images/6/66/Button_quoteurl.png", "speedTip": "Insert URL quote template", "tagOpen": "", "sampleText": "Insert quote here"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/cdnforces/images/8/86/Button_noinclude1.png", "speedTip": "Insert no-include tag", "tagOpen": " ", "tagClose": " ", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/cdnforces/images/3/33/Button_onlyinclude.png", "speedTip": "Insert include-only tag", "tagOpen": " ", "tagClose": " ", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images3.wikia.nocookie.net/cdnforces/images/7/79/Button_reflink.png", "speedTip": "Insert multiple ref tag", "tagOpen": " ", "sampleText": "REFERENCE INFO"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/cdnforces/images/2/23/Button_oneref.png", "speedTip": "Insert single ref tag", "tagOpen": " ", "sampleText": "REFERENCE INFO"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images3.wikia.nocookie.net/cdnforces/images/6/63/Button_choose.png", "speedTip": "Insert choose tag", "tagOpen": " ", "tagClose": " ", "sampleText": "Choose info"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/cdnforces/images/9/9b/Button_option.png", "speedTip": "Insert choose tag", "tagOpen": " ", "tagClose": " ", "sampleText": "Option info"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/cdnforces/images/1/12/Button_gallery.png", "speedTip": "Insert custom gallery", "tagOpen": "", "sampleText": "Gallery images go here"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images3.wikia.nocookie.net/cdnforces/images/f/fa/Button_Usertalk.png", "speedTip": "Insert talkheader", "tagOpen": "", "tagClose": "", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images3.wikia.nocookie.net/cdnforces/images/2/29/Button_user.png", "speedTip": "Welcome user", "tagOpen": "Greyman", "tagClose": "", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/cdnforces/images/6/60/Button_support.png", "speedTip": "Support vote", "tagOpen": " ~", "tagClose": "", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images4.wikia.nocookie.net/cdnforces/images/9/98/Button_oppose.png", "speedTip": "Oppose vote", "tagOpen": " ~", "tagClose": "", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/cdnforces/images/4/4f/Button_neutral.png", "speedTip": "Abstain/Neutral vote", "tagOpen": " ~", "tagClose": "", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/cdnforces/images/6/69/Level_1.png", "speedTip": "Level 1 warning", "tagOpen": " ~", "sampleText": "Insert article title"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/cdnforces/images/7/7f/Level_2.png", "speedTip": "Level 2 warning", "tagOpen": " ~", "sampleText": "Insert offence here"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/cdnforces/images/e/ed/Level_3.png", "speedTip": "Level 3 warning", "tagOpen": " ~", "sampleText": "Insert offence here"};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images2.wikia.nocookie.net/cdnforces/images/5/53/Banned_button.png", "speedTip": "Blocked message", "tagOpen": " ~", "tagClose": "", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images4.wikia.nocookie.net/cdnforces/images/f/f4/PA_button.png", "speedTip": "Personal attack warning", "tagOpen": " ~", "sampleText": "Page title here"}

}

/// ****************************************/// /// ***** END -- CUSTOM EDIT BUTTONS *******/// /// ****************************************///

/* Beginning of RC auto-refresh. Slightly modified version of Pcj's original. To put the stable version in your global.js copy and paste the following into it: importScriptPage('AjaxRC/code.js', 'dev');

ajaxPages="Special:RecentChanges,Special:Watchlist,"; function setCookie(c_name,value,expiredays) { var exdate=new Date exdate.setDate(exdate.getDate+expiredays) document.cookie=c_name+ "=" +escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString) } function getCookie(c_name) { if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "=") if (c_start!=-1) { c_start=c_start + c_name.length+1 c_end=document.cookie.indexOf(";",c_start) if (c_end==-1) c_end=document.cookie.length return unescape(document.cookie.substring(c_start,c_end)) } } return "" } function getXmlHttpRequestObject { if (window.XMLHttpRequest) { return new XMLHttpRequest; //Not Internet Explorer } else if(window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); //Internet Explorer } else { //fail silently } } getRCDataRO = getXmlHttpRequestObject; var cr = new RegExp("\r", "gm"); var lf = new RegExp("\n", "gm"); var endText = new RegExp(' [\t\s]*?[\t\s]*? ', "mi"); var rcTimer; var rcRefresh = 10000; function preloadAJAXRC { if (skin == "monaco") { s = 1; } else { s = 0; } ajaxRCCookie = (getCookie("ajaxload-"+wgPageName)=="on") ? true:false; document.getElementsByTagName("h1")[0].innerHTML += ' AJAX: '; document.getElementById("ajaxRCtoggle").checked = ajaxRCCookie; if (getCookie("ajaxload-"+wgPageName)=="on") loadRCData; } function toggleRC { if (document.getElementById("ajaxRCtoggle").checked == true) { setCookie("ajaxload-"+wgPageName, "on", 30); loadRCData; } else { setCookie("ajaxload-"+wgPageName, "off", 30); clearTimeout(rcTimer); } } function loadRCData { if (getRCDataRO.readyState == 4 || getRCDataRO.readyState == 0) { if (location.href.indexOf("/wiki/")) { rcURL = "http://" + location.hostname + "/wiki/" + wgPageName + location.search; } else { rcURL = "http://" + location.hostname + "/" + wgPageName + location.search; } getRCDataRO.open("GET", rcURL, true); getRCDataRO.onreadystatechange = parseRCdata; getRCDataRO.send(null); } } function parseRCdata { if (getRCDataRO.readyState == 4) { textFilter = new RegExp(' .*? [\t\s]*?[\t\s]*? ', "i"); rawRCdata = getRCDataRO.responseText.replace(cr, "").replace(lf, ""); filteredRCdata = textFilter.exec(rawRCdata); updatedText = filteredRCdata[0].replace(' ', "").replace(endText, ""); document.getElementById("bodyContent").innerHTML = updatedText; rcTimer = setTimeout("loadRCData;", rcRefresh); } } if (ajaxPages.indexOf(wgPageName)!=-1) addOnloadHook(preloadAJAXRC);

/* End RC auto-refresh */

/* */