Skip to content

Commit 54f1100

Browse files
committed
2 parents be635d2 + 59ad007 commit 54f1100

File tree

7 files changed

+942
-468
lines changed

7 files changed

+942
-468
lines changed

index.htm

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@
272272
</a>
273273
</p>
274274
<p>
275-
Auto-generated scripts are available from an <a href="/api">API</a>.
275+
Auto-generated scripts are available from an <a href="api/">API</a>.
276276
</p>
277277
<br>
278278
</details>

js/index.js

+21-20
Original file line numberDiff line numberDiff line change
@@ -416,26 +416,6 @@ function parameters (cb) {
416416
url = util.hapi2to3(url)
417417
}
418418

419-
const getOptions = {
420-
url,
421-
dataType: 'json',
422-
timeout: window.HAPIUI.options.metadataTimeout,
423-
requestURLElement: '#parametersRequestURL',
424-
timer: {
425-
element: '#parametersRequestTiming'
426-
}
427-
}
428-
429-
$('#parametersRequestError').empty().hide()
430-
get(getOptions, function (err, res) {
431-
if (err) {
432-
$('#parametersRequestError').html(err).show()
433-
return
434-
}
435-
$('#datasetinfo').show()
436-
process(res, url)
437-
})
438-
439419
parameters.id = 'parameters'
440420
parameters.label = 'Parameters'
441421
parameters.allowEmptyValue = true
@@ -495,6 +475,27 @@ function parameters (cb) {
495475
}
496476
}
497477

478+
const getOptions = {
479+
url,
480+
dataType: 'json',
481+
timeout: window.HAPIUI.options.metadataTimeout,
482+
requestURLElement: '#parametersRequestURL',
483+
timer: {
484+
element: '#parametersRequestTiming'
485+
}
486+
}
487+
488+
// N.B. Call to get() must go last because cb() function requires above to be set.
489+
$('#parametersRequestError').empty().hide()
490+
get(getOptions, function (err, res) {
491+
if (err) {
492+
$('#parametersRequestError').html(err).show()
493+
return
494+
}
495+
$('#datasetinfo').show()
496+
process(res, url)
497+
})
498+
498499
function process (res, url) {
499500
$('#datasetinfo ul').append(`<li>id: <code>${selected('dataset')}</code></li>`)
500501

js/shared/defaultDate.js

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ function stop (meta, end) {
2222

2323
const cadenceString = meta.cadence || 'PT1M'
2424
const cadenceMillis = dayjs.duration(cadenceString).$ms
25-
//console.log(cadenceString)
26-
//console.log(cadenceMillis)
2725
let startDate = meta.startDate
2826
if (startDate.length === 11 && startDate.endsWith('Z')) {
2927
// Safari date parsing workaround. 1999-01-01Z -> 1999-01-01

0 commit comments

Comments
 (0)