web-dev-knowledge-graph

Up to App level requirements

Headus module requirements

This document holds requirements for the headus.js file

It 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:

Back to top

Methods

init()

Back to top

listNodes(names)

This function (method) should fill the datalist of nodes with the given names as options.

Back to top

enlistNode(name)

This function (method) should add the option with the given name to the datalist of nodes.

Back to top

unlistNode(name)

This function (method) should remove the option with the given name from the datalist of nodes.

Back to top

getQuery()

This function (method) should return the current value of the query input field.

Back to top

clearQuery()

This function (method) should clear the query input field.

Back to top

Custom events

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.

Back to top

querynode

This event should be dispatched when the query input field is changed. It should carry the query string as event.detail.query object.

Back to top

This event should be dispatched when the “Menu” button is clicked.

Back to top