Can create devices nicely
This commit is contained in:
16
static/scripts.js
Normal file
16
static/scripts.js
Normal file
@@ -0,0 +1,16 @@
|
||||
function newOption(elementId, name) {
|
||||
var el = document.getElementById(elementId)
|
||||
if (el.value !== "New...") {
|
||||
return
|
||||
}
|
||||
|
||||
var newValue = window.prompt("Enter " + name + " Name")
|
||||
if (newValue === null) {
|
||||
return;
|
||||
}
|
||||
var child = document.createElement("option")
|
||||
child.value = newValue
|
||||
child.innerText = newValue
|
||||
el.prepend(child)
|
||||
el.value = newValue
|
||||
}
|
||||
Reference in New Issue
Block a user