Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
importStylesheet("MediaWiki:Chats.css");
//Chat Options
importScriptPage('MediaWiki:Chat.js/options.js');
//Chat Title
document.title = "Chat - " + wgSitename;
//Ratelimoter
var maxLimit = 5; //Sets maximum number of lines
var maxLength = 1000; // Sets max length of line in characters
var limitTimeout = 5000; //Sets time till next number of lines to be submitted
var rate = 0;
function ratelimit(e) {
if (rate > maxLimit) {
this.disabled = true;//disabling input in case they press ESC before the redirect is complete
e.preventDefault();
mainRoom.sendMessage({which : 13, shiftKey : false, preventDefault : function() {} })
document.location.href = wgServer+"/wiki/Special:UserLogout";
return false;
}
if (this.value.length>=maxLength || this.value.split('\n').length>=6) {
var val = this.value.substring(0,maxLength).split('\n');
val = val[0]+'\n'+val[1]+'\n'+val[2]+'\n'+val[3]+'\n'+val[4];//remove all lines after the 5th line.
this.value = val;
if (e.type == 'keypress') {
e.preventDefault();
return false;
}
}
if (e.type == 'keypress' && e.which == 13 && !e.shiftKey && this.value != '') {
rate += 1;
setTimeout(function() {
if (rate > 0) { rate -= 1 }
},limitTimeout);
}
}
$('[name="message"]').keyup(ratelimit).keypress(ratelimit).keydown(ratelimit);
//Chatmod Stars
setInterval(function() {
$('#Rail .User.chat-mod:not(.admin) .username').each(function() {
if (!this.innerHTML.match(/Temmington|Dream Hacked|ChaoZStrider|CPwikiCHATlogger|Kill1mes|JackFrost5738|MrDark|CrashingCymbal|Dark Hoodie/)) {
$(this).parent().addClass('admin');
}
});
}, 1000)
$('.User.chat-mod[data-user="Benjaminthewill123123"].username').removeClass('admin');
//By: User:Benjaminthewill123123
if (wgUserGroups.indexOf('sysop')!=-1)
{
$('<a id= "BlockUserButton" class="wikia-button" href="javascript:BlockUser()" style="position:absolute; right:55px; top:22px;">Block</a>').appendTo('.Write');
function BlockUser()
{
var toBlock = prompt('Please state the user to block');
var blockExpiry = prompt('Please state the block duration','3 Days');
var blockReason = prompt('Please state the block reason','Socking');
var url = wgServer+'/api.php?action=query&prop=info&intoken=block&titles=User:'+toBlock+'&format=json';
$.getJSON(url, function(data)
{
if (!blockExpiry || !blockReason) return;
var p; for (var p in data.query.pages) { break; };
var ET = data.query.pages[p].blocktoken;
var ET = ET.slice(0, -2);
var ET = ET+'%2B\\';
var url = wgServer+'/api.php?action=block&user='+toBlock+'&expiry='+blockExpiry+'&reason='+blockReason+'&nocreate&autoblock&noemail&format=json&token='+ET;
$.post(url, function()
{
inlineAlert(toBlock+'has been blocked.');
});
});
}
}
//Extra commands by Benjaminthewill123123
var lastMessage = '';
$(function() {
$('[name="message"]').keypress(function(e) {
if (e.which == 32 || e.which == 13) {
switch (this.value) {
case '/coppa': this.value = 'http://coppa.org - You must be 13 or older to legally have an account on Wikia.'; break;
case '/srule': this.value = 'http://creepypasta.wikia.com/wiki/Site_Rules';break;
case '/emote': this.value = 'http://creepypasta.wikia.com/wiki/MediaWiki:Emoticons';break;
case '/crule': this.value = 'http://creepypasta.wikia.com/wiki/Chat_Rules';break;
case '/page': this.valuse = 'http://creepypasta.wikia.com/wiki/Special:Createpage';break;
}
}
if (e.which == 13) {
if (this.value.split(' ')[0] == '/grouphug') {
var args = $('[name="message"]').val().replace('/grouphug ','').split(' ');
$('[name="message"]').val('* '+wgUserName+' grouphuggles '+args.slice(0,args.length-1).join(', ') + ' and '+args[args.length-1]+'.');
} else {
switch (this.value) {
case '/clear': this.value = ''; $('.Chat[style*="block"] ul, .Chat[style=""] ul').html('<li class="inline-alert">Window cleared</li>');break;
}
lastMessage = this.value;
}
}
}).keydown(function(e) {
if (e.which == 38 && this.value == '') {
this.value = lastMessage;
$(this).select();
}
});
})
var chatTopic = '<div style="color:#00FF1E">Welcome to the Creepypasta Wiki chat. Please read the chat rules <a href="/wiki/Chat_Rules" target="_blank" title="Chat Rules"><u>here</u></a>.</div>'
$(function() {
$('#ChatHeader .public.wordmark').prepend('<div class="chattopic">'+chatTopic+'</div>')
.find('a').attr('style','position:relative;text-decoration:underline;')
})
$('#ChatHeader .public.wordmark div:not(:first-child)').remove()
//Auto-Nope by Icecreamcaekbot
$(function() {
$('[name="message"]').keypress(function(e) {
if (e.which == 32 || e.which == 13) {
if (this.value == '#yolo'||this.value == '#YOLO'||this.value == '#swag'||this.value == '#SWAG') {
window.location = 'http://creepypasta.wikia.com/wiki/Special:UserLogout';
}
}
});
});