Skip to content

Commit

Permalink
add nep radios and related functions
Browse files Browse the repository at this point in the history
  • Loading branch information
chiaweh2 committed Dec 20, 2024
1 parent e5cce0e commit abe0123
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
9 changes: 6 additions & 3 deletions data_access.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h3>Variable Lists</h3>
<input type="radio" class="radioDataTable" id="radioNWATable" name="dataTableOptions" checked>
<label for="radioNWATable">Northwest Atlantic</label>
<input type="radio" class="radioDataTable" id="radioNEPTable" name="dataTableOptions">
<label for="radioNEPTable">Northeast Pacific (Coming soon)</label>
<label for="radioNEPTable">Northeast Pacific</label>
<br>
<br>
<ul class="nwaTableOpt">
Expand All @@ -51,7 +51,10 @@ <h3>Variable Lists</h3>
</ul>
<ul class="nepTableOpt hidden">
<li>
Hindcast: (coming soon)
Hindcast:
<a href="data_index/cefi_data_indexing.Projects.CEFI.regional_mom6.cefi_portal.northeast_pacific.full_domain.hindcast.html" target="_blank">HTML view</a>,
<a href="data_index/cefi_data_indexing.Projects.CEFI.regional_mom6.cefi_portal.northeast_pacific.full_domain.hindcast.json" target="_blank">JSON view</a>,
<a href="data_index/cefi_data_indexing.Projects.CEFI.regional_mom6.cefi_portal.northeast_pacific.full_domain.hindcast.xml" target="_blank">XML view</a>
</li>
</ul>
</div>
Expand All @@ -74,7 +77,7 @@ <h1 class="userInputTitle"><em>Data Options</em></h1>
<input type="radio" class="radioDataQuery" id="radioNWAQuery" name="dataQueryOptions" value="northwest_atlantic" checked>
<label for="radioNWAQuery">Northwest Atlantic</label>
<input type="radio" class="radioDataQuery" id="radioNEPQuery" name="dataQueryOptions" value="northeast_pacific">
<label for="radioNEPQuery">Northeast Pacific (Coming soon)</label>
<label for="radioNEPQuery">Northeast Pacific</label>
<br>
<br>

Expand Down
13 changes: 8 additions & 5 deletions data_access.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ $(document).ready(function(){
$(document).ready(function(){
$("input[type='radio'].radioDataQuery").change(function(){
var regionSubdomain = $('input[name="dataQueryOptions"]:checked').val();
// clear experiement type when changing radio
// clear experiement type and all other options when changing radio
// (needed to avoid stacking more options)
$('#expTypeDataQuery').empty();
createDataAccessAll(regionSubdomain)
data_access_all_clear();
createDataAccessAll(regionSubdomain);
});
});

Expand All @@ -48,13 +49,15 @@ async function createDataAccessAll(regSubdom) {
if (regSubdom === 'northwest_atlantic'){
region = 'northwest_atlantic';
subdomain = 'full_domain';
} else if (regSubdom === 'northeast_pacific'){
region = 'northeast_pacific';
subdomain = 'full_domain';
};

// Call the function and wait for it to complete
// create experiement type options
await createDataAccessExpType(region,subdomain);
experiment_type = $('#expTypeDataQuery').val();

// Add your additional commands here
// create options below experiement type and above variables
await createDataAccessOthers(region,subdomain,experiment_type);
}

Expand Down

0 comments on commit abe0123

Please sign in to comment.