2008-07-14 21:54:50 +08:00
|
|
|
//
|
|
|
|
// Import constants
|
|
|
|
//
|
2014-12-05 07:44:23 +08:00
|
|
|
var STATE_IDLE = <?php echo STATE_IDLE ?>;
|
|
|
|
var STATE_PREALARM = <?php echo STATE_PREALARM ?>;
|
|
|
|
var STATE_ALARM = <?php echo STATE_ALARM ?>;
|
|
|
|
var STATE_ALERT = <?php echo STATE_ALERT ?>;
|
|
|
|
var STATE_TAPE = <?php echo STATE_TAPE ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
|
|
|
var stateStrings = new Array();
|
2015-05-10 21:10:30 +08:00
|
|
|
stateStrings[STATE_IDLE] = "<?php echo translate('Idle') ?>";
|
|
|
|
stateStrings[STATE_PREALARM] = "<?php echo translate('Idle') ?>";
|
|
|
|
stateStrings[STATE_ALARM] = "<?php echo translate('Alarm') ?>";
|
|
|
|
stateStrings[STATE_ALERT] = "<?php echo translate('Alert') ?>";
|
|
|
|
stateStrings[STATE_TAPE] = "<?php echo translate('Record') ?>";
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2015-05-10 21:10:30 +08:00
|
|
|
var deleteString = "<?php echo translate('Delete') ?>";
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var CMD_NONE = <?php echo CMD_NONE ?>;
|
|
|
|
var CMD_PAUSE = <?php echo CMD_PAUSE ?>;
|
|
|
|
var CMD_PLAY = <?php echo CMD_PLAY ?>;
|
|
|
|
var CMD_STOP = <?php echo CMD_STOP ?>;
|
|
|
|
var CMD_FASTFWD = <?php echo CMD_FASTFWD ?>;
|
|
|
|
var CMD_SLOWFWD = <?php echo CMD_SLOWFWD ?>;
|
|
|
|
var CMD_SLOWREV = <?php echo CMD_SLOWREV ?>;
|
|
|
|
var CMD_FASTREV = <?php echo CMD_FASTREV ?>;
|
|
|
|
var CMD_ZOOMIN = <?php echo CMD_ZOOMIN ?>;
|
|
|
|
var CMD_ZOOMOUT = <?php echo CMD_ZOOMOUT ?>;
|
|
|
|
var CMD_PAN = <?php echo CMD_PAN ?>;
|
|
|
|
var CMD_SCALE = <?php echo CMD_SCALE ?>;
|
|
|
|
var CMD_PREV = <?php echo CMD_PREV ?>;
|
|
|
|
var CMD_NEXT = <?php echo CMD_NEXT ?>;
|
|
|
|
var CMD_SEEK = <?php echo CMD_SEEK ?>;
|
|
|
|
var CMD_QUERY = <?php echo CMD_QUERY ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var SCALE_BASE = <?php echo SCALE_BASE ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var SOUND_ON_ALARM = <?php echo ZM_WEB_SOUND_ON_ALARM ?>;
|
|
|
|
var POPUP_ON_ALARM = <?php echo ZM_WEB_POPUP_ON_ALARM ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var streamMode = "<?php echo $streamMode ?>";
|
|
|
|
var showMode = "<?php echo ($showPtzControls && !empty($control))?"control":"events" ?>";
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var connKey = '<?php echo $connkey ?>';
|
|
|
|
var maxDisplayEvents = <?php echo 2 * MAX_EVENTS ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2015-12-02 04:17:49 +08:00
|
|
|
|
2015-12-02 03:30:24 +08:00
|
|
|
var monitorId = <?php echo $monitor->Id() ?>;
|
|
|
|
var monitorWidth = <?php echo $monitor->Width() ?>;
|
|
|
|
var monitorHeight = <?php echo $monitor->Height() ?>;
|
2015-12-02 04:17:49 +08:00
|
|
|
var monitorUrl = '<?php echo ( $monitor->Server()->Url() ) ?>';
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var scale = <?php echo $scale ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var streamSrc = "<?php echo preg_replace( '/&/', '&', $streamSrc ) ?>";
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var statusRefreshTimeout = <?php echo 1000*ZM_WEB_REFRESH_STATUS ?>;
|
|
|
|
var eventsRefreshTimeout = <?php echo 1000*ZM_WEB_REFRESH_EVENTS ?>;
|
|
|
|
var imageRefreshTimeout = <?php echo 1000*ZM_WEB_REFRESH_IMAGE ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var canEditMonitors = <?php echo canEdit( 'Monitors' )?'true':'false' ?>;
|
|
|
|
var canStreamNative = <?php echo canStreamNative()?'true':'false' ?>;
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2011-06-21 17:19:10 +08:00
|
|
|
var canPlayPauseAudio = Browser.ie;
|
2009-05-26 02:03:46 +08:00
|
|
|
|
2015-12-02 03:30:24 +08:00
|
|
|
<?php if ( $monitor->CanMoveMap() ) { ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
var imageControlMode = "moveMap";
|
2015-12-02 03:30:24 +08:00
|
|
|
<?php } elseif ( $monitor->CanMoveRel() ) { ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
var imageControlMode = "movePseudoMap";
|
2015-12-02 03:30:24 +08:00
|
|
|
<?php } elseif ( $monitor->CanMoveCon() ) { ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
var imageControlMode = "moveConMap";
|
|
|
|
<?php } else { ?>
|
|
|
|
var imageControlMode = null;
|
|
|
|
<?php } ?>
|
2009-05-26 02:03:46 +08:00
|
|
|
|
2014-12-05 07:44:23 +08:00
|
|
|
var refreshApplet = <?php echo (canStreamApplet() && $streamMode == "jpeg")?'true':'false' ?>;
|
|
|
|
var appletRefreshTime = <?php echo ZM_RELOAD_CAMBOZOLA ?>;
|