eslint --fix

pull/3034/head
Matthew Noorenberghe 2020-09-04 10:02:43 -04:00
parent 46790bf401
commit 77cca7efac
9 changed files with 73 additions and 115 deletions

View File

@ -61,10 +61,10 @@ function MonitorStream(monitorData) {
};
this.pause = function() {
this.streamCmdReq.send(this.streamCmdParms+"&command="+CMD_PAUSE);
}
};
this.play = function() {
this.streamCmdReq.send(this.streamCmdParms+"&command="+CMD_PLAY);
}
};
this.eventHandler = function(event) {
console.log(event);
@ -91,8 +91,9 @@ function MonitorStream(monitorData) {
};
this.setStateClass = function(element, stateClass) {
if ( !element )
if ( !element ) {
return;
}
if ( !element.hasClass( stateClass ) ) {
if ( stateClass != 'alarm' ) {
element.removeClass('alarm');
@ -158,22 +159,24 @@ function MonitorStream(monitorData) {
}
if ( (
(typeof COMPACT_MONTAGE === 'undefined')
||
!COMPACT_MONTAGE)
&& (this.type != 'WebSite')
(typeof COMPACT_MONTAGE === 'undefined') ||
!COMPACT_MONTAGE) &&
(this.type != 'WebSite')
) {
fpsValue = $('fpsValue'+this.id);
if ( fpsValue )
if ( fpsValue ) {
fpsValue.set('text', this.status.fps);
}
stateValue = $('stateValue'+this.id);
if ( stateValue )
if ( stateValue ) {
stateValue.set('text', stateStrings[this.alarmState]);
}
monitorState = $('monitorState'+this.id);
if ( monitorState )
if ( monitorState ) {
this.setStateClass(monitorState, stateClass);
}
}
this.setStateClass($('monitor'+this.id), stateClass);

View File

@ -22,8 +22,7 @@ function setButtonStates( element ) {
var checked = 0;
for ( var i=0; i < form.elements.length; i++ ) {
if (
form.elements[i].type=="checkbox"
&&
form.elements[i].type=="checkbox" &&
form.elements[i].name=="markMids[]"
) {
var tr = $j(form.elements[i]).closest("tr");
@ -62,10 +61,8 @@ function cloneMonitor(element) {
// get the value of the first checkbox
for ( var i = 0; i < form.elements.length; i++ ) {
if (
form.elements[i].type == "checkbox"
&&
form.elements[i].name == "markMids[]"
&&
form.elements[i].type == "checkbox" &&
form.elements[i].name == "markMids[]" &&
form.elements[i].checked
) {
monitorId = form.elements[i].value;
@ -83,10 +80,8 @@ function editMonitor( element ) {
for ( var i = 0; i < form.elements.length; i++ ) {
if (
form.elements[i].type == "checkbox"
&&
form.elements[i].name == "markMids[]"
&&
form.elements[i].type == "checkbox" &&
form.elements[i].name == "markMids[]" &&
form.elements[i].checked
) {
monitorIds.push( form.elements[i].value );
@ -118,10 +113,8 @@ function selectMonitor(element) {
var url = thisUrl+'?view=console';
for ( var i = 0; i < form.elements.length; i++ ) {
if (
form.elements[i].type == 'checkbox'
&&
form.elements[i].name == 'markMids[]'
&&
form.elements[i].type == 'checkbox' &&
form.elements[i].name == 'markMids[]' &&
form.elements[i].checked
) {
url += '&MonitorId[]='+form.elements[i].value;
@ -135,7 +128,6 @@ function reloadWindow() {
}
function initPage() {
reloadWindow.periodical(consoleRefreshTimeout);
if ( showVersionPopup ) {
window.location.assign('?view=version');
@ -177,7 +169,7 @@ function initPage() {
function_form.elements['newFunction'].value = monitor.Function;
function_form.elements['newEnabled'].checked = monitor.Enabled;
function_form.elements['mid'].value = mid;
document.getElementById('function_monitor_name').innerHTML = monitor.Name;;
document.getElementById('function_monitor_name').innerHTML = monitor.Name;
$j('#modalFunction').modal('show');
});

View File

@ -4,12 +4,9 @@ function validateForm( form ) {
// If "Can Move" is enabled, then the end user must also select at least one of the other check boxes (excluding Can Move Diagonally)
if ( form.elements['newControl[CanMove]'].checked ) {
if ( !(
form.elements['newControl[CanMoveCon]'].checked
||
form.elements['newControl[CanMoveRel]'].checked
||
form.elements['newControl[CanMoveAbs]'].checked
||
form.elements['newControl[CanMoveCon]'].checked ||
form.elements['newControl[CanMoveRel]'].checked ||
form.elements['newControl[CanMoveAbs]'].checked ||
form.elements['newControl[CanMoveMap]'].checked
) ) {
errors[errors.length] = 'In addition to "Can Move", you also must select at least one of: "Can Move Mapped", "Can Move Absolute", "Can Move Relative", or "Can Move Continuous"';
@ -17,14 +14,10 @@ function validateForm( form ) {
} else {
// Now lets check for the opposite condition. If any of the boxes below Can Move are checked, but Can Move is not checked then signal an error
if ( form.elements['newControl[CanMoveCon]'].checked
||
form.elements['newControl[CanMoveRel]'].checked
||
form.elements['newControl[CanMoveAbs]'].checked
||
form.elements['newControl[CanMoveMap]'].checked
||
if ( form.elements['newControl[CanMoveCon]'].checked ||
form.elements['newControl[CanMoveRel]'].checked ||
form.elements['newControl[CanMoveAbs]'].checked ||
form.elements['newControl[CanMoveMap]'].checked ||
form.elements['newControl[CanMoveDiag]'].checked
) {
errors[errors.length] = '"Can Move" must also be selected if any one of the movement types are selected.';
@ -33,10 +26,8 @@ function validateForm( form ) {
// If "Can Zoom" is enabled, then the end user must also select at least one of the other check boxes
if ( form.elements['newControl[CanZoom]'].checked ) {
if ( !(
form.elements['newControl[CanZoomCon]'].checked
||
form.elements['newControl[CanZoomRel]'].checked
||
form.elements['newControl[CanZoomCon]'].checked ||
form.elements['newControl[CanZoomRel]'].checked ||
form.elements['newControl[CanZoomAbs]'].checked
) ) {
errors[errors.length] = 'In addition to "Can Zoom", you also must select at least one of: "Can Zoom Absolute", "Can Zoom Relative", or "Can Zoom Continuous"';
@ -44,10 +35,8 @@ function validateForm( form ) {
} else {
// Now lets check for the opposite condition. If any of the boxes below Can Zoom are checked, but Can Zoom is not checked then signal an error
if ( form.elements['newControl[CanZoomCon]'].checked
||
form.elements['newControl[CanZoomRel]'].checked
||
if ( form.elements['newControl[CanZoomCon]'].checked ||
form.elements['newControl[CanZoomRel]'].checked ||
form.elements['newControl[CanZoomAbs]'].checked
) {
errors[errors.length] = '"Can Move" must also be selected if any one of the zoom types are selected.';
@ -56,10 +45,8 @@ function validateForm( form ) {
// If "Can Zoom" is enabled, then the end user must also select at least one of the other check boxes
if ( form.elements['newControl[CanFocus]'].checked ) {
if ( !(
form.elements['newControl[CanFocusCon]'].checked
||
form.elements['newControl[CanFocusRel]'].checked
||
form.elements['newControl[CanFocusCon]'].checked ||
form.elements['newControl[CanFocusRel]'].checked ||
form.elements['newControl[CanFocusAbs]'].checked
) ) {
errors[errors.length] = 'In addition to "Can Focus", you also must select at least one of: "Can Focus Absolute", "Can Focus Relative", or "Can Focus Continuous"';
@ -67,10 +54,8 @@ function validateForm( form ) {
} else {
// Now lets check for the opposite condition. If any of the boxes below Can Zoom are checked, but Can Zoom is not checked then signal an error
if ( form.elements['newControl[CanFocusCon]'].checked
||
form.elements['newControl[CanFocusRel]'].checked
||
if ( form.elements['newControl[CanFocusCon]'].checked ||
form.elements['newControl[CanFocusRel]'].checked ||
form.elements['newControl[CanFocusAbs]'].checked
) {
errors[errors.length] = '"Can Focus" must also be selected if any one of the focus types are selected.';
@ -79,10 +64,8 @@ function validateForm( form ) {
// If "Can White" is enabled, then the end user must also select at least one of the other check boxes
if ( form.elements['newControl[CanWhite]'].checked ) {
if ( !(
form.elements['newControl[CanWhiteCon]'].checked
||
form.elements['newControl[CanWhiteRel]'].checked
||
form.elements['newControl[CanWhiteCon]'].checked ||
form.elements['newControl[CanWhiteRel]'].checked ||
form.elements['newControl[CanWhiteAbs]'].checked
) ) {
errors[errors.length] = 'In addition to "Can White Balance", you also must select at least one of: "Can White Bal Absolute", "Can White Bal Relative", or "Can White Bal Continuous"';
@ -90,10 +73,8 @@ function validateForm( form ) {
} else {
// Now lets check for the opposite condition. If any of the boxes below Can Zoom are checked, but Can Zoom is not checked then signal an error
if ( form.elements['newControl[CanWhiteCon]'].checked
||
form.elements['newControl[CanWhiteRel]'].checked
||
if ( form.elements['newControl[CanWhiteCon]'].checked ||
form.elements['newControl[CanWhiteRel]'].checked ||
form.elements['newControl[CanWhiteAbs]'].checked
) {
errors[errors.length] = '"Can White Balance" must also be selected if any one of the white balance types are selected.';
@ -103,10 +84,8 @@ function validateForm( form ) {
// If "Can Iris" is enabled, then the end user must also select at least one of the other check boxes
if ( form.elements['newControl[CanIris]'].checked ) {
if ( !(
form.elements['newControl[CanIrisCon]'].checked
||
form.elements['newControl[CanIrisRel]'].checked
||
form.elements['newControl[CanIrisCon]'].checked ||
form.elements['newControl[CanIrisRel]'].checked ||
form.elements['newControl[CanIrisAbs]'].checked
) ) {
errors[errors.length] = 'In addition to "Can Iris", you also must select at least one of: "Can Iris Absolute", "Can Iris Relative", or "Can Iris Continuous"';
@ -114,10 +93,8 @@ function validateForm( form ) {
} else {
// Now lets check for the opposite condition. If any of the boxes below Can Zoom are checked, but Can Zoom is not checked then signal an error
if ( form.elements['newControl[CanIrisCon]'].checked
||
form.elements['newControl[CanIrisRel]'].checked
||
if ( form.elements['newControl[CanIrisCon]'].checked ||
form.elements['newControl[CanIrisRel]'].checked ||
form.elements['newControl[CanIrisAbs]'].checked
) {
errors[errors.length] = '"Can Iris" must also be selected if any one of the iris types are selected.';

View File

@ -29,11 +29,11 @@ function exportProgress() {
function exportResponse(respObj, respText) {
console.log(respObj);
window.location.replace(
thisUrl+'?view='+currentView+'&'+eidParm
+'&exportFormat='+respObj.exportFormat
+'&exportFile='+respObj.exportFile
+'&generated='+((respObj.result=='Ok')?1:0)
+'&connkey='+connkey
thisUrl+'?view='+currentView+'&'+eidParm+
'&exportFormat='+respObj.exportFormat+
'&exportFile='+respObj.exportFile+
'&generated='+((respObj.result=='Ok')?1:0)+
'&connkey='+connkey
);
}

View File

@ -18,10 +18,8 @@ function configureExportButton(element) {
form.elements['exportImages'].checked ||
form.elements['exportVideo'].checked ||
form.elements['exportMisc'].checked
)
&&
( form.elements['exportFormat'][0].checked || form.elements['exportFormat'][1].checked )
&&
) &&
( form.elements['exportFormat'][0].checked || form.elements['exportFormat'][1].checked ) &&
( form.elements['exportCompress'][0].checked || form.elements['exportCompress'][1].checked )
);
}

View File

@ -48,22 +48,14 @@ function validateForm(form) {
}
} else if ( form.elements['filter[Background]'].checked ) {
if ( ! (
form.elements['filter[AutoArchive]'].checked
||
form.elements['filter[UpdateDiskSpace]'].checked
||
form.elements['filter[AutoVideo]'].checked
||
form.elements['filter[AutoEmail]'].checked
||
form.elements['filter[AutoMessage]'].checked
||
form.elements['filter[AutoExecute]'].checked
||
form.elements['filter[AutoDelete]'].checked
||
form.elements['filter[AutoCopy]'].checked
||
form.elements['filter[AutoArchive]'].checked ||
form.elements['filter[UpdateDiskSpace]'].checked ||
form.elements['filter[AutoVideo]'].checked ||
form.elements['filter[AutoEmail]'].checked ||
form.elements['filter[AutoMessage]'].checked ||
form.elements['filter[AutoExecute]'].checked ||
form.elements['filter[AutoDelete]'].checked ||
form.elements['filter[AutoCopy]'].checked ||
form.elements['filter[AutoMove]'].checked
) ) {
alert('You have chosen to run this filter in the background but not selected any actions.');

View File

@ -48,8 +48,7 @@ function evaluateLoadTimes() {
function getFrame(monId, time, last_Frame) {
if ( last_Frame ) {
if (
(last_Frame.TimeStampSecs <= time)
&&
(last_Frame.TimeStampSecs <= time) &&
(last_Frame.EndTimeStampSecs >= time)
) {
return last_Frame;
@ -104,12 +103,11 @@ function getFrame(monId, time, last_Frame) {
continue;
}
if (
e.FramesById[frame_id].TimeStampSecs == time
|| (
e.FramesById[frame_id].TimeStampSecs < time
&& (
(!e.FramesById[frame_id].NextTimeStampSecs) // only if event.EndTime is null
||
e.FramesById[frame_id].TimeStampSecs == time ||
(
e.FramesById[frame_id].TimeStampSecs < time &&
(
(!e.FramesById[frame_id].NextTimeStampSecs) || // only if event.EndTime is null
(e.FramesById[frame_id].NextTimeStampSecs > time)
)
)

View File

@ -290,8 +290,6 @@ function getCoordString() {
function updateZoneImage() {
var imageFrame = $('imageFrame');
var style = imageFrame.currentStyle || window.getComputedStyle(imageFrame);
var padding_left = style.paddingLeft.toInt();
var padding_top = style.paddingTop.toInt();
scale = (imageFrame.clientWidth - ( style.paddingLeft.toInt() + style.paddingRight.toInt() )) / maxX;
var SVG = $('zoneSVG');