Fix PM maxlength and throttling
This commit is contained in:
parent
2aba640ec5
commit
e2c3b2daad
3 changed files with 28 additions and 9 deletions
|
|
@ -124,6 +124,7 @@ Callbacks = {
|
|||
cooldown: function (time) {
|
||||
time = time + 200;
|
||||
$("#chatline").css("color", "#ff0000");
|
||||
$(".pm-input").css("color", "#ff0000");
|
||||
if (CHATTHROTTLE && $("#chatline").data("throttle_timer")) {
|
||||
clearTimeout($("#chatline").data("throttle_timer"));
|
||||
}
|
||||
|
|
@ -131,6 +132,7 @@ Callbacks = {
|
|||
$("#chatline").data("throttle_timer", setTimeout(function () {
|
||||
CHATTHROTTLE = false;
|
||||
$("#chatline").css("color", "");
|
||||
$(".pm-input").css("color", "");
|
||||
}, time));
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -2586,10 +2586,14 @@ function initPm(user) {
|
|||
var buffer = $("<div/>").addClass("pm-buffer linewrap").appendTo(body);
|
||||
$("<hr/>").appendTo(body);
|
||||
var input = $("<input/>").addClass("form-control pm-input").attr("type", "text")
|
||||
.attr("maxlength", 240)
|
||||
.appendTo(body);
|
||||
|
||||
input.keydown(function (ev) {
|
||||
if (ev.keyCode === 13) {
|
||||
if (CHATTHROTTLE) {
|
||||
return;
|
||||
}
|
||||
var meta = {};
|
||||
var msg = input.val();
|
||||
if (msg.trim() === "") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue