Add chat antiflood option
This commit is contained in:
parent
3f5ec309e9
commit
6b5466f5ae
5 changed files with 54 additions and 1 deletions
|
|
@ -29,6 +29,15 @@ function initCallbacks() {
|
|||
.addClass("server-msg-disconnect")
|
||||
.text("Kicked: " + data.reason)
|
||||
.appendTo($("#messagebuffer"));
|
||||
$("#messagebuffer").scrollTop($("#messagebuffer").prop("scrollHeight"));
|
||||
});
|
||||
|
||||
socket.on("noflood", function(data) {
|
||||
$("<div/>")
|
||||
.addClass("server-msg-disconnect")
|
||||
.text(data.action + ": " + data.msg)
|
||||
.appendTo($("#messagebuffer"));
|
||||
$("#messagebuffer").scrollTop($("#messagebuffer").prop("scrollHeight"));
|
||||
});
|
||||
|
||||
socket.on("channelNotRegistered", function() {
|
||||
|
|
@ -67,6 +76,7 @@ function initCallbacks() {
|
|||
PAGETITLE = opts.pagetitle;
|
||||
$("#opt_customcss").val(opts.customcss);
|
||||
$("#opt_customjs").val(opts.customjs);
|
||||
$("#opt_chat_antiflood").prop("checked", opts.chat_antiflood);
|
||||
$("#customCss").remove();
|
||||
if(opts.customcss.trim() != "") {
|
||||
$("<link/>").attr("rel", "stylesheet")
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ socket.on("connect", function() {
|
|||
$("<div/>").addClass("server-msg-reconnect")
|
||||
.text("Connected")
|
||||
.appendTo($("#messagebuffer"));
|
||||
$("#messagebuffer").scrollTop($("#messagebuffer").prop("scrollHeight"));
|
||||
setTimeout(function() { $("#reconnect_box").remove(); }, 3000);
|
||||
});
|
||||
|
||||
|
|
@ -377,7 +378,8 @@ $("#opt_submit").click(function() {
|
|||
voteskip_ratio: ratio,
|
||||
pagetitle: ptitle,
|
||||
customcss: css,
|
||||
customjs: $("#opt_customjs").val()
|
||||
customjs: $("#opt_customjs").val(),
|
||||
chat_antiflood: $("#opt_chat_antiflood").prop("checked")
|
||||
};
|
||||
socket.emit("channelOpts", opts);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ function handleDisconnect() {
|
|||
.addClass("server-msg-disconnect")
|
||||
.text("Disconnected from server. Attempting reconnection...")
|
||||
.appendTo($("#messagebuffer"));
|
||||
$("#messagebuffer").scrollTop($("#messagebuffer").prop("scrollHeight"));
|
||||
}
|
||||
|
||||
// Adds a user to the chatbox userlist
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue