From 6210a1a28fd05c75b6e88bda59c1dd55c1fb2f7b Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Fri, 23 May 2014 11:07:56 +0200 Subject: [PATCH] [UPDATE] changed behavior and use jQuery --- .../bootstrap/dashboard/blocks/default.tpl | 4 ++-- templates/bootstrap/dashboard/default.tpl | 13 ------------- templates/bootstrap/dashboard/js/api.tpl | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/templates/bootstrap/dashboard/blocks/default.tpl b/templates/bootstrap/dashboard/blocks/default.tpl index 85201d0c..376e9d08 100644 --- a/templates/bootstrap/dashboard/blocks/default.tpl +++ b/templates/bootstrap/dashboard/blocks/default.tpl @@ -38,8 +38,8 @@ -{/if} +{/if} \ No newline at end of file diff --git a/templates/bootstrap/dashboard/default.tpl b/templates/bootstrap/dashboard/default.tpl index dbb3b8aa..e042fa1e 100644 --- a/templates/bootstrap/dashboard/default.tpl +++ b/templates/bootstrap/dashboard/default.tpl @@ -1,19 +1,6 @@ {if $smarty.session.AUTHENTICATED|default} -
diff --git a/templates/bootstrap/dashboard/js/api.tpl b/templates/bootstrap/dashboard/js/api.tpl index f81a1fe0..f2c2b7f3 100644 --- a/templates/bootstrap/dashboard/js/api.tpl +++ b/templates/bootstrap/dashboard/js/api.tpl @@ -5,6 +5,7 @@ $(document).ready(function(){ var audioPath = "{/literal}{$PATH}{literal}/audio/"; var manifest = [ {id:"ding", src:"ding.ogg"} ]; + var muteFlag = 1; createjs.Sound.alternateExtensionseExtensions = ["mp3"]; createjs.Sound.registerManifest(manifest, audioPath); @@ -250,6 +251,23 @@ $(document).ready(function(){ } }); })(); + + // Mute Button + $('#muteButton').click(function(){ + if(muteFlag == 2) { + muteFlag = 1; + createjs.Sound.setMute(false); + $(this).toggleClass("btn-xs btn-danger").toggleClass("btn-xs btn-success"); + //$(this).find($(".fa")).removeClass('fa-volume-off').addClass('fa-volume-up'); + } else { + muteFlag = 2; + createjs.Sound.setMute(true); + $(this).toggleClass("btn-xs btn-success").toggleClass("btn-xs btn-danger"); + //$(this).find($(".fa")).removeClass('fa-volume-up').addClass('fa-volume-off'); + } + }); + + }); {/literal}