mirror of https://github.com/calzoneman/sync.git
Implement #251 (sound may change)
This commit is contained in:
parent
27ef20a76a
commit
613acd2055
|
@ -63,6 +63,7 @@ var LASTCHATTIME = 0;
|
||||||
var FOCUSED = true;
|
var FOCUSED = true;
|
||||||
var PAGETITLE = "CyTube";
|
var PAGETITLE = "CyTube";
|
||||||
var TITLE_BLINK;
|
var TITLE_BLINK;
|
||||||
|
var CHATSOUND = new Audio("assets/sounds/boop.wav");
|
||||||
var KICKED = false;
|
var KICKED = false;
|
||||||
var NAME = readCookie("cytube_uname");
|
var NAME = readCookie("cytube_uname");
|
||||||
var SESSION = readCookie("cytube_session");
|
var SESSION = readCookie("cytube_session");
|
||||||
|
@ -118,7 +119,8 @@ var USEROPTS = {
|
||||||
ignore_channeljs : getOrDefault("ignore_channeljs", false),
|
ignore_channeljs : getOrDefault("ignore_channeljs", false),
|
||||||
sort_rank : getOrDefault("sort_rank", false),
|
sort_rank : getOrDefault("sort_rank", false),
|
||||||
sort_afk : getOrDefault("sort_afk", false),
|
sort_afk : getOrDefault("sort_afk", false),
|
||||||
default_quality : getOrDefault("default_quality", "#quality_auto")
|
default_quality : getOrDefault("default_quality", "#quality_auto"),
|
||||||
|
boop : gerOrDefault("boop", false)
|
||||||
};
|
};
|
||||||
|
|
||||||
var NO_WEBSOCKETS = USEROPTS.altsocket;
|
var NO_WEBSOCKETS = USEROPTS.altsocket;
|
||||||
|
|
|
@ -614,6 +614,12 @@ function showOptionsMenu() {
|
||||||
blink.prop("checked", USEROPTS.blink_title);
|
blink.prop("checked", USEROPTS.blink_title);
|
||||||
addOption("Chat Notice", blinkcontainer);
|
addOption("Chat Notice", blinkcontainer);
|
||||||
|
|
||||||
|
var boopcontainer = $("<label/>").addClass("checkbox")
|
||||||
|
.text("Play a sound in addition to flashing the title");
|
||||||
|
var boop = $("<input/>").attr("type", "checkbox").appendTo(boopcontainer);
|
||||||
|
boop.prop("checked", USEROPTS.boop);
|
||||||
|
addOption("Chat Sound", boopcontainer);
|
||||||
|
|
||||||
var sendbtncontainer = $("<label/>").addClass("checkbox")
|
var sendbtncontainer = $("<label/>").addClass("checkbox")
|
||||||
.text("Add a send button to the chatbox");
|
.text("Add a send button to the chatbox");
|
||||||
var sendbtn = $("<input/>").attr("type", "checkbox").appendTo(sendbtncontainer);
|
var sendbtn = $("<input/>").attr("type", "checkbox").appendTo(sendbtncontainer);
|
||||||
|
@ -665,6 +671,7 @@ function showOptionsMenu() {
|
||||||
USEROPTS.ignore_channeljs = nojs.prop("checked");
|
USEROPTS.ignore_channeljs = nojs.prop("checked");
|
||||||
USEROPTS.sort_rank = sr.prop("checked");
|
USEROPTS.sort_rank = sr.prop("checked");
|
||||||
USEROPTS.sort_afk = sa.prop("checked");
|
USEROPTS.sort_afk = sa.prop("checked");
|
||||||
|
USEROPTS.boop = boop.prop("checked");
|
||||||
sortUserlist();
|
sortUserlist();
|
||||||
if(CLIENT.rank >= Rank.Moderator) {
|
if(CLIENT.rank >= Rank.Moderator) {
|
||||||
USEROPTS.modhat = modhat.prop("checked");
|
USEROPTS.modhat = modhat.prop("checked");
|
||||||
|
@ -1384,6 +1391,7 @@ function addChatMessage(data) {
|
||||||
if(SCROLLCHAT)
|
if(SCROLLCHAT)
|
||||||
scrollChat();
|
scrollChat();
|
||||||
if(USEROPTS.blink_title && !FOCUSED && !TITLE_BLINK) {
|
if(USEROPTS.blink_title && !FOCUSED && !TITLE_BLINK) {
|
||||||
|
USEROPTS.boop && CHATSOUND.play();
|
||||||
TITLE_BLINK = setInterval(function() {
|
TITLE_BLINK = setInterval(function() {
|
||||||
if(document.title == "*Chat*")
|
if(document.title == "*Chat*")
|
||||||
document.title = PAGETITLE;
|
document.title = PAGETITLE;
|
||||||
|
@ -1395,6 +1403,7 @@ function addChatMessage(data) {
|
||||||
if(data.msg.toUpperCase().indexOf(CLIENT.name.toUpperCase()) != -1) {
|
if(data.msg.toUpperCase().indexOf(CLIENT.name.toUpperCase()) != -1) {
|
||||||
div.addClass("nick-highlight");
|
div.addClass("nick-highlight");
|
||||||
if(!FOCUSED && !TITLE_BLINK) {
|
if(!FOCUSED && !TITLE_BLINK) {
|
||||||
|
USEROPTS.boop && CHATSOUND.play();
|
||||||
TITLE_BLINK = setInterval(function() {
|
TITLE_BLINK = setInterval(function() {
|
||||||
if(document.title == "*Chat*")
|
if(document.title == "*Chat*")
|
||||||
document.title = PAGETITLE;
|
document.title = PAGETITLE;
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue