User:Thundermare/global.js

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:QuickDiff/code.js',        'u:dev:MediaWiki:QuickIW/code.js',        'u:dev:MediaWiki:AjaxDelete/code.js',        'u:dev:MediaWiki:GlobalEditcount/code.js',        'u:dev:MediaWiki:MultiUpload/code.js',        'u:dev:MediaWiki:RecentChangesMultiple/code.2.js',        'u:dev:MediaWiki:MarkForDeletion/code.js',        'u:dev:MediaWiki:MassProtect/code.js',        'u:dev:MediaWiki:ListFiles/code.js',        'u:dev:MediaWiki:QuickIW/code.js',        'u:dev:MediaWiki:Quick_Management/code.js',        'u:dev:MediaWiki:WHAM/code.2.js',        'u:dev:MediaWiki:ChatButtonsCollectionDeluxe.js',        'u:dev:MediaWiki:CapsFirst/code.js',    ] });

//Custom chat ban template ChatBanModal = function(title, okCallback) { require(['jquery','wikia.ui.factory','wikia.mustache'], function($, uiFactory, Mustache) {		$.when( uiFactory.init(['modal']), mw.loader.using('mediawiki.jqueryMsg') ).then(function(uiModal) { $.msg = function { return mw.message.call(this, arguments).escaped; };			var tmpl =' \ \					 \						 \  \ \							 \ \						 \					 \					 \						 \  \ \							 \ \						 \					 \				 \			 ',			mustacheContext = { 'msg-chat-ban-modal-label-expires': 'Expires', 'msg-chat-ban-modal-label-reason': 'Reason', banOptions: ( function {					var opts = [], time = {						'seconds' : 1,						'minutes' : 60,						'hours' : 3600,						'days' : 86400,						'weeks' : 604800,						'months' : 2592000,						'years' : 31536000					};					"15 minutes:15 minutes, 1 hour:1 hour, 2 hours:2 hours,1 day:1 day,2 days:2 days,3 days:3 days,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,2 years:2 years,infinite:infinite".split(',').forEach(function(option) { option = option.split(':'); var lt = option[0].split(' '); opts.push({							time: time[lt[1]] * parseInt(lt[0]),							text: option[1]						}); });					return opts;				} ), reasons: [ {						text: 'Misbehaving in chat. If you have any inquiries about the ban, feel free to contact me on my talk page.' },					{						text: 'Trolling. If you have any inquiries about the ban, feel free to contact me on my talk page.' },                                       {						text: 'Swearing. If you have any inquiries about the ban, feel free to contact me on my talk page.' },					{						text: 'Impersonation. If you have any inquiries about the ban, feel free to contact me on my talk page.' },                                       {						text: 'Inappopriate behavior in chat. If you have any inquiries about the ban, feel free to contact me on my talk page.' },					{						text: 'Spamming. If you have any inquiries about the ban, feel free to contact me on my talk page.' },					{						text: 'Sockpuppet. If you have any inquiries about the ban, feel free to contact me on my talk page.' },					{						text: 'Insulting/Rudeness in chat. If you have any inquiries about the ban, feel free to contact me on my talk page.' },				]			},			banModalConfig = { type: 'default', vars: { id: 'ChatBanModal', size: 'small', content: Mustache.render(tmpl, mustacheContext), title: title, buttons: [ {							vars: { value: mw.message('chat-ban-modal-button-ok').escaped, classes: ['normal', 'primary'], data: [ {										key: 'event', value: 'ok' }								]							}						},						{							'vars': { 'value': mw.message('chat-ban-modal-button-cancel').escaped, data: [ {										key: 'event', value: 'close' }								]							}						}					]				}			};			uiModal.createComponent(banModalConfig, function (banModal) {				var reasonInput = banModal.$element.find('#chat-ban-reason');				function banUser {					var reason = reasonInput.val,						expires = banModal.$element.find('#chat-ban-expiry').val;					okCallback(expires, reason);					console.log(expires + ' ' + reason);					banModal.trigger('close');				}				reasonInput.placeholder.keydown(function (e) { if (e.which === 13) { // Submit when 'enter' key is pressed (BugId:28101). e.preventDefault; banUser; }				});				banModal.bind('ok', function (event) { event.preventDefault; banUser; });				banModal.show;			}); });	}); };