jsutils

package
v0.0.0-...-a33cf17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package jsutils contains dom level helper functions for Haiku(https://github.com/influx6/haiku)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendChild

func AppendChild(o *js.Object, osets ...*js.Object)

AppendChild takes a list of objects and calls appendNode on the given object

func Attributes

func Attributes(co *js.Object) map[string]string

Attributes takes a js object and extracts the attribute lists from it

func ChildNodeList

func ChildNodeList(o *js.Object) []*js.Object

ChildNodeList returns the nodes list of the childNodes of the js object

func CleanAllTextNode

func CleanAllTextNode(o *js.Object)

CleanAllTextNode removes all texts nodes within the container root

func CreateDocumentFragment

func CreateDocumentFragment() *js.Object

CreateDocumentFragment creates a dom documentFragment using the document html js.object

func CreateElement

func CreateElement(tag string) *js.Object

CreateElement creates a dom element using the document html js.object

func DOMObjectToList

func DOMObjectToList(o *js.Object) []*js.Object

DOMObjectToList takes a jsobjects and returns a list of internal objects by calling the item method

func EmptyTextNode

func EmptyTextNode(o *js.Object) (bool, bool)

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

func GetAttribute(o *js.Object, key string) string

GetAttribute returns a string if a key exists using the jsobject

func GetDocument

func GetDocument() *js.Object

GetDocument returns the document js.object from the global window object

func GetTag

func GetTag(o *js.Object) string

GetTag returns the tag of the js object

func GetWindow

func GetWindow() *js.Object

GetWindow returns the global object which is the window in the browser

func HasAttribute

func HasAttribute(o *js.Object, key string) bool

HasAttribute returns true/false if a key exists using the jsobject

func InsertBefore

func InsertBefore(target, guage, inserto *js.Object)

InsertBefore inserts the inserto before the guage object with the target

func IsEqualNode

func IsEqualNode(newNode, oldNode *js.Object) bool

IsEqualNode returns a false/true if the nodes are equal in the eyes of the dom

func QuerySelector

func QuerySelector(o *js.Object, sel string) *js.Object

QuerySelector returns the result of querySelector on an object

func QuerySelectorAll

func QuerySelectorAll(o *js.Object, sel string) []*js.Object

QuerySelectorAll returns the result of querySelectorAll on an object

func RemoveChild

func RemoveChild(o *js.Object, co ...*js.Object)

RemoveChild takes a target and a list of children to remove

func ReplaceNode

func ReplaceNode(target, newNode, oldNode *js.Object)

ReplaceNode replaces two unequal nodes using their parents

func SetAttribute

func SetAttribute(o *js.Object, key string, value string)

SetAttribute calls setAttribute on the js object with the value and key

func SetInnerHTML

func SetInnerHTML(o *js.Object, html string)

SetInnerHTML calls the innerHTML setter with the given string

func SpecialAppendChild

func SpecialAppendChild(o *js.Object, osets ...*js.Object)

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

func UnWrapSpecialTextElements(o *js.Object)

UnWrapSpecialTextElements takes a dom object and unwraps all the Text UnknownELement within the lists

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL