Handle popups that should remain popups

This commit is contained in:
digital-gnome 2017-12-05 09:39:18 -05:00
parent d741cc1a72
commit 34b708bace
4 changed files with 8 additions and 7 deletions

View File

@ -109,7 +109,7 @@ function createPopup( url, name, tag, width, height ) {
popupDimensions += ",width="+popupSize.width;
if ( popupSize.height > 0 )
popupDimensions += ",height="+popupSize.height;
var popup = window.open( url, name, popupOptions+popupDimensions );
var popup = window.open( url+"&popup=1", name, popupOptions+popupDimensions );
if ( ! popup ) {
// if popup blocking is enabled, the popup won't be defined.
console.log("Please disable popup blocking.");

View File

@ -96,7 +96,7 @@ xhtmlHeaders(__FILE__, translate('Event') );
?>
<body>
<div id="page">
<?php echo getNavBarHTML() ?>
<?php if ($_REQUEST['popup'] != 1) echo getNavBarHTML() ?>
<div id="header">
<?php
if ( ! $Event->Id() ) {
@ -110,7 +110,7 @@ if ( ! $Event->Id() ) {
<span id="dataDuration" title="<?php echo translate('Duration') ?>"><?php echo $Event->Length().'s' ?></span>
<span id="dataFrames" title="<?php echo translate('AttrFrames')."/".translate('AttrAlarmFrames') ?>"><?php echo $Event->Frames() ?>/<?php echo $Event->AlarmFrames() ?></span>
<span id="dataScore" title="<?php echo translate('AttrTotalScore')."/".translate('AttrAvgScore')."/".translate('AttrMaxScore') ?>"><?php echo $Event->TotScore() ?>/<?php echo $Event->AvgScore() ?>/<?php echo $Event->MaxScore() ?></span>
<div id="closeWindow"><a href="#" onclick="window.history.back();"><?php echo translate('Back') ?></a></div>
<div id="closeWindow"><a href="#" onclick="<?php echo $_REQUEST['popup'] != 1?'window.history.back()':'window.close()' ?>"><?php echo $_REQUEST['popup'] != 1? translate('Back'):translate('Close') ?></a></div>
</div>
<div id="menuBar1">
<div id="nameControl">

View File

@ -456,11 +456,11 @@ function getEventCmdResponse( respObj, respText ) {
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 ] ) } });
var link = new Element( 'a', { 'href': '#', 'events': { 'click': createEventPopup.pass( [ event.Id, '&trms=1&attr1=MonitorId&op1=%3d&val1='+monitorId+'&page=1&popup=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 = new Element( 'a', { 'href': '#', 'events': { 'click': createEventPopup.pass( [ event.Id, '&trms=1&attr1=MonitorId&op1=%3d&val1='+monitorId+'&page=1&popup=1', event.Width, event.Height ] ) } });
link.set( 'text', event.Name );
link.inject( row.getElement( 'td.colName' ) );

View File

@ -37,6 +37,7 @@ if ( ! visibleMonitor( $mid ) ) {
return;
}
$monitor = new Monitor( $mid );
#Whether to show the controls button
@ -61,7 +62,7 @@ xhtmlHeaders( __FILE__, $monitor->Name()." - ".translate('Feed') );
?>
<body>
<div id="page">
<?php echo getNavBarHTML() ?>
<?php if ($_REQUEST['popup'] != 1) echo getNavBarHTML() ?>
<div id="header">
<div id="monitorName"><?php echo $monitor->Name() ?></div>
<div id="menuControls">
@ -74,7 +75,7 @@ if ( canView( 'Control' ) && $monitor->Type() == 'Local' ) {
?>
<div id="scaleControl"><?php echo translate('Scale') ?>: <?php echo buildSelect( "scale", $scales, "changeScale( this );" ); ?></div>
</div>
<div id="closeControl"><a href="#" onclick="window.history.back()"><?php echo translate('Back') ?></a></div>
<div id="closeControl"><a href="#" onclick="<?php echo $_REQUEST['popup'] != 1?'window.history.back()':'window.close()' ?>"><?php echo $_REQUEST['popup'] != 1? translate('Back'):translate('Close') ?></a></div>
</div>
<div id="content">
<div id="imageFeed"><?php echo getStreamHTML( $monitor, array('scale'=>$scale) ); ?></div>