From fb3f8dda3f4791b9f0bedd7b0625e077ce0f4d60 Mon Sep 17 00:00:00 2001 From: jcass Date: Sun, 24 Jan 2016 21:29:32 +0200 Subject: [PATCH] Fix mute/unmute functionality: now also works if user unmutes by sliding volume manually. --- README.rst | 1 + .../static/images/icons/play_alt_12x12.png | Bin 0 -> 275 bytes .../static/images/icons/play_alt_16x16.png | Bin 0 -> 283 bytes mopidy_musicbox_webclient/static/index.html | 2 +- .../static/js/controls.js | 21 +++++++++++++----- mopidy_musicbox_webclient/static/mb.manifest | 4 +++- 6 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 mopidy_musicbox_webclient/static/images/icons/play_alt_12x12.png create mode 100644 mopidy_musicbox_webclient/static/images/icons/play_alt_16x16.png diff --git a/README.rst b/README.rst index 6a983b1..c7f1b14 100644 --- a/README.rst +++ b/README.rst @@ -63,6 +63,7 @@ v2.0.1 (UNRELEASED) - Increase volume slider handle by 30% to make it easier to grab on mobile devices - Add application cache manifest file for quicker loads and to allow client devices to detect when local caches should be invalidated. - Fix vertical alignment of playback control buttons in footer. +- Swop mute/unmute icons and apply fix to restore volume levels after unmute. v2.0.0 (26-3-2015) ------------------ diff --git a/mopidy_musicbox_webclient/static/images/icons/play_alt_12x12.png b/mopidy_musicbox_webclient/static/images/icons/play_alt_12x12.png new file mode 100644 index 0000000000000000000000000000000000000000..4d23adaf331802ba8fbdac4e68bc68290f1683b8 GIT binary patch literal 275 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWw1GTRmMILn>}1r8G2!W?$20SXrgO$B@Lh;sd+FJ%%H_iHeQ< z4op1(N7)>*>?b*uFkE`UaiyeDFzZvLP1i(INh8O(jKMXGDYhX(vJF?R7(3qOF=x%l zWu6drWT9aL=j`BySp}IQ2}ufq8yrd(-(ce55ZKSq@%iEtI|IkVlJ5)`Buxl@x0scU zCnuqCm!McATR@L?g!Ie>hA%plH7+W@V-z+Cad?=|afJJVNnJyiq|;Rc1{Mhhg+z-U U*#&B>Ko2l@y85}Sb4q9e0Ame6t3(I0e8UZa6b|8#1Y6Eok_)n~H^(x3{ajbP0l+XkKjuKZS literal 0 HcmV?d00001 diff --git a/mopidy_musicbox_webclient/static/index.html b/mopidy_musicbox_webclient/static/index.html index b2e64ea..0bb856f 100644 --- a/mopidy_musicbox_webclient/static/index.html +++ b/mopidy_musicbox_webclient/static/index.html @@ -117,7 +117,7 @@
  • - + diff --git a/mopidy_musicbox_webclient/static/js/controls.js b/mopidy_musicbox_webclient/static/js/controls.js index c0c279c..4106aa0 100644 --- a/mopidy_musicbox_webclient/static/js/controls.js +++ b/mopidy_musicbox_webclient/static/js/controls.js @@ -423,19 +423,28 @@ function doVolume(value) { } function triggerVolume() { - mopidy.playback.setVolume(parseInt(volumeChanging)); + if (volumeChanging > 0) { + $("#mutebt").attr('class', 'fa fa-volume-off'); + muteVolume = -1; + } else { + $("#mutebt").attr('class', 'fa fa-volume-up'); + muteVolume = currentVolume; + } + mopidy.playback.setVolume(parseInt(volumeChanging)).then(); + currentVolume = volumeChanging volumeChanging = 0; } function doMute() { //only emit the event, not the status if (muteVolume == -1) { - $("#mutebt").attr('src', 'images/icons/volume_mute_24x18.png'); - muteVolume = currentVolume; - mopidy.playback.setVolume(0).then(); + $("#mutebt").attr('class', 'fa fa-volume-up'); + volumeChanging = 0; + triggerVolume(); } else { - $("#mutebt").attr('src', 'images/icons/volume_24x18.png'); - mopidy.playback.setVolume(muteVolume).then(); + $("#mutebt").attr('class', 'fa fa-volume-off'); + volumeChanging = muteVolume; + triggerVolume(); muteVolume = -1; } diff --git a/mopidy_musicbox_webclient/static/mb.manifest b/mopidy_musicbox_webclient/static/mb.manifest index 7d2862d..144a601 100644 --- a/mopidy_musicbox_webclient/static/mb.manifest +++ b/mopidy_musicbox_webclient/static/mb.manifest @@ -1,6 +1,6 @@ CACHE MANIFEST -# 2016-01-24:v1 +# 2016-01-24:v2 CACHE: index.html @@ -41,6 +41,8 @@ images/icons/musicbox32.png images/icons/musicbox57.png images/icons/musicbox72.png images/icons/musicbox114.png +images/icons/play_alt_12x12.png +images/icons/play_alt_16x16.png images/default_cover.png images/empty.png