webstaff: audio disable and testing options
authorBill Erickson <berickxx@gmail.com>
Tue, 17 May 2016 03:16:34 +0000 (23:16 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 18 Aug 2016 19:34:21 +0000 (15:34 -0400)
For workstation admin UI.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/templates/staff/admin/workstation/t_splash.tt2
Open-ILS/web/js/ui/default/staff/admin/workstation/app.js

index 8ceb795..360f6d7 100644 (file)
   </div>
 
   <div class="row new-entry">
+    <div class="col-md-2">
+      <div class="checkbox">
+        <label>
+          <input type="checkbox"
+            ng-model="disable_sound" 
+              ng-change="apply_sound()">
+            [% l('Disable Sounds?') %]
+        </label>
+      </div>
+    </div>
+    <div class="col-md-4">
+      <span>Test: </span>
+      <button class="btn btn-success" ng-class="{disabled : disable_sound}" 
+        ng-click="test_audio('success')">[% l('Success') %]</button>
+      <button class="btn btn-info" ng-class="{disabled : disable_sound}" 
+        ng-click="test_audio('info')">[% l('Info') %]</button>
+      <button class="btn btn-warning" ng-class="{disabled : disable_sound}" 
+        ng-click="test_audio('warning')">[% l('Warning') %]</button>
+      <button class="btn btn-danger" ng-class="{disabled : disable_sound}" 
+        ng-click="test_audio('error')">[% l('Error') %]</button>
+    </div>
+  </div>
+
+  <div class="row new-entry">
     <div class="col-md-6">
       <span class="glyphicon glyphicon-print"></span>
       <a target="_self" href="./admin/workstation/print/config">
index 4924f9d..d31c5fd 100644 (file)
@@ -172,6 +172,23 @@ function($scope , $window , $location , egCore , egConfirmDialog) {
         egCore.hatch.setLocalItem(
             'eg.hatch.url', $scope.hatchURL);
     }
+
+    egCore.hatch.getItem('eg.audio.disable').then(function(val) {
+        $scope.disable_sound = val;
+    });
+
+    $scope.apply_sound = function() {
+        if ($scope.disable_sound) {
+            egCore.hatch.setItem('eg.audio.disable', true);
+        } else {
+            egCore.hatch.removeItem('eg.audio.disable');
+        }
+    }
+
+    $scope.test_audio = function(sound) {
+        egCore.audio.play(sound);
+    }
+
 }])
 
 .controller('PrintConfigCtrl',