@@ -, +, @@ web based self checkout Selector: .sco_entry Sound: https://archive.org/download/Doorbell_1/doorbell.ogg --- .../opac-tmpl/bootstrap/en/modules/sco/sco-main.tt | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt @@ -1,5 +1,6 @@ [% USE Koha %] [% USE KohaDates %] +[% USE AudioAlerts %] [% INCLUDE 'doc-head-open.inc' %] [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha [% END %] › Self checkout @@ -315,6 +316,8 @@ + + [% INCLUDE 'opac-bottom.inc' %] [% BLOCK jsinclude %] @@ -353,6 +356,26 @@ } return true; } + [% IF Koha.Preference('AudioAlerts') %] + var AUDIO_ALERTS = JSON.parse( '[% AudioAlerts.AudioAlerts | replace( "'", "\\'" ) | replace( '"', '\\"' ) %]' ); + $( document ).ready(function() { + if ( AUDIO_ALERTS ) { + for ( var k in AUDIO_ALERTS ) { + var alert = AUDIO_ALERTS[k]; + if ( $( alert.selector ).length ) { + playSound( alert.sound ); + break; + } + } + } + }); + function playSound( sound ) { + if ( ( sound.indexOf('http://') == 0 || sound.indexOf('https://') == 0 ) ) { + document.getElementById("audio-alert").innerHTML = ''; + } + } + [% END %] + $(document).ready(function() { dofocus(); --