Documentation ¶
Index ¶
- Constants
- Variables
- func ConsoleLog(args ...interface{})
- func Loop()
- func MustRequire(path string)
- func RegisterEventType(typ string, fnc EventConstructor)
- func Require(path string) error
- 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) JSRef() 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) GetAttribute(k string) js.Value
- func (e *Element) GetBoundingClientRect() Rect
- 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) SetAttribute(k string, v interface{})
- func (e *Element) SetInnerHTML(s string)
- func (e *Element) Style() *Style
- type Em
- type Event
- type EventConstructor
- type EventHandler
- type EventTarget
- 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) AddEventListener(typ string, h EventHandler)
- func (e *NodeBase) AddEventListenerFlags(typ string, flags int, 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) JSRef() js.Ref
- func (e *NodeBase) NodeName() string
- 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 Perc
- type Point
- type Px
- type Rect
- type Rem
- type Style
- type Unit
- type Value
- type Vh
- type Vmax
- type Vmin
- type Vw
- type Window
Constants ¶
View Source
const (
MouseLeft = MouseButton(0)
)
Variables ¶
View Source
var ( Doc = GetDocument() Body = Doc.GetElementsByTagName("body")[0] Head = Doc.GetElementsByTagName("head")[0] )
Functions ¶
func ConsoleLog ¶
func ConsoleLog(args ...interface{})
func MustRequire ¶ added in v0.2.1
func MustRequire(path string)
MustRequire is the same as Require, but panics on an error.
func RegisterEventType ¶
func RegisterEventType(typ string, fnc EventConstructor)
Types ¶
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) GetBoundingClientRect ¶
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) SetAttribute ¶
func (*Element) SetInnerHTML ¶
type EventConstructor ¶
type EventHandler ¶
type EventHandler func(Event)
type EventTarget ¶
type EventTarget interface { Value AddEventListener(typ string, h EventHandler) }
type Input ¶
type Input struct {
Element
}
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) AddEventListener ¶
func (e *NodeBase) AddEventListener(typ string, h EventHandler)
func (*NodeBase) AddEventListenerFlags ¶
func (e *NodeBase) AddEventListenerFlags(typ string, flags int, 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 Style ¶
type Style struct {
// contains filtered or unexported fields
}
func (*Style) SetMarginsRaw ¶
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
func (*Window) AddEventListener ¶
func (w *Window) AddEventListener(typ string, h EventHandler)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
examples
|
|
grpc-over-ws/protocol
Package protocol is a generated protocol buffer package.
|
Package protocol is a generated protocol buffer package. |
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. |
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. |
Click to show internal directories.
Click to hide internal directories.