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