Removing most legacy ui files from bootstrap skin
|
@ -1,15 +0,0 @@
|
|||
AUTOMAKE_OPTIONS = gnu
|
||||
|
||||
webdir = @WEB_PREFIX@/skins/classic
|
||||
|
||||
SUBDIRS = \
|
||||
ajax \
|
||||
css \
|
||||
graphics \
|
||||
includes \
|
||||
js \
|
||||
lang \
|
||||
views
|
||||
|
||||
dist_web_DATA = \
|
||||
skin.php
|
|
@ -1,5 +0,0 @@
|
|||
AUTOMAKE_OPTIONS = gnu
|
||||
|
||||
webdir = @WEB_PREFIX@/skins/classic/ajax
|
||||
|
||||
dist_web_DATA = # No files here
|
|
@ -1,23 +0,0 @@
|
|||
AUTOMAKE_OPTIONS = gnu
|
||||
|
||||
webdir = @WEB_PREFIX@/skins/classic/graphics
|
||||
|
||||
dist_web_DATA = \
|
||||
arrow-d.gif \
|
||||
arrow-dl.gif \
|
||||
arrow-dr.gif \
|
||||
arrow-l-d.gif \
|
||||
arrow-l.gif \
|
||||
arrow-l-u.gif \
|
||||
arrow-r.gif \
|
||||
arrow-s-d.gif \
|
||||
arrow-s-u.gif \
|
||||
arrow-u.gif \
|
||||
arrow-ul.gif \
|
||||
arrow-ur.gif \
|
||||
center.gif \
|
||||
point-g.gif \
|
||||
point-o.gif \
|
||||
point-r.gif \
|
||||
seq-d.gif \
|
||||
seq-u.gif
|
Before Width: | Height: | Size: 293 B |
Before Width: | Height: | Size: 232 B |
Before Width: | Height: | Size: 263 B |
Before Width: | Height: | Size: 538 B |
Before Width: | Height: | Size: 524 B |
Before Width: | Height: | Size: 284 B |
Before Width: | Height: | Size: 265 B |
Before Width: | Height: | Size: 206 B |
Before Width: | Height: | Size: 203 B |
Before Width: | Height: | Size: 278 B |
Before Width: | Height: | Size: 286 B |
Before Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 621 B |
Before Width: | Height: | Size: 76 B |
Before Width: | Height: | Size: 76 B |
Before Width: | Height: | Size: 76 B |
Before Width: | Height: | Size: 68 B |
Before Width: | Height: | Size: 68 B |
|
@ -1,11 +0,0 @@
|
|||
AUTOMAKE_OPTIONS = gnu
|
||||
|
||||
webdir = @WEB_PREFIX@/skins/classic/includes
|
||||
|
||||
dist_web_DATA = \
|
||||
init.php \
|
||||
config.php \
|
||||
functions.php \
|
||||
control_functions.php \
|
||||
export_functions.php \
|
||||
timeline_functions.php
|
|
@ -1,112 +0,0 @@
|
|||
<?php
|
||||
//
|
||||
// ZoneMinder HTML configuration file, $Date$, $Revision$
|
||||
// Copyright (C) 2001-2008 Philip Coombes
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
|
||||
$rates = array(
|
||||
"10000" => "100x",
|
||||
"5000" => "50x",
|
||||
"2500" => "25x",
|
||||
"1000" => "10x",
|
||||
"400" => "4x",
|
||||
"200" => "2x",
|
||||
"100" => $SLANG['Real'],
|
||||
"50" => "1/2x",
|
||||
"25" => "1/4x",
|
||||
);
|
||||
|
||||
$scales = array(
|
||||
"400" => "4x",
|
||||
"300" => "3x",
|
||||
"200" => "2x",
|
||||
"150" => "1.5x",
|
||||
"100" => $SLANG['Actual'],
|
||||
"75" => "3/4x",
|
||||
"50" => "1/2x",
|
||||
"33" => "1/3x",
|
||||
"25" => "1/4x",
|
||||
);
|
||||
|
||||
$bwArray = array(
|
||||
"high" => $SLANG['High'],
|
||||
"medium" => $SLANG['Medium'],
|
||||
"low" => $SLANG['Low']
|
||||
);
|
||||
|
||||
switch ( $_COOKIE['zmBandwidth'] )
|
||||
{
|
||||
case "high" :
|
||||
{
|
||||
define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_H_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes
|
||||
define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_H_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor
|
||||
define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_H_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
|
||||
define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_H_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window
|
||||
define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_H_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events
|
||||
define( "ZM_WEB_CAN_STREAM", ZM_WEB_H_CAN_STREAM ); // Override the automatic detection of browser streaming capability
|
||||
define( "ZM_WEB_STREAM_METHOD", ZM_WEB_H_STREAM_METHOD ); // Which method should be used to send video streams to your browser
|
||||
define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_H_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%)
|
||||
define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_H_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%)
|
||||
define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_H_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
|
||||
define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_H_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
|
||||
define( "ZM_WEB_SCALE_THUMBS", ZM_WEB_H_SCALE_THUMBS ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
|
||||
define( "ZM_WEB_EVENTS_VIEW", ZM_WEB_H_EVENTS_VIEW ); // What the default view of multiple events should be.
|
||||
define( "ZM_WEB_SHOW_PROGRESS", ZM_WEB_H_SHOW_PROGRESS ); // Whether to show the progress of replay in event view.
|
||||
define( "ZM_WEB_AJAX_TIMEOUT", ZM_WEB_H_AJAX_TIMEOUT ); // Timeout to use for Ajax requests, no timeout used if unset
|
||||
break;
|
||||
}
|
||||
case "medium" :
|
||||
{
|
||||
define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_M_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes
|
||||
define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_M_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor
|
||||
define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_M_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
|
||||
define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_M_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window
|
||||
define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_M_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events
|
||||
define( "ZM_WEB_CAN_STREAM", ZM_WEB_M_CAN_STREAM ); // Override the automatic detection of browser streaming capability
|
||||
define( "ZM_WEB_STREAM_METHOD", ZM_WEB_M_STREAM_METHOD ); // Which method should be used to send video streams to your browser
|
||||
define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_M_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%)
|
||||
define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_M_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%)
|
||||
define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_M_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
|
||||
define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_M_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
|
||||
define( "ZM_WEB_SCALE_THUMBS", ZM_WEB_M_SCALE_THUMBS ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
|
||||
define( "ZM_WEB_EVENTS_VIEW", ZM_WEB_M_EVENTS_VIEW ); // What the default view of multiple events should be.
|
||||
define( "ZM_WEB_SHOW_PROGRESS", ZM_WEB_M_SHOW_PROGRESS ); // Whether to show the progress of replay in event view.
|
||||
define( "ZM_WEB_AJAX_TIMEOUT", ZM_WEB_M_AJAX_TIMEOUT ); // Timeout to use for Ajax requests, no timeout used if unset
|
||||
break;
|
||||
}
|
||||
case "low" :
|
||||
{
|
||||
define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_L_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes
|
||||
define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_L_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor
|
||||
define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_L_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
|
||||
define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_L_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window
|
||||
define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_L_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events
|
||||
define( "ZM_WEB_CAN_STREAM", ZM_WEB_L_CAN_STREAM ); // Override the automatic detection of browser streaming capability
|
||||
define( "ZM_WEB_STREAM_METHOD", ZM_WEB_L_STREAM_METHOD ); // Which method should be used to send video streams to your browser
|
||||
define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_L_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%)
|
||||
define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_L_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%)
|
||||
define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_L_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
|
||||
define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_L_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
|
||||
define( "ZM_WEB_SCALE_THUMBS", ZM_WEB_L_SCALE_THUMBS ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
|
||||
define( "ZM_WEB_EVENTS_VIEW", ZM_WEB_L_EVENTS_VIEW ); // What the default view of multiple events should be.
|
||||
define( "ZM_WEB_SHOW_PROGRESS", ZM_WEB_L_SHOW_PROGRESS ); // Whether to show the progress of replay in event view.
|
||||
define( "ZM_WEB_AJAX_TIMEOUT", ZM_WEB_L_AJAX_TIMEOUT ); // Timeout to use for Ajax requests, no timeout used if unset
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,390 +0,0 @@
|
|||
<?php
|
||||
//
|
||||
// ZoneMinder web control function library, $Date$, $Revision$
|
||||
// Copyright (C) 2001-2008 Philip Coombes
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
|
||||
function getControlCommands( $monitor )
|
||||
{
|
||||
$cmds = array();
|
||||
|
||||
$cmds['Wake'] = "wake";
|
||||
$cmds['Sleep'] = "sleep";
|
||||
$cmds['Reset'] = "reset";
|
||||
|
||||
$cmds['PresetSet'] = "presetSet";
|
||||
$cmds['PresetGoto'] = "presetGoto";
|
||||
$cmds['PresetHome'] = "presetHome";
|
||||
|
||||
if ( !empty($monitor['CanZoom']) )
|
||||
{
|
||||
if ( $monitor['CanZoomCon'] )
|
||||
$cmds['ZoomRoot'] = "zoomCon";
|
||||
elseif ( $monitor['CanZoomRel'] )
|
||||
$cmds['ZoomRoot'] = "zoomRel";
|
||||
elseif ( $monitor['CanZoomAbs'] )
|
||||
$cmds['ZoomRoot'] = "zoomAbs";
|
||||
$cmds['ZoomTele'] = $cmds['ZoomRoot']."Tele";
|
||||
$cmds['ZoomWide'] = $cmds['ZoomRoot']."Wide";
|
||||
$cmds['ZoomStop'] = "zoomStop";
|
||||
$cmds['ZoomAuto'] = "zoomAuto";
|
||||
$cmds['ZoomMan'] = "zoomMan";
|
||||
}
|
||||
|
||||
if ( !empty($monitor['CanFocus']) )
|
||||
{
|
||||
if ( $monitor['CanFocusCon'] )
|
||||
$cmds['FocusRoot'] = "focusCon";
|
||||
elseif ( $monitor['CanFocusRel'] )
|
||||
$cmds['FocusRoot'] = "focusRel";
|
||||
elseif ( $monitor['CanFocusAbs'] )
|
||||
$cmds['FocusRoot'] = "focusAbs";
|
||||
$cmds['FocusFar'] = $cmds['FocusRoot']."Far";
|
||||
$cmds['FocusNear'] = $cmds['FocusRoot']."Near";
|
||||
$cmds['FocusStop'] = "focusStop";
|
||||
$cmds['FocusAuto'] = "focusAuto";
|
||||
$cmds['FocusMan'] = "focusMan";
|
||||
}
|
||||
|
||||
if ( !empty($monitor['CanIris']) )
|
||||
{
|
||||
if ( $monitor['CanIrisCon'] )
|
||||
$cmds['IrisRoot'] = "irisCon";
|
||||
elseif ( $monitor['CanIrisRel'] )
|
||||
$cmds['IrisRoot'] = "irisRel";
|
||||
elseif ( $monitor['CanIrisAbs'] )
|
||||
$cmds['IrisRoot'] = "irisAbs";
|
||||
$cmds['IrisOpen'] = $cmds['IrisRoot']."Open";
|
||||
$cmds['IrisClose'] = $cmds['IrisRoot']."Close";
|
||||
$cmds['IrisStop'] = "irisStop";
|
||||
$cmds['IrisAuto'] = "irisAuto";
|
||||
$cmds['IrisMan'] = "irisMan";
|
||||
}
|
||||
|
||||
if ( !empty($monitor['CanWhite']) )
|
||||
{
|
||||
if ( $monitor['CanWhiteCon'] )
|
||||
$cmds['WhiteRoot'] = "whiteCon";
|
||||
elseif ( $monitor['CanWhiteRel'] )
|
||||
$cmds['WhiteRoot'] = "whiteRel";
|
||||
elseif ( $monitor['CanWhiteAbs'] )
|
||||
$cmds['WhiteRoot'] = "whiteAbs";
|
||||
$cmds['WhiteIn'] = $cmds['WhiteRoot']."In";
|
||||
$cmds['WhiteOut'] = $cmds['WhiteRoot']."Out";
|
||||
$cmds['WhiteAuto'] = "whiteAuto";
|
||||
$cmds['WhiteMan'] = "whiteMan";
|
||||
}
|
||||
|
||||
if ( !empty($monitor['CanGain']) )
|
||||
{
|
||||
if ( $monitor['CanGainCon'] )
|
||||
$cmds['GainRoot'] = "gainCon";
|
||||
elseif ( $monitor['CanGainRel'] )
|
||||
$cmds['GainRoot'] = "gainRel";
|
||||
elseif ( $monitor['CanGainAbs'] )
|
||||
$cmds['GainRoot'] = "gainAbs";
|
||||
$cmds['GainUp'] = $cmds['GainRoot']."Up";
|
||||
$cmds['GainDown'] = $cmds['GainRoot']."Down";
|
||||
$cmds['GainAuto'] = "gainAuto";
|
||||
$cmds['GainMan'] = "gainMan";
|
||||
}
|
||||
|
||||
if ( !empty($monitor['CanMove']) )
|
||||
{
|
||||
if ( $monitor['CanMoveCon'] )
|
||||
{
|
||||
$cmds['MoveRoot'] = "moveCon";
|
||||
$cmds['Center'] = "moveStop";
|
||||
}
|
||||
elseif ( $monitor['CanMoveRel'] )
|
||||
{
|
||||
$cmds['MoveRoot'] = "moveRel";
|
||||
$cmds['Center'] = $cmds['PresetHome'];
|
||||
}
|
||||
elseif ( $monitor['CanMoveAbs'] )
|
||||
{
|
||||
$cmds['MoveRoot'] = "moveAbs";
|
||||
$cmds['Center'] = $cmds['PresetHome'];
|
||||
}
|
||||
|
||||
$cmds['MoveUp'] = $cmds['MoveRoot']."Up";
|
||||
$cmds['MoveDown'] = $cmds['MoveRoot']."Down";
|
||||
$cmds['MoveLeft'] = $cmds['MoveRoot']."Left";
|
||||
$cmds['MoveRight'] = $cmds['MoveRoot']."Right";
|
||||
$cmds['MoveUpLeft'] = $cmds['MoveRoot']."UpLeft";
|
||||
$cmds['MoveUpRight'] = $cmds['MoveRoot']."UpRight";
|
||||
$cmds['MoveDownLeft'] = $cmds['MoveRoot']."DownLeft";
|
||||
$cmds['MoveDownRight'] = $cmds['MoveRoot']."DownRight";
|
||||
}
|
||||
return( $cmds );
|
||||
}
|
||||
|
||||
function controlFocus( $monitor, $cmds )
|
||||
{
|
||||
global $SLANG;
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div class="arrowControl focusControls">
|
||||
<div class="arrowLabel"><?= $SLANG['Near'] ?></div>
|
||||
<div class="longArrowBtn upBtn" onclick="controlCmd('<?= $cmds['FocusNear'] ?>',event,0,-1)"></div>
|
||||
<div class="arrowCenter"<?php if ( $monitor['CanFocusCon'] ) { ?> onclick="controlCmd('<?= $cmds['FocusStop'] ?>')"<?php } ?>><?= $SLANG['Focus'] ?></div>
|
||||
<div class="longArrowBtn downBtn" onclick="controlCmd('<?= $cmds['FocusFar'] ?>',event,0,1)"></div>
|
||||
<div class="arrowLabel"><?= $SLANG['Far'] ?></div>
|
||||
<?php
|
||||
if ( $monitor['CanAutoFocus'] )
|
||||
{
|
||||
?>
|
||||
<input type="button" class="ptzTextBtn" value="<?= $SLANG['Auto'] ?>" onclick="controlCmd('<?= $cmds['FocusAuto'] ?>')"/>
|
||||
<input type="button" class="ptzTextBtn" value="<?= $SLANG['Man'] ?>" onclick="controlCmd('<?= $cmds['FocusMan'] ?>')"/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
function controlZoom( $monitor, $cmds )
|
||||
{
|
||||
global $SLANG;
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div class="arrowControl zoomControls">
|
||||
<div class="arrowLabel"><?= $SLANG['Tele'] ?></div>
|
||||
<div class="longArrowBtn upBtn" onclick="controlCmd('<?= $cmds['ZoomTele'] ?>',event,0,-1)"></div>
|
||||
<div class="arrowCenter"<?php if ( $monitor['CanZoomCon'] ) { ?> onclick="controlCmd('<?= $cmds['ZoomStop'] ?>')"<?php } ?>><?= $SLANG['Zoom'] ?></div>
|
||||
<div class="longArrowBtn downBtn" onclick="controlCmd('<?= $cmds['ZoomWide'] ?>',event,0,1)"></div>
|
||||
<div class="arrowLabel"><?= $SLANG['Wide'] ?></div>
|
||||
<?php
|
||||
if ( $monitor['CanAutoZoom'] )
|
||||
{
|
||||
?>
|
||||
<input type="button" class="ptzTextBtn" value="<?= $SLANG['Auto'] ?>" onclick="controlCmd('<?= $cmds['ZoomAuto'] ?>')"/>
|
||||
<input type="button" class="ptzTextBtn" value="<?= $SLANG['Man'] ?>" onclick="controlCmd('<?= $cmds['ZoomMan'] ?>')"/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div><?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
function controlIris( $monitor, $cmds )
|
||||
{
|
||||
global $SLANG;
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div class="arrowControl irisControls">
|
||||
<div class="arrowLabel"><?= $SLANG['Open'] ?></div>
|
||||
<div class="longArrowBtn upBtn" onclick="controlCmd('<?= $cmds['IrisOpen'] ?>',event,0,-1)"></div>
|
||||
<div class="arrowCenter"<?php if ( $monitor['CanIrisCon'] ) { ?> onclick="controlCmd('<?= $cmds['IrisStop'] ?>')"<?php } ?>><?= $SLANG['Iris'] ?></div>
|
||||
<div class="longArrowBtn downBtn" onclick="controlCmd('<?= $cmds['IrisClose'] ?>',event,0,1)"></div>
|
||||
<div class="arrowLabel"><?= $SLANG['Close'] ?></div>
|
||||
<?php
|
||||
if ( $monitor['CanAutoIris'] )
|
||||
{
|
||||
?>
|
||||
<input type="button" class="ptzTextBtn" value="<?= $SLANG['Auto'] ?>" onclick="controlCmd('<?= $cmds['IrisAuto'] ?>')"/>
|
||||
<input type="button" class="ptzTextBtn" value="<?= $SLANG['Man'] ?>" onclick="controlCmd('<?= $cmds['IrisMan'] ?>')"/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
function controlWhite( $monitor, $cmds )
|
||||
{
|
||||
global $SLANG;
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div class="arrowControl whiteControls">
|
||||
<div class="arrowLabel"><?= $SLANG['In'] ?></div>
|
||||
<div class="longArrowBtn upBtn" onclick="controlCmd('<?= $cmds['WhiteIn'] ?>',event,0,-1)"></div>
|
||||
<div class="arrowCenter"<?php if ( $monitor['CanWhiteCon'] ) { ?> onclick="controlCmd('<?= $cmds['WhiteStop'] ?>')"<?php } ?>><?= $SLANG['White'] ?></div>
|
||||
<div class="longArrowBtn downBtn" onclick="controlCmd('<?= $cmds['WhiteOut'] ?>',event,0,1)"></div>
|
||||
<div class="arrowLabel"><?= $SLANG['Out'] ?></div>
|
||||
<?php
|
||||
if ( $monitor['CanAutoWhite'] )
|
||||
{
|
||||
?>
|
||||
<input type="button" class="ptzTextBtn" value="<?= $SLANG['Auto'] ?>" onclick="controlCmd('<?= $cmds['WhiteAuto'] ?>')"/>
|
||||
<input type="button" class="ptzTextBtn" value="<?= $SLANG['Man'] ?>" onclick="controlCmd('<?= $cmds['WhiteMan'] ?>')"/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
function controlPanTilt( $monitor, $cmds )
|
||||
{
|
||||
global $SLANG;
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div class="pantiltControls">
|
||||
<div class="pantilLabel"><?= $SLANG['PanTilt'] ?></div>
|
||||
<div class="pantiltButtons">
|
||||
<?php
|
||||
$hasPan = $monitor['CanPan'];
|
||||
$hasTilt = $monitor['CanTilt'];
|
||||
$hasDiag = $hasPan && $hasTilt && $monitor['CanMoveDiag'];
|
||||
?>
|
||||
<div class="arrowBtn upLeftBtn<?= $hasDiag?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveUpLeft'] ?>',event,-1,-1)"></div>
|
||||
<div class="arrowBtn upBtn<?= $hasTilt?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveUp'] ?>',event,0,-1)"></div>
|
||||
<div class="arrowBtn upRightBtn<?= $hasDiag?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveUpRight'] ?>',event,1,-1)"></div>
|
||||
<div class="arrowBtn leftBtn<?= $hasPan?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveLeft'] ?>',event,1,0)"></div>
|
||||
<div class="arrowBtn centerBtn" onclick="controlCmd('<?= $cmds['Center'] ?>')"></div>
|
||||
<div class="arrowBtn rightBtn<?= $hasPan?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveRight'] ?>',event,1,0)"></div>
|
||||
<div class="arrowBtn downLeftBtn<?= $hasDiag?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveDownLeft'] ?>',event,-1,1)"></div>
|
||||
<div class="arrowBtn downBtn<?= $hasTilt?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveDown'] ?>',event,0,1)"></div>
|
||||
<div class="arrowBtn downRightBtn<?= $hasDiag?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveDownRight'] ?>',event,1,1)"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
function controlPresets( $monitor, $cmds )
|
||||
{
|
||||
global $SLANG;
|
||||
|
||||
define( "MAX_PRESETS", "12" );
|
||||
|
||||
$sql = "select * from ControlPresets where MonitorId = '".$monitor['Id']."'";
|
||||
$labels = array();
|
||||
foreach( dbFetchAll( $sql ) as $row )
|
||||
{
|
||||
$labels[$row['Preset']] = $row['Label'];
|
||||
}
|
||||
|
||||
$presetBreak = (int)(($monitor['NumPresets']+1)/((int)(($monitor['NumPresets']-1)/MAX_PRESETS)+1));
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div class="presetControls">
|
||||
<!--<div><?= $SLANG['Presets'] ?></div>-->
|
||||
<div>
|
||||
<?php
|
||||
for ( $i = 1; $i <= $monitor['NumPresets']; $i++ )
|
||||
{
|
||||
?><input type="button" class="ptzNumBtn" title="<?= isset($labels[$i])?$labels[$i]:"" ?>" value="<?= $i ?>" onclick="controlCmd('<?= $cmds['PresetGoto'] ?><?= $i ?>');"/><?php
|
||||
if ( $i && (($i%$presetBreak) == 0) )
|
||||
{
|
||||
?><br/><?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div>
|
||||
<?php
|
||||
if ( $monitor['HasHomePreset'] )
|
||||
{
|
||||
?>
|
||||
<input type="button" class="ptzTextBtn" value="<?= $SLANG['Home'] ?>" onclick="controlCmd('<?= $cmds['PresetHome'] ?>');"/>
|
||||
<?php
|
||||
}
|
||||
if ( canEdit( 'Monitors') && $monitor['CanSetPresets'] )
|
||||
{
|
||||
?>
|
||||
<input type="button" class="ptzTextBtn" value="<?= $SLANG['Set'] ?>" onclick="createPopup( '?view=controlpreset&mid=<?= $monitor['Id'] ?>', 'zmPreset', 'preset' );"/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
function controlPower( $monitor, $cmds )
|
||||
{
|
||||
global $SLANG;
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<div class="powerControls">
|
||||
<div class="powerLabel"><?= $SLANG['Control'] ?></div>
|
||||
<div>
|
||||
<?php
|
||||
if ( $monitor['CanWake'] )
|
||||
{
|
||||
?>
|
||||
<input type="button" class="ptzTextBtn" value="<?= $SLANG['Wake'] ?>" onclick="controlCmd('<?= $cmds['Wake'] ?>')"/>
|
||||
<?php
|
||||
}
|
||||
if ( $monitor['CanSleep'] )
|
||||
{
|
||||
?>
|
||||
<input type="button" class="ptzTextBtn" value="<?= $SLANG['Sleep'] ?>" onclick="controlCmd('<?= $cmds['Sleep'] ?>')"/>
|
||||
<?php
|
||||
}
|
||||
if ( $monitor['CanReset'] )
|
||||
{
|
||||
?>
|
||||
<input type="button" class="ptzTextBtn" value="<?= $SLANG['Reset'] ?>" onclick="controlCmd('<?= $cmds['Reset'] ?>')"/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
function ptzControls( $monitor )
|
||||
{
|
||||
$cmds = getControlCommands( $monitor );
|
||||
ob_start();
|
||||
?>
|
||||
<div class="controlsPanel">
|
||||
<?php
|
||||
if ( $monitor['CanFocus'] )
|
||||
echo controlFocus( $monitor, $cmds );
|
||||
if ( $monitor['CanZoom'] )
|
||||
echo controlZoom( $monitor, $cmds );
|
||||
if ( $monitor['CanIris'] )
|
||||
echo controlIris( $monitor, $cmds );
|
||||
if ( $monitor['CanWhite'] )
|
||||
echo controlWhite( $monitor, $cmds );
|
||||
if ( $monitor['CanMove'] || ( $monitor['CanWake'] || $monitor['CanSleep'] || $monitor['CanReset'] ) )
|
||||
{
|
||||
?>
|
||||
<div class="pantiltPanel">
|
||||
<?php
|
||||
if ( $monitor['CanMove'] )
|
||||
echo controlPanTilt( $monitor, $cmds );
|
||||
if ( $monitor['CanWake'] || $monitor['CanSleep'] || $monitor['CanReset'] )
|
||||
echo controlPower( $monitor, $cmds );
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
if ( $monitor['HasPresets'] )
|
||||
echo controlPresets( $monitor, $cmds );
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
?>
|
|
@ -1,963 +0,0 @@
|
|||
<?php
|
||||
//
|
||||
// ZoneMinder web export function library, $Date$, $Revision$
|
||||
// Copyright (C) 2001-2008 Philip Coombes
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
|
||||
function exportHeader( $title )
|
||||
{
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title><?= $title ?></title>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
<?php include( ZM_SKIN_PATH.'/css/export.css' ); ?>
|
||||
|
||||
|
||||
ul.tabs {
|
||||
margin: 0;
|
||||
margin-bottom: -1px;
|
||||
padding: 0;
|
||||
float: left;
|
||||
list-style: none;
|
||||
height: 32px;
|
||||
border-bottom: 1px solid #7f7fb2;
|
||||
border-left: 1px solid #7f7fb2;
|
||||
width: 100%;
|
||||
}
|
||||
ul.tabs li {
|
||||
float: left;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 31px;
|
||||
line-height: 31px;
|
||||
border: 1px solid #7f7fb2;
|
||||
border-left: none;
|
||||
margin-bottom: -1px;
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
ul.tabs li a {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
display: block;
|
||||
font-size: 1.2em;
|
||||
padding: 0 20px;
|
||||
outline: none;
|
||||
}
|
||||
ul.tabs li a:hover {
|
||||
background: #ccc;
|
||||
}
|
||||
html ul.tabs li.active, html ul.tabs li.active a:hover {
|
||||
background: #dddddd;
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
<script type="text/javascript" src="<?php echo ZM_SKIN_PATH; ?>/js/jquery-1.4.2.min.js"></script>
|
||||
<script type="text/javascript" language="javascript" charset="utf-8">
|
||||
|
||||
/*==========[tab code]==========*/
|
||||
$(document).ready(function() {
|
||||
|
||||
//When page loads...
|
||||
$(".tab_content").hide(); //Hide all content
|
||||
$("ul.tabs li:first").addClass("active").show(); //Activate first tab
|
||||
$(".tab_content:first").show(); //Show first tab content
|
||||
|
||||
//On Click Event
|
||||
$("ul.tabs li").click(function() {
|
||||
|
||||
$("ul.tabs li").removeClass("active"); //Remove any "active" class
|
||||
$(this).addClass("active"); //Add "active" class to selected tab
|
||||
$(".tab_content").hide(); //Hide all tab content
|
||||
|
||||
var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
|
||||
$(activeTab).fadeIn(); //Fade in the active ID content
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
// ]]>
|
||||
</script>
|
||||
</head>
|
||||
<?php
|
||||
}
|
||||
|
||||
function exportEventDetail( $event, $exportFrames, $exportImages )
|
||||
{
|
||||
global $SLANG;
|
||||
|
||||
ob_start();
|
||||
exportHeader( $SLANG['Event']." ".$event['Id'] );
|
||||
|
||||
$otherlinks = '';
|
||||
if( $exportFrames ) $otherlinks .= '<a href="zmEventFrames.html">'.$SLANG['Frames'].'</a>,';
|
||||
if( $exportImages ) $otherlinks .= '<a href="zmEventImages.html">'.$SLANG['Images'].'</a>,';
|
||||
$otherlinks = substr($otherlinks,0,-1);
|
||||
|
||||
|
||||
?>
|
||||
<body>
|
||||
<div id="page">
|
||||
<div id="content">
|
||||
<h2><?= $SLANG['Event'] ?>: <?= validHtmlStr($event['Name']) ?><?php if(!empty($otherlinks)) { ?> (<?=$otherlinks?>) <?php } ?></h2>
|
||||
<table id="eventDetail">
|
||||
<tr><th scope="row"><?= $SLANG['Id'] ?></th><td><?= $event['Id'] ?></td></tr>
|
||||
<tr><th scope="row"><?= $SLANG['Name'] ?></th><td><?= validHtmlStr($event['Name']) ?></td></tr>
|
||||
<tr><th scope="row"><?= $SLANG['Monitor'] ?></th><td><?= validHtmlStr($event['MonitorName']) ?> (<?= $event['MonitorId'] ?>)</td></tr>
|
||||
<tr><th scope="row"><?= $SLANG['Cause'] ?></th><td><?= validHtmlStr($event['Cause']) ?></td></tr>
|
||||
<tr><th scope="row"><?= $SLANG['Notes'] ?></th><td><?= validHtmlStr($event['Notes']) ?></td></tr>
|
||||
<tr><th scope="row"><?= $SLANG['Time'] ?></th><td><?= strftime( STRF_FMT_DATETIME_SHORTER, strtotime($event['StartTime']) ) ?></td></tr>
|
||||
<tr><th scope="row"><?= $SLANG['Duration'] ?></th><td><?= $event['Length'] ?></td></tr>
|
||||
<tr><th scope="row"><?= $SLANG['Frames'] ?></th><td><?= $event['Frames'] ?></td></tr>
|
||||
<tr><th scope="row"><?= $SLANG['AttrAlarmFrames'] ?></th><td><?= $event['AlarmFrames'] ?></td></tr>
|
||||
<tr><th scope="row"><?= $SLANG['AttrTotalScore'] ?></th><td><?= $event['TotScore'] ?></td></tr>
|
||||
<tr><th scope="row"><?= $SLANG['AttrAvgScore'] ?></th><td><?= $event['AvgScore'] ?></td></tr>
|
||||
<tr><th scope="row"><?= $SLANG['AttrMaxScore'] ?></th><td><?= $event['MaxScore'] ?></td></tr>
|
||||
<tr><th scope="row"><?= $SLANG['Archived'] ?></th><td><?= $event['Archived']?$SLANG['Yes']:$SLANG['No'] ?></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
function exportEventFrames( $event, $exportDetail, $exportImages )
|
||||
{
|
||||
global $SLANG;
|
||||
|
||||
$sql = "SELECT *, unix_timestamp( TimeStamp ) AS UnixTimeStamp FROM Frames WHERE EventID = ? ORDER BY FrameId";
|
||||
$frames = dbFetchAll( $sql, NULL, array( $event['Id'] ) );
|
||||
|
||||
ob_start();
|
||||
exportHeader( $SLANG['Frames']." ".$event['Id'] );
|
||||
|
||||
$otherlinks = '';
|
||||
if( $exportDetail ) $otherlinks .= '<a href="zmEventDetail.html">'.$SLANG['Event'].'</a>,';
|
||||
if( $exportImages ) $otherlinks .= '<a href="zmEventImages.html">'.$SLANG['Images'].'</a>,';
|
||||
$otherlinks = substr($otherlinks,0,-1);
|
||||
|
||||
?>
|
||||
<body>
|
||||
<div id="page">
|
||||
<div id="content">
|
||||
<h2><?= $SLANG['Frames'] ?>: <?= validHtmlStr($event['Name']) ?><?php if(!empty($otherlinks)) { ?> (<?=$otherlinks?>) <?php } ?></h2>
|
||||
<table id="eventFrames">
|
||||
<tr>
|
||||
<th><?= $SLANG['FrameId'] ?></th>
|
||||
<th><?= $SLANG['Type'] ?></th>
|
||||
<th><?= $SLANG['TimeStamp'] ?></th>
|
||||
<th><?= $SLANG['TimeDelta'] ?></th>
|
||||
<th><?= $SLANG['Score'] ?></th>
|
||||
<?php
|
||||
if ( $exportImages )
|
||||
{
|
||||
?>
|
||||
<th><?= $SLANG['Image'] ?></th>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
if ( count($frames) )
|
||||
{
|
||||
$eventPath = mygetEventPath( $event );
|
||||
foreach ( $frames as $frame )
|
||||
{
|
||||
$imageFile = sprintf( "%0".ZM_EVENT_IMAGE_DIGITS."d-capture.jpg", $frame['FrameId'] );
|
||||
$imagePath = $eventPath."/".$imageFile;
|
||||
$analImage = preg_replace( "/capture/", "analyse", $imagePath );
|
||||
if ( file_exists( $analImage ) )
|
||||
{
|
||||
$imageFile = preg_replace( "/capture/", "analyse", $imageFile );
|
||||
}
|
||||
|
||||
$class = strtolower($frame['Type']);
|
||||
?>
|
||||
<tr class="<?= $class ?>">
|
||||
<td><?= $frame['FrameId'] ?></td>
|
||||
<td><?= $frame['Type'] ?></td>
|
||||
<td><?= strftime( STRF_FMT_TIME, $frame['UnixTimeStamp'] ) ?></td>
|
||||
<td><?= number_format( $frame['Delta'], 2 ) ?></td>
|
||||
<td><?= $frame['Score'] ?></td>
|
||||
<?php
|
||||
if ( $exportImages )
|
||||
{
|
||||
?>
|
||||
<td><a href="<?= $imageFile ?>" target="zmExportImage"><img src="<?= $imageFile ?>" border="0" class="thumb" alt="Frame <?= $frame['FrameId'] ?>"/></a></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td class="monoRow" colspan="<?= $exportImages?6:5 ?>"><?= $SLANG['NoFramesRecorded'] ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
function exportEventImages( $event, $exportDetail, $exportFrames, $myfilelist )
|
||||
{
|
||||
global $SLANG;
|
||||
|
||||
ob_start();
|
||||
exportHeader( $SLANG['Images']." ".$event['Id'] );
|
||||
|
||||
$otherlinks = '';
|
||||
if( $exportDetail ) $otherlinks .= '<a href="zmEventDetail.html">'.$SLANG['Event'].'</a>,';
|
||||
if( $exportFrames ) $otherlinks .= '<a href="zmEventFrames.html">'.$SLANG['Frames'].'</a>,';
|
||||
$otherlinks = substr($otherlinks,0,-1);
|
||||
|
||||
$filelist = array_keys($myfilelist);
|
||||
sort($filelist,SORT_NUMERIC);
|
||||
$slides = '"'.implode('","',$filelist).'"';
|
||||
$listcount = count($filelist);
|
||||
?>
|
||||
<body>
|
||||
<style>
|
||||
*.horizontal_track {background-color: #bbb;width: <?=$event['Width']?>px;line-height: 0px;font-size: 0px;text-align: left;padding: 4px;border: 1px solid;border-color: #ddd #999 #999 #ddd;}
|
||||
*.horizontal_slider {background-color: #666;width: 16px;height: 8px;position: relative;z-index: 2;line-height: 0;margin: 0;border: 2px solid;border-color: #999 #333 #333 #999;}
|
||||
*.horizontal_slit {background-color: #333;width: <?=($event['Width']-10)?>px;height: 2px;margin: 4px 4px 2px 4px;line-height: 0;position: absolute;z-index: 1;border: 1px solid;border-color: #999 #ddd #ddd #999;}
|
||||
*.vertical_track {background-color: #bbb;padding: 3px 5px 15px 5px;border: 1px solid;border-color: #ddd #999 #999 #ddd;}
|
||||
*.vertical_slider {background-color: #666;width: 18px;height: 8px;font: 0px;text-align: left;line-height: 0px;position: relative;z-index: 1;border: 2px solid;border-color: #999 #333 #333 #999;}
|
||||
*.vertical_slit {background-color: #000;width: 2px;height: 100px;position: absolute;margin: 4px 10px 4px 10px;padding: 4px 0 1px 0;line-height: 0;font-size: 0;border: 1px solid;border-color: #666 #ccc #ccc #666;}
|
||||
*.display_holder {background-color: #bbb;color: #fff;width: 34px;height: 20px;text-align: right;padding: 0;border: 1px solid;border-color: #ddd #999 #999 #ddd;}
|
||||
.value_display {background-color: #bbb;color: #333;width: 30px;margin: 0 2px;text-align: right;font-size: 8pt;font-face: verdana, arial, helvetica, sans-serif;font-weight: bold;line-height: 12px;border: 0;cursor: default;}
|
||||
</style>
|
||||
|
||||
<h2><?= $SLANG['Images'] ?>: <?= validHtmlStr($event['Name']) ?><?php if(!empty($otherlinks)) { ?> (<?=$otherlinks?>) <?php } ?></h2>
|
||||
|
||||
<ilayer id="slidensmain" width=&{slidewidth}; height=&{slideheight}; bgColor=&{slidebgcolor}; visibility=hide>
|
||||
<layer id="slidenssub" width=&{slidewidth}; left=auto top=auto></layer>
|
||||
</ilayer>
|
||||
<div id="imagevideo" align="center"></div>
|
||||
<br>
|
||||
<div align="center">
|
||||
<button onclick="stepbackward()">< Step</button><button
|
||||
id="btnrwd" onclick="rewind()" >Rwd</button><button
|
||||
id="btnplay" onclick="playstop()">Stop</button><button
|
||||
onclick="stepforward()">Step ></button><button
|
||||
id="btnspeedup" onclick="speedup()">speedup</button><button
|
||||
id="btnspeeddown" onclick="speeddown()">slowdown</button>
|
||||
</div>
|
||||
<div align="center"><div class="horizontal_track" >
|
||||
<div class="horizontal_slit" > </div>
|
||||
<div class="horizontal_slider" id="imageslider_id" style="left: 0px;"
|
||||
onmousedown="slide(event,'horizontal', <?=($event['Width']-20)?>, 1, <?=$listcount?>, <?=$listcount?>,0, 'imageslider_display_id');" > </div>
|
||||
</div></div>
|
||||
<div align="center"><div class="display_holder" ><input id="imageslider_display_id" class="value_display" type="text" value="0" onfocus="blur(this);" /></div></div>
|
||||
|
||||
|
||||
<script language="JavaScript1.2">
|
||||
|
||||
/***********************************************
|
||||
* Flexi Slideshow- © Dynamic Drive (www.dynamicdrive.com)
|
||||
* This notice must stay intact for use
|
||||
* Visit http://www.dynamicdrive.com/ for full source code
|
||||
***********************************************/
|
||||
|
||||
var eventWidth = <?=$event['Width']?>;
|
||||
var eventHeight = <?=$event['Height']?>;
|
||||
var variableslide=[<?=$slides?>];
|
||||
|
||||
//configure the below 3 variables to set the dimension/background color of the slideshow
|
||||
|
||||
var slidewidth=eventWidth+'px' //set to width of LARGEST image in your slideshow
|
||||
var slideheight=eventHeight+'px' //set to height of LARGEST iamge in your slideshow, plus any text description
|
||||
var slidebgcolor='#ffffff'
|
||||
|
||||
//configure the below variable to determine the delay between image rotations (in miliseconds)
|
||||
var origslidedelay=100;
|
||||
var slidedelay=origslidedelay;
|
||||
|
||||
////Do not edit pass this line////////////////
|
||||
|
||||
var ie=document.all;
|
||||
var dom=document.getElementById;
|
||||
|
||||
for (i=0;i<variableslide.length;i++){
|
||||
var cacheimage=new Image()
|
||||
cacheimage.src=variableslide[i]
|
||||
}
|
||||
|
||||
var currentslide=-1
|
||||
var mytimer = null;
|
||||
|
||||
//if (ie||dom) document.write('<div id="slidedom" style="width:'+slidewidth+'px;height:'+slideheight+'; background-color:'+slidebgcolor+'"></div>');
|
||||
if (ie||dom) document.getElementById('imagevideo').innerHTML = '<div id="slidedom" style="width:'+slidewidth+'px;height:'+slideheight+'; background-color:'+slidebgcolor+'"><img src="" name="imageslideframe"></div>';
|
||||
|
||||
function rotateimages(){
|
||||
if (currentslide==variableslide.length-1) currentslide=0;
|
||||
else currentslide++;
|
||||
|
||||
changeimage();
|
||||
|
||||
mytimer = setTimeout("rotateimages()",slidedelay);
|
||||
}
|
||||
|
||||
function changeimage() {
|
||||
contentcontainer='<center><img src="'+variableslide[currentslide]+'" border="0" vspace="3"></center>';
|
||||
|
||||
if (document.layers){
|
||||
crossrotateobj.document.write(contentcontainer);
|
||||
crossrotateobj.document.close();
|
||||
}
|
||||
else if (ie||dom) document.imageslideframe.src = variableslide[currentslide];
|
||||
|
||||
slideManual(currentslide+1,eventWidth-20, 1, variableslide.length);
|
||||
}
|
||||
|
||||
|
||||
function start_slider(){
|
||||
crossrotateobj=dom? document.getElementById("slidedom") : ie? document.all.slidedom : document.slidensmain.document.slidenssub;
|
||||
if (document.layers) document.slidensmain.visibility="show";
|
||||
rotateimages();
|
||||
}
|
||||
|
||||
|
||||
// seyi_code
|
||||
function rotateimagesrewind(){
|
||||
if (currentslide==0) currentslide=variableslide.length-1;
|
||||
else currentslide--;
|
||||
|
||||
changeimage();
|
||||
|
||||
mytimer = setTimeout("rotateimagesrewind()",slidedelay);
|
||||
}
|
||||
|
||||
function stepforward() {
|
||||
clearTimeout(mytimer);
|
||||
// document.getElementById('btnrwd').style.borderTop='2px solid #ffffff';
|
||||
// document.getElementById('btnrwd').style.borderBottom='2px solid #848284';
|
||||
// document.getElementById('btnrwd').style.borderRight='2px solid #848284';
|
||||
// document.getElementById('btnrwd').style.borderLeft='1px solid #ffffff';
|
||||
document.getElementById('btnplay').disabled = false;
|
||||
document.getElementById('btnplay').innerHTML = 'Play';
|
||||
document.getElementById('btnspeedup').disabled = true;
|
||||
document.getElementById('btnspeeddown').disabled = true;
|
||||
|
||||
if (currentslide==variableslide.length-1) currentslide=0;
|
||||
else currentslide++;
|
||||
|
||||
changeimage();
|
||||
|
||||
}
|
||||
function stepbackward() {
|
||||
clearTimeout(mytimer);
|
||||
// document.getElementById('btnrwd').style.borderTop='2px solid #ffffff';
|
||||
// document.getElementById('btnrwd').style.borderBottom='2px solid #848284';
|
||||
// document.getElementById('btnrwd').style.borderRight='2px solid #848284';
|
||||
// document.getElementById('btnrwd').style.borderLeft='1px solid #ffffff';
|
||||
document.getElementById('btnplay').disabled = false;
|
||||
document.getElementById('btnplay').innerHTML = 'Play';
|
||||
document.getElementById('btnspeedup').disabled = true;
|
||||
document.getElementById('btnspeeddown').disabled = true;
|
||||
|
||||
if (currentslide==0) currentslide=variableslide.length-1;
|
||||
else currentslide--;
|
||||
|
||||
changeimage();
|
||||
|
||||
}
|
||||
function speedup() { slidedelay = slidedelay/2; }
|
||||
function speeddown() { slidedelay = slidedelay*2; }
|
||||
function playstop() {
|
||||
if(document.getElementById('btnplay').innerHTML == 'Play') {
|
||||
slidedelay = origslidedelay;
|
||||
mytimer = setTimeout("rotateimages()",slidedelay);
|
||||
document.getElementById('btnplay').innerHTML = 'Stop';
|
||||
document.getElementById('btnspeedup').disabled = false;
|
||||
document.getElementById('btnspeeddown').disabled = false;
|
||||
} else if(document.getElementById('btnplay').innerHTML == 'Stop') {
|
||||
clearTimeout(mytimer);
|
||||
document.getElementById('btnplay').innerHTML = 'Play';
|
||||
document.getElementById('btnrwd').disabled = false;
|
||||
document.getElementById('btnspeedup').disabled = true;
|
||||
document.getElementById('btnspeeddown').disabled = true;
|
||||
}
|
||||
}
|
||||
function rewind() {
|
||||
clearTimeout(mytimer);
|
||||
|
||||
if(!document.getElementById('btnplay').disabled) {
|
||||
slidedelay = origslidedelay;
|
||||
mytimer = setTimeout("rotateimagesrewind()",slidedelay);
|
||||
|
||||
// document.getElementById('btnrwd').style.borderTop = '2px solid #414241';
|
||||
// document.getElementById('btnrwd').style.borderBottom = '1px solid #ffffff';
|
||||
// document.getElementById('btnrwd').style.borderLeft = '2px solid #414241';
|
||||
// document.getElementById('btnrwd').style.borderRight = '1px solid #ffffff';
|
||||
document.getElementById('btnplay').disabled = true;
|
||||
document.getElementById('btnspeedup').disabled = false;
|
||||
document.getElementById('btnspeeddown').disabled = false;
|
||||
} else {
|
||||
|
||||
// document.getElementById('btnrwd').style.borderTop='2px solid #ffffff';
|
||||
// document.getElementById('btnrwd').style.borderBottom='2px solid #848284';
|
||||
// document.getElementById('btnrwd').style.borderRight='2px solid #848284';
|
||||
// document.getElementById('btnrwd').style.borderLeft='1px solid #ffffff';
|
||||
document.getElementById('btnplay').disabled = false;
|
||||
document.getElementById('btnspeedup').disabled = true;
|
||||
document.getElementById('btnspeeddown').disabled = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//---------------------------------+
|
||||
// CARPE S l i d e r 1.3 |
|
||||
// 2005 - 12 - 10 |
|
||||
// By Tom Hermansson Snickars |
|
||||
// Copyright CARPE Design |
|
||||
// http://carpe.ambiprospect.com/ |
|
||||
//---------------------------------+
|
||||
|
||||
// carpeGetElementByID: Cross-browser version of "document.getElementById()"
|
||||
function carpeGetElementById(element) {
|
||||
if (document.getElementById) element = document.getElementById(element);
|
||||
else if (document.all) element = document.all[element];
|
||||
else element = null;
|
||||
return element;
|
||||
}
|
||||
// carpeLeft: Cross-browser version of "element.style.left"
|
||||
function carpeLeft(elmnt, pos) {
|
||||
if (!(elmnt = carpeGetElementById(elmnt))) return 0;
|
||||
if (elmnt.style && (typeof(elmnt.style.left) == 'string')) {
|
||||
if (typeof(pos) == 'number') elmnt.style.left = pos + 'px';
|
||||
else {
|
||||
pos = parseInt(elmnt.style.left);
|
||||
if (isNaN(pos)) pos = 0;
|
||||
}
|
||||
}
|
||||
else if (elmnt.style && elmnt.style.pixelLeft) {
|
||||
if (typeof(pos) == 'number') elmnt.style.pixelLeft = pos;
|
||||
else pos = elmnt.style.pixelLeft;
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
// carpeTop: Cross-browser version of "element.style.top"
|
||||
function carpeTop(elmnt, pos) {
|
||||
if (!(elmnt = carpeGetElementById(elmnt))) return 0;
|
||||
if (elmnt.style && (typeof(elmnt.style.top) == 'string')) {
|
||||
if (typeof(pos) == 'number') elmnt.style.top = pos + 'px';
|
||||
else {
|
||||
pos = parseInt(elmnt.style.top);
|
||||
if (isNaN(pos)) pos = 0;
|
||||
}
|
||||
}
|
||||
else if (elmnt.style && elmnt.style.pixelTop) {
|
||||
if (typeof(pos) == 'number') elmnt.style.pixelTop = pos;
|
||||
else pos = elmnt.style.pixelTop;
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
// moveSlider: Handles slider and display while dragging
|
||||
function moveSlider(evnt) {
|
||||
var evnt = (!evnt) ? window.event : evnt; // The mousemove event
|
||||
if (mouseover) { // Only if slider is dragged
|
||||
x = pxLeft + evnt.screenX - xCoord // Horizontal mouse position relative to allowed slider positions
|
||||
y = pxTop + evnt.screenY - yCoord // Horizontal mouse position relative to allowed slider positions
|
||||
if (x > xMax) x = xMax // Limit horizontal movement
|
||||
if (x < 0) x = 0 // Limit horizontal movement
|
||||
if (y > yMax) y = yMax // Limit vertical movement
|
||||
if (y < 0) y = 0 // Limit vertical movement
|
||||
carpeLeft(sliderObj.id, x) // move slider to new horizontal position
|
||||
carpeTop(sliderObj.id, y) // move slider to new vertical position
|
||||
sliderVal = x + y // pixel value of slider regardless of orientation
|
||||
sliderPos = (sliderObj.pxLen / sliderObj.valCount) * Math.round(sliderObj.valCount * sliderVal / sliderObj.pxLen)
|
||||
v = Math.round((sliderPos * sliderObj.scale + sliderObj.fromVal) * // calculate display value
|
||||
Math.pow(10, displayObj.dec)) / Math.pow(10, displayObj.dec)
|
||||
displayObj.value = v // put the new value in the slider display element
|
||||
|
||||
// seyi_code
|
||||
currentslide = v-1;
|
||||
changeimage();
|
||||
return false
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// moveSlider: Handles the start of a slider move.
|
||||
function slide(evnt, orientation, length, from, to, count, decimals, display) {
|
||||
if (!evnt) evnt = window.event;
|
||||
sliderObj = (evnt.target) ? evnt.target : evnt.srcElement; // Get the activated slider element.
|
||||
sliderObj.pxLen = length // The allowed slider movement in pixels.
|
||||
sliderObj.valCount = count ? count - 1 : length // Allowed number of values in the interval.
|
||||
displayObj = carpeGetElementById(display) // Get the associated display element.\
|
||||
displayObj.dec = decimals // Number of decimals to be displayed.
|
||||
sliderObj.scale = (to - from) / length // Slider-display scale [value-change per pixel of movement].
|
||||
if (orientation == 'horizontal') { // Set limits for horizontal sliders.
|
||||
sliderObj.fromVal = from
|
||||
xMax = length
|
||||
yMax = 0
|
||||
}
|
||||
if (orientation == 'vertical') { // Set limits and scale for vertical sliders.
|
||||
sliderObj.fromVal = to
|
||||
xMax = 0
|
||||
yMax = length
|
||||
sliderObj.scale = -sliderObj.scale // Invert scale for vertical sliders. "Higher is more."
|
||||
}
|
||||
pxLeft = carpeLeft(sliderObj.id) // Sliders horizontal position at start of slide.
|
||||
pxTop = carpeTop(sliderObj.id) // Sliders vertical position at start of slide.
|
||||
xCoord = evnt.screenX // Horizontal mouse position at start of slide.
|
||||
yCoord = evnt.screenY // Vertical mouse position at start of slide.
|
||||
mouseover = true
|
||||
document.onmousemove = moveSlider // Start the action if the mouse is dragged.
|
||||
document.onmouseup = sliderMouseUp // Stop sliding.
|
||||
}
|
||||
// sliderMouseup: Handles the mouseup event after moving a slider.
|
||||
// Snaps the slider position to allowed/displayed value.
|
||||
function sliderMouseUp() {
|
||||
mouseover = false // Stop the sliding.
|
||||
v = (displayObj.value) ? displayObj.value : 0 // Find last display value.
|
||||
pos = (v - sliderObj.fromVal)/(sliderObj.scale) // Calculate slider position (regardless of orientation).
|
||||
if (yMax == 0) carpeLeft(sliderObj.id, pos) // Snap horizontal slider to corresponding display position.
|
||||
if (xMax == 0) carpeTop(sliderObj.id, pos) // Snap vertical slider to corresponding display position.
|
||||
if (document.removeEventListener) { // Remove event listeners from 'document' (Moz&co).
|
||||
document.removeEventListener('mousemove', moveSlider)
|
||||
document.removeEventListener('mouseup', sliderMouseUp)
|
||||
}
|
||||
else if (document.detachEvent) { // Remove event listeners from 'document' (IE&co).
|
||||
document.detachEvent('onmousemove', moveSlider)
|
||||
document.detachEvent('onmouseup', sliderMouseUp)
|
||||
}
|
||||
}
|
||||
|
||||
//seyi_code
|
||||
//slide(event,'horizontal', 300, 1, 22, 22,0, 'imageslider_display_id');
|
||||
//slide(evnt, orientation, length, from, to, count, decimals, display) {
|
||||
function slideManual(val,length,from,to) {
|
||||
scale = (to - from) / length // Slider-display scale [value-change per pixel of movement].
|
||||
fromVal = from
|
||||
xMax = length
|
||||
yMax = 0
|
||||
sliderid = 'imageslider_id';
|
||||
|
||||
|
||||
v = (val) ? val : 0 // Find last display value.
|
||||
displayobject = carpeGetElementById('imageslider_display_id') // Get the associated display element.\
|
||||
displayobject.value = val;
|
||||
pos = (v - fromVal)/(scale) // Calculate slider position (regardless of orientation).
|
||||
if (yMax == 0) carpeLeft(sliderid, pos) // Snap horizontal slider to corresponding display position.
|
||||
}
|
||||
|
||||
if (ie||dom) start_slider();
|
||||
else if (document.layers) window.onload=start_slider;
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function exportEventImagesMaster( $eids )
|
||||
{
|
||||
global $SLANG;
|
||||
ob_start();
|
||||
exportHeader( $SLANG['Images'].' Master' );
|
||||
?>
|
||||
<body>
|
||||
<h2><?= $SLANG['Images'] ?> Master</h2>
|
||||
<?php
|
||||
foreach ($eids as $eid) {
|
||||
//get monitor id and event id
|
||||
$sql = 'SELECT E.MonitorId FROM Monitors AS M INNER JOIN Events AS E ON (M.Id = E.MonitorId) WHERE E.Id = ?';
|
||||
$event = dbFetchOne( $sql, NULL, array( $eid ) );
|
||||
$eventMonitorId[$eid] = $event['MonitorId'];
|
||||
}
|
||||
|
||||
$monitors = array_values(array_flip(array_flip($eventMonitorId))); //unique monitors and reindex the array
|
||||
$monitorNames = array();
|
||||
|
||||
//*
|
||||
if(!empty($monitors)) {
|
||||
$tmp = dbFetchAll("SELECT Id,Name FROM Monitors WHERE Id IN (".implode(',', $monitors).") ");
|
||||
foreach ( $tmp as $row ) { $monitorNames[$row['Id']] = $row['Name']; }
|
||||
}
|
||||
//*/
|
||||
//trigger_error(print_r($monitorNames,1));
|
||||
|
||||
?>
|
||||
<div id= 'tabs'>
|
||||
<ul class= 'tabs'>
|
||||
<li class = 'active' ><a href='#all' > All </a></li>
|
||||
<?php
|
||||
|
||||
foreach ($monitors as $monitor) {
|
||||
# code...
|
||||
echo "<li><a href='#tab$monitor'>" . $monitorNames[$monitor] . "</a></li>";
|
||||
}
|
||||
?>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<table width="100%" height="100%" ><tr>
|
||||
<td valign="top" bgcolor="#dddddd" style="padding:10px;">
|
||||
<div class='tab_content' id='all'>
|
||||
<h2> All </h2>
|
||||
<?php
|
||||
if (!is_array($eids))
|
||||
{
|
||||
echo "<div><a href=\"javascript:switchevent('$eids/zm/EventImages.html');\"> $eids </div>";
|
||||
}
|
||||
?>
|
||||
<?php foreach($eids as $eid)
|
||||
{
|
||||
?>
|
||||
<div><a href="javascript:switchevent('<?php echo $eventMonitorId[$eid].'/' . $eid; ?>/zmEventImages.html');"><?=$eid?></a></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
foreach ($monitors as $monitor)
|
||||
{
|
||||
echo "<div class='tab_content' id='tab$monitor'>";
|
||||
echo "<h2>Monitor: " . $monitorNames[$monitor] . " </h2>";
|
||||
foreach ($eids as $eid)
|
||||
{
|
||||
if ($eventMonitorId[$eid] == $monitor)
|
||||
{
|
||||
?>
|
||||
<div><a href="javascript:switchevent('<?php echo $eventMonitorId[$eid].'/' . $eid; ?>/zmEventImages.html');"><?=$eid?></a></div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
echo'</div>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</td><td>
|
||||
|
||||
<iframe id="myframe" onload="resizeCaller();" name="myframe" src="#"
|
||||
scrolling="no" marginwidth="0" marginheight="0" frameborder="0"
|
||||
vspace="0" hspace="0" style="overflow:visible; width:100%; display:none">
|
||||
</iframe>
|
||||
|
||||
</td>
|
||||
</tr></table>
|
||||
|
||||
<script type="text/javascript">
|
||||
function switchevent(src) {
|
||||
if(document.all) document.all.myframe.src = src;
|
||||
else window.frames['myframe'].location.href = src;
|
||||
}
|
||||
|
||||
/***********************************************
|
||||
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
|
||||
* Visit DynamicDrive.com for hundreds of original DHTML scripts
|
||||
* This notice must stay intact for legal use
|
||||
***********************************************/
|
||||
|
||||
//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
|
||||
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
|
||||
var iframeids=["myframe"]
|
||||
|
||||
//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
|
||||
var iframehide="yes"
|
||||
|
||||
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
|
||||
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers
|
||||
|
||||
function resizeCaller() {
|
||||
var dyniframe=new Array()
|
||||
for (i=0; i<iframeids.length; i++){
|
||||
if (document.getElementById) resizeIframe(iframeids[i]);
|
||||
//reveal iframe for lower end browsers? (see var above):
|
||||
if ((document.all || document.getElementById) && iframehide=="no"){
|
||||
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
|
||||
tempobj.style.display="block"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function resizeIframe(frameid){
|
||||
var currentfr=document.getElementById(frameid)
|
||||
if (currentfr && !window.opera){
|
||||
currentfr.style.display="block"
|
||||
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
|
||||
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
|
||||
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
|
||||
currentfr.height = currentfr.Document.body.scrollHeight;
|
||||
if (currentfr.addEventListener) currentfr.addEventListener("load", readjustIframe, false);
|
||||
else if (currentfr.attachEvent){
|
||||
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
|
||||
currentfr.attachEvent("onload", readjustIframe)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function readjustIframe(loadevt) {
|
||||
var crossevt=(window.event)? event : loadevt;
|
||||
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
|
||||
if (iframeroot) resizeIframe(iframeroot.id);
|
||||
}
|
||||
|
||||
function loadintoIframe(iframeid, url){
|
||||
if (document.getElementById) document.getElementById(iframeid).src=url;
|
||||
}
|
||||
|
||||
//if (window.addEventListener) window.addEventListener("load", resizeCaller, false)
|
||||
//else if (window.attachEvent) window.attachEvent("onload", resizeCaller)
|
||||
//else window.onload=resizeCaller
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
return( ob_get_clean() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function exportFileList( $eid, $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc )
|
||||
{
|
||||
|
||||
if ( canView( 'Events' ) && $eid )
|
||||
{
|
||||
$sql = 'SELECT E.Id,E.MonitorId,M.Name AS MonitorName,M.Width,M.Height,E.Name,E.Cause,E.Notes,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived FROM Monitors AS M INNER JOIN Events AS E ON (M.Id = E.MonitorId) WHERE E.Id = ?';
|
||||
$event = dbFetchOne( $sql, NULL, array( $eid ) );
|
||||
$eventPath = mygetEventPath( $event );
|
||||
$files = array();
|
||||
if ( $dir = opendir( $eventPath ) )
|
||||
{
|
||||
while ( ($file = readdir( $dir )) !== false )
|
||||
{
|
||||
if ( is_file( $eventPath."/".$file ) )
|
||||
{
|
||||
$files[$file] = $file;
|
||||
}
|
||||
}
|
||||
closedir( $dir );
|
||||
}
|
||||
|
||||
$exportFileList = array();
|
||||
|
||||
if ( $exportDetail )
|
||||
{
|
||||
$file = "zmEventDetail.html";
|
||||
if ( !($fp = fopen( $eventPath."/".$file, "w" )) )
|
||||
{
|
||||
Fatal( "Can't open event detail export file '$file'" );
|
||||
}
|
||||
fwrite( $fp, exportEventDetail( $event, $exportFrames, $exportImages ) );
|
||||
fclose( $fp );
|
||||
$exportFileList[$file] = $eventPath."/".$file;
|
||||
}
|
||||
if ( $exportFrames )
|
||||
{
|
||||
$file = "zmEventFrames.html";
|
||||
if ( !($fp = fopen( $eventPath."/".$file, "w" )) )
|
||||
{
|
||||
Fatal( "Can't open event frames export file '$file'" );
|
||||
}
|
||||
fwrite( $fp, exportEventFrames( $event, $exportDetail, $exportImages ) );
|
||||
fclose( $fp );
|
||||
$exportFileList[$file] = $eventPath."/".$file;
|
||||
}
|
||||
if ( $exportImages )
|
||||
{
|
||||
$filesLeft = array();
|
||||
$myfilelist = array();
|
||||
foreach ( $files as $file )
|
||||
{
|
||||
if ( preg_match( "/-(?:capture|analyse).jpg$/", $file ) )
|
||||
{
|
||||
$exportFileList[$file] = $eventPath."/".$file;
|
||||
$myfilelist[$file] = $eventPath."/".$file;
|
||||
}
|
||||
else
|
||||
{
|
||||
$filesLeft[$file] = $file;
|
||||
}
|
||||
}
|
||||
$files = $filesLeft;
|
||||
|
||||
|
||||
|
||||
// create an image slider
|
||||
if(!empty($myfilelist)) {
|
||||
$file = "zmEventImages.html";
|
||||
if ( !($fp = fopen( $eventPath."/".$file, "w" )) ) Fatal( "Can't open event images export file '$file'" );
|
||||
fwrite( $fp, exportEventImages( $event, $exportDetail, $exportFrames, $myfilelist ) );
|
||||
fclose( $fp );
|
||||
$exportFileList[$file] = $eventPath."/".$file;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if ( $exportVideo )
|
||||
{
|
||||
$filesLeft = array();
|
||||
foreach ( $files as $file )
|
||||
{
|
||||
if ( preg_match( "/\.(?:mpg|mpeg|avi|asf|3gp)$/", $file ) )
|
||||
{
|
||||
$exportFileList[$file] = $eventPath."/".$file;
|
||||
}
|
||||
else
|
||||
{
|
||||
$filesLeft[$file] = $file;
|
||||
}
|
||||
}
|
||||
$files = $filesLeft;
|
||||
}
|
||||
if ( $exportMisc )
|
||||
{
|
||||
foreach ( $files as $file )
|
||||
{
|
||||
$exportFileList[$file] = $eventPath."/".$file;
|
||||
}
|
||||
$files = array();
|
||||
}
|
||||
}
|
||||
return( array_values( $exportFileList ) );
|
||||
}
|
||||
|
||||
function exportEvents( $eids, $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc, $exportFormat )
|
||||
{
|
||||
|
||||
|
||||
if ( canView( 'Events' ) && !empty($eids) )
|
||||
{
|
||||
$export_root = "zmExport";
|
||||
$export_listFile = "zmFileList.txt";
|
||||
$exportFileList = array();
|
||||
$html_eventMaster = '';
|
||||
|
||||
|
||||
if ( is_array( $eids ) )
|
||||
{
|
||||
foreach ( $eids as $eid )
|
||||
{
|
||||
$exportFileList = array_merge( $exportFileList, exportFileList( $eid , $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc ) );
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$eid = $eids;
|
||||
$exportFileList = exportFileList( $eid, $exportDetail, $exportFrames, $exportImages, $exportVideo, $exportMisc );
|
||||
}
|
||||
|
||||
// create an master image slider
|
||||
if($exportImages)
|
||||
{
|
||||
if ( !is_array($eids) )
|
||||
{
|
||||
$eids = array($eids);
|
||||
}
|
||||
$monitorPath = 'events/';
|
||||
$html_eventMaster = 'zmEventImagesMaster_'.date('Ymd_His'). '.html';
|
||||
if ( !($fp = fopen( $monitorPath."/".$html_eventMaster, "w" )) ) Fatal( "Can't open event images export file '$html_eventMaster'" );
|
||||
fwrite( $fp, exportEventImagesMaster( $eids ) );
|
||||
fclose( $fp );
|
||||
$exportFileList[] = $monitorPath."/".$html_eventMaster;
|
||||
}
|
||||
|
||||
$listFile = "temp/".$export_listFile;
|
||||
if ( !($fp = fopen( $listFile, "w" )) )
|
||||
{
|
||||
Fatal( "Can't open event export list file '$listFile'" );
|
||||
}
|
||||
foreach ( $exportFileList as $exportFile )
|
||||
{
|
||||
fwrite( $fp, "$exportFile\n" );
|
||||
}
|
||||
fclose( $fp );
|
||||
$archive = "";
|
||||
if ( $exportFormat == "tar" )
|
||||
{
|
||||
$archive = "temp/".$export_root.".tar.gz";
|
||||
@unlink( $archive );
|
||||
$command = "tar --create --gzip --file=$archive --files-from=$listFile";
|
||||
exec( escapeshellcmd( $command ), $output, $status );
|
||||
if ( $status )
|
||||
{
|
||||
Error( "Command '$command' returned with status $status" );
|
||||
if ( $output[0] )
|
||||
Error( "First line of output is '".$output[0]."'" );
|
||||
return( false );
|
||||
}
|
||||
}
|
||||
elseif ( $exportFormat == "zip" )
|
||||
{
|
||||
$archive = "temp/zm_export.zip";
|
||||
$archive = "temp/".$export_root.".zip";
|
||||
@unlink( $archive );
|
||||
$command = "cat ".escapeshellarg($listFile)." | zip -q ".escapeshellarg($archive)." -@";
|
||||
//cat zmFileList.txt | zip -q zm_export.zip -@
|
||||
//-bash: zip: command not found
|
||||
|
||||
exec( $command, $output, $status );
|
||||
if ( $status )
|
||||
{
|
||||
Error( "Command '$command' returned with status $status" );
|
||||
if ( $output[0] )
|
||||
Error( "First line of output is '".$output[0]."'" );
|
||||
return( false );
|
||||
}
|
||||
}
|
||||
|
||||
//clean up temporary files
|
||||
if(!empty($html_eventMaster)) {
|
||||
unlink($monitorPath.'/'.$html_eventMaster);
|
||||
}
|
||||
|
||||
}
|
||||
return( $archive );
|
||||
}
|
||||
function mygetEventPath( $event )
|
||||
{
|
||||
if ( ZM_USE_DEEP_STORAGE )
|
||||
$eventPath = ZM_DIR_EVENTS.'/'.$event['MonitorId'].'/'.strftime( "%y/%m/%d/%H/%M/%S", strtotime($event['StartTime']) );
|
||||
else
|
||||
$eventPath = ZM_DIR_EVENTS.'/'.$event['MonitorId'].'/'.$event['Id'];
|
||||
return( $eventPath );
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
<?php function xhtmlHeaders( $file, $title ) {
|
||||
extract( $GLOBALS, EXTR_OVERWRITE );
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" ng-app="ZoneMinder">
|
||||
<head>
|
||||
<title><?= ZM_WEB_TITLE_PREFIX ?> - <?= validHtmlStr($title) ?></title>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<base href="/">
|
||||
<link rel="icon" type="image/ico" href="graphics/favicon.ico"/>
|
||||
<link rel="shortcut icon" href="graphics/favicon.ico"/>
|
||||
<link rel="stylesheet" href="skins/bootstrap/css/bootstrap.css" type="text/css" />
|
||||
<link rel="stylesheet" href="skins/bootstrap/css/datetimepicker.css" type="text/css" />
|
||||
<link rel="stylesheet" href="skins/bootstrap/css/skin.css" type="text/css" />
|
||||
<script type="text/javascript" src="skins/bootstrap/js/moment.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
|
||||
<script src="skins/bootstrap/js/dirPagination.js"></script>
|
||||
<script type="text/javascript" src="skins/bootstrap/js/Chart.min.js"></script>
|
||||
<script src="skins/bootstrap/js/app.js"></script>
|
||||
<script src="skins/bootstrap/js/controllers.js"></script>
|
||||
<script type="text/javascript" src="skins/bootstrap/js/tc-angular-chartjs.min.js"></script>
|
||||
<script type="text/javascript" src="skins/bootstrap/js/ui-bootstrap-tpls-0.12.0.min.js"></script>
|
||||
<script type="text/javascript" src="skins/bootstrap/js/jquery-2.1.1.min.js"></script>
|
||||
<script type="text/javascript" src="skins/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="skins/bootstrap/js/datetimepicker.js"></script>
|
||||
</head>
|
||||
<?php } ?>
|
|
@ -1,525 +0,0 @@
|
|||
<?php
|
||||
|
||||
function getDateScale( $scales, $range, $minLines, $maxLines )
|
||||
{
|
||||
foreach ( $scales as $scale )
|
||||
{
|
||||
$align = isset($scale['align'])?$scale['align']:1;
|
||||
$scaleRange = (int)($range/($scale['factor']*$align));
|
||||
//echo "S:".$scale['name'].", A:$align, SR:$scaleRange<br>";
|
||||
if ( $scaleRange >= $minLines )
|
||||
{
|
||||
$scale['range'] = $scaleRange;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( !isset($scale['range']) )
|
||||
{
|
||||
$scale['range'] = (int)($range/($scale['factor']*$align));
|
||||
}
|
||||
$scale['divisor'] = 1;
|
||||
while ( ($scale['range']/$scale['divisor']) > $maxLines )
|
||||
{
|
||||
$scale['divisor']++;
|
||||
}
|
||||
$scale['lines'] = (int)($scale['range']/$scale['divisor']);
|
||||
return( $scale );
|
||||
}
|
||||
|
||||
function getYScale( $range, $minLines, $maxLines )
|
||||
{
|
||||
$scale['range'] = $range;
|
||||
$scale['divisor'] = 1;
|
||||
while ( $scale['range']/$scale['divisor'] > $maxLines )
|
||||
{
|
||||
$scale['divisor']++;
|
||||
}
|
||||
$scale['lines'] = (int)(($scale['range']-1)/$scale['divisor'])+1;
|
||||
|
||||
return( $scale );
|
||||
}
|
||||
|
||||
function getSlotFrame( $slot )
|
||||
{
|
||||
$slotFrame = isset($slot['frame'])?$slot['frame']['FrameId']:1;
|
||||
if ( false && $slotFrame )
|
||||
{
|
||||
$slotFrame -= $monitor['PreEventCount'];
|
||||
if ( $slotFrame < 1 )
|
||||
$slotFrame = 1;
|
||||
}
|
||||
return( $slotFrame );
|
||||
}
|
||||
|
||||
function parseFilterToTree( $filter )
|
||||
{
|
||||
if ( count($filter['terms']) > 0 )
|
||||
{
|
||||
$postfixExpr = array();
|
||||
$postfixStack = array();
|
||||
|
||||
$priorities = array(
|
||||
'<' => 1,
|
||||
'<=' => 1,
|
||||
'>' => 1,
|
||||
'>=' => 1,
|
||||
'=' => 2,
|
||||
'!=' => 2,
|
||||
'=~' => 2,
|
||||
'!~' => 2,
|
||||
'=[]' => 2,
|
||||
'![]' => 2,
|
||||
'and' => 3,
|
||||
'or' => 4,
|
||||
);
|
||||
|
||||
for ( $i = 0; $i <= count($filter['terms']); $i++ )
|
||||
{
|
||||
if ( !empty($filter['terms'][$i]['cnj']) )
|
||||
{
|
||||
while( true )
|
||||
{
|
||||
if ( !count($postfixStack) )
|
||||
{
|
||||
$postfixStack[] = array( 'type'=>"cnj", 'value'=>$filter['terms'][$i]['cnj'], 'sqlValue'=>$filter['terms'][$i]['cnj']);
|
||||
break;
|
||||
}
|
||||
elseif ( $postfixStack[count($postfixStack)-1]['type'] == 'obr' )
|
||||
{
|
||||
$postfixStack[] = array( 'type'=>"cnj", 'value'=>$filter['terms'][$i]['cnj'], 'sqlValue'=>$filter['terms'][$i]['cnj']);
|
||||
break;
|
||||
}
|
||||
elseif ( $priorities[$filter['terms'][$i]['cnj']] < $priorities[$postfixStack[count($postfixStack)-1]['value']] )
|
||||
{
|
||||
$postfixStack[] = array( 'type'=>"cnj", 'value'=>$filter['terms'][$i]['cnj'], 'sqlValue'=>$filter['terms'][$i]['cnj']);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
$postfixExpr[] = array_pop( $postfixStack );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( !empty($filter['terms'][$i]['obr']) )
|
||||
{
|
||||
for ( $j = 0; $j < $filter['terms'][$i]['obr']; $j++ )
|
||||
{
|
||||
$postfixStack[] = array( 'type'=>"obr", 'value'=>$filter['terms'][$i]['obr']);
|
||||
}
|
||||
}
|
||||
if ( !empty($filter['terms'][$i]['attr']) )
|
||||
{
|
||||
$dtAttr = false;
|
||||
switch ( $filter['terms'][$i]['attr'])
|
||||
{
|
||||
case 'MonitorName':
|
||||
$sqlValue = 'M.'.preg_replace( '/^Monitor/', '', $filter['terms'][$i]['attr']);
|
||||
break;
|
||||
case 'Name':
|
||||
$sqlValue = "E.Name";
|
||||
break;
|
||||
case 'Cause':
|
||||
$sqlValue = "E.Cause";
|
||||
break;
|
||||
case 'DateTime':
|
||||
$sqlValue = "E.StartTime";
|
||||
$dtAttr = true;
|
||||
break;
|
||||
case 'Date':
|
||||
$sqlValue = "to_days( E.StartTime )";
|
||||
$dtAttr = true;
|
||||
break;
|
||||
case 'Time':
|
||||
$sqlValue = "extract( hour_second from E.StartTime )";
|
||||
break;
|
||||
case 'Weekday':
|
||||
$sqlValue = "weekday( E.StartTime )";
|
||||
break;
|
||||
case 'Id':
|
||||
case 'Name':
|
||||
case 'MonitorId':
|
||||
case 'Length':
|
||||
case 'Frames':
|
||||
case 'AlarmFrames':
|
||||
case 'TotScore':
|
||||
case 'AvgScore':
|
||||
case 'MaxScore':
|
||||
case 'Archived':
|
||||
$sqlValue = "E.".$filter['terms'][$i]['attr'];
|
||||
break;
|
||||
case 'DiskPercent':
|
||||
$sqlValue = getDiskPercent();
|
||||
break;
|
||||
case 'DiskBlocks':
|
||||
$sqlValue = getDiskBlocks();
|
||||
break;
|
||||
default :
|
||||
$sqlValue = $filter['terms'][$i]['attr'];
|
||||
break;
|
||||
}
|
||||
if ( $dtAttr )
|
||||
{
|
||||
$postfixExpr[] = array( 'type'=>"attr", 'value'=>$filter['terms'][$i]['attr'], 'sqlValue'=>$sqlValue, 'dtAttr'=>true );
|
||||
}
|
||||
else
|
||||
{
|
||||
$postfixExpr[] = array( 'type'=>"attr", 'value'=>$filter['terms'][$i]['attr'], 'sqlValue'=>$sqlValue );
|
||||
}
|
||||
}
|
||||
if ( isset($filter['terms'][$i]['op']) )
|
||||
{
|
||||
if ( empty($filter['terms'][$i]['op']) )
|
||||
{
|
||||
$filter['terms'][$i]['op' ]= '=';
|
||||
}
|
||||
switch ( $filter['terms'][$i]['op' ])
|
||||
{
|
||||
case '=' :
|
||||
case '!=' :
|
||||
case '>=' :
|
||||
case '>' :
|
||||
case '<' :
|
||||
case '<=' :
|
||||
$sqlValue = $filter['terms'][$i]['op'];
|
||||
break;
|
||||
case '=~' :
|
||||
$sqlValue = "regexp";
|
||||
break;
|
||||
case '!~' :
|
||||
$sqlValue = "not regexp";
|
||||
break;
|
||||
case '=[]' :
|
||||
$sqlValue = 'in (';
|
||||
break;
|
||||
case '![]' :
|
||||
$sqlValue = 'not in (';
|
||||
break;
|
||||
}
|
||||
while( true )
|
||||
{
|
||||
if ( !count($postfixStack) )
|
||||
{
|
||||
$postfixStack[] = array( 'type'=>"op", 'value'=>$filter['terms'][$i]['op'], 'sqlValue'=>$sqlValue );
|
||||
break;
|
||||
}
|
||||
elseif ( $postfixStack[count($postfixStack)-1]['type'] == 'obr' )
|
||||
{
|
||||
$postfixStack[] = array( 'type'=>"op", 'value'=>$filter['terms'][$i]['op'], 'sqlValue'=>$sqlValue );
|
||||
break;
|
||||
}
|
||||
elseif ( $priorities[$filter['terms'][$i]['op']] < $priorities[$postfixStack[count($postfixStack)-1]['value']] )
|
||||
{
|
||||
$postfixStack[] = array( 'type'=>"op", 'value'=>$filter['terms'][$i]['op'], 'sqlValue'=>$sqlValue );
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
$postfixExpr[] = array_pop( $postfixStack );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( isset($filter['terms'][$i]['val']) )
|
||||
{
|
||||
$valueList = array();
|
||||
foreach ( preg_split( '/["\'\s]*?,["\'\s]*?/', preg_replace( '/^["\']+?(.+)["\']+?$/', '$1', $filter['terms'][$i]['val' ]) ) as $value )
|
||||
{
|
||||
switch ( $filter['terms'][$i]['attr'])
|
||||
{
|
||||
case 'MonitorName':
|
||||
case 'Name':
|
||||
case 'Cause':
|
||||
case 'Notes':
|
||||
$value = "'$value'";
|
||||
break;
|
||||
case 'DateTime':
|
||||
$value = "'".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."'";
|
||||
break;
|
||||
case 'Date':
|
||||
$value = "to_days( '".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."' )";
|
||||
break;
|
||||
case 'Time':
|
||||
$value = "extract( hour_second from '".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."' )";
|
||||
break;
|
||||
case 'Weekday':
|
||||
$value = "weekday( '".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."' )";
|
||||
break;
|
||||
}
|
||||
$valueList[] = $value;
|
||||
}
|
||||
$postfixExpr[] = array( 'type'=>"val", 'value'=>$filter['terms'][$i]['val'], 'sqlValue'=>join( ',', $valueList ) );
|
||||
}
|
||||
if ( !empty($filter['terms'][$i]['cbr']) )
|
||||
{
|
||||
for ( $j = 0; $j < $filter['terms'][$i]['cbr']; $j++ )
|
||||
{
|
||||
while ( count($postfixStack) )
|
||||
{
|
||||
$element = array_pop( $postfixStack );
|
||||
if ( $element['type'] == "obr" )
|
||||
{
|
||||
$postfixExpr[count($postfixExpr)-1]['bracket'] = true;
|
||||
break;
|
||||
}
|
||||
$postfixExpr[] = $element;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
while ( count($postfixStack) )
|
||||
{
|
||||
$postfixExpr[] = array_pop( $postfixStack );
|
||||
}
|
||||
|
||||
$exprStack = array();
|
||||
//foreach ( $postfixExpr as $element )
|
||||
//{
|
||||
//echo $element['value']." ";
|
||||
//}
|
||||
//echo "<br>";
|
||||
foreach ( $postfixExpr as $element )
|
||||
{
|
||||
if ( $element['type'] == 'attr' || $element['type'] == 'val' )
|
||||
{
|
||||
$node = array( 'data'=>$element, 'count'=>0 );
|
||||
$exprStack[] = $node;
|
||||
}
|
||||
elseif ( $element['type'] == 'op' || $element['type'] == 'cnj' )
|
||||
{
|
||||
$right = array_pop( $exprStack );
|
||||
$left = array_pop( $exprStack );
|
||||
$node = array( 'data'=>$element, 'count'=>2+$left['count']+$right['count'], 'right'=>$right, 'left'=>$left );
|
||||
$exprStack[] = $node;
|
||||
}
|
||||
else
|
||||
{
|
||||
Fatal( "Unexpected element type '".$element['type']."', value '".$element['value']."'" );
|
||||
}
|
||||
}
|
||||
if ( count($exprStack) != 1 )
|
||||
{
|
||||
Fatal( "Expression stack has ".count($exprStack)." elements" );
|
||||
}
|
||||
$exprTree = array_pop( $exprStack );
|
||||
return( $exprTree );
|
||||
}
|
||||
return( false );
|
||||
}
|
||||
|
||||
function _parseTreeToInfix( $node )
|
||||
{
|
||||
$expression = '';
|
||||
if ( isset($node) )
|
||||
{
|
||||
if ( isset($node['left']) )
|
||||
{
|
||||
if ( !empty($node['data']['bracket']) )
|
||||
$expression .= '( ';
|
||||
$expression .= _parseTreeToInfix( $node['left'] );
|
||||
}
|
||||
$expression .= $node['data']['value']." ";
|
||||
if ( isset($node['right']) )
|
||||
{
|
||||
$expression .= _parseTreeToInfix( $node['right'] );
|
||||
if ( !empty($node['data']['bracket']) )
|
||||
$expression .= ') ';
|
||||
}
|
||||
}
|
||||
return( $expression );
|
||||
}
|
||||
|
||||
function parseTreeToInfix( $tree )
|
||||
{
|
||||
return( _parseTreeToInfix( $tree ) );
|
||||
}
|
||||
|
||||
function _parseTreeToSQL( $node, $cbr=false )
|
||||
{
|
||||
$expression = '';
|
||||
if ( $node )
|
||||
{
|
||||
if ( isset($node['left']) )
|
||||
{
|
||||
if ( !empty($node['data']['bracket']) )
|
||||
$expression .= '( ';
|
||||
$expression .= _parseTreeToSQL( $node['left'] );
|
||||
}
|
||||
$inExpr = $node['data']['type'] == 'op' && ($node['data']['value'] == '=[]' || $node['data']['value'] == '![]');
|
||||
$expression .= $node['data']['sqlValue'];
|
||||
if ( !$inExpr )
|
||||
$expression .= ' ';
|
||||
if ( $cbr )
|
||||
$expression .= ') ';
|
||||
if ( isset($node['right']) )
|
||||
{
|
||||
$expression .= _parseTreeToSQL( $node['right'], $inExpr );
|
||||
if ( !empty($node['data']['bracket']) )
|
||||
$expression .= ') ';
|
||||
}
|
||||
}
|
||||
return( $expression );
|
||||
}
|
||||
|
||||
function parseTreeToSQL( $tree )
|
||||
{
|
||||
return( _parseTreeToSQL( $tree ) );
|
||||
}
|
||||
|
||||
function _parseTreeToFilter( $node, &$terms, &$level )
|
||||
{
|
||||
$elements = array();
|
||||
if ( $node )
|
||||
{
|
||||
if ( isset($node['left']) )
|
||||
{
|
||||
if ( !empty($node['data']['bracket']) )
|
||||
$terms[$level]['obr'] = 1;
|
||||
_parseTreeToFilter( $node['left'], $terms, $level );
|
||||
}
|
||||
if ( $node['data']['type'] == 'cnj' )
|
||||
{
|
||||
$level++;
|
||||
}
|
||||
$terms[$level][$node['data']['type']] = $node['data']['value'];
|
||||
if ( isset($node['right']) )
|
||||
{
|
||||
_parseTreeToFilter( $node['right'], $terms, $level );
|
||||
if ( !empty($node['data']['bracket']) )
|
||||
$terms[$level]['cbr'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function parseTreeToFilter( $tree )
|
||||
{
|
||||
$terms = array();
|
||||
if ( isset($tree) )
|
||||
{
|
||||
$level = 0;
|
||||
_parseTreeToFilter( $tree, $terms, $level );
|
||||
}
|
||||
return( array( 'terms' => $terms ) );
|
||||
}
|
||||
|
||||
function parseTreeToQuery( $tree )
|
||||
{
|
||||
$filter = parseTreeToFilter( $tree );
|
||||
parseFilter( $filter, false, '&' );
|
||||
return( $filter['query'] );
|
||||
}
|
||||
|
||||
function _drawTree( $node, $level )
|
||||
{
|
||||
if ( isset($node['left']) )
|
||||
{
|
||||
_drawTree( $node['left'], $level+1 );
|
||||
}
|
||||
echo str_repeat( ".", $level*2 ).$node['data']['value']."<br>";
|
||||
if ( isset($node['right']) )
|
||||
{
|
||||
_drawTree( $node['right'], $level+1 );
|
||||
}
|
||||
}
|
||||
|
||||
function drawTree( $tree )
|
||||
{
|
||||
_drawTree( $tree, 0 );
|
||||
}
|
||||
|
||||
function _extractDatetimeRange( &$node, &$minTime, &$maxTime, &$expandable, $subOr )
|
||||
{
|
||||
$pruned = $leftPruned = $rightPruned = false;
|
||||
if ( $node )
|
||||
{
|
||||
if ( isset($node['left']) && isset($node['right']) )
|
||||
{
|
||||
if ( $node['data']['type'] == 'cnj' && $node['data']['value'] == 'or' )
|
||||
{
|
||||
$subOr = true;
|
||||
}
|
||||
elseif ( !empty($node['left']['data']['dtAttr']) )
|
||||
{
|
||||
if ( $subOr )
|
||||
{
|
||||
$expandable = false;
|
||||
}
|
||||
elseif ( $node['data']['type'] == 'op' )
|
||||
{
|
||||
if ( $node['data']['value'] == '>' || $node['data']['value'] == '>=' )
|
||||
{
|
||||
if ( !$minTime || $minTime > $node['right']['data']['sqlValue'] )
|
||||
{
|
||||
$minTime = $node['right']['data']['value'];
|
||||
return( true );
|
||||
}
|
||||
}
|
||||
if ( $node['data']['value'] == '<' || $node['data']['value'] == '<=' )
|
||||
{
|
||||
if ( !$maxTime || $maxTime < $node['right']['data']['sqlValue'] )
|
||||
{
|
||||
$maxTime = $node['right']['data']['value'];
|
||||
return( true );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Fatal( "Unexpected node type '".$node['data']['type']."'" );
|
||||
}
|
||||
return( false );
|
||||
}
|
||||
|
||||
$leftPruned = _extractDatetimeRange( $node['left'], $minTime, $maxTime, $expandable, $subOr );
|
||||
$rightPruned = _extractDatetimeRange( $node['right'], $minTime, $maxTime, $expandable, $subOr );
|
||||
|
||||
if ( $leftPruned && $rightPruned )
|
||||
{
|
||||
$pruned = true;
|
||||
}
|
||||
elseif ( $leftPruned )
|
||||
{
|
||||
$node = $node['right'];
|
||||
}
|
||||
elseif ( $rightPruned )
|
||||
{
|
||||
$node = $node['left'];
|
||||
}
|
||||
}
|
||||
}
|
||||
return( $pruned );
|
||||
}
|
||||
|
||||
function extractDatetimeRange( &$tree, &$minTime, &$maxTime, &$expandable )
|
||||
{
|
||||
$minTime = "";
|
||||
$maxTime = "";
|
||||
$expandable = true;
|
||||
|
||||
_extractDateTimeRange( $tree, $minTime, $maxTime, $expandable, false );
|
||||
}
|
||||
|
||||
function appendDatetimeRange( &$tree, $minTime, $maxTime=false )
|
||||
{
|
||||
$attrNode = array( 'data'=>array( 'type'=>'attr', 'value'=>'DateTime', 'sqlValue'=>'E.StartTime', 'dtAttr'=>true ), 'count'=>0 );
|
||||
$valNode = array( 'data'=>array( 'type'=>'val', 'value'=>$minTime, 'sqlValue'=>$minTime ), 'count'=>0 );
|
||||
$opNode = array( 'data'=>array( 'type'=>'op', 'value'=>'>=', 'sqlValue'=>'>=' ), 'count'=>2, 'left'=>$attrNode, 'right'=>$valNode );
|
||||
if ( isset($tree) )
|
||||
{
|
||||
$cnjNode = array( 'data'=>array( 'type'=>'cnj', 'value'=>'and', 'sqlValue'=>'and' ), 'count'=>2+$tree['count']+$opNode['count'], 'left'=>$tree, 'right'=>$opNode );
|
||||
$tree = $cnjNode;
|
||||
}
|
||||
else
|
||||
{
|
||||
$tree = $opNode;
|
||||
}
|
||||
|
||||
if ( $maxTime )
|
||||
{
|
||||
$attrNode = array( 'data'=>array( 'type'=>'attr', 'value'=>'DateTime', 'sqlValue'=>'E.StartTime', 'dtAttr'=>true ), 'count'=>0 );
|
||||
$valNode = array( 'data'=>array( 'type'=>'val', 'value'=>$maxTime, 'sqlValue'=>$maxTime ), 'count'=>0 );
|
||||
$opNode = array( 'data'=>array( 'type'=>'op', 'value'=>'<=', 'sqlValue'=>'<=' ), 'count'=>2, 'left'=>$attrNode, 'right'=>$valNode );
|
||||
$cnjNode = array( 'data'=>array( 'type'=>'cnj', 'value'=>'and', 'sqlValue'=>'and' ), 'count'=>2+$tree['count']+$opNode['count'], 'left'=>$tree, 'right'=>$opNode );
|
||||
$tree = $cnjNode;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,5 +0,0 @@
|
|||
AUTOMAKE_OPTIONS = gnu
|
||||
|
||||
webdir = @WEB_PREFIX@/skins/classic/lang
|
||||
|
||||
dist_web_DATA = # No files here
|
|
@ -1,66 +0,0 @@
|
|||
<?php
|
||||
//
|
||||
// ZoneMinder HTML interface file, $Date$, $Revision$
|
||||
// Copyright (C) 2001-2008 Philip Coombes
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
|
||||
if ( empty($_COOKIE['zmBandwidth']) )
|
||||
$_COOKIE['zmBandwidth'] = "low";
|
||||
|
||||
//ini_set( "magic_quotes_gpc", "Off" );
|
||||
|
||||
// Uncomment if there are language overrides
|
||||
//if ( $skinLangFile = loadLanguage( ZM_SKIN_PATH ) )
|
||||
//require_once( $skinLangFile );
|
||||
|
||||
foreach ( getSkinIncludes( 'includes/config.php' ) as $includeFile )
|
||||
require_once $includeFile;
|
||||
|
||||
foreach ( getSkinIncludes( 'includes/functions.php' ) as $includeFile )
|
||||
require_once $includeFile;
|
||||
|
||||
if ( empty($view) )
|
||||
$view = isset($user)?'console':'login';
|
||||
|
||||
if ( !isset($user) && ZM_OPT_USE_AUTH && ZM_AUTH_TYPE == "remote" && !empty( $_SERVER['REMOTE_USER']) )
|
||||
{
|
||||
$view = "postlogin";
|
||||
$action = "login";
|
||||
$_REQUEST['username'] = $_SERVER['REMOTE_USER'];
|
||||
}
|
||||
|
||||
if ( isset($user) )
|
||||
{
|
||||
// Bandwidth Limiter
|
||||
if ( !empty($user['MaxBandwidth']) )
|
||||
{
|
||||
if ( $user['MaxBandwidth'] == "low" )
|
||||
{
|
||||
$_COOKIE['zmBandwidth'] = "low";
|
||||
}
|
||||
elseif ( $user['MaxBandwidth'] == "medium" && $_COOKIE['zmBandwidth'] == "high" )
|
||||
{
|
||||
$_COOKIE['zmBandwidth'] = "medium";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If there are additional actions
|
||||
foreach ( getSkinIncludes( 'includes/actions.php' ) as $includeFile )
|
||||
require_once $includeFile;
|
||||
|
||||
?>
|
|
@ -1,31 +0,0 @@
|
|||
AUTOMAKE_OPTIONS = gnu
|
||||
|
||||
webdir = @WEB_PREFIX@/skins/classic/views/css
|
||||
|
||||
dist_web_DATA = \
|
||||
console.css \
|
||||
controlcaps.css \
|
||||
control.css \
|
||||
devices.css \
|
||||
event.css \
|
||||
events.css \
|
||||
export.css \
|
||||
filter.css \
|
||||
frame.css \
|
||||
frames.css \
|
||||
groups.css \
|
||||
log.css \
|
||||
monitor.css \
|
||||
montage_2wide.css \
|
||||
montage_3wide50enlarge.css \
|
||||
montage_3wide.css \
|
||||
montage_4wide.css \
|
||||
montage.css \
|
||||
montage_freeform.css \
|
||||
options.css \
|
||||
stats.css \
|
||||
timeline.css \
|
||||
timeline.css.php \
|
||||
video.css \
|
||||
watch.css \
|
||||
zone.css
|
|
@ -1,97 +0,0 @@
|
|||
#systemTime {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#title {
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
#systemStats {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#monitorSummary {
|
||||
float: left;
|
||||
text-align: left;
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
#devices {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#loginBandwidth {
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
#cycleMontage {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#options {
|
||||
float: right;
|
||||
text-align: right;
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
#consoleTable {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#consoleTable tr.highlight {
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
|
||||
#consoleTable thead th {
|
||||
padding-bottom: 4px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#consoleTable tfoot td {
|
||||
padding-top: 4px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#consoleTable th,td {
|
||||
height: 16px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#consoleTable .colOrder {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#consoleTable .colMark {
|
||||
width: 32px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#consoleTable .colEvents {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#consoleTable .colZones {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#consoleTable .colLeftButtons {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#consoleTable .colLeftButtons input {
|
||||
margin-right: 24px;
|
||||
}
|
||||
|
||||
#consoleTable .colRightButtons {
|
||||
text-align: right;
|
||||
padding-right: 8px;
|
||||
}
|
||||
|
||||
#consoleTable .colRightButtons input {
|
||||
margin: 0 8px;
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
@import url(../../css/control.css);
|
|
@ -1,3 +0,0 @@
|
|||
#content table.major .colCanMove, #content table.major .colCanZoom, #content table.major .colCanFocus, #content table.major .colCanIris, #content table.major .colCanWhiteBal, #content table.major .colHasPresets {
|
||||
text-align: center;
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
input.set {
|
||||
border: 1px #7F7FB2 dashed;
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
#contentTable + input {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
#contentTable th, #contentTable td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#exportProgress {
|
||||
margin: 8px auto 4px;
|
||||
}
|
||||
|
||||
#downloadLink {
|
||||
margin-top: 8px;
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
#filterSelector {
|
||||
}
|
||||
|
||||
table.filterTable {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#fieldsTable td {
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
#fieldsTable input[type=button] {
|
||||
width: 1.6em;
|
||||
margin-left: 2px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#sortTable input[type=text] {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
#actionsTable input[type=text] {
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
#controls {
|
||||
width: 80%;
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#controls a {
|
||||
width: 40px;
|
||||
margin-left: -20px;
|
||||
}
|
||||
|
||||
#firstLink {
|
||||
position: absolute;
|
||||
left: 13%;
|
||||
}
|
||||
|
||||
#prevLink {
|
||||
position: absolute;
|
||||
left: 37%;
|
||||
}
|
||||
|
||||
#nextLink {
|
||||
position: absolute;
|
||||
left: 63%;
|
||||
}
|
||||
|
||||
#lastLink {
|
||||
position: absolute;
|
||||
left: 87%;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
#contentTable.major .colId, #contentTable.major .colType, #contentTable.major .colTimeStamp, #contentTable.major .colTimeDelta, #contentTable.major .colScore {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
tr.alarm {
|
||||
background-color: #fa8072;
|
||||
}
|
||||
|
||||
tr.bulk {
|
||||
background-color: #cccccc;
|
||||
}
|
||||
|
||||
tr.normal {
|
||||
background-color: #ffffff;
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
#contentTable .colSelect {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#contentTable .colSelect input {
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
#logSummary {
|
||||
margin: 4px auto 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
#logSummary tr {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#logSummary td {
|
||||
border: 1px solid #7f7fb2;
|
||||
padding: 0 6px;
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
line-height: 15px;
|
||||
}
|
||||
|
||||
tr.log-fat td {
|
||||
background-color:#ffcccc;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
tr.log-err td {
|
||||
background-color:#ffcccc;
|
||||
}
|
||||
|
||||
tr.log-war td {
|
||||
background-color: #ffe4b5;
|
||||
}
|
||||
|
||||
tr.log-dbg td {
|
||||
color: #666666;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
#exportLog label {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#exportLog input[type=radio] {
|
||||
margin-right: 4px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#exportError {
|
||||
display: none;
|
||||
color: #dc143c;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
#exportErrorText {
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
.swatch {
|
||||
border: 1px solid black;
|
||||
margin-left: 3px;
|
||||
padding: 0px;
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
#header {
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
#layout {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#content {
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
#monitors .alarm {
|
||||
color: #ff0000;
|
||||
}
|
||||
|
||||
#monitors .alert {
|
||||
color: #ffa500;
|
||||
}
|
||||
|
||||
#monitors .imageFeed {
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#monitors .imageFeed img.idle {
|
||||
border: 2px solid #ffffff;
|
||||
}
|
||||
|
||||
#monitors .imageFeed img.alarm {
|
||||
border: 2px solid #ff0000;
|
||||
}
|
||||
|
||||
#monitors .imageFeed img.alert {
|
||||
border: 2px solid #ffa500;
|
||||
}
|
||||
|
||||
#monitors .monitorState {
|
||||
margin: 2px auto;
|
||||
text-align: center;
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
#monitors {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitors .monitorFrame {
|
||||
padding: 1px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#monitors .monitor {
|
||||
}
|
||||
|
||||
#monitorFrame0, #monitorFrame2, #monitorFrame4, #monitorFrame6, #monitorFrame8, #monitorFrame10, #monitorFrame12, #monitorFrame14 {
|
||||
width: 49%;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#monitor0, #monitor2, #monitor4, #monitor6, #monitor8, #monitor10, #monitor12, #monitor14 {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#monitorFrame1, #monitorFrame3, #monitorFrame5, #monitorFrame7, #monitorFrame9, #monitorFrame11, #monitorFrame13, #monitorFrame15 {
|
||||
width: 49%;
|
||||
}
|
||||
|
||||
#monitor1, #monitor3, #monitor5, #monitor7, #monitor9, #monitor11, #monitor13, #monitor15 {
|
||||
float: left;
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
#monitors {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitors .monitorFrame {
|
||||
padding: 1px;
|
||||
float: left;
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
#monitors .monitor {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitorFrame0, #monitorFrame3, #monitorFrame6, #monitorFrame9, #monitorFrame12, #monitorFrame15 {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#monitor0, #monitor3, #monitor6, #monitor9, #monitor12, #monitor15 {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#monitorFrame1, #monitorFrame4, #monitorFrame7, #monitorFrame10, #monitorFrame13, #monitorFrame16 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitor1, #monitor4, #monitor7, #monitor10, #monitor13, #monitor16 {
|
||||
}
|
||||
|
||||
#monitorFrame2, #monitorFrame5, #monitorFrame8, #monitorFrame11, #monitorFrame14, #monitorFrame17 {
|
||||
}
|
||||
|
||||
#monitor2, #monitor5, #monitor8, #monitor11, #monitor14, #monitor17 {
|
||||
float: left;
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
#monitors {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitors .monitorFrame {
|
||||
float: left;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
#monitors .monitor {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitorFrame0, #monitorFrame3, #monitorFrame6, #monitorFrame9, #monitorFrame12, #monitorFrame15 {
|
||||
width: 32%;
|
||||
text-align: right;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#monitor0, #monitor3, #monitor6, #monitor9, #monitor12, #monitor15 {
|
||||
margin-left: auto;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#monitorFrame1, #monitorFrame4, #monitorFrame7, #monitorFrame10, #monitorFrame13, #monitorFrame16 {
|
||||
width: 32%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitor1, #monitor4, #monitor7, #monitor10, #monitor13, #monitor16 {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
#monitorFrame2, #monitorFrame5, #monitorFrame8, #monitorFrame11, #monitorFrame14, #monitorFrame17 {
|
||||
width: 32%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#monitor2, #monitor5, #monitor8, #monitor11, #monitor14, #monitor17 {
|
||||
margin-left: 0;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
#monitors .imageFeed img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#monitors .monitorFrame > div.alarm, #monitors .monitorFrame > div.alert {
|
||||
position: absolute;
|
||||
width: 96%;
|
||||
left: 2%;
|
||||
top: 72px;
|
||||
}
|
||||
|
||||
#monitors .monitorFrame > div.alert {
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
#monitors .monitorFrame > div.alarm {
|
||||
z-index: 200;
|
||||
}
|
||||
|
||||
#monitors .monitorFrame div.alarm, #monitors .monitorFrame div.alert {
|
||||
font-size: 140%;
|
||||
line-height: 160%;
|
||||
}
|
||||
|
||||
#monitors .monitorFrame div.monitorState {
|
||||
text-align: center;
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
#monitors {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitors .monitorFrame {
|
||||
padding: 1px;
|
||||
float: left;
|
||||
width: 24.5%;
|
||||
}
|
||||
|
||||
#monitors .monitor {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitorFrame0, #monitorFrame4, #monitorFrame8, #monitorFrame12, #monitorFrame16, #monitorFrame20 {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#monitor0, #monitor4, #monitor8, #monitor12, #monitor16, #monitor20 {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#monitorFrame1, #monitorFrame5, #monitorFrame9, #monitorFrame13, #monitorFrame17, #monitorFrame21 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitor1, #monitor5, #monitor9, #monitor13, #monitor17, #monitor21 {
|
||||
}
|
||||
|
||||
#monitorFrame2, #monitorFrame6, #monitorFrame10, #monitorFrame14, #monitorFrame18, #monitorFrame22 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitor2, #monitor6, #monitor10, #monitor14, #monitor18, #monitor22 {
|
||||
}
|
||||
|
||||
#monitorFrame3, #monitorFrame7, #monitorFrame11, #monitorFrame15, #monitorFrame19, #monitorFrame23 {
|
||||
}
|
||||
|
||||
#monitor3, #monitor7, #monitor11, #monitor15, #monitor19, #monitor23 {
|
||||
float: left;
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
#monitors {
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitors .monitorFrame {
|
||||
float: left;
|
||||
padding: 1px;
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
input.small {
|
||||
width: 6em;
|
||||
}
|
||||
|
||||
input.medium {
|
||||
width: 9em;
|
||||
}
|
||||
|
||||
input.large {
|
||||
width: 20em;
|
||||
}
|
||||
|
||||
#contentTable.optionTable th, #contentTable.optionTable td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#contentTable.userTable th, #contentTable.userTable td {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#contentTable.userTable .colMonitor, #contentTable.userTable .colUsername {
|
||||
text-align: left;
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
#settingsPanel {
|
||||
float: left;
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
#pluginSettings {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
#pluginSettings th, #pluginSettings td {
|
||||
border: 1px solid #7f7fb2;
|
||||
padding: 3px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#pluginSettings th[scope=row] {
|
||||
padding: 4px 3px 3px;
|
||||
vertical-align: top;
|
||||
white-space: nowrap;
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
#contentTable.major .colZone, #contentTable.major .colPixelDiff, #contentTable.major .colAlarmPx, #contentTable.major .colFilterPx, #contentTable.major .colBlobPx, #contentTable.major .colBlobs, #contentTable.major .colBlobSizes, #contentTable.major .colAlarmLimits, #contentTable.major .colScore {
|
||||
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#contentTable.major .rowNoStats {
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
}
|
|
@ -1,222 +0,0 @@
|
|||
#content {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
border: 1px solid #666666;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#title {
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
color: #016A9D;
|
||||
height: 30px;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
#listLink {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 20px;
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
#closeLink {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 20px;
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
#topPanel {
|
||||
position: relative;
|
||||
height: 220px;
|
||||
margin: 4px auto 6px;
|
||||
}
|
||||
|
||||
#topPanel #imagePanel
|
||||
{
|
||||
width: 50%;
|
||||
float: left;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#topPanel #image {
|
||||
float: right;
|
||||
margin: 0 auto;
|
||||
width: 90%;
|
||||
text-align: right;
|
||||
margin-right: 2px;
|
||||
background-color: #eeeeee;
|
||||
border: 1px solid #c8c8c8;
|
||||
}
|
||||
|
||||
#topPanel #image img {
|
||||
float: left;
|
||||
top: 0px;
|
||||
background-color: #f8f8f8;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#topPanel #dataPanel {
|
||||
width: 45%;
|
||||
float: left;
|
||||
text-align: left;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
#topPanel #textPanel {
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
height: 140px;
|
||||
margin: 0 auto;
|
||||
color: #016A9D;
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
line-height: 14px;
|
||||
background-color: #eeeeee;
|
||||
border: 1px solid #c8c8c8;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
#topPanel #navPanel {
|
||||
width: 100%;
|
||||
height: 70px;
|
||||
margin: 4px auto;
|
||||
}
|
||||
|
||||
#topPanel #navPanel input {
|
||||
background-color: #eeeeee;
|
||||
border: 1px solid #c8c8c8;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#chartPanel {
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#chartPanel #chart {
|
||||
position: relative;
|
||||
border: 1px solid black;
|
||||
margin: 0 auto;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
#chartPanel #activity {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
left: 0px;
|
||||
border-bottom: 1px solid #cccccc;
|
||||
}
|
||||
|
||||
#chartPanel #activity div.activity {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
z-index: 3;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
#chartPanel .events {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
left: 0px;
|
||||
background-color: #fcfcfc;
|
||||
border-bottom: 1px solid black;
|
||||
}
|
||||
|
||||
#chartPanel .event {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
#chartLabels {
|
||||
margin: 25px auto 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#range {
|
||||
width: 30%;
|
||||
margin: 0 auto;
|
||||
color: #016A9D;
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
#key {
|
||||
float: right;
|
||||
margin-top: -4px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
span.keyEntry {
|
||||
}
|
||||
|
||||
img.keyBox {
|
||||
position: relative;
|
||||
border: 1px solid black;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
top: 4px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
div.majGridX {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 0px;
|
||||
width: 1px;
|
||||
border-left: dotted 1px #cccccc;
|
||||
}
|
||||
|
||||
div.majTickX {
|
||||
position: absolute;
|
||||
bottom: -7px;
|
||||
width: 1px;
|
||||
height: 7px;
|
||||
border-left: solid 1px black;
|
||||
}
|
||||
|
||||
div.majLabelX {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
bottom: -20px;
|
||||
width: 50px;
|
||||
font-size: 9px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
div.majGridY {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
left: 0px;
|
||||
height: 1px;
|
||||
border-top: dotted 1px #cccccc;
|
||||
}
|
||||
|
||||
div.majTickY {
|
||||
position: absolute;
|
||||
left: -7px;
|
||||
height: 1px;
|
||||
width: 7px;
|
||||
border-top: solid 1px black;
|
||||
}
|
||||
|
||||
div.majLabelY {
|
||||
position: absolute;
|
||||
text-align: right;
|
||||
left: -30px;
|
||||
width: 20px;
|
||||
font-size: 9px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
div.zoom {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
bottom: 0px;
|
||||
}
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
.chartSize {
|
||||
width: <?= $chart['width'] ?>px;
|
||||
height: <?= $chart['height'] ?>px;
|
||||
}
|
||||
|
||||
.graphSize {
|
||||
width: <?= $chart['graph']['width'] ?>px;
|
||||
height: <?= $chart['graph']['height'] ?>px;
|
||||
}
|
||||
|
||||
.graphHeight {
|
||||
height: <?= $chart['graph']['height'] ?>px;
|
||||
}
|
||||
|
||||
.graphWidth {
|
||||
width: <?= $chart['graph']['width'] ?>px;
|
||||
}
|
||||
|
||||
.imageSize {
|
||||
width: <?= $chart['image']['width'] ?>px;
|
||||
height: <?= $chart['image']['height'] ?>px;
|
||||
}
|
||||
|
||||
.imageHeight {
|
||||
height: <?= $chart['image']['height'] ?>px;
|
||||
}
|
||||
|
||||
.activitySize {
|
||||
width: <?= $chart['graph']['width'] ?>px;
|
||||
height: <?= $chart['graph']['activityHeight'] ?>px;
|
||||
}
|
||||
|
||||
.eventsSize {
|
||||
width: <?= $chart['graph']['width'] ?>px;
|
||||
height: <?= $chart['graph']['eventBarHeight'] ?>px;
|
||||
}
|
||||
|
||||
.eventsHeight {
|
||||
height: <?= $chart['graph']['eventBarHeight'] ?>px;
|
||||
}
|
||||
<?php
|
||||
if ( $mode == "overlay" )
|
||||
{
|
||||
foreach ( array_keys($monitorIds) as $monitorId )
|
||||
{
|
||||
?>
|
||||
#chartPanel .eventsPos<?= $monitorId ?> {
|
||||
top: <?= $chart['eventBars'][$monitorId]['top'] ?>px;
|
||||
}
|
||||
<?php
|
||||
}
|
||||
}
|
||||
elseif ( $mode == "split" )
|
||||
{
|
||||
foreach ( array_keys($monitorIds) as $monitorId )
|
||||
{
|
||||
?>
|
||||
#chartPanel .activityPos<?= $monitorId ?> {
|
||||
top: <?= $char['activityBars'][$monitorId]['top'] ?>px;
|
||||
}
|
||||
|
||||
#chartPanel .eventsPos<?= $monitorId ?> {
|
||||
top: <?= $char['eventBars'][$monitorId]['top'] ?>px;
|
||||
}
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
foreach( array_keys($monEventSlots) as $monitorId )
|
||||
{
|
||||
?>
|
||||
.monitorColour<?= $monitorId ?> {
|
||||
background-color: <?= $monitors[$monitorId]['WebColour'] ?>;
|
||||
}
|
||||
<?php
|
||||
}
|
||||
?>
|
|
@ -1,19 +0,0 @@
|
|||
#contentTable + input {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
#videoProgress {
|
||||
margin: 8px auto 4px;
|
||||
}
|
||||
|
||||
#videoFilesHeader {
|
||||
margin: 8px auto 4px;
|
||||
}
|
||||
|
||||
#videoNoFiles {
|
||||
margin: 4px auto;
|
||||
}
|
||||
|
||||
#videoFile {
|
||||
margin-bottom: 6px;
|
||||
}
|
|
@ -1,134 +0,0 @@
|
|||
@import url(../../css/control.css);
|
||||
|
||||
#menuBar {
|
||||
margin: 6px auto 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#menuBar #monitorName {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#menuBar #closeControl {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#menuBar #menuControls {
|
||||
margin: 0 auto;
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
#menuBar #menuControls #controlControl {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#menuBar #menuControls #eventsControl {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#menuBar #menuControls #settingsControl {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#menuBar #menuControls #scaleControl {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#imageFeed{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitorStatus {
|
||||
margin: 4px auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#monitorStatus #enableDisableAlarms {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#monitorStatus #forceCancelAlarm {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#monitorStatus #monitorState {
|
||||
}
|
||||
|
||||
#dvrControls {
|
||||
margin-top: 3px;
|
||||
margin-bottom: 2px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#dvrControls input {
|
||||
height: 20px;
|
||||
width: 28px;
|
||||
padding-bottom: 3px;
|
||||
margin: 0 3px;
|
||||
}
|
||||
|
||||
#dvrControls input[disabled] {
|
||||
color: #aaaaaa;
|
||||
}
|
||||
|
||||
#dvrControls input.active {
|
||||
border: 1px solid blue;
|
||||
}
|
||||
|
||||
#dvrControls input.inactive {
|
||||
border: 1px solid green;
|
||||
}
|
||||
|
||||
#dvrControls input.unavail {
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
#replayStatus {
|
||||
margin: 3px 0 2px;
|
||||
text-align: center;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#replayStatus > span {
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
#events {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#eventList {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#eventList thead td {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#eventList th, #eventList td {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
li {
|
||||
display: inline;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
span.alarm {
|
||||
color: #DC143C;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
span.alert {
|
||||
color: #FF8C00;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#eventList tr.recent {
|
||||
background-color: #B0E0E6;
|
||||
}
|
||||
|
||||
#eventList tr.highlight {
|
||||
background-color: #DCDCDC;
|
||||
}
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
#settingsPanel {
|
||||
float: left;
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
#zoneSettings {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
#zoneSettings th, #zoneSettings td {
|
||||
border: 1px solid #7f7fb2;
|
||||
padding: 3px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#zoneSettings th[scope=row] {
|
||||
padding: 4px 3px 3px;
|
||||
vertical-align: top;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#definitionPanel {
|
||||
float: left;
|
||||
margin: 0 2px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#definitionPanel input[type=submit], #definitionPanel input[type=submit] {
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
#imagePanel {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* NB: The size of the imageFrame determines the area within which the markers
|
||||
* may be moved. When adjusting the padding and margins of the imageFrame and
|
||||
* the DIVs within it, test that the markers behave sensibly when dragged to
|
||||
* the extreme edges of the imageFrame. */
|
||||
#imageFrame {
|
||||
position: relative;
|
||||
padding: 0 3px 3px 0; /* Compensate for negative margins in the markers just below. */
|
||||
}
|
||||
|
||||
#imageFrame div {
|
||||
position: absolute;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
margin-left: -3px;
|
||||
margin-top: -3px;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
#imageFrame div {
|
||||
background-image: url(../../graphics/point-g.gif);
|
||||
}
|
||||
|
||||
#imageFrame div.highlight {
|
||||
background-image: url(../../graphics/point-o.gif);
|
||||
}
|
||||
|
||||
#imageFrame div.active {
|
||||
background-image: url(../../graphics/point-r.gif);
|
||||
}
|
||||
|
||||
#zonePoints {
|
||||
margin: 8px 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
#zonePoints td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#zonePoints table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
#zonePoints table tr.highlight {
|
||||
background-color: #f0e68c;
|
||||
}
|
||||
|
||||
#zonePoints table tr.active {
|
||||
background-color: #ffa07a;
|
||||
}
|
||||
|
||||
#zonePoints table th, #zonePoints table td {
|
||||
border: 1px solid #7f7fb2;
|
||||
padding: 3px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#zonePoints table a {
|
||||
margin: 0 2px;
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
AUTOMAKE_OPTIONS = gnu
|
||||
|
||||
webdir = @WEB_PREFIX@/skins/classic/views/js
|
||||
|
||||
dist_web_DATA = \
|
||||
console.js \
|
||||
console.js.php \
|
||||
control.js \
|
||||
controlpreset.js \
|
||||
controlpreset.js.php \
|
||||
cycle.js \
|
||||
cycle.js.php \
|
||||
devices.js \
|
||||
donate.js \
|
||||
donate.js.php \
|
||||
event.js \
|
||||
event.js.php \
|
||||
events.js \
|
||||
events.js.php \
|
||||
export.js \
|
||||
export.js.php \
|
||||
filter.js \
|
||||
filter.js.php \
|
||||
group.js \
|
||||
groups.js \
|
||||
log.js \
|
||||
login.js \
|
||||
Makefile.am \
|
||||
monitor.js \
|
||||
monitor.js.php \
|
||||
monitorpreset.js \
|
||||
monitorprobe.js \
|
||||
montage.js \
|
||||
montage.js.php \
|
||||
options.js.php \
|
||||
postlogin.js \
|
||||
state.js \
|
||||
state.js.php \
|
||||
timeline.js \
|
||||
timeline.js.php \
|
||||
user.js \
|
||||
version.js \
|
||||
version.js.php \
|
||||
video.js \
|
||||
video.js.php \
|
||||
watch.js \
|
||||
watch.js.php \
|
||||
zone.js \
|
||||
zone.js.php
|
|
@ -1,28 +0,0 @@
|
|||
var consoleRefreshTimeout = <?= 1000*ZM_WEB_REFRESH_MAIN ?>;
|
||||
|
||||
<?php
|
||||
if ( ZM_CHECK_FOR_UPDATES && canEdit('System') && ZM_DYN_LAST_VERSION && ( verNum(ZM_VERSION) < verNum(ZM_DYN_LAST_VERSION) ) && ( verNum(ZM_DYN_CURR_VERSION) < verNum(ZM_DYN_LAST_VERSION) ) && ( ZM_DYN_NEXT_REMINDER < time() ) )
|
||||
{
|
||||
$showVersionPopup = true;
|
||||
}
|
||||
elseif ( ZM_DYN_SHOW_DONATE_REMINDER )
|
||||
{
|
||||
if ( canEdit('System') )
|
||||
{
|
||||
if ( ZM_DYN_DONATE_REMINDER_TIME > 0 )
|
||||
{
|
||||
if ( ZM_DYN_DONATE_REMINDER_TIME < time() )
|
||||
{
|
||||
$showDonatePopup = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$nextReminder = time() + 30*24*60*60;
|
||||
dbQuery( "update Config set Value = '".$nextReminder."' where Name = 'ZM_DYN_DONATE_REMINDER_TIME'" );
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
var showVersionPopup = <?= isset($showVersionPopup )?'true':'false' ?>;
|
||||
var showDonatePopup = <?= isset($showDonatePopup )?'true':'false' ?>;
|
|
@ -1,49 +0,0 @@
|
|||
var controlParms = "view=request&request=control";
|
||||
var controlReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, onSuccess: getControlResponse } );
|
||||
|
||||
function getControlResponse( respObj, respText )
|
||||
{
|
||||
if ( !respObj )
|
||||
return;
|
||||
//console.log( respText );
|
||||
if ( respObj.result != 'Ok' )
|
||||
{
|
||||
alert( "Control response was status = "+respObj.status+"\nmessage = "+respObj.message );
|
||||
}
|
||||
}
|
||||
|
||||
function controlCmd( control, event, xtell, ytell )
|
||||
{
|
||||
var locParms = "&id="+$('mid').get('value');
|
||||
if ( event && (xtell || ytell) )
|
||||
{
|
||||
var xEvent = new Event( event );
|
||||
var target = xEvent.target;
|
||||
var coords = $(target).getCoordinates();
|
||||
|
||||
var l = coords.left;
|
||||
var t = coords.top;
|
||||
var x = xEvent.page.x - l;
|
||||
var y = xEvent.page.y - t;
|
||||
|
||||
if ( xtell )
|
||||
{
|
||||
var xge = parseInt( (x*100)/coords.width );
|
||||
if ( xtell == -1 )
|
||||
xge = 100 - xge;
|
||||
else if ( xtell == 2 )
|
||||
xge = 2*(50 - xge);
|
||||
locParms += "&xge="+xge;
|
||||
}
|
||||
if ( ytell )
|
||||
{
|
||||
var yge = parseInt( (y*100)/coords.height );
|
||||
if ( ytell == -1 )
|
||||
yge = 100 - yge;
|
||||
else if ( ytell == 2 )
|
||||
yge = 2*(50 - yge);
|
||||
locParms += "&yge="+yge;
|
||||
}
|
||||
}
|
||||
controlReq.send( controlParms+"&control="+control+locParms );
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
function updateLabel()
|
||||
{
|
||||
var presetIndex = $('contentForm').preset.getValue();
|
||||
if ( labels[presetIndex] )
|
||||
{
|
||||
$('contentForm').newLabel.value = labels[presetIndex];
|
||||
}
|
||||
else
|
||||
{
|
||||
$('contentForm').newLabel.value = "";
|
||||
}
|
||||
}
|
||||
|
||||
window.addEvent( 'domready', updateLabel );
|
|
@ -1,9 +0,0 @@
|
|||
var labels = new Array();
|
||||
<?php
|
||||
foreach ( $labels as $index=>$label )
|
||||
{
|
||||
?>
|
||||
labels[<?= validInt($index) ?>] = "<?= validJsStr($label) ?>";
|
||||
<?php
|
||||
}
|
||||
?>
|
|
@ -1,11 +0,0 @@
|
|||
function nextCycleView()
|
||||
{
|
||||
window.location.replace( '?view=cycle&group='+currGroup+'&mid='+nextMid+'&mode='+mode, cycleRefreshTimeout );
|
||||
}
|
||||
|
||||
function initCycle()
|
||||
{
|
||||
nextCycleView.periodical( cycleRefreshTimeout );
|
||||
}
|
||||
|
||||
window.addEvent( 'domready', initCycle );
|
|
@ -1,5 +0,0 @@
|
|||
var currGroup = "<?= isset($_REQUEST['group'])?validJsStr($_REQUEST['group']):'' ?>";
|
||||
var nextMid = "<?= isset($nextMid)?$nextMid:'' ?>";
|
||||
var mode = "<?= $mode ?>";
|
||||
|
||||
var cycleRefreshTimeout = <?= 1000*ZM_WEB_REFRESH_CYCLE ?>;
|
|
@ -1,47 +0,0 @@
|
|||
function switchDeviceOn( element, key )
|
||||
{
|
||||
var form = element.form;
|
||||
form.view.value = currentView;
|
||||
form.action.value = 'device';
|
||||
form.command.value = 'on';
|
||||
form.key.value = key;
|
||||
form.submit();
|
||||
}
|
||||
|
||||
function switchDeviceOff( element, key )
|
||||
{
|
||||
var form = element.form;
|
||||
form.view.value = currentView;
|
||||
form.action.value = 'device';
|
||||
form.command.value = 'off';
|
||||
form.key.value = key;
|
||||
form.submit();
|
||||
}
|
||||
|
||||
function deleteDevice( element )
|
||||
{
|
||||
var form = element.form;
|
||||
form.view.value = currentView;
|
||||
form.action.value = 'delete';
|
||||
form.submit();
|
||||
}
|
||||
|
||||
function configureButtons( element, name )
|
||||
{
|
||||
var form = element.form;
|
||||
var checked = false;
|
||||
for (var i = 0; i < form.elements.length; i++)
|
||||
{
|
||||
if ( form.elements[i].name.indexOf(name) == 0)
|
||||
{
|
||||
if ( form.elements[i].checked )
|
||||
{
|
||||
checked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
form.deleteBtn.disabled = !checked;
|
||||
}
|
||||
|
||||
window.focus();
|
|
@ -1,14 +0,0 @@
|
|||
function submitForm( element )
|
||||
{
|
||||
var form = element.form;
|
||||
if ( form.option.selectedIndex == 0 )
|
||||
form.view.value = currentView;
|
||||
else
|
||||
form.view.value = 'none';
|
||||
form.submit();
|
||||
}
|
||||
|
||||
if ( action == "donate" && option == "go" )
|
||||
{
|
||||
zmWindow();
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
var action = '<?= isset($_REQUEST['action'])?validJsStr($_REQUEST['action']):'' ?>';
|
||||
var option = '<?= isset($_REQUEST['option'])?validJsStr($_REQUEST['option']):'' ?>';
|
|
@ -1,150 +0,0 @@
|
|||
function closeWindows()
|
||||
{
|
||||
window.close();
|
||||
// This is a hack. The only way to close an existing window is to try and open it!
|
||||
var filterWindow = window.open( thisUrl+'?view=none', 'zmFilter', 'width=1,height=1' );
|
||||
filterWindow.close();
|
||||
}
|
||||
|
||||
function toggleCheckbox( element, name )
|
||||
{
|
||||
var form = element.form;
|
||||
var checked = element.checked;
|
||||
for (var i = 0; i < form.elements.length; i++)
|
||||
if (form.elements[i].name.indexOf(name) == 0)
|
||||
form.elements[i].checked = checked;
|
||||
form.viewBtn.disabled = !checked;
|
||||
form.editBtn.disabled = !checked;
|
||||
form.archiveBtn.disabled = unarchivedEvents?!checked:true;
|
||||
form.unarchiveBtn.disabled = archivedEvents?!checked:true;
|
||||
form.exportBtn.disabled = !checked;
|
||||
form.deleteBtn.disabled = !checked;
|
||||
}
|
||||
|
||||
function configureButton( element, name )
|
||||
{
|
||||
var form = element.form;
|
||||
var checked = element.checked;
|
||||
if ( !checked )
|
||||
{
|
||||
for (var i = 0; i < form.elements.length; i++)
|
||||
{
|
||||
if ( form.elements[i].name.indexOf(name) == 0)
|
||||
{
|
||||
if ( form.elements[i].checked )
|
||||
{
|
||||
checked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( !element.checked )
|
||||
form.toggleCheck.checked = false;
|
||||
form.viewBtn.disabled = !checked;
|
||||
form.editBtn.disabled = !checked;
|
||||
form.archiveBtn.disabled = (!checked)||(!unarchivedEvents);
|
||||
form.unarchiveBtn.disabled = (!checked)||(!archivedEvents);
|
||||
form.exportBtn.disabled = !checked;
|
||||
form.deleteBtn.disabled = !checked;
|
||||
}
|
||||
|
||||
function deleteEvents( element, name )
|
||||
{
|
||||
var form = element.form;
|
||||
var count = 0;
|
||||
for (var i = 0; i < form.elements.length; i++)
|
||||
{
|
||||
if (form.elements[i].name.indexOf(name) == 0)
|
||||
{
|
||||
if ( form.elements[i].checked )
|
||||
{
|
||||
count++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( count > 0 )
|
||||
{
|
||||
if ( confirm( confirmDeleteEventsString ) )
|
||||
{
|
||||
form.action.value = 'delete';
|
||||
form.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function editEvents( element, name )
|
||||
{
|
||||
var form = element.form;
|
||||
var eids = new Array();
|
||||
for (var i = 0; i < form.elements.length; i++)
|
||||
{
|
||||
if (form.elements[i].name.indexOf(name) == 0)
|
||||
{
|
||||
if ( form.elements[i].checked )
|
||||
{
|
||||
eids[eids.length] = 'eids[]='+form.elements[i].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
createPopup( '?view=eventdetail&'+eids.join( '&' ), 'zmEventDetail', 'eventdetail' );
|
||||
}
|
||||
|
||||
function exportEvents( element, name )
|
||||
{
|
||||
var form = element.form;
|
||||
var eids = new Array();
|
||||
for (var i = 0; i < form.elements.length; i++)
|
||||
{
|
||||
if (form.elements[i].name.indexOf(name) == 0)
|
||||
{
|
||||
if ( form.elements[i].checked )
|
||||
{
|
||||
eids[eids.length] = 'eids[]='+form.elements[i].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
createPopup( '?view=export&'+eids.join( '&' ), 'zmExport', 'export' );
|
||||
}
|
||||
|
||||
function viewEvents( element, name )
|
||||
{
|
||||
var form = element.form;
|
||||
var events = new Array();
|
||||
for (var i = 0; i < form.elements.length; i++)
|
||||
{
|
||||
if ( form.elements[i].name.indexOf(name) == 0)
|
||||
{
|
||||
if ( form.elements[i].checked )
|
||||
{
|
||||
events[events.length] = form.elements[i].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( events.length > 0 )
|
||||
{
|
||||
createPopup( '?view=event&eid='+events[0]+'&filter[terms][0][attr]=Id&&filter[terms][0][op]=%3D%5B%5D&&filter[terms][0][val]='+events.join('%2C')+sortQuery+'&page=1&play=1', 'zmEvent', 'event', maxWidth, maxHeight );
|
||||
}
|
||||
}
|
||||
|
||||
function archiveEvents( element, name )
|
||||
{
|
||||
var form = element.form;
|
||||
form.action.value = 'archive';
|
||||
form.submit();
|
||||
}
|
||||
|
||||
function unarchiveEvents( element, name )
|
||||
{
|
||||
var form = element.form;
|
||||
form.action.value = 'unarchive';
|
||||
form.submit();
|
||||
}
|
||||
|
||||
if ( openFilterWindow )
|
||||
{
|
||||
//opener.location.reload(true);
|
||||
createPopup( '?view=filter&page='+thisPage+filterQuery, 'zmFilter', 'filter' );
|
||||
location.replace( '?view='+currentView+'&page='+thisPage+filterQuery );
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
//var openFilterWindow = <?= $_REQUEST['filter']?'true':'false' ?>;
|
||||
var openFilterWindow = false;
|
||||
|
||||
var archivedEvents = <?= !empty($archived)?'true':'false' ?>;
|
||||
var unarchivedEvents = <?= !empty($unarchived)?'true':'false' ?>;
|
||||
|
||||
var filterQuery = '<?= isset($filterQuery)?validJsStr($filterQuery):'' ?>';
|
||||
var sortQuery = '<?= isset($sortQuery)?validJsStr($sortQuery):'' ?>';
|
||||
|
||||
var maxWidth = <?= $maxWidth?$maxWidth:0 ?>;
|
||||
var maxHeight = <?= $maxHeight?$maxHeight:0 ?>;
|
||||
|
||||
var confirmDeleteEventsString = "<?= addslashes($SLANG['ConfirmDeleteEvents']) ?>";
|
|
@ -1,58 +0,0 @@
|
|||
function configureExportButton( element )
|
||||
{
|
||||
var form = element.form;
|
||||
|
||||
var checkCount = 0;
|
||||
var radioCount = 0;
|
||||
for ( var i = 0; i < form.elements.length; i++ )
|
||||
if ( form.elements[i].type == "checkbox" && form.elements[i].checked )
|
||||
checkCount++;
|
||||
else if ( form.elements[i].type == "radio" && form.elements[i].checked )
|
||||
radioCount++;
|
||||
form.elements['exportButton'].disabled = (checkCount == 0 || radioCount == 0);
|
||||
}
|
||||
|
||||
function startDownload( exportFile )
|
||||
{
|
||||
window.location.replace( exportFile );
|
||||
}
|
||||
|
||||
var exportTimer = null;
|
||||
|
||||
function exportProgress()
|
||||
{
|
||||
var tickerText = $('exportProgressTicker').get('text');
|
||||
if ( tickerText.length < 1 || tickerText.length > 4 )
|
||||
$('exportProgressTicker').set( 'text', '.' );
|
||||
else
|
||||
$('exportProgressTicker').appendText( '.' );
|
||||
}
|
||||
|
||||
function exportResponse( respObj, respText )
|
||||
{
|
||||
window.location.replace( thisUrl+'?view='+currentView+'&'+eidParm+'&exportFile='+respObj.exportFile+'&generated='+((respObj.result=='Ok')?1:0) );
|
||||
}
|
||||
|
||||
function exportEvent( form )
|
||||
{
|
||||
var parms = 'view=request&request=event&action=export';
|
||||
parms += '&'+$(form).toQueryString();
|
||||
var query = new Request.JSON( { url: thisUrl, method: 'post', data: parms, onSuccess: exportResponse } );
|
||||
query.send();
|
||||
$('exportProgress').removeClass( 'hidden' );
|
||||
$('exportProgress').setProperty( 'class', 'warnText' );
|
||||
$('exportProgressText').set( 'text', exportProgressString );
|
||||
exportProgress();
|
||||
exportTimer = exportProgress.periodical( 500 );
|
||||
}
|
||||
|
||||
function initPage()
|
||||
{
|
||||
configureExportButton( $('exportButton') );
|
||||
if ( exportReady )
|
||||
{
|
||||
startDownload.pass( exportFile ).delay( 1500 );
|
||||
}
|
||||
}
|
||||
|
||||
window.addEvent( 'domready', initPage );
|
|
@ -1,22 +0,0 @@
|
|||
<?php
|
||||
if ( isset($_REQUEST['eids']) )
|
||||
{
|
||||
$eidParms = array();
|
||||
foreach ( $_REQUEST['eids'] as $eid )
|
||||
$eidParms[] = "eids[]=".validInt($eid);
|
||||
?>
|
||||
var eidParm = '<?= join( '&', $eidParms ) ?>';
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
var eidParm = 'eid=<?= validInt($_REQUEST['eid']) ?>';
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
var exportReady = <?= !empty($_REQUEST['generated'])?'true':'false' ?>;
|
||||
var exportFile = '<?= !empty($_REQUEST['exportFile'])?validJsStr($_REQUEST['exportFile']):'' ?>';
|
||||
|
||||
var exportProgressString = '<?= addslashes($SLANG['Exporting']) ?>';
|
|
@ -1,120 +0,0 @@
|
|||
function updateButtons( element )
|
||||
{
|
||||
var form = element.form;
|
||||
|
||||
if ( element.type == 'checkbox' && element.checked )
|
||||
form.elements['executeButton'].disabled = false;
|
||||
else
|
||||
{
|
||||
var canExecute = false;
|
||||
if ( form.elements['autoArchive'].checked )
|
||||
canExecute = true;
|
||||
else if ( typeof ZM_OPT_FFMPEG !== "undefined" && form.elements['autoVideo'].checked )
|
||||
canExecute = true;
|
||||
else if ( typeof ZM_OPT_UPLOAD !== "undefined" && form.elements['autoUpload'].checked )
|
||||
canExecute = true;
|
||||
else if ( typeof ZM_OPT_EMAIL !== "undefined" && form.elements['autoEmail'].checked )
|
||||
canExecute = true;
|
||||
else if ( typeof ZM_OPT_MESSAGE !== "undefined" && form.elements['autoMessage'].checked )
|
||||
canExecute = true;
|
||||
else if ( form.elements['autoExecute'].checked && form.elements['autoExecuteCmd'].value != '' )
|
||||
canExecute = true;
|
||||
else if ( form.elements['autoDelete'].checked )
|
||||
canExecute = true;
|
||||
form.elements['executeButton'].disabled = !canExecute;
|
||||
}
|
||||
}
|
||||
|
||||
function clearValue( element, line )
|
||||
{
|
||||
var form = element.form;
|
||||
var val = form.elements['filter[terms]['+line+'][val]'];
|
||||
val.value = '';
|
||||
}
|
||||
|
||||
function submitToFilter( element, reload )
|
||||
{
|
||||
var form = element.form;
|
||||
form.target = window.name;
|
||||
form.view.value = 'filter';
|
||||
form.reload.value = reload;
|
||||
form.submit();
|
||||
}
|
||||
|
||||
function submitToEvents( element )
|
||||
{
|
||||
var form = element.form;
|
||||
if ( validateForm( form ) )
|
||||
{
|
||||
form.target = 'zmEvents';
|
||||
form.view.value = 'events';
|
||||
form.action.value = '';
|
||||
form.execute.value = 0;
|
||||
form.submit();
|
||||
}
|
||||
}
|
||||
|
||||
function executeFilter( element )
|
||||
{
|
||||
var form = element.form;
|
||||
if ( validateForm( form ) )
|
||||
{
|
||||
form.target = 'zmEvents';
|
||||
form.view.value = 'events';
|
||||
form.action.value = 'filter';
|
||||
form.execute.value = 1;
|
||||
form.submit();
|
||||
}
|
||||
}
|
||||
|
||||
function saveFilter( element )
|
||||
{
|
||||
var form = element.form;
|
||||
|
||||
var popupName = 'zmEventsFilterSave';
|
||||
createPopup( thisUrl, popupName, 'filtersave' );
|
||||
|
||||
form.target = popupName;
|
||||
form.view.value = 'filtersave';
|
||||
form.submit();
|
||||
}
|
||||
|
||||
function deleteFilter( element, name )
|
||||
{
|
||||
if ( confirm( deleteSavedFilterString+" '"+name+"'" ) )
|
||||
{
|
||||
var form = element.form;
|
||||
form.action.value = 'delete';
|
||||
form.fid.value = name;
|
||||
submitToFilter( element, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
function addTerm( element, line )
|
||||
{
|
||||
var form = element.form;
|
||||
form.target = window.name;
|
||||
form.view.value = currentView;
|
||||
form.action.value = 'filter';
|
||||
form.subaction.value = 'addterm';
|
||||
form.line.value = line;
|
||||
form.submit();
|
||||
}
|
||||
|
||||
function delTerm( element, line )
|
||||
{
|
||||
var form = element.form;
|
||||
form.target = window.name;
|
||||
form.view.value = currentView;
|
||||
form.action.value = 'filter';
|
||||
form.subaction.value = 'delterm';
|
||||
form.line.value = line;
|
||||
form.submit();
|
||||
}
|
||||
|
||||
function init()
|
||||
{
|
||||
updateButtons( $('executeButton') );
|
||||
}
|
||||
|
||||
window.addEvent( 'domready', init );
|
|
@ -1,55 +0,0 @@
|
|||
var deleteSavedFilterString = "<?= $SLANG['DeleteSavedFilter'] ?>";
|
||||
function validateForm( form )
|
||||
{
|
||||
<?php
|
||||
if ( isset ($_REQUEST['filter']) && count($_REQUEST['filter']['terms']) > 2 )
|
||||
{
|
||||
?>
|
||||
var bracket_count = 0;
|
||||
<?php
|
||||
for ( $i = 0; $i < count($_REQUEST['filter']['terms']); $i++ )
|
||||
{
|
||||
?>
|
||||
var obr = form.elements['filter[terms][<?= $i ?>][obr]'];
|
||||
var cbr = form.elements['filter[terms][<?= $i ?>][cbr]'];
|
||||
bracket_count += parseInt(obr.options[obr.selectedIndex].value);
|
||||
bracket_count -= parseInt(cbr.options[cbr.selectedIndex].value);
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
if ( bracket_count )
|
||||
{
|
||||
alert( "<?= $SLANG['ErrorBrackets'] ?>" );
|
||||
return( false );
|
||||
}
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
for ( $i = 0; isset($_REQUEST['filter']) && $i < count($_REQUEST['filter']['terms']); $i++ )
|
||||
{
|
||||
?>
|
||||
var val = form.elements['filter[terms][<?= $i ?>][val]'];
|
||||
if ( val.value == '' )
|
||||
{
|
||||
alert( "<?= $SLANG['ErrorValidValue'] ?>" );
|
||||
return( false );
|
||||
}
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
return( true );
|
||||
}
|
||||
<?php
|
||||
if ( !empty($hasCal) )
|
||||
{
|
||||
?>
|
||||
</script>
|
||||
<style type="text/css">@import url(tools/jscalendar/calendar-win2k-1.css);</style>
|
||||
<script type="text/javascript" src="tools/jscalendar/calendar.js"></script>
|
||||
<script type="text/javascript" src="tools/jscalendar/lang/calendar-en.js"></script>
|
||||
<script type="text/javascript" src="tools/jscalendar/calendar-setup.js"></script>
|
||||
<script type="text/javascript">
|
||||
// Empty
|
||||
<?php
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
function selectMonitors()
|
||||
{
|
||||
createPopup( '?view=monitorselect&callForm=groupForm&callField=newGroup[MonitorIds]', 'zmMonitors', 'monitorselect' );
|
||||
}
|
||||
|
||||
if ( refreshParent )
|
||||
{
|
||||
opener.location.reload(true);
|
||||
}
|
||||
|
||||
window.focus();
|
|
@ -1,47 +0,0 @@
|
|||
function newGroup()
|
||||
{
|
||||
createPopup( '?view=group', 'zmGroup', 'group' );
|
||||
}
|
||||
|
||||
function editGroup( element )
|
||||
{
|
||||
var form = element.form;
|
||||
form.action.value = 'setgroup';
|
||||
form.submit();
|
||||
}
|
||||
|
||||
function editGroup( element )
|
||||
{
|
||||
var form = element.form;
|
||||
for ( var i = 0; i < form.gid.length; i++ )
|
||||
{
|
||||
if ( form.gid[i].checked )
|
||||
{
|
||||
createPopup( '?view=group&gid='+form.gid[i].value, 'zmGroup', 'group' );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function deleteGroup( element )
|
||||
{
|
||||
var form = element.form;
|
||||
form.view.value = currentView;
|
||||
form.action.value = 'delete';
|
||||
form.submit();
|
||||
}
|
||||
|
||||
function configureButtons( element )
|
||||
{
|
||||
if ( canEditSystem )
|
||||
{
|
||||
var form = element.form;
|
||||
if ( element.checked )
|
||||
{
|
||||
form.editBtn.disabled = (element.value == 0);
|
||||
form.deleteBtn.disabled = (element.value == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.focus();
|
|
@ -1 +0,0 @@
|
|||
window.addEvent( 'domready', function() { $('loginForm').elements['username'].focus() } );
|
|
@ -1,56 +0,0 @@
|
|||
function updateMonitorDimensions( element )
|
||||
{
|
||||
var form = element.form;
|
||||
var widthFactor = parseInt( defaultAspectRatio.replace( /:.*$/, '' ) );
|
||||
var heightFactor = parseInt( defaultAspectRatio.replace( /^.*:/, '' ) );
|
||||
|
||||
if ( form.elements['preserveAspectRatio'].checked )
|
||||
{
|
||||
var monitorWidth = parseInt(form.elements['newMonitor[Width]'].value);
|
||||
var monitorHeight = parseInt(form.elements['newMonitor[Height]'].value);
|
||||
switch( element.name )
|
||||
{
|
||||
case 'newMonitor[Width]':
|
||||
if ( monitorWidth >= 0 )
|
||||
form.elements['newMonitor[Height]'].value = Math.round((monitorWidth * heightFactor) / widthFactor);
|
||||
else
|
||||
form.elements['newMonitor[Height]'].value = '';
|
||||
break;
|
||||
case 'newMonitor[Height]':
|
||||
if ( monitorHeight >= 0 )
|
||||
form.elements['newMonitor[Width]'].value = Math.round((monitorHeight * widthFactor) / heightFactor);
|
||||
else
|
||||
form.elements['newMonitor[Width]'].value = '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
return( false );
|
||||
}
|
||||
|
||||
function loadLocations( element )
|
||||
{
|
||||
var form = element.form;
|
||||
var controlIdSelect = form.elements['newMonitor[ControlId]'];
|
||||
var returnLocationSelect = form.elements['newMonitor[ReturnLocation]'];
|
||||
|
||||
returnLocationSelect.options.length = 1;
|
||||
//returnLocationSelect.options[0] = new Option( noneString, -1 );
|
||||
|
||||
var returnLocationOptions = controlOptions[controlIdSelect.selectedIndex];
|
||||
if ( returnLocationOptions )
|
||||
{
|
||||
for ( var i = 0; i < returnLocationOptions.length; i++ )
|
||||
{
|
||||
returnLocationSelect.options[returnLocationSelect.options.length] = new Option( returnLocationOptions[i], i );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function initPage()
|
||||
{
|
||||
//var protocolSelector = $('contentForm').elements['newMonitor[Protocol]'];
|
||||
//if ( $(protocolSelector).getTag() == 'select' )
|
||||
//updateMethods( $(protocolSelector) );
|
||||
}
|
||||
|
||||
window.addEvent( 'domready', initPage );
|
|
@ -1,191 +0,0 @@
|
|||
var optControl = <?= ZM_OPT_CONTROL ?>;
|
||||
var defaultAspectRatio = '<?= ZM_DEFAULT_ASPECT_RATIO ?>';
|
||||
|
||||
<?php
|
||||
if ( ZM_OPT_CONTROL )
|
||||
{
|
||||
?>
|
||||
var controlOptions = new Object();
|
||||
<?php
|
||||
global $controlTypes;
|
||||
$controlTypes = array( ''=>$SLANG['None'] );
|
||||
# Temporary workaround to show all ptz control types regardless of monitor source type
|
||||
# $sql = "select * from Controls where Type = '".$newMonitor['Type']."'";
|
||||
$sql = "select * from Controls";
|
||||
foreach( dbFetchAll( $sql ) as $row )
|
||||
{
|
||||
$controlTypes[$row['Id']] = $row['Name'];
|
||||
?>
|
||||
controlOptions[<?= $row['Id'] ?>] = new Array();
|
||||
<?php
|
||||
if ( $row['HasHomePreset'] )
|
||||
{
|
||||
?>
|
||||
controlOptions[<?= $row['Id'] ?>][0] = '<?= $SLANG['Home'] ?>';
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
controlOptions[<?= $row['Id'] ?>][0] = null;
|
||||
<?php
|
||||
}
|
||||
for ( $i = 1; $i <= $row['NumPresets']; $i++ )
|
||||
{
|
||||
?>
|
||||
controlOptions[<?= $row['Id'] ?>][<?= $i ?>] = '<?= $SLANG['Preset'].' '.$i ?>';
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ( empty($_REQUEST['mid']) )
|
||||
{
|
||||
?>
|
||||
var monitorNames = new Object();
|
||||
<?php
|
||||
foreach ( dbFetchAll( "select Name from Monitors order by Name asc", "Name" ) as $name )
|
||||
{
|
||||
?>
|
||||
monitorNames['<?= validJsStr($name) ?>'] = true;
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
function validateForm( form )
|
||||
{
|
||||
var errors = new Array();
|
||||
|
||||
if ( form.elements['newMonitor[Name]'].value.search( /[^\w-]/ ) >= 0 )
|
||||
errors[errors.length] = "<?= $SLANG['BadNameChars'] ?>";
|
||||
else if ( form.elements.mid.value == 0 && monitorNames[form.elements['newMonitor[Name]'].value] )
|
||||
errors[errors.length] = "<?= $SLANG['DuplicateMonitorName'] ?>";
|
||||
|
||||
if ( form.elements['newMonitor[MaxFPS]'].value && !(parseFloat(form.elements['newMonitor[MaxFPS]'].value) > 0 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadMaxFPS'] ?>";
|
||||
if ( form.elements['newMonitor[AlarmMaxFPS]'].value && !(parseFloat(form.elements['newMonitor[AlarmMaxFPS]'].value) > 0 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadAlarmMaxFPS'] ?>";
|
||||
if ( !form.elements['newMonitor[RefBlendPerc]'].value || (parseInt(form.elements['newMonitor[RefBlendPerc]'].value) > 100 ) || (parseInt(form.elements['newMonitor[RefBlendPerc]'].value) < 0 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadRefBlendPerc'] ?>";
|
||||
if ( form.elements['newMonitor[Type]'].value == 'Local' )
|
||||
{
|
||||
if ( !form.elements['newMonitor[Palette]'].value || !form.elements['newMonitor[Palette]'].value.match( /^\d+$/ ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadPalette'] ?>";
|
||||
if ( !form.elements['newMonitor[Device]'].value )
|
||||
errors[errors.length] = "<?= $SLANG['BadDevice'] ?>";
|
||||
if ( !form.elements['newMonitor[Channel]'].value || !form.elements['newMonitor[Channel]'].value.match( /^\d+$/ ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadChannel'] ?>";
|
||||
if ( !form.elements['newMonitor[Format]'].value || !form.elements['newMonitor[Format]'].value.match( /^\d+$/ ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadFormat'] ?>";
|
||||
}
|
||||
else if ( form.elements['newMonitor[Type]'].value == 'Remote' )
|
||||
{
|
||||
if ( !form.elements['newMonitor[Host]'].value || !form.elements['newMonitor[Host]'].value.match( /^[0-9a-zA-Z_.:@-]+$/ ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadHost'] ?>";
|
||||
if ( form.elements['newMonitor[Port]'].value && !form.elements['newMonitor[Port]'].value.match( /^\d+$/ ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadPort'] ?>";
|
||||
//if ( !form.elements['newMonitor[Path]'].value )
|
||||
//errors[errors.length] = "<?= $SLANG['BadPath'] ?>";
|
||||
}
|
||||
else if ( form.elements['newMonitor[Type]'].value == 'File' )
|
||||
{
|
||||
if ( !form.elements['newMonitor[Path]'].value )
|
||||
errors[errors.length] = "<?= $SLANG['BadPath'] ?>";
|
||||
}
|
||||
if ( !form.elements['newMonitor[Colours]'].value || (parseInt(form.elements['newMonitor[Colours]'].value) != 1 && parseInt(form.elements['newMonitor[Colours]'].value) != 3 && parseInt(form.elements['newMonitor[Colours]'].value) != 4 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadColours'] ?>";
|
||||
if ( !form.elements['newMonitor[Width]'].value || !(parseInt(form.elements['newMonitor[Width]'].value) > 0 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadWidth'] ?>";
|
||||
if ( !form.elements['newMonitor[Height]'].value || !(parseInt(form.elements['newMonitor[Height]'].value) > 0 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadHeight'] ?>";
|
||||
if ( !form.elements['newMonitor[LabelX]'].value || !(parseInt(form.elements['newMonitor[LabelX]'].value) >= 0 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadLabelX'] ?>";
|
||||
if ( !form.elements['newMonitor[LabelY]'].value || !(parseInt(form.elements['newMonitor[LabelY]'].value) >= 0 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadLabelY'] ?>";
|
||||
if ( !form.elements['newMonitor[ImageBufferCount]'].value || !(parseInt(form.elements['newMonitor[ImageBufferCount]'].value) >= 10 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadImageBufferCount'] ?>";
|
||||
if ( !form.elements['newMonitor[WarmupCount]'].value || !(parseInt(form.elements['newMonitor[WarmupCount]'].value) >= 0 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadWarmupCount'] ?>";
|
||||
if ( !form.elements['newMonitor[PreEventCount]'].value || !(parseInt(form.elements['newMonitor[PreEventCount]'].value) > 0 ) || (parseInt(form.elements['newMonitor[PreEventCount]'].value) > parseInt(form.elements['newMonitor[ImageBufferCount]'].value)) )
|
||||
errors[errors.length] = "<?= $SLANG['BadPreEventCount'] ?>";
|
||||
if ( !form.elements['newMonitor[PostEventCount]'].value || !(parseInt(form.elements['newMonitor[PostEventCount]'].value) >= 0 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadPostEventCount'] ?>";
|
||||
if ( !form.elements['newMonitor[StreamReplayBuffer]'].value || !(parseInt(form.elements['newMonitor[StreamReplayBuffer]'].value) >= 0 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadStreamReplayBuffer'] ?>";
|
||||
if ( !form.elements['newMonitor[AlarmFrameCount]'].value || !(parseInt(form.elements['newMonitor[AlarmFrameCount]'].value) > 0 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadAlarmFrameCount'] ?>";
|
||||
if ( !form.elements['newMonitor[SectionLength]'].value || !(parseInt(form.elements['newMonitor[SectionLength]'].value) >= 30 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadSectionLength'] ?>";
|
||||
if ( !form.elements['newMonitor[FPSReportInterval]'].value || !(parseInt(form.elements['newMonitor[FPSReportInterval]'].value) >= 0 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadFPSReportInterval'] ?>";
|
||||
if ( !form.elements['newMonitor[FrameSkip]'].value || !(parseInt(form.elements['newMonitor[FrameSkip]'].value) >= 0 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadFrameSkip'] ?>";
|
||||
if ( !form.elements['newMonitor[MotionFrameSkip]'].value || !(parseInt(form.elements['newMonitor[MotionFrameSkip]'].value) >= 0 ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadMotionFrameSkip'] ?>";
|
||||
if ( form.elements['newMonitor[Type]'].value == 'Local' )
|
||||
if ( !form.elements['newMonitor[SignalCheckColour]'].value || !form.elements['newMonitor[SignalCheckColour]'].value.match( /^[#0-9a-zA-Z]+$/ ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadSignalCheckColour'] ?>";
|
||||
if ( !form.elements['newMonitor[WebColour]'].value || !form.elements['newMonitor[WebColour]'].value.match( /^[#0-9a-zA-Z]+$/ ) )
|
||||
errors[errors.length] = "<?= $SLANG['BadWebColour'] ?>";
|
||||
|
||||
if ( errors.length )
|
||||
{
|
||||
alert( errors.join( "\n" ) );
|
||||
return( false );
|
||||
}
|
||||
return( true );
|
||||
}
|
||||
|
||||
function updateLinkedMonitors( element )
|
||||
{
|
||||
var form = element.form;
|
||||
var monitorIds = new Array();
|
||||
for ( var i = 0; i < element.options.length; i++ )
|
||||
if ( element.options[i].selected )
|
||||
monitorIds[monitorIds.length] = element.options[i].value;
|
||||
form.elements['newMonitor[LinkedMonitors]'].value = monitorIds.join( ',' );
|
||||
}
|
||||
|
||||
function updateMethods( element )
|
||||
{
|
||||
var form = element.form;
|
||||
|
||||
var origMethod = form.elements['origMethod'];
|
||||
var methodSelector = form.elements['newMonitor[Method]'];
|
||||
methodSelector.options.length = 0;
|
||||
switch ( element.value )
|
||||
{
|
||||
case 'http' :
|
||||
{
|
||||
<?php
|
||||
foreach( $httpMethods as $value=>$label )
|
||||
{
|
||||
?>
|
||||
methodSelector.options[methodSelector.options.length] = new Option( "<?= htmlspecialchars($label) ?>", "<?= $value ?>" );
|
||||
if ( origMethod.value == "<?= $value ?>" )
|
||||
methodSelector.selectedIndex = methodSelector.options.length-1;
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
break;
|
||||
}
|
||||
case 'rtsp' :
|
||||
{
|
||||
<?php
|
||||
foreach( $rtspMethods as $value=>$label )
|
||||
{
|
||||
?>
|
||||
methodSelector.options[methodSelector.options.length] = new Option( "<?= htmlspecialchars($label) ?>", "<?= $value ?>" );
|
||||
if ( origMethod.value == "<?= $value ?>" )
|
||||
methodSelector.selectedIndex = form.elements['newMonitor[Method]'].options.length-1;
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
break;
|
||||
}
|
||||
}
|
||||
return( true );
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
function submitPreset( element )
|
||||
{
|
||||
var form = element.form;
|
||||
form.target = opener.name;
|
||||
form.view.value = 'monitor';
|
||||
form.submit();
|
||||
closeWindow.delay( 250 );
|
||||
}
|
||||
|
||||
function configureButtons( element )
|
||||
{
|
||||
var form = element.form;
|
||||
form.saveBtn.disabled = (form.preset.selectedIndex==0);
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
function submitCamera( element )
|
||||
{
|
||||
var form = element.form;
|
||||
form.target = opener.name;
|
||||
form.view.value = 'monitor';
|
||||
form.submit();
|
||||
closeWindow.delay( 250 );
|
||||
}
|
||||
|
||||
function configureButtons( element )
|
||||
{
|
||||
var form = element.form;
|
||||
form.saveBtn.disabled = (form.probe.selectedIndex==0);
|
||||
}
|
|
@ -1,153 +0,0 @@
|
|||
var requestQueue = new Request.Queue( { concurrent: 2 } );
|
||||
|
||||
function Monitor( index, id, connKey )
|
||||
{
|
||||
this.index = index;
|
||||
this.id = id;
|
||||
this.connKey = connKey;
|
||||
this.status = null;
|
||||
this.alarmState = STATE_IDLE;
|
||||
this.lastAlarmState = STATE_IDLE;
|
||||
this.streamCmdParms = "view=request&request=stream&connkey="+this.connKey;
|
||||
this.streamCmdTimer = null;
|
||||
|
||||
this.start = function( delay )
|
||||
{
|
||||
this.streamCmdTimer = this.streamCmdQuery.delay( delay, this );
|
||||
}
|
||||
|
||||
this.setStateClass = function( element, stateClass )
|
||||
{
|
||||
if ( !element.hasClass( stateClass ) )
|
||||
{
|
||||
if ( stateClass != 'alarm' )
|
||||
element.removeClass( 'alarm' );
|
||||
if ( stateClass != 'alert' )
|
||||
element.removeClass( 'alert' );
|
||||
if ( stateClass != 'idle' )
|
||||
element.removeClass( 'idle' );
|
||||
element.addClass( stateClass );
|
||||
}
|
||||
}
|
||||
|
||||
this.getStreamCmdResponse = function( respObj, respText )
|
||||
{
|
||||
if ( this.streamCmdTimer )
|
||||
this.streamCmdTimer = clearTimeout( this.streamCmdTimer );
|
||||
|
||||
if ( respObj.result == 'Ok' )
|
||||
{
|
||||
this.status = respObj.status;
|
||||
this.alarmState = this.status.state;
|
||||
|
||||
var stateClass = "";
|
||||
if ( this.alarmState == STATE_ALARM )
|
||||
stateClass = "alarm";
|
||||
else if ( this.alarmState == STATE_ALERT )
|
||||
stateClass = "alert";
|
||||
else
|
||||
stateClass = "idle";
|
||||
|
||||
if ( !COMPACT_MONTAGE )
|
||||
{
|
||||
$('fpsValue'+this.index).set( 'text', this.status.fps );
|
||||
$('stateValue'+this.index).set( 'text', stateStrings[this.alarmState] );
|
||||
this.setStateClass( $('monitorState'+this.index), stateClass );
|
||||
}
|
||||
this.setStateClass( $('monitor'+this.index), stateClass );
|
||||
|
||||
/*Stream could be an applet so can't use moo tools*/
|
||||
var stream = document.getElementById( "liveStream"+this.id );
|
||||
stream.className = stateClass;
|
||||
|
||||
var isAlarmed = ( this.alarmState == STATE_ALARM || this.alarmState == STATE_ALERT );
|
||||
var wasAlarmed = ( this.lastAlarmState == STATE_ALARM || this.lastAlarmState == STATE_ALERT );
|
||||
|
||||
var newAlarm = ( isAlarmed && !wasAlarmed );
|
||||
var oldAlarm = ( !isAlarmed && wasAlarmed );
|
||||
|
||||
if ( newAlarm )
|
||||
{
|
||||
if ( false && SOUND_ON_ALARM )
|
||||
{
|
||||
// Enable the alarm sound
|
||||
$('alarmSound').removeClass( 'hidden' );
|
||||
}
|
||||
if ( POPUP_ON_ALARM )
|
||||
{
|
||||
windowToFront();
|
||||
}
|
||||
}
|
||||
if ( false && SOUND_ON_ALARM )
|
||||
{
|
||||
if ( oldAlarm )
|
||||
{
|
||||
// Disable alarm sound
|
||||
$('alarmSound').addClass( 'hidden' );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
console.error( respObj.message );
|
||||
}
|
||||
var streamCmdTimeout = statusRefreshTimeout;
|
||||
if ( this.alarmState == STATE_ALARM || this.alarmState == STATE_ALERT )
|
||||
streamCmdTimeout = streamCmdTimeout/5;
|
||||
this.streamCmdTimer = this.streamCmdQuery.delay( streamCmdTimeout, this );
|
||||
this.lastAlarmState = this.alarmState;
|
||||
}
|
||||
|
||||
this.streamCmdQuery = function( resent )
|
||||
{
|
||||
//if ( resent )
|
||||
//console.log( this.connKey+": Resending" );
|
||||
//this.streamCmdReq.cancel();
|
||||
this.streamCmdReq.send( this.streamCmdParms+"&command="+CMD_QUERY );
|
||||
}
|
||||
|
||||
this.streamCmdReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, onSuccess: this.getStreamCmdResponse.bind( this ), onTimeout: this.streamCmdQuery.bind( this, true ), link: 'cancel' } );
|
||||
|
||||
requestQueue.addRequest( "cmdReq"+this.id, this.streamCmdReq );
|
||||
}
|
||||
|
||||
function selectLayout( element )
|
||||
{
|
||||
var cssFile = skinPath+'/views/css/'+$(element).get('value');
|
||||
if ( $('dynamicStyles') )
|
||||
$('dynamicStyles').destroy();
|
||||
new Asset.css( cssFile, { id: 'dynamicStyles' } );
|
||||
Cookie.write( 'zmMontageLayout', $(element).get('value'), { duration: 10*365 } );
|
||||
}
|
||||
|
||||
function changeScale()
|
||||
{
|
||||
var scale = $('scale').get('value');
|
||||
|
||||
for ( var x = 0; x < monitors.length; x++ )
|
||||
{
|
||||
var monitor = monitors[x];
|
||||
var newWidth = ( monitorData[x].width * scale ) / SCALE_BASE;
|
||||
var newHeight = ( monitorData[x].height * scale ) / SCALE_BASE;
|
||||
/*Stream could be an applet so can't use moo tools*/
|
||||
var streamImg = document.getElementById( 'liveStream'+monitor.id );
|
||||
streamImg.style.width = newWidth + "px";
|
||||
streamImg.style.height = newHeight + "px";
|
||||
}
|
||||
Cookie.write( 'zmMontageScale', scale, { duration: 10*365 } );
|
||||
}
|
||||
|
||||
var monitors = new Array();
|
||||
function initPage()
|
||||
{
|
||||
for ( var i = 0; i < monitorData.length; i++ )
|
||||
{
|
||||
monitors[i] = new Monitor( i, monitorData[i].id, monitorData[i].connKey );
|
||||
var delay = Math.round( (Math.random()+0.5)*statusRefreshTimeout );
|
||||
monitors[i].start( delay );
|
||||
}
|
||||
selectLayout( $('layout') );
|
||||
}
|
||||
|
||||
// Kick everything off
|
||||
window.addEvent( 'domready', initPage );
|
|
@ -1,37 +0,0 @@
|
|||
//
|
||||
// Import constants
|
||||
//
|
||||
var STATE_IDLE = <?= STATE_IDLE ?>;
|
||||
var STATE_PREALARM = <?= STATE_PREALARM ?>;
|
||||
var STATE_ALARM = <?= STATE_ALARM ?>;
|
||||
var STATE_ALERT = <?= STATE_ALERT ?>;
|
||||
var STATE_TAPE = <?= STATE_TAPE ?>;
|
||||
|
||||
var stateStrings = new Array();
|
||||
stateStrings[STATE_IDLE] = "<?= $SLANG['Idle'] ?>";
|
||||
stateStrings[STATE_PREALARM] = "<?= $SLANG['Idle'] ?>";
|
||||
stateStrings[STATE_ALARM] = "<?= $SLANG['Alarm'] ?>";
|
||||
stateStrings[STATE_ALERT] = "<?= $SLANG['Alert'] ?>";
|
||||
stateStrings[STATE_TAPE] = "<?= $SLANG['Record'] ?>";
|
||||
|
||||
var CMD_QUERY = <?= CMD_QUERY ?>;
|
||||
|
||||
var SCALE_BASE = <?= SCALE_BASE ?>;
|
||||
|
||||
var COMPACT_MONTAGE = <?= ZM_WEB_COMPACT_MONTAGE ?>;
|
||||
var SOUND_ON_ALARM = <?= ZM_WEB_SOUND_ON_ALARM ?>;
|
||||
var POPUP_ON_ALARM = <?= ZM_WEB_POPUP_ON_ALARM ?>;
|
||||
|
||||
var statusRefreshTimeout = <?= 1000*ZM_WEB_REFRESH_STATUS ?>;
|
||||
|
||||
var canStreamNative = <?= canStreamNative()?'true':'false' ?>;
|
||||
|
||||
var monitorData = new Array();
|
||||
<?php
|
||||
foreach ( $monitors as $monitor )
|
||||
{
|
||||
?>
|
||||
monitorData[monitorData.length] = { 'id': <?= $monitor['Id'] ?>, 'connKey': <?= $monitor['connKey'] ?>, 'width': <?= $monitor['Width'] ?>,'height':<?= $monitor['Height'] ?> };
|
||||
<?php
|
||||
}
|
||||
?>
|
|
@ -1,5 +0,0 @@
|
|||
var restartWarning = <?= empty($restartWarning)?'false':'true' ?>;
|
||||
if ( restartWarning )
|
||||
{
|
||||
alert( "<?= $SLANG['OptionRestartWarning'] ?>" );
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
function validateForm( form )
|
||||
{
|
||||
return( true );
|
||||
}
|
||||
|
||||
function submitForm( form )
|
||||
{
|
||||
form.submit();
|
||||
}
|
||||
|
||||
|
||||
function limitRange( field, minValue, maxValue )
|
||||
{
|
||||
if ( parseInt(field.value) < parseInt(minValue) )
|
||||
{
|
||||
field.value = minValue;
|
||||
}
|
||||
else if ( parseInt(field.value) > parseInt(maxValue) )
|
||||
{
|
||||
field.value = maxValue;
|
||||
}
|
||||
}
|
||||
|
||||
function initPage()
|
||||
{
|
||||
return( true );
|
||||
}
|
||||
|
||||
window.addEvent( 'domready', initPage );
|
|
@ -1 +0,0 @@
|
|||
(function () { window.location.replace( thisUrl ); }).delay( 500 );
|
|
@ -1,43 +0,0 @@
|
|||
function checkState( element )
|
||||
{
|
||||
var form = element.form;
|
||||
|
||||
var minIndex = running?2:1;
|
||||
if ( form.runState.selectedIndex < minIndex )
|
||||
{
|
||||
form.saveBtn.disabled = true;
|
||||
form.deleteBtn.disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
form.saveBtn.disabled = false;
|
||||
form.deleteBtn.disabled = false;
|
||||
}
|
||||
if ( form.newState.value != '' )
|
||||
form.saveBtn.disabled = false;
|
||||
}
|
||||
|
||||
function saveState( element )
|
||||
{
|
||||
var form = element.form;
|
||||
form.view.value = currentView;
|
||||
form.action.value = 'save';
|
||||
form.submit();
|
||||
}
|
||||
|
||||
function deleteState( element )
|
||||
{
|
||||
var form = element.form;
|
||||
form.view.value = currentView;
|
||||
form.action.value = 'delete';
|
||||
form.submit();
|
||||
}
|
||||
|
||||
if ( applying )
|
||||
{
|
||||
function submitForm()
|
||||
{
|
||||
$('contentForm').submit();
|
||||
}
|
||||
window.addEvent( 'domready', function() { submitForm.delay( 1000 ); } );
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
var running = <?= $running?'true':'false' ?>;
|
||||
var applying = <?= !empty($_REQUEST['apply'])?'true':'false' ?>;
|
|
@ -1,137 +0,0 @@
|
|||
var events = new Object();
|
||||
|
||||
function showEvent( eid, fid, width, height )
|
||||
{
|
||||
var url = '?view=event&eid='+eid+'&fid='+fid;
|
||||
url += filterQuery;
|
||||
createPopup( url, 'zmEvent', 'event', width, height );
|
||||
}
|
||||
|
||||
function createEventHtml( event, frame )
|
||||
{
|
||||
var eventHtml = new Element( 'div' );
|
||||
|
||||
if ( event.Archived > 0 )
|
||||
eventHtml.addClass( 'archived' );
|
||||
|
||||
new Element( 'p' ).inject( eventHtml ).set( 'text', monitorNames[event.MonitorId] );
|
||||
new Element( 'p' ).inject( eventHtml ).set( 'text', event.Name+(frame?("("+frame.FrameId+")"):"") );
|
||||
new Element( 'p' ).inject( eventHtml ).set( 'text', event.StartTime+" - "+event.Length+"s" );
|
||||
new Element( 'p' ).inject( eventHtml ).set( 'text', event.Cause );
|
||||
if ( event.Notes )
|
||||
new Element( 'p' ).inject( eventHtml ).set( 'text', event.Notes );
|
||||
if ( event.Archived > 0 )
|
||||
new Element( 'p' ).inject( eventHtml ).set( 'text', archivedString );
|
||||
|
||||
return( eventHtml );
|
||||
}
|
||||
|
||||
function showEventDetail( eventHtml )
|
||||
{
|
||||
$('instruction').addClass( 'hidden' );
|
||||
$('eventData').empty();
|
||||
$('eventData').adopt( eventHtml );
|
||||
$('eventData').removeClass( 'hidden' );
|
||||
}
|
||||
|
||||
function eventDataResponse( respObj, respText )
|
||||
{
|
||||
var event = respObj.event;
|
||||
if ( !event )
|
||||
{
|
||||
console.log( "Null event" );
|
||||
return;
|
||||
}
|
||||
events[event.Id] = event;
|
||||
|
||||
if ( respObj.loopback )
|
||||
{
|
||||
requestFrameData( event.Id, respObj.loopback );
|
||||
}
|
||||
}
|
||||
|
||||
function frameDataResponse( respObj, respText )
|
||||
{
|
||||
var frame = respObj.frameimage;
|
||||
if ( !frame.FrameId )
|
||||
{
|
||||
console.log( "Null frame" );
|
||||
return;
|
||||
}
|
||||
|
||||
var event = events[frame.EventId];
|
||||
if ( !event )
|
||||
{
|
||||
console.error( "No event "+frame.eventId+" found" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !event['frames'] )
|
||||
event['frames'] = new Object();
|
||||
|
||||
event['frames'][frame.FrameId] = frame;
|
||||
event['frames'][frame.FrameId]['html'] = createEventHtml( event, frame );
|
||||
showEventDetail( event['frames'][frame.FrameId]['html'] );
|
||||
loadEventImage( frame.Image.imagePath, event.Id, frame.FrameId, event.Width, event.Height );
|
||||
}
|
||||
|
||||
var eventQuery = new Request.JSON( { url: thisUrl, method: 'get', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: eventDataResponse } );
|
||||
var frameQuery = new Request.JSON( { url: thisUrl, method: 'get', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: frameDataResponse } );
|
||||
|
||||
function requestFrameData( eventId, frameId )
|
||||
{
|
||||
if ( !events[eventId] )
|
||||
{
|
||||
eventQuery.options.data = "view=request&request=status&entity=event&id="+eventId+"&loopback="+frameId;
|
||||
eventQuery.send();
|
||||
}
|
||||
else
|
||||
{
|
||||
frameQuery.options.data = "view=request&request=status&entity=frameimage&id[0]="+eventId+"&id[1]="+frameId;
|
||||
frameQuery.send();
|
||||
}
|
||||
}
|
||||
|
||||
function previewEvent( eventId, frameId )
|
||||
{
|
||||
if ( events[eventId] )
|
||||
{
|
||||
if ( events[eventId]['frames'] )
|
||||
{
|
||||
if ( events[eventId]['frames'][frameId] )
|
||||
{
|
||||
showEventDetail( events[eventId]['frames'][frameId]['html'] );
|
||||
loadEventImage( events[eventId].frames[frameId].Image.imagePath, eventId, frameId, events[eventId].Width, events[eventId].Height );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
requestFrameData( eventId, frameId );
|
||||
}
|
||||
|
||||
function loadEventImage( imagePath, eid, fid, width, height )
|
||||
{
|
||||
var imageSrc = $('imageSrc');
|
||||
imageSrc.setProperty( 'src', imagePrefix+imagePath );
|
||||
imageSrc.removeEvent( 'click' );
|
||||
imageSrc.addEvent( 'click', showEvent.pass( [ eid, fid, width, height ] ) );
|
||||
var eventData = $('eventData');
|
||||
eventData.removeEvent( 'click' );
|
||||
eventData.addEvent( 'click', showEvent.pass( [ eid, fid, width, height ] ) );
|
||||
}
|
||||
|
||||
function tlZoomBounds( minTime, maxTime )
|
||||
{
|
||||
console.log( "Zooming" );
|
||||
window.location = '?view='+currentView+filterQuery+'&minTime='+minTime+'&maxTime='+maxTime;
|
||||
}
|
||||
|
||||
function tlZoomRange( midTime, range )
|
||||
{
|
||||
window.location = '?view='+currentView+filterQuery+'&midTime='+midTime+'&range='+range;
|
||||
}
|
||||
|
||||
function tlPan( midTime, range )
|
||||
{
|
||||
window.location = '?view='+currentView+filterQuery+'&midTime='+midTime+'&range='+range;
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
var filterQuery = '<?= validJsStr($filterQuery) ?>';
|
||||
|
||||
var monitorNames = new Object();
|
||||
<?php
|
||||
foreach ( $monitors as $monitor )
|
||||
{
|
||||
if ( !empty($monitorIds[$monitor['Id']]) )
|
||||
{
|
||||
?>
|
||||
monitorNames[<?= $monitor['Id'] ?>] = '<?= validJsStr($monitor['Name']) ?>';
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
var archivedString = "<?= $SLANG['Archived'] ?>";
|
|
@ -1,36 +0,0 @@
|
|||
function validateForm( form, newUser )
|
||||
{
|
||||
var errors = new Array();
|
||||
if ( !form.elements['newUser[Username]'].value )
|
||||
{
|
||||
errors[errors.length] = "You must supply a username";
|
||||
}
|
||||
if ( form.elements['newUser[Password]'].value )
|
||||
{
|
||||
if ( !form.conf_password.value )
|
||||
{
|
||||
errors[errors.length] = "You must confirm the password";
|
||||
}
|
||||
else if ( form.elements['newUser[Password]'].value != form.conf_password.value )
|
||||
{
|
||||
errors[errors.length] = "The new and confirm passwords are different";
|
||||
}
|
||||
}
|
||||
else if ( newUser )
|
||||
{
|
||||
errors[errors.length] = "You must supply a password";
|
||||
}
|
||||
var monitorIds = new Array();
|
||||
for ( var i = 0; i < form.elements['monitorIds'].options.length; i++ )
|
||||
{
|
||||
if ( form.elements['monitorIds'].options[i].selected )
|
||||
monitorIds[monitorIds.length] = form.elements['monitorIds'].options[i].value;
|
||||
}
|
||||
form.elements['newUser[MonitorIds]'].value = monitorIds.join( ',' );
|
||||
if ( errors.length )
|
||||
{
|
||||
alert( errors.join( "\n" ) );
|
||||
return( false );
|
||||
}
|
||||
return( true );
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
function submitForm( element )
|
||||
{
|
||||
var form = element.form;
|
||||
if ( form.option.selectedIndex == 0 )
|
||||
{
|
||||
form.view.value = currentView;
|
||||
}
|
||||
else
|
||||
{
|
||||
form.view.value = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
if ( openZmWindow )
|
||||
{
|
||||
zmWindow();
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
var openZmWindow = <?= (isset($_REQUEST['action']) && $_REQUEST['action'] == "version" && $_REQUEST['option'] == "go")?'true':'false' ?>;
|
|
@ -1,38 +0,0 @@
|
|||
function deleteVideo( index )
|
||||
{
|
||||
window.location.replace( thisUrl+'?view='+currentView+'&eid='+eventId+'&deleteIndex='+index );
|
||||
}
|
||||
|
||||
function downloadVideo( index )
|
||||
{
|
||||
window.location.replace( thisUrl+'?view='+currentView+'&eid='+eventId+'&downloadIndex='+index );
|
||||
}
|
||||
|
||||
var generateVideoTimer = null;
|
||||
|
||||
function generateVideoProgress()
|
||||
{
|
||||
var tickerText = $('videoProgressTicker').get('text');
|
||||
if ( tickerText.length < 1 || tickerText.length > 4 )
|
||||
$('videoProgressTicker').set( 'text', '.' );
|
||||
else
|
||||
$('videoProgressTicker').appendText( '.' );
|
||||
}
|
||||
|
||||
function generateVideoResponse( respObj, respText )
|
||||
{
|
||||
window.location.replace( thisUrl+'?view='+currentView+'&eid='+eventId+'&generated='+((respObj.result=='Ok')?1:0) );
|
||||
}
|
||||
|
||||
function generateVideo( form )
|
||||
{
|
||||
var parms = 'view=request&request=event&action=video';
|
||||
parms += '&'+$(form).toQueryString();
|
||||
var query = new Request.JSON( { url: thisUrl, method: 'post', data: parms, onSuccess: generateVideoResponse } );
|
||||
query.send();
|
||||
$('videoProgress').removeClass( 'hidden' );
|
||||
$('videoProgress').setProperty( 'class', 'warnText' );
|
||||
$('videoProgressText').set( 'text', videoGenProgressString );
|
||||
generateVideoProgress();
|
||||
generateVideoTimer = generateVideoProgress.periodical( 500 );
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
var eventId = '<?= $event['Id'] ?>';
|
||||
|
||||
var videoGenSuccessString = '<?= addslashes($SLANG['VideoGenSucceeded']) ?>';
|
||||
var videoGenFailedString = '<?= addslashes($SLANG['VideoGenFailed']) ?>';
|
||||
var videoGenProgressString = '<?= addslashes($SLANG['GeneratingVideo']) ?>';
|
|
@ -1,723 +0,0 @@
|
|||
function setButtonState( element, butClass )
|
||||
{
|
||||
element.className = butClass;
|
||||
element.disabled = (butClass != 'inactive');
|
||||
}
|
||||
|
||||
function showEvents()
|
||||
{
|
||||
$('ptzControls').addClass( 'hidden' );
|
||||
$('events').removeClass( 'hidden' );
|
||||
if ( $('eventsControl') )
|
||||
$('eventsControl').addClass('hidden');
|
||||
if ( $('controlControl') )
|
||||
$('controlControl').removeClass('hidden');
|
||||
showMode = "events";
|
||||
}
|
||||
|
||||
function showPtzControls()
|
||||
{
|
||||
$('events').addClass( 'hidden' );
|
||||
$('ptzControls').removeClass( 'hidden' );
|
||||
if ( $('eventsControl') )
|
||||
$('eventsControl').removeClass('hidden');
|
||||
if ( $('controlControl') )
|
||||
$('controlControl').addClass('hidden');
|
||||
showMode = "control";
|
||||
}
|
||||
|
||||
function changeScale()
|
||||
{
|
||||
var scale = $('scale').get('value');
|
||||
var newWidth = ( monitorWidth * scale ) / SCALE_BASE;
|
||||
var newHeight = ( monitorHeight * scale ) / SCALE_BASE;
|
||||
|
||||
// This causes FF3 to kill the stream now, ok with FF2
|
||||
//streamCmdScale( scale );
|
||||
|
||||
/*Stream could be an applet so can't use moo tools*/
|
||||
var streamImg = document.getElementById('liveStream');
|
||||
streamImg.style.width = newWidth + "px";
|
||||
streamImg.style.height = newHeight + "px";
|
||||
|
||||
}
|
||||
|
||||
var alarmState = STATE_IDLE;
|
||||
var lastAlarmState = STATE_IDLE;
|
||||
|
||||
function setAlarmState( currentAlarmState )
|
||||
{
|
||||
alarmState = currentAlarmState;
|
||||
|
||||
var stateString = "Unknown";
|
||||
var stateClass = "";
|
||||
if ( alarmState == STATE_ALARM )
|
||||
stateClass = "alarm";
|
||||
else if ( alarmState == STATE_ALERT )
|
||||
stateClass = "alert";
|
||||
$('stateValue').set( 'text', stateStrings[alarmState] );
|
||||
if ( stateClass )
|
||||
$('stateValue').setProperty( 'class', stateClass );
|
||||
else
|
||||
$('stateValue').removeProperty( 'class' );
|
||||
|
||||
var isAlarmed = ( alarmState == STATE_ALARM || alarmState == STATE_ALERT );
|
||||
var wasAlarmed = ( lastAlarmState == STATE_ALARM || lastAlarmState == STATE_ALERT );
|
||||
|
||||
var newAlarm = ( isAlarmed && !wasAlarmed );
|
||||
var oldAlarm = ( !isAlarmed && wasAlarmed );
|
||||
|
||||
if ( newAlarm )
|
||||
{
|
||||
if ( SOUND_ON_ALARM )
|
||||
{
|
||||
// Enable the alarm sound
|
||||
if ( !canPlayPauseAudio )
|
||||
$('alarmSound').removeClass( 'hidden' );
|
||||
else
|
||||
$('MediaPlayer').Play();
|
||||
}
|
||||
if ( POPUP_ON_ALARM )
|
||||
{
|
||||
window.focus();
|
||||
}
|
||||
}
|
||||
if ( SOUND_ON_ALARM )
|
||||
{
|
||||
if ( oldAlarm )
|
||||
{
|
||||
// Disable alarm sound
|
||||
if ( !canPlayPauseAudio )
|
||||
$('alarmSound').addClass( 'hidden' );
|
||||
else
|
||||
$('MediaPlayer').Stop();
|
||||
}
|
||||
}
|
||||
if ( oldAlarm) //done with an event do a refresh
|
||||
eventCmdQuery();
|
||||
|
||||
lastAlarmState = alarmState;
|
||||
}
|
||||
|
||||
var streamCmdParms = "view=request&request=stream&connkey="+connKey;
|
||||
var streamCmdReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: getStreamCmdResponse } );
|
||||
var streamCmdTimer = null;
|
||||
|
||||
var streamStatus;
|
||||
|
||||
function getStreamCmdResponse( respObj, respText )
|
||||
{
|
||||
watchdogOk("stream");
|
||||
if ( streamCmdTimer )
|
||||
streamCmdTimer = clearTimeout( streamCmdTimer );
|
||||
|
||||
if ( respObj.result == 'Ok' )
|
||||
{
|
||||
streamStatus = respObj.status;
|
||||
$('fpsValue').set( 'text', streamStatus.fps );
|
||||
|
||||
setAlarmState( streamStatus.state );
|
||||
|
||||
$('levelValue').set( 'text', streamStatus.level );
|
||||
if ( streamStatus.level > 95 )
|
||||
$('levelValue').className = "alarm";
|
||||
else if ( streamStatus.level > 80 )
|
||||
$('levelValue').className = "alert";
|
||||
else
|
||||
$('levelValue').className = "ok";
|
||||
|
||||
var delayString = secsToTime( streamStatus.delay );
|
||||
|
||||
if ( streamStatus.paused == true )
|
||||
{
|
||||
$('modeValue').set( 'text', "Paused" );
|
||||
$('rate').addClass( 'hidden' );
|
||||
$('delayValue').set( 'text', delayString );
|
||||
$('delay').removeClass( 'hidden' );
|
||||
$('level').removeClass( 'hidden' );
|
||||
streamCmdPause( false );
|
||||
}
|
||||
else if ( streamStatus.delayed == true )
|
||||
{
|
||||
$('modeValue').set( 'text', "Replay" );
|
||||
$('rateValue').set( 'text', streamStatus.rate );
|
||||
$('rate').removeClass( 'hidden' );
|
||||
$('delayValue').set( 'text', delayString );
|
||||
$('delay').removeClass( 'hidden' );
|
||||
$('level').removeClass( 'hidden' );
|
||||
if ( streamStatus.rate == 1 )
|
||||
{
|
||||
streamCmdPlay( false );
|
||||
}
|
||||
else if ( streamStatus.rate > 0 )
|
||||
{
|
||||
if ( streamStatus.rate < 1 )
|
||||
streamCmdSlowFwd( false );
|
||||
else
|
||||
streamCmdFastFwd( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( streamStatus.rate > -1 )
|
||||
streamCmdSlowRev( false );
|
||||
else
|
||||
streamCmdFastRev( false );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$('modeValue').set( 'text', "Live" );
|
||||
$('rate').addClass( 'hidden' );
|
||||
$('delay').addClass( 'hidden' );
|
||||
$('level').addClass( 'hidden' );
|
||||
streamCmdPlay( false );
|
||||
}
|
||||
$('zoomValue').set( 'text', streamStatus.zoom );
|
||||
if ( streamStatus.zoom == "1.0" )
|
||||
setButtonState( $('zoomOutBtn'), 'unavail' );
|
||||
else
|
||||
setButtonState( $('zoomOutBtn'), 'inactive' );
|
||||
|
||||
if ( canEditMonitors )
|
||||
{
|
||||
if ( streamStatus.enabled )
|
||||
{
|
||||
$('enableAlarmsLink').addClass( 'hidden' );
|
||||
$('disableAlarmsLink').removeClass( 'hidden' );
|
||||
if ( streamStatus.forced )
|
||||
{
|
||||
$('forceAlarmLink').addClass( 'hidden' );
|
||||
$('cancelAlarmLink').removeClass( 'hidden' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('forceAlarmLink').removeClass( 'hidden' );
|
||||
$('cancelAlarmLink').addClass( 'hidden' );
|
||||
}
|
||||
$('forceCancelAlarm').removeClass( 'hidden' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('enableAlarmsLink').removeClass( 'hidden' );
|
||||
$('disableAlarmsLink').addClass( 'hidden' );
|
||||
$('forceCancelAlarm').addClass( 'hidden' );
|
||||
}
|
||||
$('enableDisableAlarms').removeClass( 'hidden' );
|
||||
}
|
||||
}
|
||||
else
|
||||
checkStreamForErrors("getStreamCmdResponse",respObj);//log them
|
||||
|
||||
var streamCmdTimeout = statusRefreshTimeout;
|
||||
if ( alarmState == STATE_ALARM || alarmState == STATE_ALERT )
|
||||
streamCmdTimeout = streamCmdTimeout/5;
|
||||
streamCmdTimer = streamCmdQuery.delay( streamCmdTimeout );
|
||||
}
|
||||
|
||||
function streamCmdPause( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'active' );
|
||||
setButtonState( $('playBtn'), 'inactive' );
|
||||
setButtonState( $('stopBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowRevBtn'), 'inactive' );
|
||||
setButtonState( $('fastRevBtn'), 'inactive' );
|
||||
if ( action )
|
||||
streamCmdReq.send( streamCmdParms+"&command="+CMD_PAUSE );
|
||||
}
|
||||
|
||||
function streamCmdPlay( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), 'active' );
|
||||
if ( streamStatus.delayed == true )
|
||||
{
|
||||
setButtonState( $('stopBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowRevBtn'), 'inactive' );
|
||||
setButtonState( $('fastRevBtn'), 'inactive' );
|
||||
}
|
||||
else
|
||||
{
|
||||
setButtonState( $('stopBtn'), 'unavail' );
|
||||
setButtonState( $('fastFwdBtn'), 'unavail' );
|
||||
setButtonState( $('slowFwdBtn'), 'unavail' );
|
||||
setButtonState( $('slowRevBtn'), 'unavail' );
|
||||
setButtonState( $('fastRevBtn'), 'unavail' );
|
||||
}
|
||||
if ( action )
|
||||
streamCmdReq.send( streamCmdParms+"&command="+CMD_PLAY );
|
||||
}
|
||||
|
||||
function streamCmdStop( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), 'unavail' );
|
||||
setButtonState( $('stopBtn'), 'active' );
|
||||
setButtonState( $('fastFwdBtn'), 'unavail' );
|
||||
setButtonState( $('slowFwdBtn'), 'unavail' );
|
||||
setButtonState( $('slowRevBtn'), 'unavail' );
|
||||
setButtonState( $('fastRevBtn'), 'unavail' );
|
||||
if ( action )
|
||||
streamCmdReq.send( streamCmdParms+"&command="+CMD_STOP );
|
||||
setButtonState( $('stopBtn'), 'unavail' );
|
||||
setButtonState( $('playBtn'), 'active' );
|
||||
}
|
||||
|
||||
function streamCmdFastFwd( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), 'inactive' );
|
||||
setButtonState( $('stopBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowRevBtn'), 'inactive' );
|
||||
setButtonState( $('fastRevBtn'), 'inactive' );
|
||||
if ( action )
|
||||
streamCmdReq.send( streamCmdParms+"&command="+CMD_FASTFWD );
|
||||
}
|
||||
|
||||
function streamCmdSlowFwd( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), 'inactive' );
|
||||
setButtonState( $('stopBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowFwdBtn'), 'active' );
|
||||
setButtonState( $('slowRevBtn'), 'inactive' );
|
||||
setButtonState( $('fastRevBtn'), 'inactive' );
|
||||
if ( action )
|
||||
streamCmdReq.send( streamCmdParms+"&command="+CMD_SLOWFWD );
|
||||
setButtonState( $('pauseBtn'), 'active' );
|
||||
setButtonState( $('slowFwdBtn'), 'inactive' );
|
||||
}
|
||||
|
||||
function streamCmdSlowRev( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), 'inactive' );
|
||||
setButtonState( $('stopBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowRevBtn'), 'active' );
|
||||
setButtonState( $('fastRevBtn'), 'inactive' );
|
||||
if ( action )
|
||||
streamCmdReq.send( streamCmdParms+"&command="+CMD_SLOWREV );
|
||||
setButtonState( $('pauseBtn'), 'active' );
|
||||
setButtonState( $('slowRevBtn'), 'inactive' );
|
||||
}
|
||||
|
||||
function streamCmdFastRev( action )
|
||||
{
|
||||
setButtonState( $('pauseBtn'), 'inactive' );
|
||||
setButtonState( $('playBtn'), 'inactive' );
|
||||
setButtonState( $('stopBtn'), 'inactive' );
|
||||
setButtonState( $('fastFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowFwdBtn'), 'inactive' );
|
||||
setButtonState( $('slowRevBtn'), 'inactive' );
|
||||
setButtonState( $('fastRevBtn'), 'inactive' );
|
||||
if ( action )
|
||||
streamCmdReq.send( streamCmdParms+"&command="+CMD_FASTREV );
|
||||
}
|
||||
|
||||
function streamCmdZoomIn( x, y )
|
||||
{
|
||||
streamCmdReq.send( streamCmdParms+"&command="+CMD_ZOOMIN+"&x="+x+"&y="+y );
|
||||
}
|
||||
|
||||
function streamCmdZoomOut()
|
||||
{
|
||||
streamCmdReq.send( streamCmdParms+"&command="+CMD_ZOOMOUT );
|
||||
}
|
||||
|
||||
function streamCmdScale( scale )
|
||||
{
|
||||
streamCmdReq.send( streamCmdParms+"&command="+CMD_SCALE+"&scale="+scale );
|
||||
}
|
||||
|
||||
function streamCmdPan( x, y )
|
||||
{
|
||||
streamCmdReq.send( streamCmdParms+"&command="+CMD_PAN+"&x="+x+"&y="+y );
|
||||
}
|
||||
|
||||
function streamCmdQuery()
|
||||
{
|
||||
streamCmdReq.send( streamCmdParms+"&command="+CMD_QUERY );
|
||||
}
|
||||
|
||||
var statusCmdParms = "view=request&request=status&entity=monitor&id="+monitorId+"&element[]=Status&element[]=FrameRate";
|
||||
var statusCmdReq = new Request.JSON( { url: thisUrl, method: 'post', data: statusCmdParms, timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: getStatusCmdResponse } );
|
||||
var statusCmdTimer = null;
|
||||
|
||||
function getStatusCmdResponse( respObj, respText )
|
||||
{
|
||||
watchdogOk("status");
|
||||
if ( statusCmdTimer )
|
||||
statusCmdTimer = clearTimeout( statusCmdTimer );
|
||||
|
||||
if ( respObj.result == 'Ok' )
|
||||
{
|
||||
$('fpsValue').set( 'text', respObj.monitor.FrameRate );
|
||||
setAlarmState( respObj.monitor.Status );
|
||||
}
|
||||
else
|
||||
checkStreamForErrors("getStatusCmdResponse",respObj);
|
||||
|
||||
var statusCmdTimeout = statusRefreshTimeout;
|
||||
if ( alarmState == STATE_ALARM || alarmState == STATE_ALERT )
|
||||
statusCmdTimeout = statusCmdTimeout/5;
|
||||
statusCmdTimer = statusCmdQuery.delay( statusCmdTimeout );
|
||||
}
|
||||
|
||||
function statusCmdQuery()
|
||||
{
|
||||
statusCmdReq.send();
|
||||
}
|
||||
|
||||
var alarmCmdParms = "view=request&request=alarm&id="+monitorId;
|
||||
var alarmCmdReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: getAlarmCmdResponse, onTimeout: streamCmdQuery } );
|
||||
var alarmCmdFirst = true;
|
||||
|
||||
function getAlarmCmdResponse( respObj, respText )
|
||||
{
|
||||
checkStreamForErrors("getAlarmCmdResponse",respObj);
|
||||
}
|
||||
|
||||
function cmdDisableAlarms()
|
||||
{
|
||||
alarmCmdReq.send( alarmCmdParms+"&command=disableAlarms" );
|
||||
}
|
||||
|
||||
function cmdEnableAlarms()
|
||||
{
|
||||
alarmCmdReq.send( alarmCmdParms+"&command=enableAlarms" );
|
||||
}
|
||||
|
||||
function cmdForceAlarm()
|
||||
{
|
||||
alarmCmdReq.send( alarmCmdParms+"&command=forceAlarm" );
|
||||
}
|
||||
|
||||
function cmdCancelForcedAlarm()
|
||||
{
|
||||
alarmCmdReq.send( alarmCmdParms+"&command=cancelForcedAlarm" );
|
||||
}
|
||||
|
||||
function getActResponse( respObj, respText )
|
||||
{
|
||||
if ( respObj.result == 'Ok' )
|
||||
{
|
||||
if ( respObj.refreshParent )
|
||||
{
|
||||
window.opener.location.reload();
|
||||
}
|
||||
}
|
||||
eventCmdQuery();
|
||||
}
|
||||
|
||||
function deleteEvent( event, eventId )
|
||||
{
|
||||
var actParms = "view=request&request=event&action=delete&id="+eventId;
|
||||
var actReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: 3000, data: actParms, onSuccess: getActResponse } );
|
||||
actReq.send();
|
||||
event.stop();
|
||||
}
|
||||
|
||||
var eventCmdParms = "view=request&request=status&entity=events&id="+monitorId+"&count="+maxDisplayEvents+"&sort=Id%20desc";
|
||||
var eventCmdReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, data: eventCmdParms, link: 'cancel', onSuccess: getEventCmdResponse, onTimeout: eventCmdQuery } );
|
||||
var eventCmdTimer = null;
|
||||
var eventCmdFirst = true;
|
||||
|
||||
function highlightRow( row )
|
||||
{
|
||||
$(row).toggleClass( 'highlight' );
|
||||
}
|
||||
|
||||
function getEventCmdResponse( respObj, respText )
|
||||
{
|
||||
watchdogOk("event");
|
||||
if ( eventCmdTimer )
|
||||
eventCmdTimer = clearTimeout( eventCmdTimer );
|
||||
|
||||
if ( respObj.result == 'Ok' )
|
||||
{
|
||||
var dbEvents = respObj.events.reverse();
|
||||
var eventList = $('eventList');
|
||||
var eventListBody = $(eventList).getElement( 'tbody' );
|
||||
var eventListRows = $(eventListBody).getElements( 'tr' );
|
||||
|
||||
eventListRows.each( function( row ) { row.removeClass( 'updated' ); } );
|
||||
|
||||
for ( var i = 0; i < dbEvents.length; i++ )
|
||||
{
|
||||
var event = dbEvents[i];
|
||||
var row = $('event'+event.Id);
|
||||
var newEvent = (row == null ? true : false);
|
||||
if ( newEvent )
|
||||
{
|
||||
row = new Element( 'tr', { 'id': 'event'+event.Id } );
|
||||
new Element( 'td', { 'class': 'colId' } ).inject( row );
|
||||
new Element( 'td', { 'class': 'colName' } ).inject( row );
|
||||
new Element( 'td', { 'class': 'colTime' } ).inject( row );
|
||||
new Element( 'td', { 'class': 'colSecs' } ).inject( row );
|
||||
new Element( 'td', { 'class': 'colFrames' } ).inject( row );
|
||||
new Element( 'td', { 'class': 'colScore' } ).inject( row );
|
||||
new Element( 'td', { 'class': 'colDelete' } ).inject( row );
|
||||
|
||||
var cells = row.getElements( 'td' );
|
||||
|
||||
var link = new Element( 'a', { 'href': '#', 'events': { 'click': createEventPopup.pass( [ event.Id, '&trms=1&attr1=MonitorId&op1=%3d&val1='+monitorId+'&page=1', event.Width, event.Height ] ) } });
|
||||
link.set( 'text', event.Id );
|
||||
link.inject( row.getElement( 'td.colId' ) );
|
||||
|
||||
link = new Element( 'a', { 'href': '#', 'events': { 'click': createEventPopup.pass( [ event.Id, '&trms=1&attr1=MonitorId&op1=%3d&val1='+monitorId+'&page=1', event.Width, event.Height ] ) } });
|
||||
link.set( 'text', event.Name );
|
||||
link.inject( row.getElement( 'td.colName' ) );
|
||||
|
||||
row.getElement( 'td.colTime' ).set( 'text', event.StartTime );
|
||||
row.getElement( 'td.colSecs' ).set( 'text', event.Length );
|
||||
|
||||
link = new Element( 'a', { 'href': '#', 'events': { 'click': createFramesPopup.pass( [ event.Id, event.Width, event.Height ] ) } });
|
||||
link.set( 'text', event.Frames+'/'+event.AlarmFrames );
|
||||
link.inject( row.getElement( 'td.colFrames' ) );
|
||||
|
||||
link = new Element( 'a', { 'href': '#', 'events': { 'click': createFramePopup.pass( [ event.Id, '0', event.Width, event.Height ] ) } });
|
||||
link.set( 'text', event.AvgScore+'/'+event.MaxScore );
|
||||
link.inject( row.getElement( 'td.colScore' ) );
|
||||
|
||||
link = new Element( 'a', { 'href': '#', 'title': deleteString, 'events': { 'click': function( event ) { deleteEvent( event, event.Id ); }.bind( link ), 'mouseover': highlightRow.pass( row ), 'mouseout': highlightRow.pass( row ) } });
|
||||
link.set( 'text', 'X' );
|
||||
link.inject( row.getElement( 'td.colDelete' ) );
|
||||
|
||||
if ( i == 0 )
|
||||
row.inject( $(eventListBody) );
|
||||
else
|
||||
{
|
||||
row.inject( $(eventListBody), 'top' );
|
||||
if ( !eventCmdFirst )
|
||||
row.addClass( 'recent' );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
row.getElement( 'td.colName a' ).set( 'text', event.Name );
|
||||
row.getElement( 'td.colSecs' ).set( 'text', event.Length );
|
||||
row.getElement( 'td.colFrames a' ).set( 'text', event.Frames+'/'+event.AlarmFrames );
|
||||
row.getElement( 'td.colScore a' ).set( 'text', event.AvgScore+'/'+event.MaxScore );
|
||||
row.removeClass( 'recent' );
|
||||
}
|
||||
row.addClass( 'updated' );
|
||||
}
|
||||
|
||||
var rows = $(eventListBody).getElements( 'tr' );
|
||||
for ( var i = 0; i < rows.length; i++ )
|
||||
{
|
||||
if ( !rows[i].hasClass( 'updated' ) )
|
||||
{
|
||||
rows[i].destroy();
|
||||
rows.splice( i, 1 );
|
||||
i--;
|
||||
}
|
||||
}
|
||||
while ( rows.length > maxDisplayEvents )
|
||||
{
|
||||
rows[rows.length-1].destroy();
|
||||
rows.length--;
|
||||
}
|
||||
}
|
||||
else
|
||||
checkStreamForErrors("getEventCmdResponse",respObj);
|
||||
|
||||
var eventCmdTimeout = eventsRefreshTimeout;
|
||||
if ( alarmState == STATE_ALARM || alarmState == STATE_ALERT )
|
||||
eventCmdTimeout = eventCmdTimeout/5;
|
||||
eventCmdTimer = eventCmdQuery.delay( eventCmdTimeout );
|
||||
eventCmdFirst = false;
|
||||
}
|
||||
|
||||
function eventCmdQuery()
|
||||
{
|
||||
if ( eventCmdTimer ) //avoid firing another if we are firing one
|
||||
eventCmdTimer = clearTimeout( eventCmdTimer );
|
||||
eventCmdReq.send();
|
||||
}
|
||||
|
||||
var controlParms = "view=request&request=control&id="+monitorId;
|
||||
var controlReq = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: getControlResponse } );
|
||||
|
||||
function getControlResponse( respObj, respText )
|
||||
{
|
||||
if ( !respObj )
|
||||
return;
|
||||
//console.log( respText );
|
||||
if ( respObj.result != 'Ok' )
|
||||
{
|
||||
alert( "Control response was status = "+respObj.status+"\nmessage = "+respObj.message );
|
||||
}
|
||||
}
|
||||
|
||||
function controlCmd( control, event, xtell, ytell )
|
||||
{
|
||||
var locParms = "";
|
||||
if ( event && (xtell || ytell) )
|
||||
{
|
||||
var xEvent = new Event( event );
|
||||
var target = xEvent.target;
|
||||
var coords = $(target).getCoordinates();
|
||||
|
||||
var l = coords.left;
|
||||
var t = coords.top;
|
||||
var x = xEvent.page.x - l;
|
||||
var y = xEvent.page.y - t;
|
||||
|
||||
if ( xtell )
|
||||
{
|
||||
var xge = parseInt( (x*100)/coords.width );
|
||||
if ( xtell == -1 )
|
||||
xge = 100 - xge;
|
||||
else if ( xtell == 2 )
|
||||
xge = 2*(50 - xge);
|
||||
locParms += "&xge="+xge;
|
||||
}
|
||||
if ( ytell )
|
||||
{
|
||||
var yge = parseInt( (y*100)/coords.height );
|
||||
if ( ytell == -1 )
|
||||
yge = 100 - yge;
|
||||
else if ( ytell == 2 )
|
||||
yge = 2*(50 - yge);
|
||||
locParms += "&yge="+yge;
|
||||
}
|
||||
}
|
||||
controlReq.send( controlParms+"&control="+control+locParms );
|
||||
if ( streamMode == "single" )
|
||||
fetchImage.pass( $('imageFeed').getElement('img') ).delay( 1000 );
|
||||
}
|
||||
|
||||
function controlCmdImage( x, y )
|
||||
{
|
||||
var imageControlParms = controlParms;
|
||||
imageControlParms += "&scale="+scale;
|
||||
imageControlParms += "&control="+imageControlMode;
|
||||
|
||||
controlReq.send( imageControlParms+"&x="+x+"&y="+y );
|
||||
if ( streamMode == "single" )
|
||||
fetchImage.pass( $('imageFeed').getElement('img') ).delay( 1000 );
|
||||
}
|
||||
|
||||
var tempImage = null;
|
||||
function fetchImage( streamImage )
|
||||
{
|
||||
var now = new Date();
|
||||
if ( !tempImage )
|
||||
tempImage = new Element( 'img' );
|
||||
tempImage.setProperty( 'src', streamSrc+'&'+now.getTime() );
|
||||
$(streamImage).setProperty( 'src', tempImage.getProperty( 'src' ) );
|
||||
}
|
||||
|
||||
function handleClick( event )
|
||||
{
|
||||
var target = event.target;
|
||||
var x = event.page.x - $(target).getLeft();
|
||||
var y = event.page.y - $(target).getTop();
|
||||
|
||||
if ( showMode == "events" || !imageControlMode )
|
||||
{
|
||||
if ( event.shift )
|
||||
streamCmdPan( x, y );
|
||||
else
|
||||
streamCmdZoomIn( x, y );
|
||||
}
|
||||
else
|
||||
{
|
||||
controlCmdImage( x, y );
|
||||
}
|
||||
}
|
||||
|
||||
function appletRefresh()
|
||||
{
|
||||
if ( streamStatus && (!streamStatus.paused && !streamStatus.delayed) )
|
||||
{
|
||||
var streamImg = $('liveStream');
|
||||
var parent = streamImg.getParent();
|
||||
streamImg.dispose();
|
||||
streamImg.inject( parent );
|
||||
if ( appletRefreshTime )
|
||||
appletRefresh.delay( appletRefreshTime*1000 );
|
||||
}
|
||||
else
|
||||
{
|
||||
appletRefresh.delay( 15*1000 ); //if we are paused or delayed check every 15 seconds if we are live yet...
|
||||
}
|
||||
}
|
||||
|
||||
var watchdogInactive = {
|
||||
'stream': false,
|
||||
'status': false,
|
||||
'event': false
|
||||
};
|
||||
|
||||
var watchdogFunctions = {
|
||||
'stream': streamCmdQuery,
|
||||
'status': statusCmdQuery,
|
||||
'event': eventCmdQuery
|
||||
};
|
||||
|
||||
//Make sure the various refreshes are still taking effect
|
||||
function watchdogCheck( type )
|
||||
{
|
||||
if ( watchdogInactive[type] )
|
||||
{
|
||||
console.log( "Detected streamWatch of type: " + type + " stopped, restarting" );
|
||||
watchdogFunctions[type]();
|
||||
watchdogInactive[type] = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
watchdogInactive[type] = true;
|
||||
}
|
||||
}
|
||||
|
||||
function watchdogOk( type )
|
||||
{
|
||||
watchdogInactive[type] = false;
|
||||
}
|
||||
|
||||
function initPage()
|
||||
{
|
||||
if ( streamMode == "single" )
|
||||
{
|
||||
statusCmdTimer = statusCmdQuery.delay( (Math.random()+0.1)*statusRefreshTimeout );
|
||||
watchdogCheck.pass('status').periodical(statusRefreshTimeout*2);
|
||||
}
|
||||
else
|
||||
{
|
||||
streamCmdTimer = streamCmdQuery.delay( (Math.random()+0.1)*statusRefreshTimeout );
|
||||
watchdogCheck.pass('stream').periodical(statusRefreshTimeout*2);
|
||||
}
|
||||
|
||||
eventCmdTimer = eventCmdQuery.delay( (Math.random()+0.1)*statusRefreshTimeout );
|
||||
watchdogCheck.pass('event').periodical(eventsRefreshTimeout*2);
|
||||
|
||||
if ( canStreamNative || streamMode == "single" )
|
||||
{
|
||||
var streamImg = $('imageFeed').getElement('img');
|
||||
if ( !streamImg )
|
||||
streamImg = $('imageFeed').getElement('object');
|
||||
if ( streamMode == "single" )
|
||||
{
|
||||
streamImg.addEvent( 'click', fetchImage.pass( streamImg ) );
|
||||
fetchImage.pass( streamImg ).periodical( imageRefreshTimeout );
|
||||
}
|
||||
else
|
||||
streamImg.addEvent( 'click', function( event ) { handleClick( event ); } );
|
||||
}
|
||||
|
||||
if ( refreshApplet && appletRefreshTime )
|
||||
appletRefresh.delay( appletRefreshTime*1000 );
|
||||
}
|
||||
|
||||
// Kick everything off
|
||||
window.addEvent( 'domready', initPage );
|
|
@ -1,75 +0,0 @@
|
|||
//
|
||||
// Import constants
|
||||
//
|
||||
var STATE_IDLE = <?= STATE_IDLE ?>;
|
||||
var STATE_PREALARM = <?= STATE_PREALARM ?>;
|
||||
var STATE_ALARM = <?= STATE_ALARM ?>;
|
||||
var STATE_ALERT = <?= STATE_ALERT ?>;
|
||||
var STATE_TAPE = <?= STATE_TAPE ?>;
|
||||
|
||||
var stateStrings = new Array();
|
||||
stateStrings[STATE_IDLE] = "<?= $SLANG['Idle'] ?>";
|
||||
stateStrings[STATE_PREALARM] = "<?= $SLANG['Idle'] ?>";
|
||||
stateStrings[STATE_ALARM] = "<?= $SLANG['Alarm'] ?>";
|
||||
stateStrings[STATE_ALERT] = "<?= $SLANG['Alert'] ?>";
|
||||
stateStrings[STATE_TAPE] = "<?= $SLANG['Record'] ?>";
|
||||
|
||||
var deleteString = "<?= $SLANG['Delete'] ?>";
|
||||
|
||||
var CMD_NONE = <?= CMD_NONE ?>;
|
||||
var CMD_PAUSE = <?= CMD_PAUSE ?>;
|
||||
var CMD_PLAY = <?= CMD_PLAY ?>;
|
||||
var CMD_STOP = <?= CMD_STOP ?>;
|
||||
var CMD_FASTFWD = <?= CMD_FASTFWD ?>;
|
||||
var CMD_SLOWFWD = <?= CMD_SLOWFWD ?>;
|
||||
var CMD_SLOWREV = <?= CMD_SLOWREV ?>;
|
||||
var CMD_FASTREV = <?= CMD_FASTREV ?>;
|
||||
var CMD_ZOOMIN = <?= CMD_ZOOMIN ?>;
|
||||
var CMD_ZOOMOUT = <?= CMD_ZOOMOUT ?>;
|
||||
var CMD_PAN = <?= CMD_PAN ?>;
|
||||
var CMD_SCALE = <?= CMD_SCALE ?>;
|
||||
var CMD_PREV = <?= CMD_PREV ?>;
|
||||
var CMD_NEXT = <?= CMD_NEXT ?>;
|
||||
var CMD_SEEK = <?= CMD_SEEK ?>;
|
||||
var CMD_QUERY = <?= CMD_QUERY ?>;
|
||||
|
||||
var SCALE_BASE = <?= SCALE_BASE ?>;
|
||||
|
||||
var SOUND_ON_ALARM = <?= ZM_WEB_SOUND_ON_ALARM ?>;
|
||||
var POPUP_ON_ALARM = <?= ZM_WEB_POPUP_ON_ALARM ?>;
|
||||
|
||||
var streamMode = "<?= $streamMode ?>";
|
||||
var showMode = "<?= ($showPtzControls && !empty($control))?"control":"events" ?>";
|
||||
|
||||
var connKey = '<?= $connkey ?>';
|
||||
var maxDisplayEvents = <?= 2 * MAX_EVENTS ?>;
|
||||
|
||||
var monitorId = <?= $monitor['Id'] ?>;
|
||||
var monitorWidth = <?= $monitor['Width'] ?>;
|
||||
var monitorHeight = <?= $monitor['Height'] ?>;
|
||||
|
||||
var scale = <?= $scale ?>;
|
||||
|
||||
var streamSrc = "<?= preg_replace( '/&/', '&', $streamSrc ) ?>";
|
||||
|
||||
var statusRefreshTimeout = <?= 1000*ZM_WEB_REFRESH_STATUS ?>;
|
||||
var eventsRefreshTimeout = <?= 1000*ZM_WEB_REFRESH_EVENTS ?>;
|
||||
var imageRefreshTimeout = <?= 1000*ZM_WEB_REFRESH_IMAGE ?>;
|
||||
|
||||
var canEditMonitors = <?= canEdit( 'Monitors' )?'true':'false' ?>;
|
||||
var canStreamNative = <?= canStreamNative()?'true':'false' ?>;
|
||||
|
||||
var canPlayPauseAudio = Browser.ie;
|
||||
|
||||
<?php if ( $monitor['CanMoveMap'] ) { ?>
|
||||
var imageControlMode = "moveMap";
|
||||
<?php } elseif ( $monitor['CanMoveRel'] ) { ?>
|
||||
var imageControlMode = "movePseudoMap";
|
||||
<?php } elseif ( $monitor['CanMoveCon'] ) { ?>
|
||||
var imageControlMode = "moveConMap";
|
||||
<?php } else { ?>
|
||||
var imageControlMode = null;
|
||||
<?php } ?>
|
||||
|
||||
var refreshApplet = <?= (canStreamApplet() && $streamMode == "jpeg")?'true':'false' ?>;
|
||||
var appletRefreshTime = <?= ZM_RELOAD_CAMBOZOLA ?>;
|
|
@ -1,509 +0,0 @@
|
|||
function validateForm( form )
|
||||
{
|
||||
var errors = new Array();
|
||||
if ( selfIntersecting )
|
||||
{
|
||||
errors[errors.length] = selfIntersectingString;
|
||||
}
|
||||
if ( form.elements['newZone[Type]'].value != 'Inactive' )
|
||||
{
|
||||
if ( !form.newAlarmRgbR.value || !form.newAlarmRgbG.value || !form.newAlarmRgbB.value )
|
||||
{
|
||||
errors[errors.length] = alarmRGBUnsetString;
|
||||
}
|
||||
form.elements['newZone[AlarmRGB]'].value = (form.newAlarmRgbR.value<<16)|(form.newAlarmRgbG.value<<8)|form.newAlarmRgbB.value;
|
||||
if ( !form.elements['newZone[MinPixelThreshold]'].value || (parseInt(form.elements['newZone[MinPixelThreshold]'].value) <= 0 ) )
|
||||
{
|
||||
errors[errors.length] = minPixelThresUnsetString;
|
||||
}
|
||||
else if ( (parseInt(form.elements['newZone[MinPixelThreshold]'].value) >= parseInt(form.elements['newZone[MaxPixelThreshold]'].value)) && (parseInt(form.elements['newZone[MaxPixelThreshold]'].value) > 0) )
|
||||
{
|
||||
errors[errors.length] = minPixelThresLtMaxString;
|
||||
}
|
||||
if ( form.elements['newZone[CheckMethod]'].value == 'FilteredPixels' || form.elements['newZone[CheckMethod]'].value == 'Blobs' )
|
||||
{
|
||||
if ( !form.elements['newZone[FilterX]'].value || !form.elements['newZone[FilterY]'].value )
|
||||
{
|
||||
errors[errors.length] = filterUnsetString;
|
||||
}
|
||||
}
|
||||
if ( !form.elements['newZone[MinAlarmPixels]'].value || (parseFloat(form.elements['newZone[MinAlarmPixels]'].value) <= 0 ) )
|
||||
{
|
||||
errors[errors.length] = minAlarmAreaUnsetString;
|
||||
}
|
||||
else if ( (parseFloat(form.elements['newZone[MinAlarmPixels]'].value) >= parseFloat(form.elements['newZone[MaxAlarmPixels]'].value)) && (parseFloat(form.elements['newZone[MaxAlarmPixels]'].value) > 0) )
|
||||
{
|
||||
errors[errors.length] = minAlarmAreaLtMaxString;
|
||||
}
|
||||
if ( form.elements['newZone[CheckMethod]'].value == 'FilteredPixels' || form.elements['newZone[CheckMethod]'].value == 'Blobs' )
|
||||
{
|
||||
if ( !form.elements['newZone[MinFilterPixels]'].value || (parseFloat(form.elements['newZone[MinFilterPixels]'].value) <= 0 ) )
|
||||
{
|
||||
errors[errors.length] = minFilterAreaUnsetString;
|
||||
}
|
||||
else if ( (parseFloat(form.elements['newZone[MinFilterPixels]'].value) >= parseFloat(form.elements['newZone[MaxFilterPixels]'].value)) && (parseFloat(form.elements['newZone[MaxFilterPixels]'].value) > 0) )
|
||||
{
|
||||
errors[errors.length] = minFilterAreaLtMaxString;
|
||||
}
|
||||
else if ( parseFloat(form.elements['newZone[MinAlarmPixels]'].value) < parseFloat(form.elements['newZone[MinFilterPixels]'].value) )
|
||||
{
|
||||
errors[errors.length] = minFilterLtMinAlarmString;
|
||||
}
|
||||
if ( form.elements['newZone[CheckMethod]'].value == 'Blobs' )
|
||||
{
|
||||
if ( !form.elements['newZone[MinBlobPixels]'].value || (parseFloat(form.elements['newZone[MinBlobPixels]'].value) <= 0 ) )
|
||||
{
|
||||
errors[errors.length] = minBlobAreaUnsetString;
|
||||
}
|
||||
else if ( (parseFloat(form.elements['newZone[MinBlobPixels]'].value) >= parseFloat(form.elements['newZone[MaxBlobPixels]'].value)) && (parseFloat(form.elements['newZone[MaxBlobPixels]'].value) > 0) )
|
||||
{
|
||||
errors[errors.length] = minBlobAreaLtMaxString;
|
||||
}
|
||||
else if ( parseFloat(form.elements['newZone[MinFilterPixels]'].value) < parseFloat(form.elements['newZone[MinBlobPixels]'].value) )
|
||||
{
|
||||
errors[errors.length] = minBlobLtMinFilterString;
|
||||
}
|
||||
if ( !form.elements['newZone[MinBlobs]'].value || (parseInt(form.elements['newZone[MinBlobs]'].value) <= 0 ) )
|
||||
{
|
||||
errors[errors.length] = minBlobsUnsetString;
|
||||
}
|
||||
else if ( (parseInt(form.elements['newZone[MinBlobs]'].value) >= parseInt(form.elements['newZone[MaxBlobs]'].value)) && (parseInt(form.elements['newZone[MaxBlobs]'].value) > 0) )
|
||||
{
|
||||
errors[errors.length] = minBlobsLtMaxString;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( errors.length )
|
||||
{
|
||||
alert( errors.join( "\n" ) );
|
||||
return( false );
|
||||
}
|
||||
return( true );
|
||||
}
|
||||
|
||||
function submitForm( form )
|
||||
{
|
||||
form.elements['newZone[AlarmRGB]'].value = (form.newAlarmRgbR.value<<16)|(form.newAlarmRgbG.value<<8)|form.newAlarmRgbB.value;
|
||||
form.elements['newZone[NumCoords]'].value = zone['Points'].length;
|
||||
form.elements['newZone[Coords]'].value = getCoordString();
|
||||
form.elements['newZone[Area]'].value = zone.Area;
|
||||
|
||||
form.submit();
|
||||
}
|
||||
|
||||
function applyZoneType()
|
||||
{
|
||||
var form = document.zoneForm;
|
||||
if ( form.elements['newZone[Type]'].value == 'Inactive' )
|
||||
{
|
||||
form.presetSelector.disabled = true;
|
||||
form.newAlarmRgbR.disabled = true;
|
||||
form.newAlarmRgbG.disabled = true;
|
||||
form.newAlarmRgbB.disabled = true;
|
||||
form.elements['newZone[CheckMethod]'].disabled = true;
|
||||
form.elements['newZone[MinPixelThreshold]'].disabled = true;
|
||||
form.elements['newZone[MaxPixelThreshold]'].disabled = true;
|
||||
form.elements['newZone[MinAlarmPixels]'].disabled = true;
|
||||
form.elements['newZone[MaxAlarmPixels]'].disabled = true;
|
||||
form.elements['newZone[FilterX]'].disabled = true;
|
||||
form.elements['newZone[FilterY]'].disabled = true;
|
||||
form.elements['newZone[MinFilterPixels]'].disabled = true;
|
||||
form.elements['newZone[MaxFilterPixels]'].disabled = true;
|
||||
form.elements['newZone[MinBlobPixels]'].disabled = true;
|
||||
form.elements['newZone[MaxBlobPixels]'].disabled = true;
|
||||
form.elements['newZone[MinBlobs]'].disabled = true;
|
||||
form.elements['newZone[MaxBlobs]'].disabled = true;
|
||||
form.elements['newZone[OverloadFrames]'].disabled = true;
|
||||
form.elements['newZone[ExtendAlarmFrames]'].disabled = true;
|
||||
}
|
||||
else if ( form.elements['newZone[Type]'].value == 'Preclusive' )
|
||||
{
|
||||
form.presetSelector.disabled = false;
|
||||
form.newAlarmRgbR.disabled = true;
|
||||
form.newAlarmRgbG.disabled = true;
|
||||
form.newAlarmRgbB.disabled = true;
|
||||
form.elements['newZone[CheckMethod]'].disabled = false;
|
||||
form.elements['newZone[MinPixelThreshold]'].disabled = false;
|
||||
form.elements['newZone[MaxPixelThreshold]'].disabled = false;
|
||||
form.elements['newZone[MinAlarmPixels]'].disabled = false;
|
||||
form.elements['newZone[MaxAlarmPixels]'].disabled = false;
|
||||
form.elements['newZone[OverloadFrames]'].disabled = false;
|
||||
form.elements['newZone[ExtendAlarmFrames]'].disabled = false;
|
||||
applyCheckMethod();
|
||||
}
|
||||
else
|
||||
{
|
||||
form.presetSelector.disabled = false;
|
||||
form.newAlarmRgbR.disabled = false;
|
||||
form.newAlarmRgbG.disabled = false;
|
||||
form.newAlarmRgbB.disabled = false;
|
||||
form.elements['newZone[CheckMethod]'].disabled = false;
|
||||
form.elements['newZone[MinPixelThreshold]'].disabled = false;
|
||||
form.elements['newZone[MaxPixelThreshold]'].disabled = false;
|
||||
form.elements['newZone[MinAlarmPixels]'].disabled = false;
|
||||
form.elements['newZone[MaxAlarmPixels]'].disabled = false;
|
||||
form.elements['newZone[OverloadFrames]'].disabled = false;
|
||||
form.elements['newZone[ExtendAlarmFrames]'].disabled = true;
|
||||
applyCheckMethod();
|
||||
}
|
||||
}
|
||||
|
||||
function applyCheckMethod()
|
||||
{
|
||||
var form = document.zoneForm;
|
||||
if ( form.elements['newZone[CheckMethod]'].value == 'AlarmedPixels' )
|
||||
{
|
||||
form.elements['newZone[FilterX]'].disabled = true;
|
||||
form.elements['newZone[FilterY]'].disabled = true;
|
||||
form.elements['newZone[MinFilterPixels]'].disabled = true;
|
||||
form.elements['newZone[MaxFilterPixels]'].disabled = true;
|
||||
form.elements['newZone[MinBlobPixels]'].disabled = true;
|
||||
form.elements['newZone[MaxBlobPixels]'].disabled = true;
|
||||
form.elements['newZone[MinBlobs]'].disabled = true;
|
||||
form.elements['newZone[MaxBlobs]'].disabled = true;
|
||||
}
|
||||
else if ( form.elements['newZone[CheckMethod]'].value == 'FilteredPixels' )
|
||||
{
|
||||
form.elements['newZone[FilterX]'].disabled = false;
|
||||
form.elements['newZone[FilterY]'].disabled = false;
|
||||
form.elements['newZone[MinFilterPixels]'].disabled = false;
|
||||
form.elements['newZone[MaxFilterPixels]'].disabled = false;
|
||||
form.elements['newZone[MinBlobPixels]'].disabled = true;
|
||||
form.elements['newZone[MaxBlobPixels]'].disabled = true;
|
||||
form.elements['newZone[MinBlobs]'].disabled = true;
|
||||
form.elements['newZone[MaxBlobs]'].disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
form.elements['newZone[FilterX]'].disabled = false;
|
||||
form.elements['newZone[FilterY]'].disabled = false;
|
||||
form.elements['newZone[MinFilterPixels]'].disabled = false;
|
||||
form.elements['newZone[MaxFilterPixels]'].disabled = false;
|
||||
form.elements['newZone[MinBlobPixels]'].disabled = false;
|
||||
form.elements['newZone[MaxBlobPixels]'].disabled = false;
|
||||
form.elements['newZone[MinBlobs]'].disabled = false;
|
||||
form.elements['newZone[MaxBlobs]'].disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function applyPreset()
|
||||
{
|
||||
var form = document.zoneForm;
|
||||
var presetId = $('presetSelector').get('value');
|
||||
|
||||
if ( presets[presetId] )
|
||||
{
|
||||
var preset = presets[presetId];
|
||||
|
||||
form.elements['newZone[Units]'].selectedIndex = preset['UnitsIndex'];
|
||||
form.elements['newZone[CheckMethod]'].selectedIndex = preset['CheckMethodIndex'];
|
||||
form.elements['newZone[MinPixelThreshold]'].value = preset['MinPixelThreshold'];
|
||||
form.elements['newZone[MaxPixelThreshold]'].value = preset['MaxPixelThreshold'];
|
||||
form.elements['newZone[FilterX]'].value = preset['FilterX'];
|
||||
form.elements['newZone[FilterY]'].value = preset['FilterY'];
|
||||
form.elements['newZone[MinAlarmPixels]'].value = preset['MinAlarmPixels'];
|
||||
form.elements['newZone[MaxAlarmPixels]'].value = preset['MaxAlarmPixels'];
|
||||
form.elements['newZone[MinFilterPixels]'].value = preset['MinFilterPixels'];
|
||||
form.elements['newZone[MaxFilterPixels]'].value = preset['MaxFilterPixels'];
|
||||
form.elements['newZone[MinBlobPixels]'].value = preset['MinBlobPixels'];
|
||||
form.elements['newZone[MaxBlobPixels]'].value = preset['MaxBlobPixels'];
|
||||
form.elements['newZone[MinBlobs]'].value = preset['MinBlobs'];
|
||||
form.elements['newZone[MaxBlobs]'].value = preset['MaxBlobs'];
|
||||
form.elements['newZone[OverloadFrames]'].value = preset['OverloadFrames'];
|
||||
form.elements['newZone[ExtendAlarmFrames]'].value = preset['ExtendAlarmFrames'];
|
||||
|
||||
applyCheckMethod();
|
||||
form.elements['newZone[TempArea]'].value = 100;
|
||||
}
|
||||
}
|
||||
|
||||
function toPixels( field, maxValue )
|
||||
{
|
||||
if ( field.value != '' )
|
||||
field.value = Math.round((field.value*maxValue)/100);
|
||||
}
|
||||
|
||||
function toPercent( field, maxValue )
|
||||
{
|
||||
if ( field.value != '' )
|
||||
field.value = Math.round((100*100*field.value)/maxValue)/100;
|
||||
}
|
||||
|
||||
function applyZoneUnits()
|
||||
{
|
||||
var area = zone.Area;
|
||||
|
||||
var form = document.zoneForm;
|
||||
if ( form.elements['newZone[Units]'].value == 'Pixels' )
|
||||
{
|
||||
form.elements['newZone[TempArea]'].value = area;
|
||||
toPixels( form.elements['newZone[MinAlarmPixels]'], area );
|
||||
toPixels( form.elements['newZone[MaxAlarmPixels]'], area );
|
||||
toPixels( form.elements['newZone[MinFilterPixels]'], area );
|
||||
toPixels( form.elements['newZone[MaxFilterPixels]'], area );
|
||||
toPixels( form.elements['newZone[MinBlobPixels]'], area );
|
||||
toPixels( form.elements['newZone[MaxBlobPixels]'], area );
|
||||
}
|
||||
else
|
||||
{
|
||||
form.elements['newZone[TempArea]'].value = 100;
|
||||
toPercent( form.elements['newZone[MinAlarmPixels]'], area );
|
||||
toPercent( form.elements['newZone[MaxAlarmPixels]'], area );
|
||||
toPercent( form.elements['newZone[MinFilterPixels]'], area );
|
||||
toPercent( form.elements['newZone[MaxFilterPixels]'], area );
|
||||
toPercent( form.elements['newZone[MinBlobPixels]'], area );
|
||||
toPercent( form.elements['newZone[MaxBlobPixels]'], area );
|
||||
}
|
||||
}
|
||||
|
||||
function limitRange( field, minValue, maxValue )
|
||||
{
|
||||
field.value = constrainValue( parseInt(field.value), parseInt(minValue), parseInt(maxValue) );
|
||||
}
|
||||
|
||||
function limitFilter( field )
|
||||
{
|
||||
field.value = (Math.floor((field.value-1)/2)*2) + 1;
|
||||
field.value = constrainValue(parseInt(field.value), 3, 15);
|
||||
}
|
||||
|
||||
function limitArea( field )
|
||||
{
|
||||
var minValue = 0;
|
||||
var maxValue = zone.Area;
|
||||
if ( document.zoneForm.elements['newZone[Units]'].value == "Percent" )
|
||||
{
|
||||
maxValue = 100;
|
||||
}
|
||||
limitRange( field, minValue, maxValue );
|
||||
}
|
||||
|
||||
function highlightOn( index )
|
||||
{
|
||||
$('row'+index).addClass( 'highlight' );
|
||||
$('point'+index).addClass( 'highlight' );
|
||||
}
|
||||
|
||||
function highlightOff( index )
|
||||
{
|
||||
$('row'+index).removeClass( 'highlight' );
|
||||
$('point'+index).removeClass( 'highlight' );
|
||||
}
|
||||
|
||||
function setActivePoint( index )
|
||||
{
|
||||
highlightOff( index );
|
||||
$('row'+index).addClass( 'active' );
|
||||
$('point'+index).addClass( 'active' );
|
||||
}
|
||||
|
||||
function unsetActivePoint( index )
|
||||
{
|
||||
$('row'+index).removeClass( 'active' );
|
||||
$('point'+index).removeClass( 'active' );
|
||||
}
|
||||
|
||||
function updateZoneImageResponse( respObj, respText )
|
||||
{
|
||||
if ( respObj.result == 'Ok' )
|
||||
{
|
||||
document.zoneForm.elements['submitBtn'].disabled = ( selfIntersecting = respObj.selfIntersecting );
|
||||
document.zoneForm.elements['newZone[Area]'].value = zone.Area = respObj.area;
|
||||
if ( document.zoneForm.elements['newZone[Units]'].value == 'Pixels' )
|
||||
document.zoneForm.elements['newZone[TempArea]'].value = document.zoneForm.elements['newZone[Area]'].value;
|
||||
|
||||
var newImage = new Asset.image( respObj.zoneImage, { 'onload': function() { $('zoneImage').src = newImage.src; } } );
|
||||
}
|
||||
}
|
||||
|
||||
function getCoordString()
|
||||
{
|
||||
var coords = new Array();
|
||||
for ( var i = 0; i < zone['Points'].length; i++ )
|
||||
coords[coords.length] = zone['Points'][i].x+','+zone['Points'][i].y;
|
||||
return( coords.join( " " ) );
|
||||
}
|
||||
|
||||
function updateZoneImage()
|
||||
{
|
||||
var parms = "view=request&request=zone&action=zoneImage&mid="+zone.MonitorId+"&zid="+zone.Id+"&coords="+getCoordString();
|
||||
var query = new Request.JSON( { url: thisUrl, method: 'post', timeout: AJAX_TIMEOUT, data: parms, onSuccess: updateZoneImageResponse } );
|
||||
query.send();
|
||||
}
|
||||
|
||||
function fixActivePoint( index )
|
||||
{
|
||||
updateActivePoint( index );
|
||||
unsetActivePoint( index );
|
||||
updateZoneImage();
|
||||
}
|
||||
|
||||
function constrainValue( value, loVal, hiVal )
|
||||
{
|
||||
if ( value < loVal ) {
|
||||
return loVal;
|
||||
}
|
||||
if ( value > hiVal ) {
|
||||
return hiVal;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function updateActivePoint( index )
|
||||
{
|
||||
var point = $('point'+index);
|
||||
var x = constrainValue( point.getStyle( 'left' ).toInt(), 0, maxX );
|
||||
var y = constrainValue( point.getStyle( 'top' ).toInt(), 0, maxY );
|
||||
|
||||
$('newZone[Points]['+index+'][x]').value = x;
|
||||
$('newZone[Points]['+index+'][y]').value = y;
|
||||
zone['Points'][index].x = x;
|
||||
zone['Points'][index].y = y;
|
||||
}
|
||||
|
||||
function addPoint( index )
|
||||
{
|
||||
var nextIndex = index+1;
|
||||
if ( index >= (zone['Points'].length-1) )
|
||||
nextIndex = 0;
|
||||
var newX = parseInt(Math.round((zone['Points'][index]['x']+zone['Points'][nextIndex]['x'])/2));
|
||||
var newY = parseInt(Math.round((zone['Points'][index]['y']+zone['Points'][nextIndex]['y'])/2));
|
||||
if ( nextIndex == 0 )
|
||||
zone['Points'][zone['Points'].length] = { 'x': newX, 'y': newY };
|
||||
else
|
||||
zone['Points'].splice( nextIndex, 0, { 'x': newX, 'y': newY } );
|
||||
drawZonePoints();
|
||||
//setActivePoint( nextIndex );
|
||||
}
|
||||
|
||||
function delPoint( index )
|
||||
{
|
||||
zone['Points'].splice( index, 1 );
|
||||
drawZonePoints();
|
||||
}
|
||||
|
||||
function limitPointValue( point, loVal, hiVal )
|
||||
{
|
||||
point.value = constrainValue(point.value, loVal, hiVal)
|
||||
}
|
||||
|
||||
function updateX( index )
|
||||
{
|
||||
limitPointValue( $('newZone[Points]['+index+'][x]'), 0, maxX );
|
||||
|
||||
var point = $('point'+index);
|
||||
var x = $('newZone[Points]['+index+'][x]').get('value');
|
||||
|
||||
point.setStyle( 'left', x+'px' );
|
||||
zone['Points'][index].x = x;
|
||||
|
||||
updateZoneImage();
|
||||
}
|
||||
|
||||
function updateY( index )
|
||||
{
|
||||
limitPointValue( $('newZone[Points]['+index+'][y]'), 0, maxY );
|
||||
|
||||
var point = $('point'+index);
|
||||
var y = $('newZone[Points]['+index+'][y]').get('value');
|
||||
|
||||
point.setStyle( 'top', y+'px' );
|
||||
zone['Points'][index].y = y;
|
||||
|
||||
updateZoneImage();
|
||||
}
|
||||
|
||||
function saveChanges( element )
|
||||
{
|
||||
var form = element.form;
|
||||
if ( validateForm( form ) )
|
||||
{
|
||||
submitForm( form );
|
||||
return( true );
|
||||
}
|
||||
return( false );
|
||||
}
|
||||
|
||||
function drawZonePoints()
|
||||
{
|
||||
$('imageFrame').getElements( 'div.zonePoint' ).each( function( element ) { element.destroy(); } );
|
||||
for ( var i = 0; i < zone['Points'].length; i++ )
|
||||
{
|
||||
var div = new Element( 'div', { 'id': 'point'+i, 'class': 'zonePoint', 'title': 'Point '+(i+1), 'styles': { 'left': zone['Points'][i].x, 'top': zone['Points'][i].y } } );
|
||||
div.addEvent( 'mouseover', highlightOn.pass( i ) );
|
||||
div.addEvent( 'mouseout', highlightOff.pass( i ) );
|
||||
div.inject( $('imageFrame') );
|
||||
div.makeDraggable( { 'container': $('imageFrame'), 'onStart': setActivePoint.pass( i ), 'onComplete': fixActivePoint.pass( i ), 'onDrag': updateActivePoint.pass( i ) } );
|
||||
}
|
||||
|
||||
var tables = $('zonePoints').getElements( 'table' );
|
||||
tables.each( function( table ) { table.getElement( 'tbody' ).empty(); } );
|
||||
for ( var i = 0; i < zone['Points'].length; i++ )
|
||||
{
|
||||
var row = new Element( 'tr', { 'id': 'row'+i } );
|
||||
row.addEvents( { 'mouseover': highlightOn.pass( i ), 'mouseout': highlightOff.pass( i ) } );
|
||||
var cell = new Element( 'td' );
|
||||
cell.set( 'text', i+1 );
|
||||
cell.inject( row );
|
||||
|
||||
cell = new Element( 'td' );
|
||||
var input = new Element( 'input', { 'id': 'newZone[Points]['+i+'][x]', 'name': 'newZone[Points]['+i+'][x]', 'value': zone['Points'][i].x, 'size': 5 } );
|
||||
input.addEvent( 'change', updateX.pass( i ) );
|
||||
input.inject( cell );
|
||||
cell.inject( row );
|
||||
|
||||
cell = new Element( 'td' );
|
||||
input = new Element( 'input', { 'id': 'newZone[Points]['+i+'][y]', 'name': 'newZone[Points]['+i+'][y]', 'value': zone['Points'][i].y, 'size': 5 } );
|
||||
input.addEvent( 'change', updateY.pass( i ) );
|
||||
input.inject( cell );
|
||||
cell.inject( row );
|
||||
|
||||
cell = new Element( 'td' );
|
||||
new Element( 'a', { 'href': '#', 'events': { 'click': addPoint.pass( i ) } } ).set( 'text', '+' ).inject( cell );
|
||||
if ( zone['Points'].length > 3 )
|
||||
new Element( 'a', { 'id': 'delete'+i, 'href': '#', 'events': { 'click': delPoint.pass( i ) } } ).set( 'text', '-' ).inject( cell );
|
||||
cell.inject( row );
|
||||
|
||||
row.inject( tables[i%tables.length].getElement( 'tbody' ) );
|
||||
}
|
||||
}
|
||||
|
||||
function initPage()
|
||||
{
|
||||
var form = document.zoneForm;
|
||||
|
||||
//form.elements['newZone[Name]'].disabled = true;
|
||||
//form.elements['newZone[Type]'].disabled = true;
|
||||
form.presetSelector.disabled = true;
|
||||
//form.elements['newZone[Units]'].disabled = true;
|
||||
form.newAlarmRgbR.disabled = true;
|
||||
form.newAlarmRgbG.disabled = true;
|
||||
form.newAlarmRgbB.disabled = true;
|
||||
form.elements['newZone[CheckMethod]'].disabled = true;
|
||||
form.elements['newZone[MinPixelThreshold]'].disabled = true;
|
||||
form.elements['newZone[MaxPixelThreshold]'].disabled = true;
|
||||
form.elements['newZone[MinAlarmPixels]'].disabled = true;
|
||||
form.elements['newZone[MaxAlarmPixels]'].disabled = true;
|
||||
form.elements['newZone[FilterX]'].disabled = true;
|
||||
form.elements['newZone[FilterY]'].disabled = true;
|
||||
form.elements['newZone[MinFilterPixels]'].disabled = true;
|
||||
form.elements['newZone[MaxFilterPixels]'].disabled = true;
|
||||
form.elements['newZone[MinBlobPixels]'].disabled = true;
|
||||
form.elements['newZone[MaxBlobPixels]'].disabled = true;
|
||||
form.elements['newZone[MinBlobs]'].disabled = true;
|
||||
form.elements['newZone[MaxBlobs]'].disabled = true;
|
||||
form.elements['newZone[OverloadFrames]'].disabled = true;
|
||||
|
||||
applyZoneType();
|
||||
|
||||
if ( form.elements['newZone[Units]'].value == 'Percent' )
|
||||
{
|
||||
applyZoneUnits();
|
||||
}
|
||||
|
||||
applyCheckMethod();
|
||||
drawZonePoints();
|
||||
}
|
||||
|
||||
window.addEvent( 'domready', initPage );
|
|
@ -1,67 +0,0 @@
|
|||
var presets = new Object();
|
||||
<?php
|
||||
foreach ( $presets as $preset )
|
||||
{
|
||||
?>
|
||||
presets[<?= $preset['Id'] ?>] = {
|
||||
'UnitsIndex': <?= $preset['UnitsIndex'] ?>,
|
||||
'CheckMethodIndex': <?= $preset['CheckMethodIndex'] ?>,
|
||||
'MinPixelThreshold': '<?= $preset['MinPixelThreshold'] ?>',
|
||||
'MaxPixelThreshold': '<?= $preset['MaxPixelThreshold'] ?>',
|
||||
'FilterX': '<?= $preset['FilterX'] ?>',
|
||||
'FilterY': '<?= $preset['FilterY'] ?>',
|
||||
'MinAlarmPixels': '<?= $preset['MinAlarmPixels'] ?>',
|
||||
'MaxAlarmPixels': '<?= $preset['MaxAlarmPixels'] ?>',
|
||||
'MinFilterPixels': '<?= $preset['MinFilterPixels'] ?>',
|
||||
'MaxFilterPixels': '<?= $preset['MaxFilterPixels'] ?>',
|
||||
'MinBlobPixels': '<?= $preset['MinBlobPixels'] ?>',
|
||||
'MaxBlobPixels': '<?= $preset['MaxBlobPixels'] ?>',
|
||||
'MinBlobs': '<?= $preset['MinBlobs'] ?>',
|
||||
'MaxBlobs': '<?= $preset['MaxBlobs'] ?>',
|
||||
'OverloadFrames': '<?= $preset['OverloadFrames'] ?>',
|
||||
'ExtendAlarmFrames': '<?= $preset['ExtendAlarmFrames'] ?>'
|
||||
};
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
var zone = {
|
||||
'Name': '<?= validJsStr($zone['Name']) ?>',
|
||||
'Id': <?= validJsStr($zone['Id']) ?>,
|
||||
'MonitorId': <?= validJsStr($zone['MonitorId']) ?>,
|
||||
'CheckMethod': '<?= $zone['CheckMethod'] ?>',
|
||||
'AlarmRGB': '<?= $zone['AlarmRGB'] ?>',
|
||||
'NumCoords': <?= $zone['NumCoords'] ?>,
|
||||
'Coords': '<?= $zone['Coords'] ?>',
|
||||
'Area': <?= $zone['Area'] ?>
|
||||
};
|
||||
|
||||
zone['Points'] = new Array();
|
||||
<?php
|
||||
for ( $i = 0; $i < count($newZone['Points']); $i++ )
|
||||
{
|
||||
?>
|
||||
zone['Points'][<?= $i ?>] = { 'x': <?= $newZone['Points'][$i]['x'] ?>, 'y': <?= $newZone['Points'][$i]['y'] ?> };
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
var maxX = <?= $monitor['Width']-1 ?>;
|
||||
var maxY = <?= $monitor['Height']-1 ?>;
|
||||
var selfIntersecting = <?= $selfIntersecting?'true':'false' ?>;
|
||||
|
||||
var selfIntersectingString = '<?= addslashes($SLANG['SelfIntersecting']) ?>';
|
||||
var alarmRGBUnsetString = '<?= addslashes($SLANG['AlarmRGBUnset']) ?>';
|
||||
var minPixelThresUnsetString = '<?= addslashes($SLANG['MinPixelThresUnset']) ?>';
|
||||
var minPixelThresLtMaxString = '<?= addslashes($SLANG['MinPixelThresLtMax']) ?>';
|
||||
var filterUnsetString = '<?= addslashes($SLANG['FilterUnset']) ?>';
|
||||
var minAlarmAreaUnsetString = '<?= addslashes($SLANG['MinAlarmAreaUnset']) ?>';
|
||||
var minAlarmAreaLtMaxString = '<?= addslashes($SLANG['MinAlarmAreaLtMax']) ?>';
|
||||
var minFilterAreaUnsetString = '<?= addslashes($SLANG['MinFilterAreaUnset']) ?>';
|
||||
var minFilterAreaLtMaxString = '<?= addslashes($SLANG['MinFilterAreaLtMax']) ?>';
|
||||
var minFilterLtMinAlarmString = '<?= addslashes($SLANG['MinFilterLtMinAlarm']) ?>';
|
||||
var minBlobAreaUnsetString = '<?= addslashes($SLANG['MinBlobAreaUnset']) ?>';
|
||||
var minBlobAreaLtMaxString = '<?= addslashes($SLANG['MinBlobAreaLtMax']) ?>';
|
||||
var minBlobLtMinFilterString = '<?= addslashes($SLANG['MinBlobLtMinFilter']) ?>';
|
||||
var minBlobsUnsetString = '<?= addslashes($SLANG['MinBlobsUnset']) ?>';
|
||||
var minBlobsLtMaxString = '<?= addslashes($SLANG['MinBlobsLtMax']) ?>';
|