User:Joeytje50/common.js

/***************************************** If you see this and also want to have one page for all your scripts: remember to place the following on your wikia.js and monobook.js files:

importScript('User: /common.js');



//Imports

importScript('User:Joeytje50/ChatBans.js'); importScript('User:Quarenon/exchangewatch.js'); importScript('User:Suppa_chuppa/hybrid.js'); importScript('User:Joeytje50/dupes.js'); importScript('User:Joeytje50/price.js'); importScript('User:Joeytje50/tabkey.js');

var excludeuser = "Joeytje50"; importScript('User:Joeytje50/watchlist.js');

var cg = ["Speedy move candidates","Speedy deletion candidates"]; importScript('User:Joeytje50/categories.js');

//Allowing longer summaries

$(document).ready(function{	$('#wpSummary').attr('maxlength', '250'); })

//attributes stuff $(document).ready(function{	$('.wordmark a').removeAttr('accesskey')	$('.mw-rollback-link a').attr('accesskey', 'z')	$('input[name="wpMove"]').attr('accesskey', 's')	$('textarea#wpFilterRules').removeAttr('readonly') })

//Function for making it easier to filter an input from certain characters. When the characters in the regex (or string) are found in the input, they are removed after moving back up the key.

function filter(regex, selector) { $(selector).keyup(function {		if ($(selector).val.search(regex) != '-1') {			$(selector).val($(selector).val.replace(regex, ''))		}	}) }

/*** 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: 'Vandalism', ns: 'User talk', open: '', close: ' ~', sample: '__CONTENTPAGE__' }); toolbarTemplates.push({ name: 'Welcome', ns: 'User talk', open: , sample:  }); toolbarTemplates.push({ name: 'Banned from chat', ns: 'User talk', open: '', close: ' ~', sample: ' ' }); toolbarTemplates.push({ name: 'Incorrect timezone', ns: 'User talk', open: , close: '~', sample:  }); toolbarTemplates.push({ name: 'Rare drop table', ns: 'User talk', open: , close: '~', sample:  }); toolbarTemplates.push({ name: 'Infobox Item', ns: 'Main', open: , sample:  }); toolbarTemplates.push({ name: 'Infobox Monster', ns: 'Main', open: , sample:  }); toolbarTemplates.push({ name: 'Infobox NPC', ns: 'Main', open: , sample:  }); toolbarTemplates.push({ name: 'User page with red links leading to it', ns: 'User', open: , close: , sample: '' }); toolbarTemplates.push({ name: 'IP editing userpage', ns: 'User talk', open: 'Please remember to log in before editing userpages.', close: '~', sample: ''}) toolbarTemplates.push({ name: 'Minor glitch image deletion', ns: 'File', open: '', sample: 'Minor glitch image' }); toolbarTemplates.push({ name: 'Personal image deletion', ns: 'File', open: '', sample: 'Personal/vanity image' }); toolbarTemplates.push({ name: 'Unnecessary image deletion', ns: 'File', open: '', sample: 'Unnecessary image' }); toolbarTemplates.push({ name: 'Duplicate image deletion', ns: 'File', open: '', sample: 'Duplicate' }); /* DO NOT EDIT THIS LINE! */ importScript('User:Quarenon/templates.js'); // /*** END TEMPLATES SCRIPT ***/

/*** BEGIN AUTO CVU SCRIPT ***/ // Enables automatic submission of edits. Change to 0 to disable. var autoCvuSubmit = 0; /* DO NOT EDIT THIS LINE! */ importScript('User:Quarenon/autocvu.js'); /*** END AUTO CVU 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 = ''; var autoWelcomeSummary = 'Welcome'; /* DO NOT CHANGE THIS LINE! */ importScript('User:Quarenon/autowelcome.js'); // /*** END AUTO WELCOME SCRIPT ***/

//Ticker script. Put on a page with this script to create a very simple ticker: every click it adds one.

$(document).ready(function{	$('#ticker').html(' Tick ')	$('#tick').click(function { var count = $('#count').val count++ $('#count').val(count) })	filter(/[^0-9]/g, '#count') })

$(document).ready(function { if ($('pre.source-javascript').length != 0) {	$('pre.source-javascript').html($('pre.source-javascript').html.replace(/?(\(|{)/g, ' $&').replace(/\)|}/g, '$& '))	$('head').append('.source-javascript .JSgroup:hover {background-color:rgba(50, 50, 50, 0.1);} ')	$('pre.source-javascript').dblclick(function { if ($('style.JSEffects').html.replace(/^(..).*/, '$1') != '/*') { $('style.JSEffects').html('/*' + $('style.JSEffects').html + '*/') } else { $('style.JSEffects').html($('style.JSEffects').html.replace(/\/\*|\*\//, '')) }	}) } })

//--- Sommin cake'y

if (wgPageName == 'User:Joeytje50/RCFrames') { $('head').html(' RecentChanges Frames watch body {position:relative;height:90%;min-height:90%;} div.container {display:none;overflow:hidden;resize:both;width:30%;padding:10px 4px;} iframe {width:100%;height:100%;} #inp1:checked~#frame1, #inp2:checked~#frame2,#inp3:checked~#frame3,#inp4:checked~#frame4 {display:inline-block;} input[type="checkbox"] {display:none;} label {color:red;background:#FDD;cursor:pointer;padding:0 2px;border:1px solid #666;border-radius:4px;} label:hover {text-decoration:underline;} input[type="checkbox"]:checked+label {color:green;background:#DFD;} ');

$('body').html(' RC  Logs  Newbies  AbuseLog     ') }

importScript('User:Joeytje50/AWBload.js')

setTimeout(function {	fillIframe_SPOTLIGHT_FOOTER_1 = function {return false;}	fillIframe_SPOTLIGHT_FOOTER_2 = function {return false;}	fillIframe_SPOTLIGHT_FOOTER_3 = function {return false;} },20)

//Kinda sick of narbs constantly bugging me about me playing runescape when I'm on the wiki @ schuul

$(function {	if (wgCanonicalSpecialPageName != 'chat' && getCookie('hideLogo')=='true') {		$('#p-logo a').attr('style','background-image:url("http://i.imgur.com/oJ7HV.png") !important;')	}	if (wgTitle == 'HIDE-LOGO') {		setCookie('hideLogo','true',1000)	} else if (wgTitle == 'SHOW-LOGO') {		setCookie('hideLogo','false',1000)	} }) // if (wgNamespaceNumber == 3 && document.location.href.indexOf('redlink=1')!=-1 && wgAction == 'edit') { var enforceSign = false; }

$(function { if ($('.javascript.source-javascript').length && $('.javascript.source-javascript').html.split('\n').length > 5 && wgTitle.match(/\.js$/)) {	$('.javascript.source-javascript').parent.before(' highlight line  ');	$('#highlight').click(function { if (parseInt($('#highlightline').val) && $('.javascript.source-javascript').html.split('\n').length > parseInt($('#highlightline').val)) { $('.jshighlight').replaceWith(function { return this.innerHTML }) $('.javascript.source-javascript').html(function {				return this.innerHTML.replace((new RegExp('((.*(\n|\r)){'+(parseInt($('#highlightline').val)-1)+'})(.*)')), '$1 $4 ')			}) document.body.scrollTop += (16 * parseInt($('#highlightline').val)) }	}) } })

//Linking files on File: pages to the thumbnail version, so you can view the file correctly.

$(function {	$('.fullImageLink#file a').has('img').attr('href',function { var randnr = Math.floor(10000+Math.random*10000); var curlink = $(this).attr('href'); return curlink.replace('images/','images/thumb/')+'/'+randnr+'px-'+ curlink.split('/')[curlink.split('/').length-1]; }); })

$(window).load(function { if (wgCanonicalSpecialPageName == 'Search') {	if ((document.location.search.match('go=Go') || document.location.search.match('fulltext=0')) && $('.searchresults > div > strong').length) {		var pagename = $('.searchresults > div > strong a').attr('href'); console.log(pagename)		document.location.href = pagename;	} } })