Skip to content

Instantly share code, notes, and snippets.

@pantlesswonder
Created October 18, 2012 00:20
Show Gist options
  • Save pantlesswonder/3909166 to your computer and use it in GitHub Desktop.
Save pantlesswonder/3909166 to your computer and use it in GitHub Desktop.
plug.dj chat goes red when rate limit in effect
(function(){
if (Models.chat._sendChat) { return; }
Models.chat._sendChat = Models.chat.sendChat;
Models.chat.sendChat = function(value){
var sent = this._sendChat(value);
if (sent)
{
$('#chat-input-field').css({color: '#CC4141'});
setTimeout(function(){$('#chat-input-field').css({color: '#fff'});}, this.rateLimit * 1000);
}
return sent;
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment