Update monitor edit to not use inline js
This commit is contained in:
parent
c7e09e03d3
commit
ee4b452e42
|
@ -46,6 +46,24 @@ function initPage() {
|
||||||
//var protocolSelector = $('contentForm').elements['newMonitor[Protocol]'];
|
//var protocolSelector = $('contentForm').elements['newMonitor[Protocol]'];
|
||||||
//if ( $(protocolSelector).getTag() == 'select' )
|
//if ( $(protocolSelector).getTag() == 'select' )
|
||||||
//updateMethods( $(protocolSelector) );
|
//updateMethods( $(protocolSelector) );
|
||||||
|
document.querySelectorAll('input[name="newMonitor[SignalCheckColour]"]').forEach(function(el) {
|
||||||
|
el.oninput = function(event) {
|
||||||
|
$j('#SignalCheckSwatch').css('background-color', event.target.value);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
document.querySelectorAll('input[name="newMonitor[WebColour]"]').forEach(function(el) {
|
||||||
|
el.oninput = function(event) {
|
||||||
|
$j('#WebSwatch').css('background-color', event.target.value);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
$j('#contentForm').submit(function(event){
|
||||||
|
if ( validateForm(this) ) {
|
||||||
|
$j('#contentButtons').hide();
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener( 'DOMContentLoaded', initPage );
|
window.addEventListener( 'DOMContentLoaded', initPage );
|
||||||
|
|
|
@ -523,7 +523,7 @@ foreach ( $tabs as $name=>$value ) {
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<form name="contentForm" id="contentForm" method="post" action="?" onsubmit="if(validateForm(this)){$j('#contentButtons').hide();return true;}else{return false;};">
|
<form name="contentForm" id="contentForm" method="post" action="?">
|
||||||
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
||||||
<input type="hidden" name="tab" value="<?php echo $tab ?>"/>
|
<input type="hidden" name="tab" value="<?php echo $tab ?>"/>
|
||||||
<input type="hidden" name="action" value="monitor"/>
|
<input type="hidden" name="action" value="monitor"/>
|
||||||
|
@ -1006,15 +1006,56 @@ if ( $monitor->Type() == 'Local' ) {
|
||||||
case 'misc' :
|
case 'misc' :
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<tr><td><?php echo translate('EventPrefix') ?></td><td><input type="text" name="newMonitor[EventPrefix]" value="<?php echo validHtmlStr($monitor->EventPrefix()) ?>" size="24"/></td></tr>
|
<tr>
|
||||||
<tr><td><?php echo translate('Sectionlength') ?></td><td><input type="text" name="newMonitor[SectionLength]" value="<?php echo validHtmlStr($monitor->SectionLength()) ?>" size="6"/></td></tr>
|
<td><?php echo translate('EventPrefix') ?></td>
|
||||||
<tr><td><?php echo translate('FrameSkip') ?></td><td><input type="text" name="newMonitor[FrameSkip]" value="<?php echo validHtmlStr($monitor->FrameSkip()) ?>" size="6"/></td></tr>
|
<td><input type="text" name="newMonitor[EventPrefix]" value="<?php echo validHtmlStr($monitor->EventPrefix()) ?>"/></td>
|
||||||
<tr><td><?php echo translate('MotionFrameSkip') ?></td><td><input type="text" name="newMonitor[MotionFrameSkip]" value="<?php echo validHtmlStr($monitor->MotionFrameSkip()) ?>" size="6"/></td></tr>
|
</tr>
|
||||||
<tr><td><?php echo translate('AnalysisUpdateDelay') ?></td><td><input type="text" name="newMonitor[AnalysisUpdateDelay]" value="<?php echo validHtmlStr($monitor->AnalysisUpdateDelay()) ?>" size="6"/></td></tr>
|
<tr>
|
||||||
<tr><td><?php echo translate('FPSReportInterval') ?></td><td><input type="text" name="newMonitor[FPSReportInterval]" value="<?php echo validHtmlStr($monitor->FPSReportInterval()) ?>" size="6"/></td></tr>
|
<td><?php echo translate('Sectionlength') ?></td>
|
||||||
<tr><td><?php echo translate('DefaultRate') ?></td><td><?php echo htmlSelect( "newMonitor[DefaultRate]", $rates, $monitor->DefaultRate() ); ?></td></tr>
|
<td>
|
||||||
<tr><td><?php echo translate('DefaultScale') ?></td><td><?php echo htmlSelect( "newMonitor[DefaultScale]", $scales, $monitor->DefaultScale() ); ?></td></tr>
|
<input type="number" name="newMonitor[SectionLength]" value="<?php echo validHtmlStr($monitor->SectionLength()) ?>"/>
|
||||||
<tr><td><?php echo translate('DefaultCodec') ?></td><td><?php echo htmlSelect( "newMonitor[DefaultCodec]", $codecs, $monitor->DefaultCodec() ); ?></td></tr>
|
<?php echo translate('seconds')?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo translate('FrameSkip') ?></td>
|
||||||
|
<td>
|
||||||
|
<input type="number" name="newMonitor[FrameSkip]" value="<?php echo validHtmlStr($monitor->FrameSkip()) ?>"/>
|
||||||
|
<?php echo translate('frames')?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo translate('MotionFrameSkip') ?></td>
|
||||||
|
<td>
|
||||||
|
<input type="number" name="newMonitor[MotionFrameSkip]" value="<?php echo validHtmlStr($monitor->MotionFrameSkip()) ?>"/>
|
||||||
|
<?php echo translate('frames')?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo translate('AnalysisUpdateDelay') ?></td>
|
||||||
|
<td>
|
||||||
|
<input type="number" name="newMonitor[AnalysisUpdateDelay]" value="<?php echo validHtmlStr($monitor->AnalysisUpdateDelay()) ?>"/>
|
||||||
|
<?php echo translate('seconds')?>
|
||||||
|
</td></tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo translate('FPSReportInterval') ?></td>
|
||||||
|
<td>
|
||||||
|
<input type="number" name="newMonitor[FPSReportInterval]" value="<?php echo validHtmlStr($monitor->FPSReportInterval()) ?>"/>
|
||||||
|
<?php echo translate('frames')?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo translate('DefaultRate') ?></td>
|
||||||
|
<td><?php echo htmlSelect('newMonitor[DefaultRate]', $rates, $monitor->DefaultRate()); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo translate('DefaultScale') ?></td>
|
||||||
|
<td><?php echo htmlSelect('newMonitor[DefaultScale]', $scales, $monitor->DefaultScale()); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo translate('DefaultCodec') ?></td>
|
||||||
|
<td><?php echo htmlSelect('newMonitor[DefaultCodec]', $codecs, $monitor->DefaultCodec()); ?></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo translate('SignalCheckPoints') ?></td>
|
<td><?php echo translate('SignalCheckPoints') ?></td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -1024,14 +1065,14 @@ if ( $monitor->Type() == 'Local' ) {
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo translate('SignalCheckColour') ?></td>
|
<td><?php echo translate('SignalCheckColour') ?></td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="newMonitor[SignalCheckColour]" value="<?php echo validHtmlStr($monitor->SignalCheckColour()) ?>" size="10" onchange="$('SignalCheckSwatch').setStyle('backgroundColor', this.value)"/>
|
<input type="text" name="newMonitor[SignalCheckColour]" value="<?php echo validHtmlStr($monitor->SignalCheckColour()) ?>"/>
|
||||||
<span id="SignalCheckSwatch" class="swatch" style="background-color: <?php echo validHtmlStr($monitor->SignalCheckColour()); ?>;"> </span>
|
<span id="SignalCheckSwatch" class="swatch" style="background-color: <?php echo validHtmlStr($monitor->SignalCheckColour()); ?>;"> </span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo translate('WebColour') ?></td>
|
<td><?php echo translate('WebColour') ?></td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="newMonitor[WebColour]" value="<?php echo validHtmlStr($monitor->WebColour()) ?>" size="10" onchange="$('WebSwatch').setStyle( 'backgroundColor', this.value )"/>
|
<input type="text" name="newMonitor[WebColour]" value="<?php echo validHtmlStr($monitor->WebColour()) ?>" onchange="$('WebSwatch').setStyle( 'backgroundColor', this.value )"/>
|
||||||
<span id="WebSwatch" class="swatch" style="background-color: <?php echo validHtmlStr($monitor->WebColour()) ?>;"> </span>
|
<span id="WebSwatch" class="swatch" style="background-color: <?php echo validHtmlStr($monitor->WebColour()) ?>;"> </span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue