-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix date type in dynamic load test page
- Loading branch information
Showing
3 changed files
with
19 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ | |
const url = 'https://cdn.jsdelivr.net/npm/[email protected]/dist/pretty-print-json.js'; | ||
globalThis.document.querySelector('main pre').classList.add('active'); | ||
const onModuleLoad = (module) => { | ||
const pageLoaded = Number(globalThis.document.body.dataset.pageLoaded); | ||
const pageLoaded = new Date(Number(globalThis.document.body.dataset.pageLoaded)); | ||
const moduleLoaded = new Date(); | ||
const message = { | ||
message: 'ES Module Dynamic Loading', | ||
|
@@ -61,22 +61,22 @@ | |
buttonClicked: buttonClicked, | ||
moduleLoaded_: moduleLoaded, | ||
}, | ||
milliseconds: { | ||
waitForClick: buttonClicked - pageLoaded, | ||
loadModule: moduleLoaded - buttonClicked, | ||
seconds: { | ||
waitForClick: (buttonClicked - pageLoaded) / 1000, | ||
loadModule__: (moduleLoaded - buttonClicked) / 1000, | ||
}, | ||
}; | ||
const html = module.prettyPrintJson.toHtml(message); | ||
const output = globalThis.document.querySelector('main output'); | ||
output.innerHTML = html; | ||
dna.ui.fadeSlideIn(output); | ||
dna.ui.slideFadeIn(output); | ||
}; | ||
import(url).then(onModuleLoad); | ||
}, | ||
setup() { | ||
const pageLoaded = String(new Date()); | ||
globalThis.document.body.dataset.pageLoaded = pageLoaded; | ||
globalThis.document.querySelector('main code').textContent = pageLoaded; | ||
const now = Date.now(); | ||
globalThis.document.body.dataset.pageLoaded = String(now); | ||
globalThis.document.querySelector('main code').textContent = Date(now).toLocaleString(); | ||
dna.dom.onClick(app.loadModule, 'main button'); | ||
libX.ui.autoDisableButtons(); | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ | |
const url = 'https://cdn.jsdelivr.net/npm/[email protected]/dist/pretty-print-json.js'; | ||
globalThis.document.querySelector('main pre').classList.add('active'); | ||
const onModuleLoad = (module) => { | ||
const pageLoaded = Number(globalThis.document.body.dataset.pageLoaded); | ||
const pageLoaded = new Date(Number(globalThis.document.body.dataset.pageLoaded)); | ||
const moduleLoaded = new Date(); | ||
const message = { | ||
message: 'ES Module Dynamic Loading', | ||
|
@@ -61,22 +61,22 @@ | |
buttonClicked: buttonClicked, | ||
moduleLoaded_: moduleLoaded, | ||
}, | ||
milliseconds: { | ||
waitForClick: buttonClicked - pageLoaded, | ||
loadModule: moduleLoaded - buttonClicked, | ||
seconds: { | ||
waitForClick: (buttonClicked - pageLoaded) / 1000, | ||
loadModule__: (moduleLoaded - buttonClicked) / 1000, | ||
}, | ||
}; | ||
const html = module.prettyPrintJson.toHtml(message); | ||
const output = globalThis.document.querySelector('main output'); | ||
output.innerHTML = html; | ||
dna.ui.fadeSlideIn(output); | ||
dna.ui.slideFadeIn(output); | ||
}; | ||
import(url).then(onModuleLoad); | ||
}, | ||
setup() { | ||
const pageLoaded = String(new Date()); | ||
globalThis.document.body.dataset.pageLoaded = pageLoaded; | ||
globalThis.document.querySelector('main code').textContent = pageLoaded; | ||
const now = Date.now(); | ||
globalThis.document.body.dataset.pageLoaded = String(now); | ||
globalThis.document.querySelector('main code').textContent = Date(now).toLocaleString(); | ||
dna.dom.onClick(app.loadModule, 'main button'); | ||
libX.ui.autoDisableButtons(); | ||
}, | ||
|