Bug 11431: (QA followup) Allow https in sound URLs
authorKyle M Hall <kyle@bywatersolutions.com>
Mon, 27 Apr 2015 11:49:50 +0000 (07:49 -0400)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 4 Nov 2015 15:32:58 +0000 (12:32 -0300)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js

index 3552e18..af4a3e1 100644 (file)
@@ -122,8 +122,7 @@ function confirmDelete(message) {
 }
 
 function playSound( sound ) {
-    // This is way faster than substring
-    if ( ! ( sound.charAt(4) == ':' && sound.charAt(5) == '/' && sound.charAt(6) == '/' ) ) {
+    if ( ! ( sound.indexOf('http://') == 0 || sound.indexOf('https://') == 0  ) {
         sound = AUDIO_ALERT_PATH + sound;
     }
     document.getElementById("audio-alert").innerHTML = '<audio src="' + sound + '" autoplay="autoplay" autobuffer="autobuffer"></audio>';