diff --git a/www/assets/js/client.js b/www/assets/js/client.js index 3397c423..a5749715 100644 --- a/www/assets/js/client.js +++ b/www/assets/js/client.js @@ -49,7 +49,8 @@ var USEROPTS = { synch : parseBool(readCookie("cytube_synch")) || true, hidevid : parseBool(readCookie("cytube_hidevid")) || false, show_timestamps : parseBool(readCookie("cytube_show_timestamps")) || false, - modhat : parseBool(readCookie("cytube_modhat")) || false + modhat : parseBool(readCookie("cytube_modhat")) || false, + blink_chat : parseBool(readCookie("cytube_blink_chat")) || false }; applyOpts(); $("#optlink").click(showUserOpts); diff --git a/www/assets/js/functions.js b/www/assets/js/functions.js index a56cb889..1974cd77 100644 --- a/www/assets/js/functions.js +++ b/www/assets/js/functions.js @@ -186,10 +186,14 @@ function addChatMessage(data) { } if(SCROLLCHAT) $("#messagebuffer").scrollTop($("#messagebuffer").prop("scrollHeight")); -} - -function formatChatMessage(data) { - var div = $("
"); + if(USEROPTS.blink_title && !FOCUSED && !TITLE_BLINK) { + TITLE_BLINK = setInterval(function() { + if(document.title == "*Chat*") + document.title = PAGETITLE; + else + document.title = "*Chat*"; + }, 1000); + } if(uname) { if(data.msg.toUpperCase().indexOf(uname.toUpperCase()) != -1) { div.addClass("nick-highlight"); @@ -203,6 +207,10 @@ function formatChatMessage(data) { } } } +} + +function formatChatMessage(data) { + var div = $(""); if(USEROPTS.show_timestamps) { var time = $("").addClass("timestamp").appendTo(div); var timestamp = new Date(data.time).toTimeString().split(" ")[0]; @@ -1073,13 +1081,18 @@ function showUserOpts() { hidevid.prop("checked", USEROPTS.hidevid); addOption("Hide Video", vidcontainer); - var tscontainer = $("").addClass("checkbox") .text("Show timestamps in chat"); var showts = $("").attr("type", "checkbox").appendTo(tscontainer); showts.prop("checked", USEROPTS.show_timestamps); addOption("Show timestamps", tscontainer); + var blinkcontainer = $("").addClass("checkbox") + .text("Flash title on every incoming message"); + var blink = $("").attr("type", "checkbox").appendTo(blinkcontainer); + blink.prop("checked", USEROPTS.blink_title); + addOption("Chat Notice", blinkcontainer); + if(RANK >= Rank.Moderator) { $("