events sound pandora_enterprise#7960
This commit is contained in:
parent
c7088f9f19
commit
f6de9fb0a0
|
@ -2089,7 +2089,6 @@ if ($get_events_fired) {
|
||||||
foreach ($data as $event) {
|
foreach ($data as $event) {
|
||||||
$return[] = [
|
$return[] = [
|
||||||
'fired' => $event['id_evento'],
|
'fired' => $event['id_evento'],
|
||||||
'sound' => 'include/sounds/Star_Trek_emergency_simulation.wav',
|
|
||||||
'message' => ui_print_string_substr(
|
'message' => ui_print_string_substr(
|
||||||
strip_tags(io_safe_output($event['evento'])),
|
strip_tags(io_safe_output($event['evento'])),
|
||||||
75,
|
75,
|
||||||
|
|
|
@ -962,12 +962,20 @@ if ($pure) {
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function openSoundEventWindow() {
|
function openSoundEventWindow() {
|
||||||
url = "<?php echo ui_get_full_url('operation/events/sound_events.php'); ?>";
|
url = '<?php echo ui_get_full_url('operation/events/sound_events.php'); ?>';
|
||||||
|
// devicePixelRatio knows how much zoom browser applied.
|
||||||
|
var windowScale = parseFloat(window.devicePixelRatio);
|
||||||
|
var defaultWidth = 630;
|
||||||
|
var defaultHeight = 630;
|
||||||
|
// If the scale is 1, no zoom has been applied.
|
||||||
|
var windowWidth = windowScale <= 1 ? defaultWidth : windowScale*defaultWidth;
|
||||||
|
var windowHeight = windowScale <= 1 ? defaultHeight : windowScale*defaultHeight + (defaultHeight*0.1);
|
||||||
|
|
||||||
window.open(
|
window.open(
|
||||||
url,
|
url,
|
||||||
'<?php __('Sound Alerts'); ?>',
|
'<?php __('Sound Alerts'); ?>',
|
||||||
'width=600, height=450, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no'
|
'width='+windowWidth+', height='+windowHeight+', resizable=yes, toolbar=no, location=no, directories=no, status=no, menubar=no'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -109,7 +109,7 @@ ui_require_css_file('discovery');
|
||||||
}
|
}
|
||||||
|
|
||||||
.events_fired li div.flex-time {
|
.events_fired li div.flex-time {
|
||||||
flex: 0 1 75px;
|
flex: 0 1 100px;
|
||||||
text-align: end;
|
text-align: end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,6 +238,33 @@ $inputs[] = [
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$sounds = [
|
||||||
|
'aircraftalarm.wav' => 'Air craft alarm',
|
||||||
|
'air_shock_alarm.wav' => 'Air shock alarm',
|
||||||
|
'alien_alarm.wav' => 'Alien alarm',
|
||||||
|
'alien_beacon.wav' => 'Alien beacon',
|
||||||
|
'bell_school_ringing.wav' => 'Bell school ringing',
|
||||||
|
'Door_Alarm.wav' => 'Door alarm',
|
||||||
|
'EAS_beep.wav' => 'EAS beep',
|
||||||
|
'Firewarner.wav' => 'Fire warner',
|
||||||
|
'HardPCMAlarm.wav' => 'Hard PCM Alarm',
|
||||||
|
'negativebeep.wav' => 'Negative beep',
|
||||||
|
'Star_Trek_emergency_simulation.wav' => 'StarTrek emergency simulation',
|
||||||
|
];
|
||||||
|
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => \__('Sounds'),
|
||||||
|
'class' => 'flex-row',
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'select',
|
||||||
|
'fields' => $sounds,
|
||||||
|
'name' => 'sound_id',
|
||||||
|
'selected' => 'Star_Trek_emergency_simulation.wav',
|
||||||
|
'return' => true,
|
||||||
|
'class' => 'fullwidth',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
// Print form.
|
// Print form.
|
||||||
HTML::printForm(
|
HTML::printForm(
|
||||||
[
|
[
|
||||||
|
@ -375,6 +402,7 @@ function forgetPreviousEvents() {
|
||||||
|
|
||||||
function check_event() {
|
function check_event() {
|
||||||
if (running) {
|
if (running) {
|
||||||
|
var sound = '../../include/sounds/' + $('#sound_id').val();
|
||||||
jQuery.post ("../../ajax.php",
|
jQuery.post ("../../ajax.php",
|
||||||
{
|
{
|
||||||
"page" : "include/ajax/events",
|
"page" : "include/ajax/events",
|
||||||
|
@ -392,12 +420,11 @@ function check_event() {
|
||||||
'src','../../images/sound_events_console_alert.gif'
|
'src','../../images/sound_events_console_alert.gif'
|
||||||
);
|
);
|
||||||
$('audio').remove();
|
$('audio').remove();
|
||||||
if(data[0].sound == '') {
|
|
||||||
data[0].sound = 'include/sounds/Star_Trek_emergency_simulation.wav';
|
|
||||||
}
|
|
||||||
|
|
||||||
$('body')
|
$('body')
|
||||||
.append("<audio id='audio-boom' src='../../" + data[0].sound + "' autoplay='true' hidden='true' loop='true' >");
|
.append(
|
||||||
|
"<audio id='audio-boom' src='" + sound + "' autoplay='true' hidden='true' loop='true' >"
|
||||||
|
);
|
||||||
|
|
||||||
data.forEach(function (element) {
|
data.forEach(function (element) {
|
||||||
var li = document.createElement('li');
|
var li = document.createElement('li');
|
||||||
|
|
|
@ -420,7 +420,6 @@ if (check_acl($config['id_user'], 0, 'ER')
|
||||||
|
|
||||||
// Sound Events.
|
// Sound Events.
|
||||||
$javascript = "javascript: window.open('operation/events/sound_events.php');";
|
$javascript = "javascript: window.open('operation/events/sound_events.php');";
|
||||||
$javascript = 'javascript: alert(111);';
|
|
||||||
$javascript = 'javascript: openSoundEventWindow();';
|
$javascript = 'javascript: openSoundEventWindow();';
|
||||||
$sub[$javascript]['text'] = __('Sound Events');
|
$sub[$javascript]['text'] = __('Sound Events');
|
||||||
$sub[$javascript]['id'] = 'Sound Events';
|
$sub[$javascript]['id'] = 'Sound Events';
|
||||||
|
@ -432,12 +431,12 @@ if (check_acl($config['id_user'], 0, 'ER')
|
||||||
url = '<?php echo ui_get_full_url('operation/events/sound_events.php'); ?>';
|
url = '<?php echo ui_get_full_url('operation/events/sound_events.php'); ?>';
|
||||||
// devicePixelRatio knows how much zoom browser applied.
|
// devicePixelRatio knows how much zoom browser applied.
|
||||||
var windowScale = parseFloat(window.devicePixelRatio);
|
var windowScale = parseFloat(window.devicePixelRatio);
|
||||||
var defaultWidth = 600;
|
var defaultWidth = 630;
|
||||||
var defaultHeight = 450;
|
var defaultHeight = 630;
|
||||||
// If the scale is 1, no zoom has been applied.
|
// If the scale is 1, no zoom has been applied.
|
||||||
var windowWidth = windowScale <= 1 ? defaultWidth : windowScale*defaultWidth;
|
var windowWidth = windowScale <= 1 ? defaultWidth : windowScale*defaultWidth;
|
||||||
var windowHeight = windowScale <= 1 ? defaultHeight : windowScale*defaultHeight + (defaultHeight*0.1);
|
var windowHeight = windowScale <= 1 ? defaultHeight : windowScale*defaultHeight + (defaultHeight*0.1);
|
||||||
|
|
||||||
window.open(
|
window.open(
|
||||||
url,
|
url,
|
||||||
'<?php __('Sound Alerts'); ?>',
|
'<?php __('Sound Alerts'); ?>',
|
||||||
|
|
Loading…
Reference in New Issue