1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Reformatting

This commit is contained in:
Tim Düsterhus 2011-12-13 21:50:28 +01:00
parent b73ba2168c
commit e0a7943c1c

View File

@ -54,17 +54,16 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
}, this));
$('#chatForm').submit($.proxy(function (event) {
// check the input, if not empty send it.
// break if input contains only whitespace
if ($('#chatInput').val().trim().length === 0) return false;
event.preventDefault();
textInput = $(event.target).find('#chatInput');
submitButton = $(event.target).find('input[type=image]');
$.ajax('index.php/Chat/Send/', {
dataType: 'json',
data: { ajax: 1,
text: textInput.val()
data: {
text: $('#chatInput').val()
},
type: 'POST',
beforeSend: $.proxy(function (jqXHR) {
@ -72,7 +71,7 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
}),
success: $.proxy(function (data, textStatus, jqXHR) {
this.getMessages();
textInput.val('').focus();
$('#chatInput').val('').focus();
}, this),
error: function() {
// TODO: find a nicer solution.