diff --git a/pdb-ui/src/main/resources/resources/css/design.css b/pdb-ui/src/main/resources/resources/css/design.css index ecb51ae..1d54495 100644 --- a/pdb-ui/src/main/resources/resources/css/design.css +++ b/pdb-ui/src/main/resources/resources/css/design.css @@ -58,6 +58,9 @@ body{ .autocomplete .active { background-color: #AAA; } +.autocomplete.open{ + z-index:2; +} /* scrollbars are nice, but with them an empty autocomplete box is shown @@ -93,19 +96,42 @@ body{ margin-right:3px; } -#result-view { +#result { grid-area: result; background: #eee; margin: 0; padding: 0; overflow: hidden; + position:relative; } -#result-view i { - background: white; - display:inline; - font-style:normal; - line-height: 1.2em; +#result-image { + height: 100%; +} + +#prev_image, #next_image { + position: absolute; + height: 100%; + font-size: 4em; + opacity: 0.1; + display: flex; + justify-content: center; + align-items: center; +} +#prev_image:hover, #next_image:hover { + background: whitesmoke; + opacity: 0.7; +} + +#prev_image:hover i, #next_image:hover i { + opacity: 1.0; +} + +#prev_image { + left: 0; +} +#next_image{ + right: 0; } diff --git a/pdb-ui/src/main/resources/resources/js/invaders.js b/pdb-ui/src/main/resources/resources/js/invaders.js index 05ea4ce..060a426 100644 --- a/pdb-ui/src/main/resources/resources/js/invaders.js +++ b/pdb-ui/src/main/resources/resources/js/invaders.js @@ -52,6 +52,7 @@ function startInvaders() { } $('#'+invaders_parentDivId).show(); + clearIntervals(); invaders_game_move=window.setInterval("moveRandomly('"+invaders_parentDivId+"')",100); invaders_game_new=window.setInterval("addInvader()", 1000); } diff --git a/pdb-ui/src/main/resources/resources/js/search.js b/pdb-ui/src/main/resources/resources/js/search.js index b1bb97c..92f901b 100644 --- a/pdb-ui/src/main/resources/resources/js/search.js +++ b/pdb-ui/src/main/resources/resources/js/search.js @@ -1,4 +1,11 @@ +var splitBy = { + field: '', + query: '', + values: [], + index: 0 +}; + $(document).ready(function(){ $('#search-submit').click(plot); @@ -7,11 +14,14 @@ $(document).ready(function(){ updateSearchLimitValue(); $('#search-limit-by').change(updateSearchLimitValue); + disableSplitBy(); $('#nav_left').click(dateLeftShift); $('#nav_left_half').click(dateHalfLeftShift); $('#nav_right_half').click(dateHalfRightShift); $('#nav_right').click(dateRightShift); + $('#prev_image').click(prev_image); + $('#next_image').click(next_image); $('#zoom_in').click(zoomIn); $('#zoom_out').click(zoomOut); @@ -42,7 +52,7 @@ $(document).ready(function(){ } }); - initInvaders('result-view'); + initInvaders('result-image'); //startInvaders(); }); @@ -50,36 +60,36 @@ function zoomIn() { shiftDate(0.25); zoom(0.5); - plot(); + plotCurrent(); } function zoomOut() { shiftDate(-0.5); zoom(2); - plot(); + plotCurrent(); } function dateLeftShift() { shiftDate(-1); - plot(); + plotCurrent(); } function dateHalfLeftShift() { shiftDate(-0.5); - plot(); + plotCurrent(); } function dateHalfRightShift() { shiftDate(0.5); - plot(); + plotCurrent(); } function dateRightShift() { shiftDate(1); - plot(); + plotCurrent(); } function zoom(factor) @@ -207,6 +217,24 @@ function shiftByInterval(date, directionalFactor) return date; } +function prev_image() +{ + if (splitBy['values'].length > 0) + { + splitBy['index'] = (splitBy['index']+ splitBy['values'].length-1) % splitBy['values'].length; + plotCurrent(); + } +} + +function next_image() +{ + if (splitBy['values'].length > 0) + { + splitBy['index'] = (splitBy['index']+1) % splitBy['values'].length; + plotCurrent(); + } +} + function updateSearchLimitValue () { var optionSelected = $('#search-limit-by').find("option:selected"); var valueSelected = optionSelected.val(); @@ -216,7 +244,25 @@ function updateSearchLimitValue () { }else{ $('#search-limit-value').show(); } - } +} + +function enableSplitBy(fieldValues) { + splitBy['field'] = $('#split-by').val(); + splitBy['values'] = fieldValues; + splitBy['index'] = 0; + splitBy['query'] = $('#search-input').val(); + $('#prev_image').show(); + $('#next_image').show(); +} + +function disableSplitBy() { + splitBy['field'] = ''; + splitBy['values'] = []; + splitBy['index'] = 0; + splitBy['query'] = ''; + $('#prev_image').hide(); + $('#next_image').hide(); +} function renderGroupBy() { @@ -227,6 +273,7 @@ function renderGroupBy() initSearchGroupBy('#search-group-by-1', response); initSearchGroupBy('#search-group-by-2', response); initSearchGroupBy('#search-group-by-3', response); + initFieldsDropDown('#split-by', response); }; var error = function(e) { $('#result-view').text("FAILED: " + JSON.parse(e.responseText).message); @@ -250,23 +297,85 @@ function initSearchGroupBy(selector, response) ); } + +function initFieldsDropDown(selector, response) +{ + $(selector).empty(); + var option = new Option("", ""); + $(selector).append($(option)); + + response.forEach( + (item, index) => { + var option = new Option(item, item); + $(selector).append($(option)); + } + ); +} + function showLoadingIcon() { //$('#result-view').html("