Work on chat filters

This commit is contained in:
calzoneman 2013-06-18 10:57:53 -04:00
parent 09e9fb2eab
commit 25862acd72
6 changed files with 43 additions and 18 deletions

View file

@ -107,7 +107,13 @@ Callbacks = {
},
chatFilters: function(entries) {
var tbl = $("#filtereditor table");
var tbl = $("#filteredit table");
if(!tbl.hasClass("table")) {
setTimeout(function() {
Callbacks.chatFilters(entries);
}, 100);
return;
}
if(tbl.children().length > 1) {
$(tbl.children()[1]).remove();
}
@ -116,7 +122,7 @@ Callbacks = {
var tr = $("<tr/>").appendTo(tbl);
var remove = $("<button/>").addClass("btn btn-mini btn-danger")
.appendTo($("<td/>").appendTo(tr));
$("<i/>").addClass("icon-remove-circle").appendTo(remove);
$("<i/>").addClass("icon-trash").appendTo(remove);
var name = $("<code/>").text(f.name)
.appendTo($("<td/>").appendTo(tr));
var regex = $("<code/>").text(f.source)
@ -125,6 +131,9 @@ Callbacks = {
.appendTo($("<td/>").appendTo(tr));
var replace = $("<code/>").text(f.replace)
.appendTo($("<td/>").appendTo(tr));
var linktd = $("<td/>").appendTo(tr);
var link = $("<input/>").attr("type", "checkbox")
.prop("checked", false).appendTo(linktd);
var activetd = $("<td/>").appendTo(tr);
var active = $("<input/>").attr("type", "checkbox")
.prop("checked", f.active).appendTo(activetd);
@ -152,7 +161,7 @@ Callbacks = {
active.click(actcallback);
}
var newfilt = $("<tr/>").appendTo(tbl);
var newfilt = $("<tr/>");//.appendTo(tbl);
$("<td/>").appendTo(newfilt);
var name = $("<input/>").attr("type", "text")
.appendTo($("<td/>").appendTo(newfilt));

View file

@ -18,6 +18,9 @@
clickHandler("#show_permedit", "#permedit");
clickHandler("#show_motdedit", "#motdedit");
clickHandler("#show_filteredit", "#filteredit");
$("#show_filteredit").click(function() {
socket.emit("requestChatFilters");
});
clickHandler("#show_cssedit", "#cssedit");
clickHandler("#show_jsedit", "#jsedit");
clickHandler("#show_banlist", "#banlist");

View file

@ -1057,6 +1057,7 @@ function fluidLayout() {
$("#ytapiplayer").attr("width", VWIDTH);
$("#ytapiplayer").attr("height", VHEIGHT);
$("#chatline").removeClass().addClass("span12");
$("#channelsettingswrap3").css("margin-left", "0");
}
function synchtubeLayout() {

View file

@ -91,7 +91,19 @@
<button class="btn btn-primary" id="save_motd">Save</button>
</div>
<div id="filteredit" class="span12">
Filters Here
<table class="table table-striped">
<thead>
<tr>
<th>Delete</th>
<th>Name</th>
<th>Regex</th>
<th>Flags</th>
<th>Replacement</th>
<th>Affects Links</th>
<th>Active</th>
</tr>
</thead>
</table>
</div>
<div id="cssedit" class="span12">
<p>Max 20KB. If you need more space, host the file externally and use the External CSS option</p>