headus.js
fileIt should export a headus
object that is an instance of EventTarget
with the following methods:
Also headus
object is expected to dispatch the following custom events:
init()
listNodes(names)
This function (method) should fill the datalist of nodes with the given names
as options.
enlistNode(name)
This function (method) should add the option with the given name
to the datalist of nodes.
unlistNode(name)
This function (method) should remove the option with the given name
from the datalist of nodes.
getQuery()
This function (method) should return the current value of the query input field.
clearQuery()
This function (method) should clear the query input field.
addnodetrigger
This event should be dispatched when the “Add Node” button is clicked. It should carry the current value of the query input field as event.detail.name
if it is not empty after trim.
querynode
This event should be dispatched when the query input field is changed. It should carry the query string as event.detail.query
object.
menutrigger
This event should be dispatched when the “Menu” button is clicked.