Added inline links settings

This commit is contained in:
Mattias Erming 2014-09-27 16:22:34 -07:00
parent 2e293ce785
commit 7a0e572100
2 changed files with 32 additions and 1 deletions

View file

@ -200,6 +200,21 @@
Show quits
</label>
</div>
<div class="col-sm-12">
<h2>Links and URLs</h2>
</div>
<div class="col-sm-6">
<label class="opt">
<input type="checkbox" name="thumbnails">
Show thumbnails
</label>
</div>
<div class="col-sm-6">
<label class="opt">
<input type="checkbox" name="links">
Show link descriptions
</label>
</div>
<div class="col-sm-12">
<h2>Notifications</h2>
</div>

View file

@ -277,7 +277,21 @@ $(function() {
});
socket.on("toggle", function(data) {
$("#toggle-" + data.id).parent().after(render("toggle", data));
var toggle = $("#toggle-" + data.id);
toggle.parent().after(render("toggle", data));
switch (data.type) {
case "link":
if (options.links) {
toggle.click();
}
break;
case "image":
if (options.thumbnails) {
toggle.click();
}
break;
}
});
socket.on("users", function(data) {
@ -292,11 +306,13 @@ $(function() {
var options = $.extend({
badge: false,
join: true,
links: true,
mode: true,
motd: false,
nick: true,
notification: true,
part: true,
thumbnails: true,
quit: true,
}, $.cookie("settings"));