Documentation ¶
Overview ¶
Package jsutils contains dom level helper functions for Haiku(https://github.com/influx6/haiku)
Index ¶
- func AppendChild(o *js.Object, osets ...*js.Object)
- func Attributes(co *js.Object) map[string]string
- func ChildNodeList(o *js.Object) []*js.Object
- func CleanAllTextNode(o *js.Object)
- func CreateDocumentFragment() *js.Object
- func CreateElement(tag string) *js.Object
- func DOMObjectToList(o *js.Object) []*js.Object
- func EmptyTextNode(o *js.Object) (bool, bool)
- func GetAttribute(o *js.Object, key string) string
- func GetDocument() *js.Object
- func GetTag(o *js.Object) string
- func GetWindow() *js.Object
- func HasAttribute(o *js.Object, key string) bool
- func InsertBefore(target, guage, inserto *js.Object)
- func IsEqualNode(newNode, oldNode *js.Object) bool
- func QuerySelector(o *js.Object, sel string) *js.Object
- func QuerySelectorAll(o *js.Object, sel string) []*js.Object
- func RemoveChild(o *js.Object, co ...*js.Object)
- func ReplaceNode(target, newNode, oldNode *js.Object)
- func SetAttribute(o *js.Object, key string, value string)
- func SetInnerHTML(o *js.Object, html string)
- func SpecialAppendChild(o *js.Object, osets ...*js.Object)
- func UnWrapSpecialTextElements(o *js.Object)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendChild ¶
AppendChild takes a list of objects and calls appendNode on the given object
func Attributes ¶
Attributes takes a js object and extracts the attribute lists from it
func ChildNodeList ¶
ChildNodeList returns the nodes list of the childNodes of the js object
func CleanAllTextNode ¶
CleanAllTextNode removes all texts nodes within the container root
func CreateDocumentFragment ¶
CreateDocumentFragment creates a dom documentFragment using the document html js.object
func CreateElement ¶
CreateElement creates a dom element using the document html js.object
func DOMObjectToList ¶
DOMObjectToList takes a jsobjects and returns a list of internal objects by calling the item method
func EmptyTextNode ¶
EmptyTextNode returns two bool values, the first indicating if its a text node and the second indicating if the text node is empty
func GetAttribute ¶
GetAttribute returns a string if a key exists using the jsobject
func GetDocument ¶
GetDocument returns the document js.object from the global window object
func HasAttribute ¶
HasAttribute returns true/false if a key exists using the jsobject
func InsertBefore ¶
InsertBefore inserts the inserto before the guage object with the target
func IsEqualNode ¶
IsEqualNode returns a false/true if the nodes are equal in the eyes of the dom
func QuerySelector ¶
QuerySelector returns the result of querySelector on an object
func QuerySelectorAll ¶
QuerySelectorAll returns the result of querySelectorAll on an object
func RemoveChild ¶
RemoveChild takes a target and a list of children to remove
func ReplaceNode ¶
ReplaceNode replaces two unequal nodes using their parents
func SetAttribute ¶
SetAttribute calls setAttribute on the js object with the value and key
func SetInnerHTML ¶
SetInnerHTML calls the innerHTML setter with the given string
func SpecialAppendChild ¶
SpecialAppendChild takes a list of objects and calls appendNode on the given object, but checks if the objects contain an unknownelement with a text tag then strip the tagname and only apply its content
func UnWrapSpecialTextElements ¶
UnWrapSpecialTextElements takes a dom object and unwraps all the Text UnknownELement within the lists
Types ¶
This section is empty.