Documentation ¶
Index ¶
- Constants
- Variables
- func ConsoleLog(args ...interface{})
- func Loop()
- func RegisterEventType(typ string, fnc EventConstructor)
- type AttachShadowOpts
- type Auto
- type BaseEvent
- func (e *BaseEvent) Bubbles() bool
- func (e *BaseEvent) Cancelable() bool
- func (e *BaseEvent) Composed() bool
- func (e *BaseEvent) CurrentTarget() *Element
- func (e *BaseEvent) DefaultPrevented() bool
- func (e *BaseEvent) IsTrusted() bool
- func (e *BaseEvent) JSValue() js.Ref
- func (e *BaseEvent) Path() NodeList
- func (e *BaseEvent) PreventDefault()
- func (e *BaseEvent) StopImmediatePropagation()
- func (e *BaseEvent) StopPropagation()
- func (e *BaseEvent) Target() *Element
- func (e *BaseEvent) Type() string
- type Button
- type Color
- type Document
- func (d *Document) CreateElement(tag string) *Element
- func (d *Document) CreateElementNS(ns string, tag string) *Element
- func (d *Document) GetElementById(id string) *Element
- func (d *Document) GetElementsByTagName(tag string) NodeList
- func (d *Document) NewButton(s string) *Button
- func (d *Document) NewInput(typ string) *Input
- func (d *Document) QuerySelector(qu string) *Element
- func (d *Document) QuerySelectorAll(qu string) NodeList
- type Element
- func (e *Element) AsHTMLElement() *HTMLElement
- func (e *Element) AttachShadow(opts AttachShadowOpts) *ShadowRoot
- func (e *Element) ClassList() *TokenList
- func (e *Element) ClassName() string
- func (e *Element) ClientHeight() int
- func (e *Element) ClientLeft() int
- func (e *Element) ClientTop() int
- func (e *Element) ClientWidth() int
- func (e *Element) ComputedName() string
- func (e *Element) ComputedRole() string
- func (e *Element) GetAttribute(k string) js.Value
- func (e *Element) GetBoundingClientRect() Rect
- func (e *Element) Id() string
- func (e *Element) InnerHTML() string
- func (e *Element) InsertAdjacentElement(position Position, newElement *Element) js.Value
- func (e *Element) LocalName() string
- func (e *Element) NamespaceURI() string
- func (e *Element) OnClick(h MouseEventHandler)
- func (e *Element) OnMouseDown(h MouseEventHandler)
- func (e *Element) OnMouseMove(h MouseEventHandler)
- func (e *Element) OnMouseUp(h MouseEventHandler)
- func (e *Element) OuterHTML() string
- func (e *Element) Prefix() string
- func (e *Element) RemoveAttribute(k string)
- func (e *Element) ScrollHeight() int
- func (e *Element) ScrollLeft() int
- func (e *Element) ScrollLeftMax() int
- func (e *Element) ScrollTop() int
- func (e *Element) ScrollTopMax() int
- func (e *Element) ScrollWidth() int
- func (e *Element) SetAttribute(k string, v interface{})
- func (e *Element) SetClassName(v string)
- func (e *Element) SetId(v string)
- func (e *Element) SetInnerHTML(v string)
- func (e *Element) SetOuterHTML(v string)
- func (e *Element) SetScrollLeft(v int)
- func (e *Element) SetScrollTop(v int)
- func (e *Element) SetSlot(v string)
- func (e *Element) SetTabStop(v bool)
- func (e *Element) SetUndoScope(v bool)
- func (e *Element) ShadowRoot() *ShadowRoot
- func (e *Element) Slot() string
- func (e *Element) TabStop() bool
- func (e *Element) TagName() string
- func (e *Element) UndoManager() js.Value
- func (e *Element) UndoScope() bool
- type Em
- type Event
- type EventConstructor
- type EventHandler
- type EventTarget
- type HTMLElement
- func (e *HTMLElement) AccessKey() string
- func (e *HTMLElement) AccessKeyLabel() string
- func (e *HTMLElement) ContentEditable() string
- func (e *HTMLElement) Dataset() js.Value
- func (e *HTMLElement) Dir() string
- func (e *HTMLElement) Draggable() bool
- func (e *HTMLElement) Dropzone() *TokenList
- func (e *HTMLElement) Hidden() bool
- func (e *HTMLElement) Inert() bool
- func (e *HTMLElement) InnerText() string
- func (e *HTMLElement) IsContentEditable() bool
- func (e *HTMLElement) ItemId() string
- func (e *HTMLElement) ItemProp() *TokenList
- func (e *HTMLElement) ItemRef() *TokenList
- func (e *HTMLElement) ItemScope() bool
- func (e *HTMLElement) ItemType() *TokenList
- func (e *HTMLElement) ItemValue() js.Value
- func (e *HTMLElement) Lang() string
- func (e *HTMLElement) NoModule() bool
- func (e *HTMLElement) Nonce() js.Value
- func (e *HTMLElement) OffsetHeight() float64
- func (e *HTMLElement) OffsetLeft() float64
- func (e *HTMLElement) OffsetParent() *Element
- func (e *HTMLElement) OffsetTop() float64
- func (e *HTMLElement) OffsetWidth() float64
- func (e *HTMLElement) SetAccessKey(v string)
- func (e *HTMLElement) SetContentEditable(v string)
- func (e *HTMLElement) SetDir(v string)
- func (e *HTMLElement) SetDraggable(v bool)
- func (e *HTMLElement) SetHidden(v bool)
- func (e *HTMLElement) SetInert(v bool)
- func (e *HTMLElement) SetInnerText(v string)
- func (e *HTMLElement) SetItemId(v string)
- func (e *HTMLElement) SetItemScope(v bool)
- func (e *HTMLElement) SetItemValue(v js.Value)
- func (e *HTMLElement) SetLang(v string)
- func (e *HTMLElement) SetNoModule(v bool)
- func (e *HTMLElement) SetNonce(v js.Value)
- func (e *HTMLElement) SetSpellcheck(v bool)
- func (e *HTMLElement) SetStyle(v *Style)
- func (e *HTMLElement) SetTabIndex(v int)
- func (e *HTMLElement) SetTitle(v string)
- func (e *HTMLElement) SetTranslate(v bool)
- func (e *HTMLElement) Spellcheck() bool
- func (e *HTMLElement) Style() *Style
- func (e *HTMLElement) TabIndex() int
- func (e *HTMLElement) Title() string
- func (e *HTMLElement) Translate() bool
- type Input
- type MouseButton
- type MouseEvent
- func (e *MouseEvent) AltKey() bool
- func (e *MouseEvent) Button() MouseButton
- func (e *MouseEvent) ClientPos() Point
- func (e *MouseEvent) CtrlKey() bool
- func (e *MouseEvent) MetaKey() bool
- func (e *MouseEvent) OffsetPos() Point
- func (e *MouseEvent) PagePos() Point
- func (e *MouseEvent) ScreenPos() Point
- func (e *MouseEvent) ShiftKey() bool
- type MouseEventHandler
- type Node
- type NodeBase
- func (e *NodeBase) AddErrorListener(h func(err error))
- func (e *NodeBase) AddEventListener(typ string, h EventHandler)
- func (e *NodeBase) AppendChild(n Node)
- func (e *NodeBase) BaseURI() string
- func (e *NodeBase) ChildNodes() NodeList
- func (e *NodeBase) Contains(n Node) bool
- func (e *NodeBase) IsEqualNode(n Node) bool
- func (e *NodeBase) IsSameNode(n Node) bool
- func (e NodeBase) JSValue() js.Ref
- func (e *NodeBase) NodeName() string
- func (e *NodeBase) NodeType() NodeType
- func (e *NodeBase) ParentElement() *Element
- func (e *NodeBase) ParentNode() Node
- func (e *NodeBase) Remove()
- func (e *NodeBase) RemoveChild(n Node) Node
- func (e *NodeBase) ReplaceChild(n, old Node) Node
- func (e *NodeBase) SetTextContent(s string)
- func (e *NodeBase) TextContent() string
- type NodeList
- type NodeType
- type Perc
- type Point
- type Position
- type Px
- type Rect
- type Rem
- type ShadowRoot
- type Style
- type TokenList
- type Unit
- type Value
- type Vh
- type Vmax
- type Vmin
- type Vw
- type Window
Constants ¶
const (
MouseLeft = MouseButton(0)
)
Variables ¶
var ( Doc = GetDocument() Body = getFirstWithTag("body") Head = getFirstWithTag("head") )
Functions ¶
func ConsoleLog ¶
func ConsoleLog(args ...interface{})
func RegisterEventType ¶
func RegisterEventType(typ string, fnc EventConstructor)
Types ¶
type AttachShadowOpts ¶ added in v0.4.0
type BaseEvent ¶
type BaseEvent struct {
// contains filtered or unexported fields
}
func (*BaseEvent) Cancelable ¶
func (*BaseEvent) CurrentTarget ¶
func (*BaseEvent) DefaultPrevented ¶
func (*BaseEvent) PreventDefault ¶ added in v0.2.1
func (e *BaseEvent) PreventDefault()
func (*BaseEvent) StopImmediatePropagation ¶ added in v0.2.1
func (e *BaseEvent) StopImmediatePropagation()
func (*BaseEvent) StopPropagation ¶ added in v0.2.1
func (e *BaseEvent) StopPropagation()
type Button ¶
type Button struct {
Element
}
func (*Button) OnClick ¶
func (b *Button) OnClick(h EventHandler)
type Document ¶
type Document struct {
NodeBase
}
func GetDocument ¶
func GetDocument() *Document
func (*Document) CreateElement ¶
func (*Document) CreateElementNS ¶
func (*Document) GetElementById ¶
func (*Document) GetElementsByTagName ¶
func (*Document) QuerySelector ¶
func (*Document) QuerySelectorAll ¶
type Element ¶
type Element struct {
NodeBase
}
func NewElement ¶ added in v0.2.1
func (*Element) AsHTMLElement ¶ added in v0.4.0
func (e *Element) AsHTMLElement() *HTMLElement
func (*Element) AttachShadow ¶ added in v0.4.0
func (e *Element) AttachShadow(opts AttachShadowOpts) *ShadowRoot
func (*Element) ClassList ¶ added in v0.4.0
ClassList returns a DOMTokenList containing the list of class attributes.
func (*Element) ClassName ¶ added in v0.4.0
ClassName is a DOMString representing the class of the element.
func (*Element) ClientHeight ¶ added in v0.4.0
ClientHeight returns a Number representing the inner height of the element.
func (*Element) ClientLeft ¶ added in v0.4.0
ClientLeft returns a Number representing the width of the left border of the element.
func (*Element) ClientTop ¶ added in v0.4.0
ClientTop returns a Number representing the width of the top border of the element.
func (*Element) ClientWidth ¶ added in v0.4.0
ClientWidth returns a Number representing the inner width of the element.
func (*Element) ComputedName ¶ added in v0.4.0
ComputedName returns a DOMString containing the label exposed to accessibility.
func (*Element) ComputedRole ¶ added in v0.4.0
ComputedRole returns a DOMString containing the ARIA role that has been applied to a particular element.
func (*Element) GetBoundingClientRect ¶
func (*Element) InnerHTML ¶ added in v0.4.0
InnerHTML is a DOMString representing the markup of the element's content.
func (*Element) InsertAdjacentElement ¶ added in v0.4.0
InsertAdjacentElement inserts a given element node at a given position relative to the element it is invoked upon.
func (*Element) LocalName ¶ added in v0.4.0
LocalName a DOMString representing the local part of the qualified name of the element.
func (*Element) NamespaceURI ¶ added in v0.4.0
NamespaceURI the namespace URI of the element, or null if it is no namespace.
func (*Element) OnClick ¶
func (e *Element) OnClick(h MouseEventHandler)
func (*Element) OnMouseDown ¶
func (e *Element) OnMouseDown(h MouseEventHandler)
func (*Element) OnMouseMove ¶
func (e *Element) OnMouseMove(h MouseEventHandler)
func (*Element) OnMouseUp ¶
func (e *Element) OnMouseUp(h MouseEventHandler)
func (*Element) OuterHTML ¶ added in v0.4.0
OuterHTML is a DOMString representing the markup of the element including its content. When used as a setter, replaces the element with nodes parsed from the given string.
func (*Element) Prefix ¶ added in v0.4.0
Prefix a DOMString representing the namespace prefix of the element, or null if no prefix is specified.
func (*Element) RemoveAttribute ¶ added in v0.4.0
func (*Element) ScrollHeight ¶ added in v0.4.0
ScrollHeight returns a Number representing the scroll view height of an element.
func (*Element) ScrollLeft ¶ added in v0.4.0
ScrollLeft is a Number representing the left scroll offset of the element.
func (*Element) ScrollLeftMax ¶ added in v0.4.0
ScrollLeftMax returns a Number representing the maximum left scroll offset possible for the element.
func (*Element) ScrollTop ¶ added in v0.4.0
ScrollTop a Number representing number of pixels the top of the document is scrolled vertically.
func (*Element) ScrollTopMax ¶ added in v0.4.0
ScrollTopMax returns a Number representing the maximum top scroll offset possible for the element.
func (*Element) ScrollWidth ¶ added in v0.4.0
ScrollWidth returns a Number representing the scroll view width of the element.
func (*Element) SetAttribute ¶
func (*Element) SetClassName ¶ added in v0.4.0
SetClassName is a DOMString representing the class of the element.
func (*Element) SetInnerHTML ¶
SetInnerHTML is a DOMString representing the markup of the element's content.
func (*Element) SetOuterHTML ¶ added in v0.4.0
SetOuterHTML is a DOMString representing the markup of the element including its content. When used as a setter, replaces the element with nodes parsed from the given string.
func (*Element) SetScrollLeft ¶ added in v0.4.0
SetScrollLeft is a Number representing the left scroll offset of the element.
func (*Element) SetScrollTop ¶ added in v0.4.0
SetScrollTop a Number representing number of pixels the top of the document is scrolled vertically.
func (*Element) SetSlot ¶ added in v0.4.0
SetSlot returns the name of the shadow DOM slot the element is inserted in.
func (*Element) SetTabStop ¶ added in v0.4.0
SetTabStop is a Boolean indicating if the element can receive input focus via the tab key.
func (*Element) SetUndoScope ¶ added in v0.4.0
SetUndoScope is a Boolean indicating if the element is an undo scope host, or not.
func (*Element) ShadowRoot ¶ added in v0.4.0
func (e *Element) ShadowRoot() *ShadowRoot
Shadow returns the open shadow root that is hosted by the element, or null if no open shadow root is present.
func (*Element) Slot ¶ added in v0.4.0
Slot returns the name of the shadow DOM slot the element is inserted in.
func (*Element) TabStop ¶ added in v0.4.0
TabStop is a Boolean indicating if the element can receive input focus via the tab key.
func (*Element) TagName ¶ added in v0.4.0
TagName returns a String with the name of the tag for the given element.
func (*Element) UndoManager ¶ added in v0.4.0
UndoManager returns the UndoManager associated with the element.
type EventConstructor ¶
type EventHandler ¶
type EventHandler func(Event)
type EventTarget ¶
type EventTarget interface { js.Wrapper AddEventListener(typ string, h EventHandler) }
type HTMLElement ¶ added in v0.4.0
type HTMLElement struct {
Element
}
func (*HTMLElement) AccessKey ¶ added in v0.4.0
func (e *HTMLElement) AccessKey() string
AccessKey is a DOMString representing the access key assigned to the element.
func (*HTMLElement) AccessKeyLabel ¶ added in v0.4.0
func (e *HTMLElement) AccessKeyLabel() string
AccessKeyLabel returns a DOMString containing the element's assigned access key.
func (*HTMLElement) ContentEditable ¶ added in v0.4.0
func (e *HTMLElement) ContentEditable() string
ContentEditable is a DOMString, where a value of "true" means the element is editable and a value of "false" means it isn't.
func (*HTMLElement) Dataset ¶ added in v0.4.0
func (e *HTMLElement) Dataset() js.Value
Dataset returns a DOMStringMap with which script can read and write the element's custom data attributes (data-*) .
func (*HTMLElement) Dir ¶ added in v0.4.0
func (e *HTMLElement) Dir() string
Dir is a DOMString, reflecting the dir global attribute, representing the directionality of the element. Possible values are "ltr", "rtl", and "auto".
func (*HTMLElement) Draggable ¶ added in v0.4.0
func (e *HTMLElement) Draggable() bool
Draggable is a Boolean indicating if the element can be dragged.
func (*HTMLElement) Dropzone ¶ added in v0.4.0
func (e *HTMLElement) Dropzone() *TokenList
Dropzone returns a DOMSettableTokenList reflecting the dropzone global attribute and describing the behavior of the element regarding a drop operation.
func (*HTMLElement) Hidden ¶ added in v0.4.0
func (e *HTMLElement) Hidden() bool
Hidden is a Boolean indicating if the element is hidden or not.
func (*HTMLElement) Inert ¶ added in v0.4.0
func (e *HTMLElement) Inert() bool
Inert is a Boolean indicating whether the user agent must act as though the given node is absent for the purposes of user interaction events, in-page text searches ("find in page"), and text selection.
func (*HTMLElement) InnerText ¶ added in v0.4.0
func (e *HTMLElement) InnerText() string
InnerText represents the "rendered" text content of a node and its descendants. As a getter, it approximates the text the user would get if they highlighted the contents of the element with the cursor and then copied it to the clipboard.
func (*HTMLElement) IsContentEditable ¶ added in v0.4.0
func (e *HTMLElement) IsContentEditable() bool
IsContentEditable returns a Boolean that indicates whether or not the content of the element can be edited.
func (*HTMLElement) ItemId ¶ added in v0.4.0
func (e *HTMLElement) ItemId() string
ItemId is a DOMString representing the item ID.
func (*HTMLElement) ItemProp ¶ added in v0.4.0
func (e *HTMLElement) ItemProp() *TokenList
ItemProp returns a DOMSettableTokenList…
func (*HTMLElement) ItemRef ¶ added in v0.4.0
func (e *HTMLElement) ItemRef() *TokenList
ItemRef returns a DOMSettableTokenList…
func (*HTMLElement) ItemScope ¶ added in v0.4.0
func (e *HTMLElement) ItemScope() bool
ItemScope is a Boolean representing the item scope.
func (*HTMLElement) ItemType ¶ added in v0.4.0
func (e *HTMLElement) ItemType() *TokenList
ItemType returns a DOMSettableTokenList…
func (*HTMLElement) ItemValue ¶ added in v0.4.0
func (e *HTMLElement) ItemValue() js.Value
ItemValue returns a Object representing the item value.
func (*HTMLElement) Lang ¶ added in v0.4.0
func (e *HTMLElement) Lang() string
Lang is a DOMString representing the language of an element's attributes, text, and element contents.
func (*HTMLElement) NoModule ¶ added in v0.4.0
func (e *HTMLElement) NoModule() bool
NoModule is a Boolean indicating whether an import script can be executed in user agents that support module scripts.
func (*HTMLElement) Nonce ¶ added in v0.4.0
func (e *HTMLElement) Nonce() js.Value
Nonce returns the cryptographic number used once that is used by Content Security Policy to determine whether a given fetch will be allowed to proceed.
func (*HTMLElement) OffsetHeight ¶ added in v0.4.0
func (e *HTMLElement) OffsetHeight() float64
OffsetHeight returns a double containing the height of an element, relative to the layout.
func (*HTMLElement) OffsetLeft ¶ added in v0.4.0
func (e *HTMLElement) OffsetLeft() float64
OffsetLeft returns a double, the distance from this element's left border to its offsetParent's left border.
func (*HTMLElement) OffsetParent ¶ added in v0.4.0
func (e *HTMLElement) OffsetParent() *Element
OffsetParent returns a Element that is the element from which all offset calculations are currently computed.
func (*HTMLElement) OffsetTop ¶ added in v0.4.0
func (e *HTMLElement) OffsetTop() float64
OffsetTop returns a double, the distance from this element's top border to its offsetParent's top border.
func (*HTMLElement) OffsetWidth ¶ added in v0.4.0
func (e *HTMLElement) OffsetWidth() float64
OffsetWidth returns a double containing the width of an element, relative to the layout.
func (*HTMLElement) SetAccessKey ¶ added in v0.4.0
func (e *HTMLElement) SetAccessKey(v string)
SetAccessKey is a DOMString representing the access key assigned to the element.
func (*HTMLElement) SetContentEditable ¶ added in v0.4.0
func (e *HTMLElement) SetContentEditable(v string)
SetContentEditable is a DOMString, where a value of "true" means the element is editable and a value of "false" means it isn't.
func (*HTMLElement) SetDir ¶ added in v0.4.0
func (e *HTMLElement) SetDir(v string)
SetDir is a DOMString, reflecting the dir global attribute, representing the directionality of the element. Possible values are "ltr", "rtl", and "auto".
func (*HTMLElement) SetDraggable ¶ added in v0.4.0
func (e *HTMLElement) SetDraggable(v bool)
SetDraggable is a Boolean indicating if the element can be dragged.
func (*HTMLElement) SetHidden ¶ added in v0.4.0
func (e *HTMLElement) SetHidden(v bool)
SetHidden is a Boolean indicating if the element is hidden or not.
func (*HTMLElement) SetInert ¶ added in v0.4.0
func (e *HTMLElement) SetInert(v bool)
SetInert is a Boolean indicating whether the user agent must act as though the given node is absent for the purposes of user interaction events, in-page text searches ("find in page"), and text selection.
func (*HTMLElement) SetInnerText ¶ added in v0.4.0
func (e *HTMLElement) SetInnerText(v string)
SetInnerText represents the "rendered" text content of a node and its descendants. As a getter, it approximates the text the user would get if they highlighted the contents of the element with the cursor and then copied it to the clipboard.
func (*HTMLElement) SetItemId ¶ added in v0.4.0
func (e *HTMLElement) SetItemId(v string)
SetItemId is a DOMString representing the item ID.
func (*HTMLElement) SetItemScope ¶ added in v0.4.0
func (e *HTMLElement) SetItemScope(v bool)
SetItemScope is a Boolean representing the item scope.
func (*HTMLElement) SetItemValue ¶ added in v0.4.0
func (e *HTMLElement) SetItemValue(v js.Value)
SetItemValue returns a Object representing the item value.
func (*HTMLElement) SetLang ¶ added in v0.4.0
func (e *HTMLElement) SetLang(v string)
SetLang is a DOMString representing the language of an element's attributes, text, and element contents.
func (*HTMLElement) SetNoModule ¶ added in v0.4.0
func (e *HTMLElement) SetNoModule(v bool)
SetNoModule is a Boolean indicating whether an import script can be executed in user agents that support module scripts.
func (*HTMLElement) SetNonce ¶ added in v0.4.0
func (e *HTMLElement) SetNonce(v js.Value)
SetNonce returns the cryptographic number used once that is used by Content Security Policy to determine whether a given fetch will be allowed to proceed.
func (*HTMLElement) SetSpellcheck ¶ added in v0.4.0
func (e *HTMLElement) SetSpellcheck(v bool)
SetSpellcheck is a Boolean that controls spell-checking. It is present on all HTML elements, though it doesn't have an effect on all of them.
func (*HTMLElement) SetStyle ¶ added in v0.4.0
func (e *HTMLElement) SetStyle(v *Style)
SetStyle is a CSSStyleDeclaration, an object representing the declarations of an element's style attributes.
func (*HTMLElement) SetTabIndex ¶ added in v0.4.0
func (e *HTMLElement) SetTabIndex(v int)
SetTabIndex is a long representing the position of the element in the tabbing order.
func (*HTMLElement) SetTitle ¶ added in v0.4.0
func (e *HTMLElement) SetTitle(v string)
SetTitle is a DOMString containing the text that appears in a popup box when mouse is over the element.
func (*HTMLElement) SetTranslate ¶ added in v0.4.0
func (e *HTMLElement) SetTranslate(v bool)
SetTranslate is a Boolean representing the translation.
func (*HTMLElement) Spellcheck ¶ added in v0.4.0
func (e *HTMLElement) Spellcheck() bool
Spellcheck is a Boolean that controls spell-checking. It is present on all HTML elements, though it doesn't have an effect on all of them.
func (*HTMLElement) Style ¶ added in v0.4.0
func (e *HTMLElement) Style() *Style
Style is a CSSStyleDeclaration, an object representing the declarations of an element's style attributes.
func (*HTMLElement) TabIndex ¶ added in v0.4.0
func (e *HTMLElement) TabIndex() int
TabIndex is a long representing the position of the element in the tabbing order.
func (*HTMLElement) Title ¶ added in v0.4.0
func (e *HTMLElement) Title() string
Title is a DOMString containing the text that appears in a popup box when mouse is over the element.
func (*HTMLElement) Translate ¶ added in v0.4.0
func (e *HTMLElement) Translate() bool
Translate is a Boolean representing the translation.
type Input ¶
type Input struct {
HTMLElement
}
func (*Input) OnChange ¶
func (inp *Input) OnChange(h EventHandler)
func (*Input) OnInput ¶
func (inp *Input) OnInput(h EventHandler)
type MouseButton ¶
type MouseButton int
type MouseEvent ¶
type MouseEvent struct {
BaseEvent
}
func (*MouseEvent) AltKey ¶
func (e *MouseEvent) AltKey() bool
func (*MouseEvent) Button ¶
func (e *MouseEvent) Button() MouseButton
func (*MouseEvent) ClientPos ¶
func (e *MouseEvent) ClientPos() Point
func (*MouseEvent) CtrlKey ¶
func (e *MouseEvent) CtrlKey() bool
func (*MouseEvent) MetaKey ¶
func (e *MouseEvent) MetaKey() bool
func (*MouseEvent) OffsetPos ¶
func (e *MouseEvent) OffsetPos() Point
func (*MouseEvent) PagePos ¶
func (e *MouseEvent) PagePos() Point
func (*MouseEvent) ScreenPos ¶
func (e *MouseEvent) ScreenPos() Point
func (*MouseEvent) ShiftKey ¶
func (e *MouseEvent) ShiftKey() bool
type MouseEventHandler ¶
type MouseEventHandler func(*MouseEvent)
type Node ¶
type Node interface { EventTarget BaseURI() string NodeName() string ChildNodes() NodeList ParentNode() Node ParentElement() *Element TextContent() string SetTextContent(s string) AppendChild(n Node) Contains(n Node) bool IsEqualNode(n Node) bool IsSameNode(n Node) bool RemoveChild(n Node) Node ReplaceChild(n, old Node) Node }
type NodeBase ¶
type NodeBase struct {
// contains filtered or unexported fields
}
func (*NodeBase) AddErrorListener ¶ added in v0.4.0
func (*NodeBase) AddEventListener ¶
func (e *NodeBase) AddEventListener(typ string, h EventHandler)
func (*NodeBase) AppendChild ¶
func (*NodeBase) ChildNodes ¶
func (*NodeBase) IsEqualNode ¶
func (*NodeBase) IsSameNode ¶
func (*NodeBase) ParentElement ¶
func (*NodeBase) ParentNode ¶
func (*NodeBase) RemoveChild ¶
func (*NodeBase) ReplaceChild ¶
func (*NodeBase) SetTextContent ¶
func (*NodeBase) TextContent ¶
type NodeType ¶ added in v0.4.0
type NodeType int
const ( ElementNode NodeType = 1 TextNode NodeType = 3 CDataSectionNode NodeType = 4 ProcessingInstructionNode NodeType = 7 CommentNode NodeType = 8 DocumentNode NodeType = 9 DocumentTypeNode NodeType = 10 DocumentFragmentNode NodeType = 11 )
See https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType#Node_type_constants
type ShadowRoot ¶ added in v0.4.0
type ShadowRoot struct {
NodeBase
}
func AsShadowRoot ¶ added in v0.4.0
func AsShadowRoot(v js.Value) *ShadowRoot
func (*ShadowRoot) Host ¶ added in v0.4.0
func (r *ShadowRoot) Host() *Element
func (*ShadowRoot) InnerHTML ¶ added in v0.4.0
func (r *ShadowRoot) InnerHTML() string
func (*ShadowRoot) IsOpen ¶ added in v0.4.0
func (r *ShadowRoot) IsOpen() bool
func (*ShadowRoot) SetInnerHTML ¶ added in v0.4.0
func (r *ShadowRoot) SetInnerHTML(s string)
type Style ¶
type Style struct {
// contains filtered or unexported fields
}
func (*Style) SetMarginsRaw ¶
type TokenList ¶ added in v0.4.0
type TokenList struct {
// contains filtered or unexported fields
}
func AsTokenList ¶ added in v0.4.0
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
func (*Window) AddEventListener ¶
func (w *Window) AddEventListener(typ string, h EventHandler)
func (*Window) SetLocation ¶ added in v0.4.0
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
examples
module
|
|
extension
|
|
chrome/native
Package native provides an API for Native Messaging for Chrome extensions.
|
Package native provides an API for Native Messaging for Chrome extensions. |
internal
|
|
Package JS provides additional functionality on top of syscall/js package for WASM.
|
Package JS provides additional functionality on top of syscall/js package for WASM. |
net
|
|
ws
Package ws provides a functionality similar to Go net package on top of WebSockets.
|
Package ws provides a functionality similar to Go net package on top of WebSockets. |