diff options
| author | dumpfmprod <dumpfmprod@ubuntu.(none)> | 2010-04-13 07:31:11 -0400 |
|---|---|---|
| committer | dumpfmprod <dumpfmprod@ubuntu.(none)> | 2010-04-13 07:31:11 -0400 |
| commit | 41661c78d6941a4a63bebbb30cf0bcf82aa04138 (patch) | |
| tree | c2c5607e48640f86acf29b1a744d43cdd7e05527 /static/js | |
| parent | d87cbb95e22bae4597943b9a39f938fd5bda4253 (diff) | |
| parent | d0bd678ff36fed7cf492b89542588b82efafb938 (diff) | |
Merge branch 'master' of /pichat/repo
Diffstat (limited to 'static/js')
| -rw-r--r-- | static/js/admin.js | 37 | ||||
| -rw-r--r-- | static/js/pichat.js | 2 |
2 files changed, 21 insertions, 18 deletions
diff --git a/static/js/admin.js b/static/js/admin.js index a5a5f71..e6bef70 100644 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -26,7 +26,7 @@ Admin.mute = function(nick) { .append(reason) .appendTo($(Admin._dialogHtml)); var title = 'Mute ' + nick; - var cancel = function() { html.dialog('close'); } + var close = function() { html.dialog('close'); } var submit = function() { html.find('[name]').removeClass('ui-state-error'); @@ -34,26 +34,29 @@ Admin.mute = function(nick) { var u = unit.val(); var r = reason.val(); - if (!t) { - time.addClass('ui-state-error'); - } + if (!t) { time.addClass('ui-state-error'); } + if (!u) { reason.addClass('ui-state-error'); } + if (!r) { reason.addClass('ui-state-error'); } + if (!t || !u || !r) { return; } - if (!u) { - reason.addClass('ui-state-error'); - } - - if (!r) { - reason.addClass('ui-state-error'); - } - - if (!t || !u || !r) { - return; - } + $.ajax({ + type: 'POST', + timeout: 5000, + url: '/mute', + cache: false, + data: { 'time': t, 'unit': u, + 'reason': r, 'nick': nick }, + success: close, + error: function(s) { + alert("Error muting user: " + s.responseText); + } + }); }; html.dialog({ - modal: true, + modal: false, title: title, width: 400, - buttons: { 'OK': submit , 'Cancel': cancel } + buttons: { 'OK': submit , 'Cancel': close } }); + html.dialog('open'); };
\ No newline at end of file diff --git a/static/js/pichat.js b/static/js/pichat.js index d6af36f..d52212d 100644 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -221,7 +221,7 @@ function handleMsgError(resp) { if (respText == 'MUST_LOGIN') { alert("Can't send message! Please login."); } else if (respText) { - alert("Can't send message! (" + respText + ")"); + alert("Can't send message! " + respText); } else { alert("Can't send message!"); } |
