diff --git a/src/zmu.cpp b/src/zmu.cpp index d9e68f2f7..4ca2fd58e 100644 --- a/src/zmu.cpp +++ b/src/zmu.cpp @@ -198,7 +198,6 @@ bool ValidateAccess(User *user, int mon_id, int function) { void exit_zmu(int exit_code) { logTerm(); - printf("closing db\n"); zmDbClose(); exit(exit_code); diff --git a/web/skins/classic/views/js/timeline.js b/web/skins/classic/views/js/timeline.js index 8d3f01d4c..0b4d1d5fc 100644 --- a/web/skins/classic/views/js/timeline.js +++ b/web/skins/classic/views/js/timeline.js @@ -36,14 +36,14 @@ function createEventHtml(zm_event, frame) { return eventHtml; } -function showEventDetail( eventHtml ) { - $('instruction').addClass( 'hidden' ); +function showEventDetail(eventHtml) { + $('instruction').addClass('hidden'); $('eventData').empty(); - $('eventData').adopt( eventHtml ); - $('eventData').removeClass( 'hidden' ); + $('eventData').adopt(eventHtml); + $('eventData').removeClass('hidden'); } -function eventDataResponse( respObj, respText ) { +function eventDataResponse(respObj, respText) { var zm_event = respObj.event; if ( !zm_event ) { console.log('Null event'); @@ -179,7 +179,10 @@ function loadEventImage( imagePath, eid, fid, width, height, fps, videoName, dur eventData.addEvent('click', showEvent.pass()); } -function tlZoomBounds( minTime, maxTime ) { +function tlZoomBounds(event) { + var target = event.target; + var minTime = target.getAttribute('data-zoom-min-time'); + var maxTime = target.getAttribute('data-zoom-max-time'); location.replace('?view='+currentView+filterQuery+'&minTime='+minTime+'&maxTime='+maxTime); } @@ -194,14 +197,18 @@ function tlPanRight() { location.replace('?view='+currentView+filterQuery+'&midTime='+maxTime+'&range='+range); } -window.addEventListener("DOMContentLoaded", function() { - document.querySelectorAll("div.event").forEach(function(el) { +window.addEventListener('DOMContentLoaded', function() { + // These look like the code in skin.js, but that code doesn't select for divs. + document.querySelectorAll('div.event').forEach(function(el) { el.onclick = window[el.getAttribute('data-on-click-this')].bind(el, el); el.onmouseover = window[el.getAttribute('data-on-mouseover-this')].bind(el, el); }); - document.querySelectorAll("div.activity").forEach(function(el) { + document.querySelectorAll('div.activity').forEach(function(el) { el.onclick = window[el.getAttribute('data-on-click-this')].bind(el, el); el.onmouseover = window[el.getAttribute('data-on-mouseover-this')].bind(el, el); }); + document.querySelectorAll('div.zoom').forEach(function(el) { + el.onclick = function(ev) { window[el.getAttribute('data-on-click')](ev); }; + }); }); diff --git a/web/skins/classic/views/timeline.php b/web/skins/classic/views/timeline.php index 794b99c20..cab313f52 100644 --- a/web/skins/classic/views/timeline.php +++ b/web/skins/classic/views/timeline.php @@ -154,7 +154,7 @@ if ( isset($_REQUEST['midTime']) ) if ( isset($_REQUEST['maxTime']) ) $maxTime = validHtmlStr($_REQUEST['maxTime']); -if ( isset($range) ) { +if ( isset($range) and validInt($range) ) { $halfRange = (int)($range/2); if ( isset($midTime) ) { $midTimeT = strtotime($midTime); @@ -616,7 +616,7 @@ function drawXGrid( $chart, $scale, $labelClass, $tickClass, $gridClass, $zoomCl $zoomMinTime = strftime( STRF_FMT_DATETIME_DB, (int)($chart['data']['x']['lo'] + ($lastTick * $chart['data']['x']['density'])) ); $zoomMaxTime = strftime( STRF_FMT_DATETIME_DB, (int)($chart['data']['x']['lo'] + ($i * $chart['data']['x']['density'])) ); ?> -
+
-
+