mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Reformatting
This commit is contained in:
parent
b73ba2168c
commit
e0a7943c1c
@ -54,25 +54,24 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
|
|||||||
}, this));
|
}, this));
|
||||||
|
|
||||||
$('#chatForm').submit($.proxy(function (event) {
|
$('#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;
|
if ($('#chatInput').val().trim().length === 0) return false;
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
textInput = $(event.target).find('#chatInput');
|
|
||||||
submitButton = $(event.target).find('input[type=image]');
|
submitButton = $(event.target).find('input[type=image]');
|
||||||
|
|
||||||
$.ajax('index.php/Chat/Send/', {
|
$.ajax('index.php/Chat/Send/', {
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: { ajax: 1,
|
data: {
|
||||||
text: textInput.val()
|
text: $('#chatInput').val()
|
||||||
},
|
},
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
beforeSend: $.proxy(function (jqXHR) {
|
beforeSend: $.proxy(function (jqXHR) {
|
||||||
submitButton.attr('src', WCF.Icon.get('wcf.icon.loading'));
|
submitButton.attr('src', WCF.Icon.get('wcf.icon.loading'));
|
||||||
}),
|
}),
|
||||||
success: $.proxy(function (data, textStatus, jqXHR) {
|
success: $.proxy(function (data, textStatus, jqXHR) {
|
||||||
this.getMessages();
|
this.getMessages();
|
||||||
textInput.val('').focus();
|
$('#chatInput').val('').focus();
|
||||||
}, this),
|
}, this),
|
||||||
error: function() {
|
error: function() {
|
||||||
// TODO: find a nicer solution.
|
// TODO: find a nicer solution.
|
||||||
|
Loading…
Reference in New Issue
Block a user