User:Evil1888/wikia.js

/*** BEGIN TEMPLATES SCRIPT ***/ //

/* For help with this script, visit http://runescape.wikia.com/wiki/User:Quarenon/Scripts/Templates */

var toolbarTemplates = []; var toolbarFillSummary = 1; var toolbarFillHeader = 0;

// Add custom templates here

toolbarTemplates.push({ name: 'Requested signature', ns: 'User talk', open: '==Requested signature==\n\nYour requested signature is ready! ', close: ' ~', sample: 'Go see!' }); toolbarTemplates.push({ name: 'JPEG', ns: 'File', open: '', sample: 'JPEG' }); toolbarTemplates.push({ name: 'Delete Duplicate/Unnecessary', ns: 'File', open: '', sample: 'Duplicate/Unnecessary' });

/* DO NOT EDIT THIS LINE! */

/** * templates.js * * Insert various templates from the edit toolbar. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */

$(document).ready(function {	// http://www.netlobo.com/url_query_string_javascript.html	function getParam(name) {		name = name.replace(/[\[]/, '\\\[').replace(/[\]]/, '\\\]');		var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'); 		var results = regex.exec(window.location.href);		if (results == null) {			return '';		} else {			return decodeURIComponent(results[1]);		}	}

function setCookie(name, value, expires) { var d = new Date; d.setDate(d.getDate + expires); document.cookie = name + '=' + escape(value) + ';path=/'; }

function getCookie(name) { if (document.cookie.length > 0) { var start = document.cookie.indexOf(name + '='); if (start != -1) { start = start + name.length + 1; var end = document.cookie.indexOf(';', start); if (end == -1) { end = document.cookie.length; }				return unescape(document.cookie.substring(start, end)); } 		}		return ''; }

// Needle and haystack should contain strings. Each element in haystack will be trimmed before comparison. function inArray(needle, haystack) { for (var i in haystack) { if (needle == $.trim(haystack[i])) { return true; }		}

return false; }

var toolbarTemplates = (window.toolbarTemplates instanceof Array) ? window.toolbarTemplates : [];

toolbarTemplates = toolbarTemplates.concat([		{ name: 'Delete', ns: '|File', open: '\n\n', sample: 'Reason' },		{ name: 'Delete Personal', ns: 'File', open: '\n\n', sample: 'Personal image' },		{ name: 'Delete Move artefact', ns: 'File', open: '\n\n', sample: 'Move artefact' },		{ name: 'Blacklist', ns: '|File', open: '\n\n', sample: 'Reason' },		{ name: 'NPOV', ns: , open: , close: '\n\n', sample:  },		{ name: 'Move', ns: , open: '\n\n', sample: 'Page' },		{ name: 'Merge', ns: , open: '\n\n', sample: 'Page' },		{ name: 'Under construction', ns: '|User|Project', open: '\n\n', close: , sample:  },		{ name: 'Disputed', ns: , open: '\n\n', close: , sample:  },		{ name: 'Cleanup', ns: , open: '\n\n', close: , sample:  },		{ name: 'Clarify', ns: , open: , close: , sample:  },		{ name: 'Incomplete', ns: , open: '\n\n', close: , sample:  },		{ name: 'In Use', ns: '|Project', open: '\n\n', close: , sample:  }, { name: 'Map Nomination', ns: , open: '\n\n', close: , sample: '' }, { name: 'Obsolete', ns: , open: '\n\n', close: , sample: '' }, { name: 'Protect', ns: , open: '\n\n', close: , sample: '' }, { name: 'Too Big', ns: , open: '\n\n', close: , sample: '' }, { name: 'Vote for Deletion', ns: , open: '\n\n', close: , sample: '' }, { name: 'Wikify', ns: '|Update', open: '\n\n', close: , sample:  }, { name: 'Stub', ns: , open: '\n\n', close: , sample: '' }, { name: 'Section Stub', ns: , open: '\n\n', close: , sample: '' },

{ name: 'GEMW Incorrect Edit (GEMW 1)', ns: 'User_talk', open: '', close: ' ~', sample: '__CONTENTPAGE__' }, { name: 'GEMW Vandalism (GEMW 2)', ns: 'User_talk', open: '', close: ' ~', sample: '__CONTENTPAGE__' }, { name: 'Charm Log Incorrect Edit (Charm log 1)', ns: 'User_talk', open: '', close: ' ~', sample: '__CONTENTPAGE__' }, { name: 'Charm Log Vandalism (Charm log 2)', ns: 'User_talk', open: '', close: ' ~', sample: '__CONTENTPAGE__' }, { name: 'Welcome Notice', ns: 'User_talk', open:  + wgUserName + , close: , sample:  }, { name: 'Thank You', ns: 'User_talk', open:  + wgUserName + , close: , sample:  }, { name: 'No Personal Images', ns: 'User_talk', open:  + wgUserName + ' ~', close: , sample: '' }, { name: 'No Vandal', ns: 'User_talk', open: ' ~', close: , sample:  }, { name: 'Inaccurate Edit (Error 1)', ns: 'User_talk', open: '', close: ' ~', sample: '__CONTENTPAGE__' }, { name: 'Inaccurate Edit (Error 2)', ns: 'User_talk', open: '', close: ' ~', sample: '__CONTENTPAGE__' }, { name: 'Test Edit Warning (Test 1)', ns: 'User_talk', open: '', close: ' ~', sample: '__CONTENTPAGE__' }, { name: 'Possible Vandalism Warning (Test 2)', ns: 'User_talk', open: '', close: ' ~', sample: '__CONTENTPAGE__' }, { name: 'Disruption Warning (Test 3)', ns: 'User_talk', open: '', close: ' ~', sample: '__CONTENTPAGE__' }, { name: 'Final warning', ns: 'User_talk', open: '==Vandalism==\n\nI know what you\'re thinking — "Did he ban six vandals or only five?" Well, to tell you the truth, in all this excitement, I\'ve kinda lost track myself. But, being as this is a .44 Banham, the most powerful banhammer in the world and would ban your IP clean off, you\'ve got to ask yourself one question: "Do I feel lucky?" Well, do ya, punk? ~', close: , sample:  }, { name: 'Deleted User Talk', ns: 'User_talk', open: ' ~', close: , sample:  }, { name: 'Non-Neutral Point of View (POV 1)', ns: 'User_talk', open: '', close: ' ~', sample: '__CONTENTPAGE__' }, { name: 'Non-Neutral Point of View (POV 2)', ns: 'User_talk', open: '', close: ' ~', sample: '__CONTENTPAGE__' }, { name: 'Temporary Block', ns: 'User_talk', open: ' ~', close: , sample:  }, { name: 'Vandal', ns: 'User_talk', open: '', close: ' ~', sample: 'number of offense' }, { name: 'User Edit', ns: 'User_talk', open:  + wgUserName + ' ~', close: , sample: '' }, { name: 'Don\'t Edit Userpages', ns: 'User_talk', open: '', close: ' ~', sample: '__CONTENTPAGE__' }, { name: 'Happy Birthday\!', ns: 'User_talk', open: ' ~', sample: '|' }, { name: 'Happy Belated Birthday\!', ns: 'User_talk', open: ' ~', sample: '||Belated' } ]);

/* Try to keep track of the last visited "content" page. */	if (wgCanonicalNamespace.search(/talk|special/gi) == -1) { var page = wgPageName.replace(/_/g, ' '); if (wgCanonicalNamespace == 'File') { page = ':' + page; }		setCookie('templatesContentReferrer', page); }

/* Append template list when editing user talk pages. */	if (wgAction == 'edit' || wgAction == 'submit') { var haveTemplates = false;

var $select = $(' ').change(function {			var i = $(this).val;

if (i == '-1') { return; }

var tpl = toolbarTemplates[i]; insertTags(tpl.open, tpl.close, tpl.sample.replace('__CONTENTPAGE__', getCookie('templatesContentReferrer')));

var fillSummary = (typeof(window.toolbarFillSummary) != 'undefined') ? window.toolbarFillSummary : true; var fillHeading = (typeof(window.toolbarFillHeading) != 'undefined') ? window.toolbarFillHeading : false; var newSection = (getParam('section') == 'new');

if ((newSection && fillHeading) || (!newSection && fillSummary)) { var summary = $('#wpSummaryEnhanced').val;

if ($.trim(summary.replace(/\/\*.*?\*\//, )) == ) { $('#wpSummaryEnhanced').val(summary + tpl.name); }			}		});

$select.append($(' ').val('-1').text('[Templates]'));

for (var i in toolbarTemplates) { var tpl = toolbarTemplates[i]; var ns = tpl.ns.toLowerCase; // normalize namespace list ns = ns.replace(/ /g, '_').replace(/main/g, '').replace(/image/g, 'file'); if (tpl.ns == '*' || inArray(wgCanonicalNamespace.toLowerCase, ns.split('|'))) { $select.append($(' ').val(i).text(tpl.name)); haveTemplates = true; }		}

if (haveTemplates) { $('#toolbar').prepend($select); }	} });

// /*** END TEMPLATES SCRIPT ***/

/*** BEGIN AUTO WELCOME SCRIPT ***/ //

/* For help with this script, visit http://runescape.wikia.com/wiki/User:Quarenon/Scripts/Autowelcome */

/* Your user welcome text. Unless you have your own welcoming text/template, just use the default. */ var autoWelcomeText =  + wgUserName + ;

/* DO NOT CHANGE THIS LINE! */ importScript('User:Quarenon/autowelcome.js');

// /*** END AUTO WELCOME SCRIPT ***/

/*** BEGIN SMILEY TOOLBAR SCRIPT ***/

/* DO NOT EDIT THIS LINE! */ importScript('User:Quarenon/smileys.js');

/*** END SMILEY TOOLBAR SCRIPT ***/

/*** BEGIN PURGE SCRIPT ***/

/* DO NOT EDIT THIS LINE! */ importScript('User:Quarenon/purge.js');

/*** END PURGE SCRIPT ***/

/*** BEGIN WATCHLIST NOTIFICATION SCRIPT ***/ /* DO NOT EDIT THIS LINE! */ importScript('User:Quarenon/watchlistnotify.js'); /*** END WATCHLIST NOTIFICATION SCRIPT ***/

/*** BEGIN AUTO CVU SCRIPT ***/

// Enables automatic submission of edits. Change to 0 to disable. var autoCvuSubmit = 1;

/* DO NOT EDIT THIS LINE! */ importScript('User:Quarenon/autocvu.js');

/*** END AUTO CVU SCRIPT ***/

/*** BEGIN QUICK PREVIEW SCRIPT ***/

/* DO NOT EDIT THIS LINE! */ importScript('User:Quarenon/quickpreview.js');

/*** END QUICK PREVIEW SCRIPT ***/

/*** BEGIN SWITCH OF GEMW SCRIPT ***/

var enableGemwUpdate = false;

/*** END SWITCH OF GEMW SCRIPT ***/