From 8fbc956111fdef2091c9c91d9530c4c9a901123c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 24 Dec 2011 17:28:36 +0100 Subject: [PATCH] Someone freed the fish, oh a noez --- file/js/TimWolla.WCF.Chat.coffee | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/file/js/TimWolla.WCF.Chat.coffee b/file/js/TimWolla.WCF.Chat.coffee index a0d029f..05b470e 100644 --- a/file/js/TimWolla.WCF.Chat.coffee +++ b/file/js/TimWolla.WCF.Chat.coffee @@ -103,6 +103,32 @@ TimWolla.WCF ?= {} target.parent().addClass 'ajaxLoad' , this) ### + # Frees the fish + ### + freeTheFish: () -> + return if $.wcfIsset('fish') + fish = $ '
' + WCF.String.escapeHTML('><((((°>') + '
' + fish.css + position: 'absolute' + top: '150px' + left: '400px' + color: 'black' + textShadow: '1px 1px white' + zIndex: 9999 + + fish.appendTo $ 'body' + new WCF.PeriodicalExecuter(() -> + left = (Math.random() * 100 - 50) + + $('#fish').text('><((((°>') if (left > 0) + $('#fish').text('<°))))><') if (left < 0) + + $('#fish').animate + top: '+=' + (Math.random() * 100 - 50) + left: '+=' + left + , 1000 + , 3e3); + ### # Loads new messages. ### getMessages: () -> @@ -176,6 +202,8 @@ TimWolla.WCF ?= {} # break if input contains only whitespace return false if $('#chatInput').val().trim().length == 0 + this.freeTheFish() if $('#chatInput').val().trim() == '/free the fish' + $.ajax $('#chatForm').attr('action'), data: text: $('#chatInput').val(),