Merge pull request #3240 from connortechnology/fix_3237

fix warnings not being displayed
This commit is contained in:
Isaac Connor 2021-05-18 10:53:16 -04:00 committed by GitHub
commit 50c0dddb10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -45,6 +45,7 @@ rtspStreamNames[\''.validJsStr($row['RTSPStreamName']).'\'] = true;
function validateForm( form ) { function validateForm( form ) {
var errors = new Array(); var errors = new Array();
var warnings = new Array();
if ( form.elements['newMonitor[Name]'].value.search( /[^\w\-\.\(\)\:\/ ]/ ) >= 0 ) if ( form.elements['newMonitor[Name]'].value.search( /[^\w\-\.\(\)\:\/ ]/ ) >= 0 )
errors[errors.length] = "<?php echo translate('BadNameChars') ?>"; errors[errors.length] = "<?php echo translate('BadNameChars') ?>";
@ -74,7 +75,7 @@ function validateForm( form ) {
} else if ( form.elements['newMonitor[Type]'].value == 'Ffmpeg' ) { } else if ( form.elements['newMonitor[Type]'].value == 'Ffmpeg' ) {
if ( !form.elements['newMonitor[Path]'].value ) { if ( !form.elements['newMonitor[Path]'].value ) {
errors[errors.length] = "<?php echo translate('BadPath') ?>"; errors[errors.length] = "<?php echo translate('BadPath') ?>";
} else if ( form.elements['newMonitor[Path]'].value.match( /[\!\*'\(\)\$ ,#\[\]]/) ) { } else if (form.elements['newMonitor[Path]'].value.match(/[\!\*'\(\)\$ ,#\[\]]/)) {
warnings[warnings.length] = "<?php echo translate('BadPathNotEncoded') ?>"; warnings[warnings.length] = "<?php echo translate('BadPathNotEncoded') ?>";
} }
@ -162,7 +163,6 @@ function validateForm( form ) {
return false; return false;
} }
var warnings = new Array();
if ( (form.elements['newMonitor[Function]'].value != 'Monitor') && (form.elements['newMonitor[Function]'].value != 'None') ) { if ( (form.elements['newMonitor[Function]'].value != 'Monitor') && (form.elements['newMonitor[Function]'].value != 'None') ) {
if ( (form.elements['newMonitor[SaveJPEGs]'].value == '0') && (form.elements['newMonitor[VideoWriter]'].value == '0') ) { if ( (form.elements['newMonitor[SaveJPEGs]'].value == '0') && (form.elements['newMonitor[VideoWriter]'].value == '0') ) {
warnings[warnings.length] = "<?php echo translate('BadNoSaveJPEGsOrVideoWriter'); ?>"; warnings[warnings.length] = "<?php echo translate('BadNoSaveJPEGsOrVideoWriter'); ?>";