Comparing version 0.1.0-beta.14 to 0.1.0-beta.15
@@ -31,2 +31,7 @@ import * as tests from './exports'; | ||
} | ||
setSearchParam(param, value) { | ||
const params = new URLSearchParams(location.search); | ||
params.set(param, value); | ||
history.replaceState(null, '', `${location.pathname}?${params}`); | ||
} | ||
ready() { | ||
@@ -56,2 +61,3 @@ const entries = Object.entries(tasks); | ||
preview() { | ||
const container = document.createElement('div'); | ||
const select = document.createElement('select'); | ||
@@ -68,5 +74,20 @@ const empty = document.createElement('option'); | ||
} | ||
select.onchange = () => this.runner.preview(select.value); | ||
document.body.prepend(select); | ||
select.onchange = () => { | ||
this.runner.preview(select.value); | ||
this.setSearchParam('preset', select.value); | ||
}; | ||
const preset = this.getSearchParam('preset'); | ||
if (preset) | ||
select.value = preset; | ||
// button | ||
const button = document.createElement('button'); | ||
button.textContent = 'Run Current'; | ||
button.onclick = () => { | ||
if (select.value) | ||
this.runner.preview(select.value); | ||
}; | ||
document.body.prepend(container); | ||
container.appendChild(select); | ||
container.appendChild(button); | ||
} | ||
} |
{ | ||
"name": "iperf", | ||
"version": "0.1.0-beta.14", | ||
"version": "0.1.0-beta.15", | ||
"description": "Performance Testing Framework for Front-end Renderers", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31884
902