spacing, code style, code comments

This commit is contained in:
Isaac Connor 2021-05-22 11:34:09 -04:00
parent 2e12bc08cd
commit bc384d6fbe
1 changed files with 139 additions and 130 deletions

View File

@ -254,9 +254,7 @@ function getCmdResponse(respObj, respText) {
zmsBroke = false; zmsBroke = false;
if ( streamCmdTimer ) { if (streamCmdTimer) streamCmdTimer = clearTimeout(streamCmdTimer);
streamCmdTimer = clearTimeout(streamCmdTimer);
}
streamStatus = respObj.status; streamStatus = respObj.status;
if (!streamStatus) { if (!streamStatus) {
@ -292,7 +290,7 @@ function getCmdResponse(respObj, respText) {
} }
$j('#progressValue').html(secsToTime(parseInt(streamStatus.progress))); $j('#progressValue').html(secsToTime(parseInt(streamStatus.progress)));
$j('#zoomValue').html(streamStatus.zoom); $j('#zoomValue').html(streamStatus.zoom);
if ( streamStatus.zoom == "1.0" ) { if (streamStatus.zoom == '1.0') {
setButtonState('zoomOutBtn', 'unavail'); setButtonState('zoomOutBtn', 'unavail');
} else { } else {
setButtonState('zoomOutBtn', 'inactive'); setButtonState('zoomOutBtn', 'inactive');
@ -389,7 +387,6 @@ function streamFastFwd( action ) {
} }
} }
function streamSlowFwd(action) { function streamSlowFwd(action) {
if (vid) { if (vid) {
vid.currentTime(vid.currentTime() + spf); vid.currentTime(vid.currentTime() + spf);
@ -414,6 +411,9 @@ function stopFastRev() {
revSpeed = .5; revSpeed = .5;
} }
/* Called when rewind button is clicked
* should cycle through the reverse rates including pause
*/
function streamFastRev(action) { function streamFastRev(action) {
setButtonState('pauseBtn', 'inactive'); setButtonState('pauseBtn', 'inactive');
setButtonState('playBtn', 'inactive'); setButtonState('playBtn', 'inactive');
@ -449,6 +449,7 @@ function streamPrev(action) {
location.replace(thisUrl + '?view=event&eid=' + prevEventId + filterQuery + sortQuery); location.replace(thisUrl + '?view=event&eid=' + prevEventId + filterQuery + sortQuery);
return; return;
/* Ideally I'd like to get back to this style
if ( vid && PrevEventDefVideoPath.indexOf("view_video") > 0 ) { if ( vid && PrevEventDefVideoPath.indexOf("view_video") > 0 ) {
CurEventDefVideoPath = PrevEventDefVideoPath; CurEventDefVideoPath = PrevEventDefVideoPath;
eventQuery(prevEventId); eventQuery(prevEventId);
@ -458,11 +459,15 @@ function streamPrev(action) {
streamReq({command: CMD_PREV}); streamReq({command: CMD_PREV});
streamPlay(); streamPlay();
} }
*/
} }
} }
function streamNext(action) { function streamNext(action) {
if ( action ) { if (!action) {
return;
}
$j(".vjsMessage").remove();//This shouldn't happen $j(".vjsMessage").remove();//This shouldn't happen
if (nextEventId == 0) { //handles deleting last event. if (nextEventId == 0) { //handles deleting last event.
pauseClicked(); pauseClicked();
@ -477,17 +482,21 @@ function streamNext(action) {
// //
location.replace(thisUrl + '?view=event&eid=' + nextEventId + filterQuery + sortQuery); location.replace(thisUrl + '?view=event&eid=' + nextEventId + filterQuery + sortQuery);
return; return;
if ( vid && ( NextEventDefVideoPath.indexOf('view_video') > 0 ) ) { //on and staying with videojs if (vid && ( NextEventDefVideoPath.indexOf('view_video') > 0 )) {
// on and staying with videojs
CurEventDefVideoPath = NextEventDefVideoPath; CurEventDefVideoPath = NextEventDefVideoPath;
eventQuery(nextEventId); eventQuery(nextEventId);
} else if ( zmsBroke || (vid && NextEventDefVideoPath.indexOf("view_video") < 0) || NextEventDefVideoPath.indexOf("view_video") > 0) {//reload zms, leaving vjs, moving to vjs } else if (
zmsBroke ||
(vid && NextEventDefVideoPath.indexOf("view_video") < 0) ||
NextEventDefVideoPath.indexOf("view_video") > 0
) {//reload zms, leaving vjs, moving to vjs
location.replace(thisUrl + '?view=event&eid=' + nextEventId + filterQuery + sortQuery); location.replace(thisUrl + '?view=event&eid=' + nextEventId + filterQuery + sortQuery);
} else { } else {
streamReq({command: CMD_NEXT}); streamReq({command: CMD_NEXT});
streamPlay(); streamPlay();
} }
} } // end function streamNext(action)
}
function vjsPanZoom(action, x, y) { //Pan and zoom with centering where the click occurs function vjsPanZoom(action, x, y) { //Pan and zoom with centering where the click occurs
var outer = $j('#videoobj'); var outer = $j('#videoobj');
@ -692,7 +701,7 @@ function nextEvent() {
} }
function getActResponse(respObj, respText) { function getActResponse(respObj, respText) {
if ( checkStreamForErrors( "getActResponse", respObj ) ) { if (checkStreamForErrors('getActResponse', respObj)) {
return; return;
} }
@ -921,7 +930,7 @@ function initPage() {
}); });
} }
} }
} } // end if videojs or mjpeg stream
nearEventsQuery(eventData.Id); nearEventsQuery(eventData.Id);
initialAlarmCues(eventData.Id); //call ajax+renderAlarmCues initialAlarmCues(eventData.Id); //call ajax+renderAlarmCues
if (scale == '0' || scale == 'auto') changeScale(); if (scale == '0' || scale == 'auto') changeScale();