Documentation ¶
Overview ¶
Package ui contains functions to make the website interactive that can be compiled to WebAssembly for the website.
Index ¶
- func AlertOnPanic()
- func CloneElement(query string) js.Value
- func FormatTime(utcSeconds int64) string
- func InitDomFuncs(ctx context.Context, wg *sync.WaitGroup)
- func NewJsEventFunc(fn func(event js.Value)) js.Func
- func NewJsFunc(fn func()) js.Func
- func QuerySelector(query string) js.Value
- func QuerySelectorAll(document js.Value, query string) []js.Value
- func RegisterFuncs(ctx context.Context, wg *sync.WaitGroup, parentName string, ...)
- func ReleaseJsFuncsOnDone(ctx context.Context, wg *sync.WaitGroup, jsFuncs map[string]js.Func)
- func SetButtonDisabled(query string, disabled bool)
- func SetChecked(query string, checked bool)
- func SetValue(query, value string)
- func Value(query string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlertOnPanic ¶
func AlertOnPanic()
AlertOnPanic checks to see if a panic has occurred. Thes function shoould be deferred as the first statement for each goroutine
func CloneElement ¶
CloneElement creates a close of the element, which should be a template.
func FormatTime ¶
FormatTime formats a datetime to HH:MM:SS.
func InitDomFuncs ¶
InitDomFuncs registers the logging and otp javascript functions.
func NewJsEventFunc ¶
NewJsEventFunc creates a new javascript function from the provided function that processes an event and returns nothing. PreventDefault is called on the event before applying the function.
func QuerySelector ¶
QuerySelector returns the first element returned by the query from root of the document.
func QuerySelectorAll ¶
QuerySelectorAll returns an array of the elements returned by the query from the specified document.
func RegisterFuncs ¶
func RegisterFuncs(ctx context.Context, wg *sync.WaitGroup, parentName string, jsFuncs map[string]js.Func)
RegisterFuncs sets the function as fields on the parent. The parent object is created if it does not exist.
func ReleaseJsFuncsOnDone ¶
ReleaseJsFuncsOnDone releases the jsFuncs and decrements the waitgroup when the context is done. This function should be called on a separate goroutine.
func SetButtonDisabled ¶
SetButtonDisabled sets the disable property of the button element.
func SetChecked ¶
SetChecked sets the checked property of the element.
Types ¶
This section is empty.