User:MarkvA/global.js

//

function WikiLinks { }

addOnloadHook(WikiLinks);

/*** Purge knop; knop die je toestaat om snel een pagina te purgen *****/

PurgeButtonText = 'Purge'; importScriptPage('PurgeButton/code.js', 'dev');

/*** Einde purge knop *****/

/*** Gepersonaliseerde bewerk knoppen; staat je toe om wiki-wide de edit bar aan te passen *****/ if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/2/28/Button_wikilink.png?1", "speedTip": "Link", "tagOpen": "w:c:",    "tagClose": "", "sampleText": "Wikinaam"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/3/3b/Button_template_alt.png?1", "speedTip": "Sjabloon", "tagOpen": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/b/b4/Button_category03.png?1", "speedTip": "Categorie", "tagOpen": "[[Category:",    "tagClose": "]]", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/c/c8/Button_redirect.png?1", "speedTip": "Doorverwijzing", "tagOpen": "#REDIRECT ",    "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/c/c9/Button_strike.png?1", "speedTip": "Doorstrepen", "tagOpen": " ", "tagClose": " ", "sampleText": "Doorgestreepte tekst"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/f/f6/Button_html_comment.png?1", "speedTip": "HTML opmerking", "tagOpen": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/2/23/Button_code.png?1", "speedTip": "Code", "tagOpen": " ", "sampleText": "Voer code hier in"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/7/73/Button_code_nowiki.png?1", "speedTip": "Code+Nowiki", "tagOpen": " ", "sampleText": "Voer code hier in"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/9/9f/Button_defaultsort.png?1", "speedTip": "Defaultsort", "tagOpen": "", "sampleText": "Voer sleutel hier in"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/3/33/Button_onlyinclude.png", "speedTip": "Onlyinclude", "tagOpen": "<" + "onlyinclude" + ">", "tagClose": "", "sampleText": "Voer sleutel hier in"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/d/d1/Button_pipehack.png?1", "speedTip": "WikiTable hack", "tagOpen": "|", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/2/29/Button_user.png?1", "speedTip": "Mijn globale gebruikerspagina sjabloon", "tagOpen": "", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/2/29/Button_user.png?1", "speedTip": "Mijn globale overlegpagina sjabloon", "tagOpen": "", "tagClose": "", "sampleText": ""};

mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/2/29/Button_user.png?1", "speedTip": "Mijn globale gebruikerspagina (NL)", "tagOpen": "", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images1.wikia.nocookie.net/central/images/2/29/Button_user.png?1", "speedTip": "Mijn globale overlegpagina sjabloon (NL)", "tagOpen": "", "tagClose": "", "sampleText": ""}; }

/*** Einde gepersonaliseerde bewerk knoppen ******/ /********* Snelle delete knoppen; staat je toe om snel pagina's te verwijderen, zonder het verwijder scherm ******************/

importScriptPage('FastDelete/code.js', 'dev');

var fdButtons = [];

fdButtons[fdButtons.length] = { 'summary': 'Spam', 'label': 'S'}; fdButtons[fdButtons.length] = { 'summary': 'Vandalism', 'label': 'V'}; fdButtons[fdButtons.length] = { 'summary': 'Marked for deletion', 'label': 'M'}; fdButtons[fdButtons.length] = { 'summary': 'Housekeeping', 'label': 'H'}; fdButtons[fdButtons.length] = { 'summary': ' ', 'label': 'NR'}; /*************Einde snelle delete knoppen************************************/

///////////////////////////////////////////////////////////////////////////////////////////////////////////

// GEAVANCEERDE AUTOMATISCH VERNIEUWENDE RECENTE WIJZIGINGEN EN VOLGLIJST // Code gemaakt door "pcj" van WoWWiki.

// INDIVIDUEEL GEBRUIK // Dit is een niet-gemodificeerde versie van de WoWWiki site-wide versie, alleen vertaald naar het Nederlands // Deze versie is specifiek ontworpen voor Special:Mypage/global.js gebruik.

// WIKI-WIDE GEBRUIK // Als je het toevoegd aan een Wiki's MediaWiki:Common.js *zou* hij moeten werken - dit is niet getest. // Het zou niet moeten conflicten met je eigen global.js

// WAT HET DOET // De voegt voegt een checkbox bovenaan Special:RecentChanges en Special:Watchlist, naast de header. // Hem aanvinken activeert een cookie (specifiek voor iedere Wiki) en begint met het updaten van de lijst. // Dit gebeurt in stilte iedere 60 seconde zonder een volledige pagina vernieuwing.

///////////////////////////////////////////////////////////////////////////////////////////////////////////

ajaxPages="Special:RecentChanges,Special:Watchlist,Speciaal:RecenteWijzigingen,Speciaal:Volglijst";

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 = 60000; function preloadAJAXRC { if (skin == "monaco") { s = 1; } else { s = 0; } ajaxRCCookie = (getCookie("ajaxload-"+wgPageName)=="on") ? true:false; document.getElementsByTagName("h1")[0].innerHTML += ' AUTO-VERNIEUWING: '; 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; }

//rcURL = 'http://disneyparks.wikia.com/index.php?title=Special:RecentChanges&from=20080930151557&days=30&limit=500&hideminor=0';

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 + document.getElementById("bodyContent").innerHTML; rcTimer = setTimeout("loadRCData;", rcRefresh); } }

if (ajaxPages.indexOf(wgPageName)!=-1) { addOnloadHook(preloadAJAXRC); }

///////////////////////////////////////////////////////////////////////////////////////////////////////////

// EINDE VAN DE CODE

///////////////////////////////////////////////////////////////////////////////////////////////////////////

/*** Begin Locale tijd script; wijzigt timestamps naar mijn tijdzone ***/ /*** Script door Gary King (Wikipedia), gewijzigd door Quarenon|Quarenon. ***/ /*	Documentation: Comments in Local Time

addOnloadHook(function {	// wgCanonicalNamespace = unsafeWindow.wgCanonicalNamespace	/*		Language	*/	var language = 		{			// relative terms			'Today'		: 	'Vandaag',			'Yesterday'	: 	'Gisteren',			'Tomorrow'	: 	'Morgen',			'last'		: 	'laatste',			'this'		: 	'deze',			// days of the week			'Sunday'	: 	'Zondag',			'Monday'	: 	'Maandag',			'Tuesday'	: 	'Dinsdag',			'Wednesday'	: 	'Woensdag',			'Thursday'	: 	'Donderdag',			'Friday'	: 	'Vrijdag',			'Saturday'	: 	'Zaterdag',			// months of the year			'January'	: 	'Januari',			'February'	: 	'Februari',			'March'		: 	'Maart',			'April'		: 	'April',			'May'		: 	'Mei',			'June'		: 	'Juni',			'July'		: 	'Juli',			'August'	: 	'Augustus',			'September'	: 	'September',			'October'	: 	'Oktober',			'November'	: 	'November',			'December'	: 	'December',			// difference words			'ago'		: 	'geleden',			'from now'	: 	'van nu',			// date phrases			'year'		: 	'jaar', 'years'		: 	'jaren', 'month'		: 	'maand', 'months'	: 	'maanden', 'day'		: 	'dag', 'days'		: 	'dagen' };	/*		Settings */	if (typeof(LocalComments) == 'undefined') LocalComments = {};

if (typeof(LocalComments.dateDifference) == 'undefined') LocalComments.dateDifference = true; if (typeof(LocalComments.dateFormat) == 'undefined') {		// Deprecated: LocalizeConfig if (typeof(LocalizeConfig) != 'undefined' && typeof(LocalizeConfig.dateFormat) != 'undefined' && LocalizeConfig.dateFormat != '') LocalComments.dateFormat = LocalizeConfig.dateFormat; else LocalComments.dateFormat = 'dmy'; }	if (typeof(LocalComments.timeFirst) == 'undefined') LocalComments.timeFirst = true; if (typeof(LocalComments.twentyFourHours) == 'undefined') LocalComments.twentyFourHours = false; /*		End Settings */	if (wgCanonicalNamespace == '' || wgCanonicalNamespace == 'MediaWiki' || wgCanonicalNamespace == 'Special') return; var disabled_urls = new Array('action=history'), unique_url = false, wikiPreview = new Array('action=edit', 'action=submit'); for (var i = 0; i < disabled_urls.length; i++) {		if (document.location.href.indexOf(disabled_urls[i]) != -1) return; }	for (var i = 0; i < wikiPreview.length; i++) {		if (document.location.href.indexOf(wikiPreview[i]) != -1) unique_url = 'wikiPreview'; }	var element_id = unique_url ? unique_url : 'bodyContent'; replace_text(document.getElementById(element_id), /(\d\d):(\d\d), (\d{1,2}) ([A-Z][a-z]+) (\d{4}) \(UTC\)/g, adjust_time);

// Quarenon: Fix for Wikia's timestamp format, which has the day and month reversed. replace_text(document.getElementById(element_id), /(\d\d):(\d\d), ([A-Z][a-z]+) (\d{1,2}), (\d{4}) \(UTC\)/g, function(a, b, c, d, e, f, g) { return adjust_time(a, b, c, e, d, f, g); });

function add_leading_zero(number) {	if (number < 10) number = '0' + number; return number; }

function adjust_time(original_timestamp, old_hour, old_minute, old_day, old_month, old_year, offset) {	var today = new Date, yesterday = new Date, tomorrow = new Date; yesterday.setDate(yesterday.getDate - 1); tomorrow.setDate(tomorrow.getDate + 1); // set the date entered var time = new Date; time.setUTCFullYear(old_year, convert_month_to_number(old_month), old_day); time.setUTCHours(old_hour); time.setUTCMinutes(old_minute); // determine the time offset var utc_offset = -1 * time.getTimezoneOffset / 60; if (utc_offset >= 0) utc_offset = '+' + utc_offset; else utc_offset = '−' + Math.abs(utc_offset); // set the date bits to output var year = time.getFullYear, month = add_leading_zero(time.getMonth + 1); var day = time.getDate; var hour = parseInt(time.getHours), minute = add_leading_zero(time.getMinutes);

// output am or pm depending on the date var ampm = ''; if (!LocalComments.twentyFourHours) {		ampm = ' am'; if (hour > 11) ampm = ' pm'; if (hour > 12) hour -= 12; if (hour == '00') hour = 12; }	// return 'today' or 'yesterday' if that is the case if (year == today.getFullYear && month == add_leading_zero(today.getMonth + 1) && day == today.getDate) var date = language['Today']; else if (year == yesterday.getFullYear && month == add_leading_zero(yesterday.getMonth + 1) && day == yesterday.getDate) var date = language['Yesterday']; else if (year == tomorrow.getFullYear && month == add_leading_zero(tomorrow.getMonth + 1) && day == tomorrow.getDate) var date = language['Tomorrow']; else {		// calculate day of week var day_names = new Array(language['Sunday'], language['Monday'], language['Tuesday'], language['Wednesday'], language['Thursday'], language['Friday'], language['Saturday']); var day_of_the_week = day_names[time.getDay]; if (LocalComments.dateDifference) {			// calculate time difference from today and the timestamp today = new Date(today.getYear, today.getMonth, today.getDate); time = new Date(time.getYear, time.getMonth, time.getDate); var milliseconds_ago = today.getTime - time.getTime; var days_ago = Math.round(milliseconds_ago / 1000 / 60 / 60 / 24);

var difference, difference_word = , last = ; if (today.valueOf >= time.valueOf) {				difference = new Date(today.valueOf - time.valueOf); difference_word = language['ago']; if (days_ago <= 7) last = language['last'] + ' '; }			else {				difference = new Date(time.valueOf - today.valueOf); difference_word = language['from now']; if (days_ago >= -7) last = language['this'] + ' '; }			var descriptive_difference = [];

if (difference.getYear - 70 > 0) {				var years_ago = (difference.getYear - 70) + ' ' + pluralize(language['year'], difference.getYear - 70, language['years']); descriptive_difference.push(years_ago); }			if (difference.getMonth > 0) {				var months_ago = difference.getMonth + ' ' + pluralize(language['month'], difference.getMonth, language['months']); descriptive_difference.push(months_ago); }			if (difference.getDate > 0) {				var new_days_ago = difference.getDate + ' ' + pluralize(language['day'], difference.getDate, language['days']); descriptive_difference.push(new_days_ago); }			descriptive_difference = ' (' + descriptive_difference.join(', ') + ' ' + difference_word + ')'; }		else {			descriptive_difference = ''; last = ''; }		// format the date according to user preferences var formatted_date = '', month_name = convert_number_to_month(time.getMonth); switch (LocalComments.dateFormat.toLowerCase) {			case 'dmy': formatted_date = day + ' ' + month_name + ' ' + year; break; case 'mdy': formatted_date = month_name + ' ' + day + ', ' + year; break; default: formatted_date = year + '-' + month + '-' + add_leading_zero(day); }		var date = formatted_date + ', ' + last + day_of_the_week + descriptive_difference; }	var time = hour + ':' + minute + ampm; if (LocalComments.timeFirst) var return_date = time + ', ' + date + ' (UTC' + utc_offset + ')'; else var return_date = date + ', ' + time + ' (UTC' + utc_offset + ')';

return return_date; }

function convert_month_to_number(month) {  var output = new Date(month + ' 1, 2001'); return output.getMonth; }

function convert_number_to_month(number) {	var month = new Array(language['January'], language['February'], language['March'], language['April'], language['May'], language['June'], language['July'], language['August'], language['September'], language['October'], language['November'], language['December']); return month[number]; }

function pluralize(term, count, plural) { if (plural == null) plural = term + 's';

return (count == 1 ? term : plural) }

function replace_text(node, search, replace) {	if (node.nodeType == 3) {		var value = node.nodeValue; var matches = value.match(search); if (matches != null) {			var node_parent_node = node.parentNode; var old_node = node; // old_node_list = node.parentNode.childNodes; for (match = 0; match < matches.length; match++) {				// Create MATCHES[MATCH] var position; if (after_match != null && length != null) position = after_match.search(search) + before_match.length + length; else position = value.search(search); var length = matches[match].toString.length; var before_match = value.substring(0, position); var after_match = value.substring(position + length); var span = document.createElement('span'); span.setAttribute('class', 'localcomments'); span.style.fontSize = '95%'; span.style.whiteSpace = 'nowrap'; span.setAttribute('title', matches[match]); span.appendChild(document.createTextNode(matches[match].toString.replace(search, replace))); var new_node = document.createDocumentFragment; new_node.appendChild(document.createTextNode(before_match)); new_node.appendChild(span); new_node.appendChild(document.createTextNode(after_match));

node_parent_node.replaceChild(new_node, old_node); break; }		}	}	else {		var children = [], child = node.firstChild; while (child) {			children[children.length] = child; child = child.nextSibling; }		for (var child = 0; child < children.length; child++) replace_text(children[child], search, replace); } }

});

/*** Einde locale tijd script ***/

/* Verwijderd MyHome if( wgPageName == 'Special:MyHome' ) { window.location = wgServer + wgScriptPath + '/wiki/' + wgMainpage; }

Einde verwijdering MyHome */

//