From 5bd148d7b5c9d867d748b481cb6a21d5680f4286 Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Mon, 16 Jun 2014 23:16:22 +0200 Subject: [PATCH] Make it pop --- client/audio/pop.ogg | Bin 0 -> 11652 bytes client/js/chat.js | 11 ++++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 client/audio/pop.ogg diff --git a/client/audio/pop.ogg b/client/audio/pop.ogg new file mode 100644 index 0000000000000000000000000000000000000000..1fe623f5a6199ce77327c80ff7b707300edd6b56 GIT binary patch literal 11652 zcmb_?bzD?U7w`o^Qlz`3mabJ&Nr9zdmoDj&Mnn`*>2_ICI;BNQDN*Teq!FY`VnGz) zyNl2JywCId{`lTMzWL1#b7sz*JE!KHxfg8*2Ymn=_^YVZ#28_^t>=Q#Sj<=t+`X)w zyfFjVN@ZZX3nKpYdxxcsS^0Otti%GL$c=k9Nd+$cRXnf!A;bjE8##G63Tk^fu(~=~ z8(flSRbv$u78Vnh6qdwL!@~W8%%`AefCb=#BO)3+Z9zlv2ml}j0M?Y7q%K9Z6DBUt z^B4A3!%Jhti#y~Q>=R+Md@BWkWSVY#G+lS zFEm6q^7CS)Hp{99q=*D+h7^da+Q{|qLno%aNqcw-PBEk-2S z1et8Sxm?bOXX--+bc z7K0-6Wf5@bxW4Q-9PvMtXP5Q@GJ=(1pW+;ZFNQR}6iX0Dmh>61KJlL?fe5NEzi~t$ z6ZBw`#K?AzVief(r%X_RcGLb>jhG%Wa)sw|RxKLY&Qq+1!9yi*L%Y9#y}#5A;u*&y zxdk@p!Jb+y@~Xhp7&sfDhvJc(%KR6-(`?jrh0A5{rxRRcFMD)(sPAh3C57qr{4pOn z00{D&;0eo3Sbyvp>Qx9)VgzyKPTiZ&d-hHEh&53C)&$j{a3S92HGtPv}c5!VUq7u(tXf?O_QI@)celVJ(>Fwvmg<>{Euq$x90!~pif@9Bg#5bWG(vz zsRHDWg8%XyWlze^myBvi4)wSE{UhKL#I=u<29Mx_RCdGE_Xp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1N2JPLv;q~wS5A3;^<2psMF5dT!ZRCD9H}C}BAODn<)wGq7 n33yOrSUUds^JiO1c&PwllH94Vh+${gQT$N=U-?W%H}HP|oa+*c literal 0 HcmV?d00001 diff --git a/client/js/chat.js b/client/js/chat.js index 52670e2f..43cc60d0 100644 --- a/client/js/chat.js +++ b/client/js/chat.js @@ -165,6 +165,9 @@ $(function() { } } + var pop = new Audio(); + pop.src = "/audio/pop.ogg"; + var viewport = $("#viewport"); var touchDevice = (window.screen.width <= 768); @@ -225,6 +228,10 @@ $(function() { chat.on("append", ".messages", function() { var messages = $(this); var id = messages.closest(".window").find(".form").data("target"); + var last = messages.find(".row:last-child"); + if (last.hasClass("highlight")) { + pop.play(); + } var link = $("#channel-" + id + ":not(.active)"); if (link.length == 0) { @@ -236,9 +243,7 @@ $(function() { link.removeClass("pulse"); }, 500); - var last = messages.find(".row:last-child"); var type = last.attr("class"); - var ignore = [ "join", "part", @@ -255,7 +260,7 @@ $(function() { if (badge.length != 0) { var i = (parseInt(badge.html()) || 0) + 1; badge.html(i); - if (messages.children().last().hasClass("highlight")) { + if (last.hasClass("highlight")) { badge.addClass("highlight"); } }