Merge branch 'fix_zone_edit' into storageareas

This commit is contained in:
Isaac Connor 2016-06-13 09:43:03 -04:00
commit abad7cbf9f
2 changed files with 6 additions and 5 deletions

View File

@ -356,6 +356,7 @@ function updateActivePoint( index )
var Point = $('zonePoly').points.getItem(index); var Point = $('zonePoly').points.getItem(index);
Point.x =x; Point.x =x;
Point.y =y; Point.y =y;
updateArea();
} }
function addPoint( index ) function addPoint( index )
@ -468,13 +469,13 @@ function drawZonePoints()
cell = new Element( 'td' ); 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 } ); 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.addEvent( 'input', updateX.pass( i ) );
input.inject( cell ); input.inject( cell );
cell.inject( row ); cell.inject( row );
cell = new Element( 'td' ); 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 = 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.addEvent( 'input', updateY.pass( i ) );
input.inject( cell ); input.inject( cell );
cell.inject( row ); cell.inject( row );

View File

@ -131,7 +131,7 @@ xhtmlHeaders(__FILE__, translate('Zone') );
<h2><?php echo translate('Monitor') ?> <?php echo $monitor->Name() ?> - <?php echo translate('Zone') ?> <?php echo $newZone['Name'] ?></h2> <h2><?php echo translate('Monitor') ?> <?php echo $monitor->Name() ?> - <?php echo translate('Zone') ?> <?php echo $newZone['Name'] ?></h2>
</div> </div>
<div id="content"> <div id="content">
<form name="zoneForm" id="zoneForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>"> <form name="zoneForm" id="zoneForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" onkeypress="return event.keyCode != 13;">
<input type="hidden" name="view" value="<?php echo $view ?>"/> <input type="hidden" name="view" value="<?php echo $view ?>"/>
<input type="hidden" name="action" value="zone"/> <input type="hidden" name="action" value="zone"/>
<input type="hidden" name="mid" value="<?php echo $mid ?>"/> <input type="hidden" name="mid" value="<?php echo $mid ?>"/>
@ -249,8 +249,8 @@ for ( $i = 0; $i < $pointCols; $i++ )
?> ?>
<tr id="row<?php echo $j ?>" onmouseover="highlightOn( <?php echo $j ?> )" onmouseout="highlightOff( <?php echo $j ?> )" onclick="setActivePoint( <?php echo $j ?> )"> <tr id="row<?php echo $j ?>" onmouseover="highlightOn( <?php echo $j ?> )" onmouseout="highlightOff( <?php echo $j ?> )" onclick="setActivePoint( <?php echo $j ?> )">
<td><?php echo $j+1 ?></td> <td><?php echo $j+1 ?></td>
<td><input name="newZone[Points][<?php echo $j ?>][x]" id="newZone[Points][<?php echo $j ?>][x]" size="5" value="<?php echo $newZone['Points'][$j]['x'] ?>" onchange="updateX( this, <?php echo $j ?> )"<?php if ( canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/></td> <td><input name="newZone[Points][<?php echo $j ?>][x]" id="newZone[Points][<?php echo $j ?>][x]" size="5" value="<?php echo $newZone['Points'][$j]['x'] ?>" oninput="updateX( this, <?php echo $j ?> );"<?php if ( canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/></td>
<td><input name="newZone[Points][<?php echo $j ?>][y]" id="newZone[Points][<?php echo $j ?>][y]" size="5" value="<?php echo $newZone['Points'][$j]['y'] ?>" onchange="updateY( this, <?php echo $j ?> )"<?php if ( canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/></td> <td><input name="newZone[Points][<?php echo $j ?>][y]" id="newZone[Points][<?php echo $j ?>][y]" size="5" value="<?php echo $newZone['Points'][$j]['y'] ?>" oninput="updateY( this, <?php echo $j ?> );"<?php if ( canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/></td>
<td><a href="#" onclick="addPoint( this, <?php echo $j ?> ); return( false );">+</a><?php if ( count($newZone['Points']) > 3 ) { ?>&nbsp;<a id="delete<?php echo $j ?>" href="#" onclick="delPoint( this, <?php echo $j ?> ); return(false);">&ndash;</a><?php } ?>&nbsp;<a id="cancel<?php echo $j ?>" href="#" onclick="unsetActivePoint( <?php echo $j ?> ); return( false );">X</a></td> <td><a href="#" onclick="addPoint( this, <?php echo $j ?> ); return( false );">+</a><?php if ( count($newZone['Points']) > 3 ) { ?>&nbsp;<a id="delete<?php echo $j ?>" href="#" onclick="delPoint( this, <?php echo $j ?> ); return(false);">&ndash;</a><?php } ?>&nbsp;<a id="cancel<?php echo $j ?>" href="#" onclick="unsetActivePoint( <?php echo $j ?> ); return( false );">X</a></td>
</tr> </tr>
<?php <?php