bgneal@12: $(document).ready(function() { bgneal@12: var submit = $('#shoutbox-submit'); bgneal@12: submit.click(function () { bgneal@12: var input = $('#shoutbox-smiley-input'); bgneal@27: var msg = $.trim(input.val()); bgneal@12: if (msg.length == 0) { bgneal@12: return false; bgneal@12: } bgneal@12: submit.attr('disabled', 'disabled'); bgneal@12: $.post('/shout/shout/', { bgneal@12: msg: msg bgneal@12: }, bgneal@12: function (data, textStatus) { bgneal@12: input.val(''); bgneal@12: if (data != '') { bgneal@12: $('#shoutbox-shout-container').prepend(data); bgneal@12: $('#shoutbox-shout-container p:first').fadeIn(2500); bgneal@12: } bgneal@12: submit.removeAttr('disabled'); bgneal@12: }, bgneal@12: 'html'); bgneal@12: return false; bgneal@12: }); bgneal@12: var smilies_loaded = false; bgneal@12: var smiley_frame = $('#shoutbox-smiley-frame'); bgneal@12: $('#shoutbox-smilies').click(function () { bgneal@12: smiley_frame.toggle(); bgneal@12: if (!smilies_loaded) { bgneal@12: smiley_frame.load('/smiley/farm/', function () { bgneal@12: $('#shoutbox-busy-icon').hide(); bgneal@123: var txt = $("#shoutbox-smiley-input")[0]; bgneal@123: $('#shoutbox-smiley-frame img').click(function() { bgneal@123: txt.value += ' ' + this.alt + ' '; bgneal@123: txt.focus(); bgneal@123: }); bgneal@12: smilies_loaded = true; bgneal@12: }); bgneal@12: } bgneal@12: }); bgneal@12: });