From 6173680e927ddc76081a2c116c0407b71a08b37b Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Mon, 17 Apr 2017 15:43:43 -0400 Subject: [PATCH] webstaff: sound effects for patron search Signed-off-by: Jason Etheridge Signed-off-by: Mike Rylander --- Open-ILS/web/js/ui/default/staff/circ/patron/app.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js index 8a8e326b68..7f0e0d881c 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js @@ -989,6 +989,7 @@ function($scope, $q, $routeParams, $timeout, $window, $location, egCore, egProgressDialog.open(); // Indeterminate patronSvc.patrons = []; + var which_sound = 'success'; egCore.net.request( 'open-ils.actor', 'open-ils.actor.patron.search.advanced.fleshed', @@ -1005,7 +1006,9 @@ function($scope, $q, $routeParams, $timeout, $window, $location, egCore, function() { deferred.resolve(); }, - null, // onerror + function() { // onerror + which_sound = 'error'; + }, function(user) { // hide progress bar as soon as the first result appears. egProgressDialog.close(); @@ -1013,7 +1016,13 @@ function($scope, $q, $routeParams, $timeout, $window, $location, egCore, patronSvc.patrons.push(user); deferred.notify(user); } - )['finally'](egProgressDialog.close); // close on 0-hits or error + )['finally'](function() { // close on 0-hits or error + if (which_sound == 'success' && patronSvc.patrons.length == 0) { + which_sound = 'warning'; + } + egCore.audio.play(which_sound + '.patron.by_search'); + egProgressDialog.close(); + }); return deferred.promise; }; -- 2.43.2