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 Show quits
</label> </label>
</div> </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"> <div class="col-sm-12">
<h2>Notifications</h2> <h2>Notifications</h2>
</div> </div>

View File

@ -277,7 +277,21 @@ $(function() {
}); });
socket.on("toggle", function(data) { 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) { socket.on("users", function(data) {
@ -292,11 +306,13 @@ $(function() {
var options = $.extend({ var options = $.extend({
badge: false, badge: false,
join: true, join: true,
links: true,
mode: true, mode: true,
motd: false, motd: false,
nick: true, nick: true,
notification: true, notification: true,
part: true, part: true,
thumbnails: true,
quit: true, quit: true,
}, $.cookie("settings")); }, $.cookie("settings"));