Skip to content
Snippets Groups Projects
Verified Commit 365d62d7 authored by David Hoese's avatar David Hoese
Browse files

Clean up quicklook order information and code

Closes !2
parent 30c490d6
No related branches found
No related tags found
1 merge request!1Add information on selecting quicklook data for download
/* this function is called when the user clicks the "Order AOSS Tower Data" button */ /* this function is called when the user clicks the "Download AOSS Tower Data" button */
function order(site,inst) { function order(site, inst) {
var formatMenu = document.getElementById(inst+'format'); //grab the format menu var formatMenu = document.getElementById(inst+'format'); //grab the format menu
var formatString = formatMenu.options[formatMenu.selectedIndex].text; //grab the currently selected format var formatString = formatMenu.options[formatMenu.selectedIndex].text; //grab the currently selected format
formatString = formatString.toLowerCase(); //make it lowercase formatString = formatString.toLowerCase(); //make it lowercase
......
...@@ -33,21 +33,6 @@ var update_quicklooks_no_forms = function(){ ...@@ -33,21 +33,6 @@ var update_quicklooks_no_forms = function(){
}; };
var select_all_click_func = function(){
var table=$(this).closest('.row').find('table');
if($(this).html() == "Select All"){
table.children('tbody').children('tr.ql_date_row').children('td').each(function(){
highlight_col($(this));
});
$(this).html('Deselect All');
} else {
table.children('tbody').children('tr.ql_date_row').children('td').each(function(){
unhighlight_col($(this));
});
$(this).html('Select All');
}
};
var table_scroll_func = _.throttle(function(){ var table_scroll_func = _.throttle(function(){
$('.table-holder').not($(this)).scrollLeft($(this).scrollLeft()); $('.table-holder').not($(this)).scrollLeft($(this).scrollLeft());
},30); },30);
......
//calls func on each item in the td's column //calls func on each item in the td's column
function for_each_in_col(td, col, func) { function for_each_in_col(td, col, func) {
var table = td.closest('table'); var table = td.closest('table');
if(!col) var col = col; // avoid reassigning argument
var col = td.index(); if (!col)
col = td.index();
table.children('tbody').children('tr').children('td').each(function(){ table.children('tbody').children('tr').children('td').each(function(){
if($(this).index() == col)$(this)[func]('selected'); if ($(this).index() == col)
$(this)[func]('selected');
}); });
} }
var toggle_col = (td, col) => for_each_in_col(td,col,'toggleClass');
var highlight_col = (td, col) => for_each_in_col(td,col,'addClass'); var toggle_col = (td, col) => for_each_in_col(td, col,'toggleClass');
var unhighlight_col = (td, col) => for_each_in_col(td,col,'removeClass'); var highlight_col = (td, col) => for_each_in_col(td, col,'addClass');
var unhighlight_col = (td, col) => for_each_in_col(td, col,'removeClass');
/**
* Select all date columns for the current quicklook view
*/
function select_all_click_func() {
var table = $(this).closest('.row').find('table');
if($(this).html() == "Select All"){
table.children('tbody').children('tr.ql_date_row').children('td').each(function(){
highlight_col($(this));
});
$(this).html('Deselect All');
} else {
table.children('tbody').children('tr.ql_date_row').children('td').each(function(){
unhighlight_col($(this));
});
$(this).html('Select All');
}
}
function displayOverlay(url) { function displayOverlay(url) {
$("<table id='overlay'><tbody><tr><td><img src='" + url+ "'></td></tr></tbody></table>").css({ $("<table id='overlay'><tbody><tr><td><img src='" + url+ "'></td></tr></tbody></table>").css({
......
...@@ -59,7 +59,8 @@ ...@@ -59,7 +59,8 @@
<div class="col-xs-12"> <div class="col-xs-12">
<h3>AOSS Rooftop, UW-Madison</h3> <h3>AOSS Rooftop, UW-Madison</h3>
<h4>AOSS Tower</h4> <h4>AOSS Tower</h4>
<button type="submit" form="towerform" value="Submit" onclick="order('aoss','tower')">Order AOSS Tower Data</button> <p>Click thumbnails to enlarge. Click date to select for data download.</p>
<button type="submit" form="towerform" value="Submit" onclick="order('aoss','tower')">Download AOSS Tower Data</button>
<button type="submit" class="select-all">Select All</button> <button type="submit" class="select-all">Select All</button>
Format: <select id="towerformat"> Format: <select id="towerformat">
<option selected> CSV </option> <option selected> CSV </option>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<li class="dropdown"> <li class="dropdown">
<a href="" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Data Access<span class="caret"></span></a> <a href="" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Data Access<span class="caret"></span></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="/file_download">File Download</a></li> <li><a href="/file_download">File Download (Beta)</a></li>
<li><a href="/data_download">Data Download</a></li> <li><a href="/data_download">Data Download</a></li>
<li><a href="http://metobs-test.ssec.wisc.edu/api/">Data API</a></li> <li><a href="http://metobs-test.ssec.wisc.edu/api/">Data API</a></li>
</ul> </ul>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment