Bugzilla – Attachment 55453 Details for
Bug 16732
Add audio alerts (custom sound notifications) to web based self checkout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 16732 - Add audio alerts (custom sound notifications) to web based self checkout
SIGNED-OFF-Bug-16732---Add-audio-alerts-custom-sou.patch (text/plain), 3.02 KB, created by
Owen Leonard
on 2016-09-09 17:25:30 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 16732 - Add audio alerts (custom sound notifications) to web based self checkout
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2016-09-09 17:25:30 UTC
Size:
3.02 KB
patch
obsolete
>From 9ca148fbf7523257f4defb02870a5a17888437eb Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 15 Aug 2016 19:58:52 +0000 >Subject: [PATCH] [SIGNED-OFF] Bug 16732 - Add audio alerts (custom sound > notifications) to web based self checkout >Content-Type: text/plain; charset="utf-8" > >This patch adds the infrastructure needed to allow audio alerts, as >configured in administration, to affect the sco module > >This patch allows only for the use of sounds with a full URL to be used >and does not allow for the Koha standard sounds to be accessed via the >SCO > >To test: >Ensure you have the preference AudioAlerts enabled >Ensure you can hear normal sounds from the staff module >Define an audio alert such as: > Selector: .sco_entry > Sound: https://archive.org/download/Doorbell_1/doorbell.ogg >Load the SCO module >You should hear the doorbell noise (everytime you reload even!) >Test that the default sounds are not activated for the SCO, you must >sepcifically define them > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../opac-tmpl/bootstrap/en/modules/sco/sco-main.tt | 23 ++++++++++++++++++++++ > 1 file changed, 23 insertions(+) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >index 42d2508..11147ae 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >+++ b/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' %] > <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha [% END %] › Self checkout </title> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> >@@ -315,6 +316,8 @@ > </div> <!-- / .row-fluid --> > </div> <!-- / .container-fluid --> > </div> <!-- / .main --> >+ <span id="audio-alert"></span> >+</body> > > [% 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 = '<audio src="' + sound + '" autoplay="autoplay" autobuffer="autobuffer"></audio>'; >+ } >+ } >+ [% END %] >+ > > $(document).ready(function() { > dofocus(); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16732
:
54492
|
55453
|
55523