Test Plan:
1) Enable audio alerts
2) Note audio alerts don't work
3) Apply this patch
4) Note audio alerts now work
Use complex selectors to test:
#circ_returns p.problem:contains('Not checked out.')
#doc3 > #bd
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
[% USE raw %]
[% USE Asset %]
[% USE AudioAlerts %]
+[% USE To %]
[%# Prevent XFS attacks -%]
[% UNLESS popup %]
<script type="text/javascript">
<script type="text/javascript">
//<![CDATA[
var AUDIO_ALERT_PATH = '[% interface | html %]/[% theme | html %]/sound/';
- var AUDIO_ALERTS = JSON.parse( '[% AudioAlerts.AudioAlerts | replace( "'", "\\'" ) | replace( '"', '\\"' ) | html %]' );
+ var AUDIO_ALERTS = JSON.parse( "[% To.json(AudioAlerts.AudioAlerts) | $raw %]" );
//]]>
$( document ).ready(function() {