Documentation
¶
Overview ¶
Package dom contains the javascript bindings for the site
Index ¶
- func CloneElement(query string) js.Value
- func Confirm(message string) bool
- func FormatTime(utcSeconds int64) string
- func GetCheckedQuery(query string) bool
- func GetValue(query string) string
- func NewJsEventFunc(fn func(event js.Value)) js.Func
- func NewJsFunc(fn func()) js.Func
- func NewWebSocket(url string) js.Value
- func QuerySelector(query string) js.Value
- func QuerySelectorAll(document js.Value, query string) []js.Value
- func RegisterFunc(parentName, fnName string, fn js.Func)
- func SetButtonDisabled(query string, disabled bool)
- func SetCheckedQuery(query string, checked bool)
- func SetValue(query, value string)
- type Form
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneElement ¶
CloneElement creates a close of the element, which should be a template.
func Confirm ¶
Confirm shows a popup asking the user a yes/no question. The true return value implies the "yes" choice.
func FormatTime ¶
FormatTime formats a datetime to HH:MM:SS.
func GetCheckedQuery ¶
GetCheckedQuery returns whether the element has a checked value of true.
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 NewWebSocket ¶
NewWebSocket creates a new WebSocket with the specified url.
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 RegisterFunc ¶
RegisterFunc sets the function as a field on the parent. The parent object is created if it does not exist.
func SetButtonDisabled ¶
SetButtonDisabled sets the disable property of the button element.
func SetCheckedQuery ¶
SetCheckedQuery sets the checked property of the element.
Types ¶
type Form ¶
type Form struct { Method string URL url.URL Params url.Values // contains filtered or unexported fields }
Form contains the fields needed to make a request to the server.
func (*Form) StoreCredentials ¶
func (f *Form) StoreCredentials()
StoreCredentials attempts to save the credentials for the login, if browser wants to