tinydom

package module
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 3 Imported by: 17

README

TinyDom

TinyGo compatible DOM manipulation library. For use in WASM

This library is heavily based on godom. It was changed to be usable in TinyGo projects.

TinyDom wraps nearly every function of syscall/js.

Also TimyDom provides some wrapper around html elements, like the following:

  • form
  • input
  • label
  • output
  • fieldset
  • video

Example Usage

package main

import (
package main

import (
 "github.com/Nerzal/tinydom"
 "github.com/Nerzal/tinydom/elements/form"
 "github.com/Nerzal/tinydom/elements/input"
)

func main() {
 document := tinydom.GetDocument()

 body := document.GetElementById("body-component")

 h1 := document.CreateElement("h1")
 h1.SetInnerHTML("Welcome to tinydom - Hello TinyWorld <3")
 body.AppendChild(h1)

 h2 := document.CreateElement("h1")
 h2.SetInnerHTML("Yes! I do compile with TinyGo!")
 body.AppendChild(h2)

 br := document.CreateElement("br")
 body.AppendChild(br)

 body.AppendChild(br)

 myForm := form.New()
 label := document.CreateElement("label")
 label.SetInnerHTML("Name:")
 textInput := input.NewTextInput()

 passwordLabel := document.CreateElement("label")
 passwordLabel.SetInnerHTML("Password:")
 passwordInput := input.New(input.PasswordInput)

 submitInput := input.New(input.SubmitInput)

 err := myForm.Append(label, textInput.Element, passwordLabel, passwordInput.Element, submitInput.Element)
 if err != nil {
  println(err.Error())
 }

 body.AppendChild(myForm.Element)

 wait := make(chan struct{}, 0)
 <-wait
}

}

Run the example

Simply use the makefile :)

make example-app

Note: The example uses a wasm_exec.js from tinygo 1.17 :)

Example Result

grafik

Example Video is Big Buck Bunny from blender

Example Video License: https://creativecommons.org/licenses/by/3.0/

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClassAlreadyExisting = errors.New("tried to append class multiple times")

ErrClassAlreadyExisting is being thrown when trying to append the same class multiple times

View Source
var LocalStorage = &Storage{GetWindow().Get("localStorage")}
View Source
var SessionStorage = &Storage{GetWindow().Get("sessionStorage")}

Functions

This section is empty.

Types

type CSS

type CSS struct {
	js.Value
}

func (*CSS) AlignContent

func (s *CSS) AlignContent() string

func (*CSS) AlignItems

func (s *CSS) AlignItems() string

func (*CSS) AlignSelf

func (s *CSS) AlignSelf() string

func (*CSS) Animation

func (s *CSS) Animation() string

func (*CSS) AnimationDelay

func (s *CSS) AnimationDelay() string

func (*CSS) AnimationDirection

func (s *CSS) AnimationDirection() string

func (*CSS) AnimationDuration

func (s *CSS) AnimationDuration() string

func (*CSS) AnimationFillMode

func (s *CSS) AnimationFillMode() string

func (*CSS) AnimationIterationCount

func (s *CSS) AnimationIterationCount() string

func (*CSS) AnimationName

func (s *CSS) AnimationName() string

func (*CSS) AnimationPlayState

func (s *CSS) AnimationPlayState() string

func (*CSS) AnimationTimingFunction

func (s *CSS) AnimationTimingFunction() string

func (*CSS) BackfaceVisibility

func (s *CSS) BackfaceVisibility() string

func (*CSS) Background

func (s *CSS) Background() string

func (*CSS) BackgroundAttachment

func (s *CSS) BackgroundAttachment() string

func (*CSS) BackgroundClip

func (s *CSS) BackgroundClip() string

func (*CSS) BackgroundColor

func (s *CSS) BackgroundColor() string

func (*CSS) BackgroundImage

func (s *CSS) BackgroundImage() string

func (*CSS) BackgroundOrigin

func (s *CSS) BackgroundOrigin() string

func (*CSS) BackgroundPosition

func (s *CSS) BackgroundPosition() string

func (*CSS) BackgroundRepeat

func (s *CSS) BackgroundRepeat() string

func (*CSS) BackgroundSize

func (s *CSS) BackgroundSize() string

func (*CSS) Border

func (s *CSS) Border() string

func (*CSS) BorderBottom

func (s *CSS) BorderBottom() string

func (*CSS) BorderBottomColor

func (s *CSS) BorderBottomColor() string

func (*CSS) BorderBottomLeftRadius

func (s *CSS) BorderBottomLeftRadius() string

func (*CSS) BorderBottomRightRadius

func (s *CSS) BorderBottomRightRadius() string

func (*CSS) BorderBottomStyle

func (s *CSS) BorderBottomStyle() string

func (*CSS) BorderBottomWidth

func (s *CSS) BorderBottomWidth() string

func (*CSS) BorderCollapse

func (s *CSS) BorderCollapse() string

func (*CSS) BorderColor

func (s *CSS) BorderColor() string

func (*CSS) BorderImage

func (s *CSS) BorderImage() string

func (*CSS) BorderImageOutset

func (s *CSS) BorderImageOutset() string

func (*CSS) BorderImageRepeat

func (s *CSS) BorderImageRepeat() string

func (*CSS) BorderImageSlice

func (s *CSS) BorderImageSlice() string

func (*CSS) BorderImageSource

func (s *CSS) BorderImageSource() string

func (*CSS) BorderImageWidth

func (s *CSS) BorderImageWidth() string

func (*CSS) BorderLeft

func (s *CSS) BorderLeft() string

func (*CSS) BorderLeftColor

func (s *CSS) BorderLeftColor() string

func (*CSS) BorderLeftStyle

func (s *CSS) BorderLeftStyle() string

func (*CSS) BorderLeftWidth

func (s *CSS) BorderLeftWidth() string

func (*CSS) BorderRadius

func (s *CSS) BorderRadius() string

func (*CSS) BorderRight

func (s *CSS) BorderRight() string

func (*CSS) BorderRightColor

func (s *CSS) BorderRightColor() string

func (*CSS) BorderRightStyle

func (s *CSS) BorderRightStyle() string

func (*CSS) BorderRightWidth

func (s *CSS) BorderRightWidth() string

func (*CSS) BorderSpacing

func (s *CSS) BorderSpacing() string

func (*CSS) BorderStyle

func (s *CSS) BorderStyle() string

func (*CSS) BorderTop

func (s *CSS) BorderTop() string

func (*CSS) BorderTopColor

func (s *CSS) BorderTopColor() string

func (*CSS) BorderTopLeftRadius

func (s *CSS) BorderTopLeftRadius() string

func (*CSS) BorderTopRightRadius

func (s *CSS) BorderTopRightRadius() string

func (*CSS) BorderTopStyle

func (s *CSS) BorderTopStyle() string

func (*CSS) BorderTopWidth

func (s *CSS) BorderTopWidth() string

func (*CSS) BorderWidth

func (s *CSS) BorderWidth() string

func (*CSS) Bottom

func (s *CSS) Bottom() string

func (*CSS) BoxShadow

func (s *CSS) BoxShadow() string

func (*CSS) BoxSizing

func (s *CSS) BoxSizing() string

func (*CSS) CaptionSide

func (s *CSS) CaptionSide() string

func (*CSS) Clear

func (s *CSS) Clear() string

func (*CSS) Clip

func (s *CSS) Clip() string

func (*CSS) Color

func (s *CSS) Color() string

func (*CSS) ColumnCount

func (s *CSS) ColumnCount() string

func (*CSS) ColumnFill

func (s *CSS) ColumnFill() string

func (*CSS) ColumnGap

func (s *CSS) ColumnGap() string

func (*CSS) ColumnRule

func (s *CSS) ColumnRule() string

func (*CSS) ColumnRuleColor

func (s *CSS) ColumnRuleColor() string

func (*CSS) ColumnRuleStyle

func (s *CSS) ColumnRuleStyle() string

func (*CSS) ColumnRuleWidth

func (s *CSS) ColumnRuleWidth() string

func (*CSS) ColumnSpan

func (s *CSS) ColumnSpan() string

func (*CSS) ColumnWidth

func (s *CSS) ColumnWidth() string

func (*CSS) Columns

func (s *CSS) Columns() string

func (*CSS) CounterIncrement

func (s *CSS) CounterIncrement() string

func (*CSS) CounterReset

func (s *CSS) CounterReset() string

func (*CSS) CssFloat

func (s *CSS) CssFloat() string

func (*CSS) CssText

func (s *CSS) CssText() string

func (*CSS) Cursor

func (s *CSS) Cursor() string

func (*CSS) Direction

func (s *CSS) Direction() string

func (*CSS) Display

func (s *CSS) Display() string

func (*CSS) EmptyCells

func (s *CSS) EmptyCells() string

func (*CSS) Filter

func (s *CSS) Filter() string

func (*CSS) Flex

func (s *CSS) Flex() string

func (*CSS) FlexBasis

func (s *CSS) FlexBasis() string

func (*CSS) FlexDirection

func (s *CSS) FlexDirection() string

func (*CSS) FlexFlow

func (s *CSS) FlexFlow() string

func (*CSS) FlexGrow

func (s *CSS) FlexGrow() string

func (*CSS) FlexShrink

func (s *CSS) FlexShrink() string

func (*CSS) FlexWrap

func (s *CSS) FlexWrap() string

func (*CSS) Font

func (s *CSS) Font() string

func (*CSS) FontFamily

func (s *CSS) FontFamily() string

func (*CSS) FontSize

func (s *CSS) FontSize() string

func (*CSS) FontSizeAdjust

func (s *CSS) FontSizeAdjust() string

func (*CSS) FontStyle

func (s *CSS) FontStyle() string

func (*CSS) FontVariant

func (s *CSS) FontVariant() string

func (*CSS) FontWeight

func (s *CSS) FontWeight() string

func (*CSS) Height

func (s *CSS) Height() string

func (*CSS) JustifyContent

func (s *CSS) JustifyContent() string

func (*CSS) Left

func (s *CSS) Left() string

func (*CSS) Length

func (s *CSS) Length() int

func (*CSS) LetterSpacing

func (s *CSS) LetterSpacing() string

func (*CSS) LineHeight

func (s *CSS) LineHeight() string

func (*CSS) ListStyle

func (s *CSS) ListStyle() string

func (*CSS) ListStyleImage

func (s *CSS) ListStyleImage() string

func (*CSS) ListStylePosition

func (s *CSS) ListStylePosition() string

func (*CSS) ListStyleType

func (s *CSS) ListStyleType() string

func (*CSS) Margin

func (s *CSS) Margin() string

func (*CSS) MarginBottom

func (s *CSS) MarginBottom() string

func (*CSS) MarginLeft

func (s *CSS) MarginLeft() string

func (*CSS) MarginRight

func (s *CSS) MarginRight() string

func (*CSS) MarginTop

func (s *CSS) MarginTop() string

func (*CSS) MaxHeight

func (s *CSS) MaxHeight() string

func (*CSS) MaxWidth

func (s *CSS) MaxWidth() string

func (*CSS) MinHeight

func (s *CSS) MinHeight() string

func (*CSS) MinWidth

func (s *CSS) MinWidth() string

func (*CSS) Opacity

func (s *CSS) Opacity() string

func (*CSS) Order

func (s *CSS) Order() string

func (*CSS) Orphans

func (s *CSS) Orphans() string

func (*CSS) Outline

func (s *CSS) Outline() string

func (*CSS) OutlineColor

func (s *CSS) OutlineColor() string

func (*CSS) OutlineOffset

func (s *CSS) OutlineOffset() string

func (*CSS) OutlineStyle

func (s *CSS) OutlineStyle() string

func (*CSS) OutlineWidth

func (s *CSS) OutlineWidth() string

func (*CSS) Overflow

func (s *CSS) Overflow() string

func (*CSS) OverflowX

func (s *CSS) OverflowX() string

func (*CSS) OverflowY

func (s *CSS) OverflowY() string

func (*CSS) Padding

func (s *CSS) Padding() string

func (*CSS) PaddingBottom

func (s *CSS) PaddingBottom() string

func (*CSS) PaddingLeft

func (s *CSS) PaddingLeft() string

func (*CSS) PaddingRight

func (s *CSS) PaddingRight() string

func (*CSS) PaddingTop

func (s *CSS) PaddingTop() string

func (*CSS) PageBreakAfter

func (s *CSS) PageBreakAfter() string

func (*CSS) PageBreakBefore

func (s *CSS) PageBreakBefore() string

func (*CSS) PageBreakInside

func (s *CSS) PageBreakInside() string

func (*CSS) Perspective

func (s *CSS) Perspective() string

func (*CSS) PerspectiveOrigin

func (s *CSS) PerspectiveOrigin() string

func (*CSS) Position

func (s *CSS) Position() string

func (*CSS) Quotes

func (s *CSS) Quotes() string

func (*CSS) Resize

func (s *CSS) Resize() string

func (*CSS) Right

func (s *CSS) Right() string

func (*CSS) SetAlignContent

func (s *CSS) SetAlignContent(v string)

func (*CSS) SetAlignItems

func (s *CSS) SetAlignItems(v string)

func (*CSS) SetAlignSelf

func (s *CSS) SetAlignSelf(v string)

func (*CSS) SetAnimation

func (s *CSS) SetAnimation(v string)

func (*CSS) SetAnimationDelay

func (s *CSS) SetAnimationDelay(v string)

func (*CSS) SetAnimationDirection

func (s *CSS) SetAnimationDirection(v string)

func (*CSS) SetAnimationDuration

func (s *CSS) SetAnimationDuration(v string)

func (*CSS) SetAnimationFillMode

func (s *CSS) SetAnimationFillMode(v string)

func (*CSS) SetAnimationIterationCount

func (s *CSS) SetAnimationIterationCount(v string)

func (*CSS) SetAnimationName

func (s *CSS) SetAnimationName(v string)

func (*CSS) SetAnimationPlayState

func (s *CSS) SetAnimationPlayState(v string)

func (*CSS) SetAnimationTimingFunction

func (s *CSS) SetAnimationTimingFunction(v string)

func (*CSS) SetBackfaceVisibility

func (s *CSS) SetBackfaceVisibility(v string)

func (*CSS) SetBackground

func (s *CSS) SetBackground(v string)

func (*CSS) SetBackgroundAttachment

func (s *CSS) SetBackgroundAttachment(v string)

func (*CSS) SetBackgroundClip

func (s *CSS) SetBackgroundClip(v string)

func (*CSS) SetBackgroundColor

func (s *CSS) SetBackgroundColor(v string)

func (*CSS) SetBackgroundImage

func (s *CSS) SetBackgroundImage(v string)

func (*CSS) SetBackgroundOrigin

func (s *CSS) SetBackgroundOrigin(v string)

func (*CSS) SetBackgroundPosition

func (s *CSS) SetBackgroundPosition(v string)

func (*CSS) SetBackgroundRepeat

func (s *CSS) SetBackgroundRepeat(v string)

func (*CSS) SetBackgroundSize

func (s *CSS) SetBackgroundSize(v string)

func (*CSS) SetBorder

func (s *CSS) SetBorder(v string)

func (*CSS) SetBorderBottom

func (s *CSS) SetBorderBottom(v string)

func (*CSS) SetBorderBottomColor

func (s *CSS) SetBorderBottomColor(v string)

func (*CSS) SetBorderBottomLeftRadius

func (s *CSS) SetBorderBottomLeftRadius(v string)

func (*CSS) SetBorderBottomRightRadius

func (s *CSS) SetBorderBottomRightRadius(v string)

func (*CSS) SetBorderBottomStyle

func (s *CSS) SetBorderBottomStyle(v string)

func (*CSS) SetBorderBottomWidth

func (s *CSS) SetBorderBottomWidth(v string)

func (*CSS) SetBorderCollapse

func (s *CSS) SetBorderCollapse(v string)

func (*CSS) SetBorderColor

func (s *CSS) SetBorderColor(v string)

func (*CSS) SetBorderImage

func (s *CSS) SetBorderImage(v string)

func (*CSS) SetBorderImageOutset

func (s *CSS) SetBorderImageOutset(v string)

func (*CSS) SetBorderImageRepeat

func (s *CSS) SetBorderImageRepeat(v string)

func (*CSS) SetBorderImageSlice

func (s *CSS) SetBorderImageSlice(v string)

func (*CSS) SetBorderImageSource

func (s *CSS) SetBorderImageSource(v string)

func (*CSS) SetBorderImageWidth

func (s *CSS) SetBorderImageWidth(v string)

func (*CSS) SetBorderLeft

func (s *CSS) SetBorderLeft(v string)

func (*CSS) SetBorderLeftColor

func (s *CSS) SetBorderLeftColor(v string)

func (*CSS) SetBorderLeftStyle

func (s *CSS) SetBorderLeftStyle(v string)

func (*CSS) SetBorderLeftWidth

func (s *CSS) SetBorderLeftWidth(v string)

func (*CSS) SetBorderRadius

func (s *CSS) SetBorderRadius(v string)

func (*CSS) SetBorderRight

func (s *CSS) SetBorderRight(v string)

func (*CSS) SetBorderRightColor

func (s *CSS) SetBorderRightColor(v string)

func (*CSS) SetBorderRightStyle

func (s *CSS) SetBorderRightStyle(v string)

func (*CSS) SetBorderRightWidth

func (s *CSS) SetBorderRightWidth(v string)

func (*CSS) SetBorderSpacing

func (s *CSS) SetBorderSpacing(v string)

func (*CSS) SetBorderStyle

func (s *CSS) SetBorderStyle(v string)

func (*CSS) SetBorderTop

func (s *CSS) SetBorderTop(v string)

func (*CSS) SetBorderTopColor

func (s *CSS) SetBorderTopColor(v string)

func (*CSS) SetBorderTopLeftRadius

func (s *CSS) SetBorderTopLeftRadius(v string)

func (*CSS) SetBorderTopRightRadius

func (s *CSS) SetBorderTopRightRadius(v string)

func (*CSS) SetBorderTopStyle

func (s *CSS) SetBorderTopStyle(v string)

func (*CSS) SetBorderTopWidth

func (s *CSS) SetBorderTopWidth(v string)

func (*CSS) SetBorderWidth

func (s *CSS) SetBorderWidth(v string)

func (*CSS) SetBottom

func (s *CSS) SetBottom(v string)

func (*CSS) SetBoxShadow

func (s *CSS) SetBoxShadow(v string)

func (*CSS) SetBoxSizing

func (s *CSS) SetBoxSizing(v string)

func (*CSS) SetCaptionSide

func (s *CSS) SetCaptionSide(v string)

func (*CSS) SetClear

func (s *CSS) SetClear(v string)

func (*CSS) SetClip

func (s *CSS) SetClip(v string)

func (*CSS) SetColor

func (s *CSS) SetColor(v string)

func (*CSS) SetColumnCount

func (s *CSS) SetColumnCount(v string)

func (*CSS) SetColumnFill

func (s *CSS) SetColumnFill(v string)

func (*CSS) SetColumnGap

func (s *CSS) SetColumnGap(v string)

func (*CSS) SetColumnRule

func (s *CSS) SetColumnRule(v string)

func (*CSS) SetColumnRuleColor

func (s *CSS) SetColumnRuleColor(v string)

func (*CSS) SetColumnRuleStyle

func (s *CSS) SetColumnRuleStyle(v string)

func (*CSS) SetColumnRuleWidth

func (s *CSS) SetColumnRuleWidth(v string)

func (*CSS) SetColumnSpan

func (s *CSS) SetColumnSpan(v string)

func (*CSS) SetColumnWidth

func (s *CSS) SetColumnWidth(v string)

func (*CSS) SetColumns

func (s *CSS) SetColumns(v string)

func (*CSS) SetCounterIncrement

func (s *CSS) SetCounterIncrement(v string)

func (*CSS) SetCounterReset

func (s *CSS) SetCounterReset(v string)

func (*CSS) SetCssFloat

func (s *CSS) SetCssFloat(v string)

func (*CSS) SetCursor

func (s *CSS) SetCursor(v string)

func (*CSS) SetDirection

func (s *CSS) SetDirection(v string)

func (*CSS) SetDisplay

func (s *CSS) SetDisplay(v string)

func (*CSS) SetEmptyCells

func (s *CSS) SetEmptyCells(v string)

func (*CSS) SetFilter

func (s *CSS) SetFilter(v string)

func (*CSS) SetFlex

func (s *CSS) SetFlex(v string)

func (*CSS) SetFlexBasis

func (s *CSS) SetFlexBasis(v string)

func (*CSS) SetFlexDirection

func (s *CSS) SetFlexDirection(v string)

func (*CSS) SetFlexFlow

func (s *CSS) SetFlexFlow(v string)

func (*CSS) SetFlexGrow

func (s *CSS) SetFlexGrow(v string)

func (*CSS) SetFlexShrink

func (s *CSS) SetFlexShrink(v string)

func (*CSS) SetFlexWrap

func (s *CSS) SetFlexWrap(v string)

func (*CSS) SetFont

func (s *CSS) SetFont(v string)

func (*CSS) SetFontFamily

func (s *CSS) SetFontFamily(v string)

func (*CSS) SetFontSize

func (s *CSS) SetFontSize(v string)

func (*CSS) SetFontSizeAdjust

func (s *CSS) SetFontSizeAdjust(v string)

func (*CSS) SetFontStyle

func (s *CSS) SetFontStyle(v string)

func (*CSS) SetFontVariant

func (s *CSS) SetFontVariant(v string)

func (*CSS) SetFontWeight

func (s *CSS) SetFontWeight(v string)

func (*CSS) SetHeight

func (s *CSS) SetHeight(v string)

func (*CSS) SetJustifyContent

func (s *CSS) SetJustifyContent(v string)

func (*CSS) SetLeft

func (s *CSS) SetLeft(v string)

func (*CSS) SetLetterSpacing

func (s *CSS) SetLetterSpacing(v string)

func (*CSS) SetLineHeight

func (s *CSS) SetLineHeight(v string)

func (*CSS) SetListStyle

func (s *CSS) SetListStyle(v string)

func (*CSS) SetListStyleImage

func (s *CSS) SetListStyleImage(v string)

func (*CSS) SetListStylePosition

func (s *CSS) SetListStylePosition(v string)

func (*CSS) SetListStyleType

func (s *CSS) SetListStyleType(v string)

func (*CSS) SetMargin

func (s *CSS) SetMargin(v string)

func (*CSS) SetMarginBottom

func (s *CSS) SetMarginBottom(v string)

func (*CSS) SetMarginLeft

func (s *CSS) SetMarginLeft(v string)

func (*CSS) SetMarginRight

func (s *CSS) SetMarginRight(v string)

func (*CSS) SetMarginTop

func (s *CSS) SetMarginTop(v string)

func (*CSS) SetMaxHeight

func (s *CSS) SetMaxHeight(v string)

func (*CSS) SetMaxWidth

func (s *CSS) SetMaxWidth(v string)

func (*CSS) SetMinHeight

func (s *CSS) SetMinHeight(v string)

func (*CSS) SetMinWidth

func (s *CSS) SetMinWidth(v string)

func (*CSS) SetOpacity

func (s *CSS) SetOpacity(v string)

func (*CSS) SetOrder

func (s *CSS) SetOrder(v string)

func (*CSS) SetOrphans

func (s *CSS) SetOrphans(v string)

func (*CSS) SetOutline

func (s *CSS) SetOutline(v string)

func (*CSS) SetOutlineColor

func (s *CSS) SetOutlineColor(v string)

func (*CSS) SetOutlineOffset

func (s *CSS) SetOutlineOffset(v string)

func (*CSS) SetOutlineStyle

func (s *CSS) SetOutlineStyle(v string)

func (*CSS) SetOutlineWidth

func (s *CSS) SetOutlineWidth(v string)

func (*CSS) SetOverflow

func (s *CSS) SetOverflow(v string)

func (*CSS) SetOverflowX

func (s *CSS) SetOverflowX(v string)

func (*CSS) SetOverflowY

func (s *CSS) SetOverflowY(v string)

func (*CSS) SetPadding

func (s *CSS) SetPadding(v string)

func (*CSS) SetPaddingBottom

func (s *CSS) SetPaddingBottom(v string)

func (*CSS) SetPaddingLeft

func (s *CSS) SetPaddingLeft(v string)

func (*CSS) SetPaddingRight

func (s *CSS) SetPaddingRight(v string)

func (*CSS) SetPaddingTop

func (s *CSS) SetPaddingTop(v string)

func (*CSS) SetPageBreakAfter

func (s *CSS) SetPageBreakAfter(v string)

func (*CSS) SetPageBreakBefore

func (s *CSS) SetPageBreakBefore(v string)

func (*CSS) SetPageBreakInside

func (s *CSS) SetPageBreakInside(v string)

func (*CSS) SetPerspective

func (s *CSS) SetPerspective(v string)

func (*CSS) SetPerspectiveOrigin

func (s *CSS) SetPerspectiveOrigin(v string)

func (*CSS) SetPosition

func (s *CSS) SetPosition(v string)

func (*CSS) SetQuotes

func (s *CSS) SetQuotes(v string)

func (*CSS) SetResize

func (s *CSS) SetResize(v string)

func (*CSS) SetRight

func (s *CSS) SetRight(v string)

func (*CSS) SetTabSize

func (s *CSS) SetTabSize(v string)

func (*CSS) SetTableLayout

func (s *CSS) SetTableLayout(v string)

func (*CSS) SetTextAlign

func (s *CSS) SetTextAlign(v string)

func (*CSS) SetTextAlignLast

func (s *CSS) SetTextAlignLast(v string)

func (*CSS) SetTextDecoration

func (s *CSS) SetTextDecoration(v string)

func (*CSS) SetTextDecorationColor

func (s *CSS) SetTextDecorationColor(v string)

func (*CSS) SetTextDecorationLine

func (s *CSS) SetTextDecorationLine(v string)

func (*CSS) SetTextDecorationStyle

func (s *CSS) SetTextDecorationStyle(v string)

func (*CSS) SetTextIndent

func (s *CSS) SetTextIndent(v string)

func (*CSS) SetTextOverflow

func (s *CSS) SetTextOverflow(v string)

func (*CSS) SetTextShadow

func (s *CSS) SetTextShadow(v string)

func (*CSS) SetTextTransform

func (s *CSS) SetTextTransform(v string)

func (*CSS) SetTop

func (s *CSS) SetTop(v string)

func (*CSS) SetTransform

func (s *CSS) SetTransform(v string)

func (*CSS) SetTransformOrigin

func (s *CSS) SetTransformOrigin(v string)

func (*CSS) SetTransformStyle

func (s *CSS) SetTransformStyle(v string)

func (*CSS) SetTransition

func (s *CSS) SetTransition(v string)

func (*CSS) SetTransitionDelay

func (s *CSS) SetTransitionDelay(v string)

func (*CSS) SetTransitionDuration

func (s *CSS) SetTransitionDuration(v string)

func (*CSS) SetTransitionProperty

func (s *CSS) SetTransitionProperty(v string)

func (*CSS) SetTransitionTimingFunction

func (s *CSS) SetTransitionTimingFunction(v string)

func (*CSS) SetUnicodeBidi

func (s *CSS) SetUnicodeBidi(v string)

func (*CSS) SetUserSelect

func (s *CSS) SetUserSelect(v string)

func (*CSS) SetVerticalAlign

func (s *CSS) SetVerticalAlign(v string)

func (*CSS) SetVisibility

func (s *CSS) SetVisibility(v string)

func (*CSS) SetWhiteSpace

func (s *CSS) SetWhiteSpace(v string)

func (*CSS) SetWidows

func (s *CSS) SetWidows(v string)

func (*CSS) SetWidth

func (s *CSS) SetWidth(v string)

func (*CSS) SetWordBreak

func (s *CSS) SetWordBreak(v string)

func (*CSS) SetWordSpacing

func (s *CSS) SetWordSpacing(v string)

func (*CSS) SetWordWrap

func (s *CSS) SetWordWrap(v string)

func (*CSS) SetZIndex

func (s *CSS) SetZIndex(v string)

func (*CSS) TabSize

func (s *CSS) TabSize() string

func (*CSS) TableLayout

func (s *CSS) TableLayout() string

func (*CSS) TextAlign

func (s *CSS) TextAlign() string

func (*CSS) TextAlignLast

func (s *CSS) TextAlignLast() string

func (*CSS) TextDecoration

func (s *CSS) TextDecoration() string

func (*CSS) TextDecorationColor

func (s *CSS) TextDecorationColor() string

func (*CSS) TextDecorationLine

func (s *CSS) TextDecorationLine() string

func (*CSS) TextDecorationStyle

func (s *CSS) TextDecorationStyle() string

func (*CSS) TextIndent

func (s *CSS) TextIndent() string

func (*CSS) TextOverflow

func (s *CSS) TextOverflow() string

func (*CSS) TextShadow

func (s *CSS) TextShadow() string

func (*CSS) TextTransform

func (s *CSS) TextTransform() string

func (*CSS) Top

func (s *CSS) Top() string

func (*CSS) Transform

func (s *CSS) Transform() string

func (*CSS) TransformOrigin

func (s *CSS) TransformOrigin() string

func (*CSS) TransformStyle

func (s *CSS) TransformStyle() string

func (*CSS) Transition

func (s *CSS) Transition() string

func (*CSS) TransitionDelay

func (s *CSS) TransitionDelay() string

func (*CSS) TransitionDuration

func (s *CSS) TransitionDuration() string

func (*CSS) TransitionProperty

func (s *CSS) TransitionProperty() string

func (*CSS) TransitionTimingFunction

func (s *CSS) TransitionTimingFunction() string

func (*CSS) UnicodeBidi

func (s *CSS) UnicodeBidi() string

func (*CSS) UserSelect

func (s *CSS) UserSelect() string

func (*CSS) VerticalAlign

func (s *CSS) VerticalAlign() string

func (*CSS) Visibility

func (s *CSS) Visibility() string

func (*CSS) WhiteSpace

func (s *CSS) WhiteSpace() string

func (*CSS) Widows

func (s *CSS) Widows() string

func (*CSS) Width

func (s *CSS) Width() string

func (*CSS) WordBreak

func (s *CSS) WordBreak() string

func (*CSS) WordSpacing

func (s *CSS) WordSpacing() string

func (*CSS) WordWrap

func (s *CSS) WordWrap() string

func (*CSS) ZIndex

func (s *CSS) ZIndex() string

type DOMTokenList

type DOMTokenList struct {
	js.Value
}

func (*DOMTokenList) Add

func (t *DOMTokenList) Add(s string)

func (*DOMTokenList) Contains

func (t *DOMTokenList) Contains(s string) bool

func (*DOMTokenList) Length

func (t *DOMTokenList) Length() int

func (*DOMTokenList) Remove

func (t *DOMTokenList) Remove(s string)

func (*DOMTokenList) Toggle

func (t *DOMTokenList) Toggle(s string)

type Document

type Document struct {
	js.Value
}

Document wraps the JavaScript document element, which is usually fetched by js.Global().Get("document")

func GetDocument

func GetDocument() *Document

func (*Document) ActiveElement

func (e *Document) ActiveElement() *Element

func (*Document) CreateDocumentFragment added in v0.0.15

func (d *Document) CreateDocumentFragment() *Element

func (*Document) CreateElement

func (d *Document) CreateElement(tag string) *Element

func (*Document) CreateTextNode

func (d *Document) CreateTextNode(textContent string) *Element

func (*Document) DocumentElement

func (e *Document) DocumentElement() *Element

func (*Document) GetElementById

func (d *Document) GetElementById(id string) *Element

func (*Document) Write

func (d *Document) Write(markup string)

type Element

type Element struct {
	js.Value
}

func (*Element) AddEventListener added in v0.0.2

func (e *Element) AddEventListener(t string, listener js.Func) *Element

func (*Element) AppendAfter

func (e *Element) AppendAfter(n *Element)

func (*Element) AppendBefore

func (e *Element) AppendBefore(n *Element)

func (*Element) AppendChild

func (e *Element) AppendChild(child *Element)

func (*Element) AppendChildBr

func (e *Element) AppendChildBr(child *Element)

AppendChildBr appends the child and adds an additional br

func (*Element) AppendChildren added in v0.0.3

func (e *Element) AppendChildren(children ...*Element)

func (*Element) AppendChildrenBr added in v0.0.3

func (e *Element) AppendChildrenBr(children ...*Element)

func (*Element) AppendClass added in v0.0.11

func (e *Element) AppendClass(values ...string) error

func (*Element) Blur added in v0.0.2

func (e *Element) Blur() *Element

func (*Element) Br added in v0.0.3

func (e *Element) Br()

func (*Element) ChildNodes

func (e *Element) ChildNodes() []*Element

func (*Element) Class added in v0.0.10

func (e *Element) Class() (bool, []string)

func (*Element) Contains

func (e *Element) Contains(n *Element) bool

func (*Element) Dataset added in v0.0.2

func (e *Element) Dataset() *Element

func (*Element) FindChildNode added in v0.0.3

func (e *Element) FindChildNode(tag string) *Element

func (*Element) FirstChild

func (e *Element) FirstChild() *Element

func (*Element) Focus added in v0.0.2

func (e *Element) Focus() *Element

func (*Element) GetAttribute

func (e *Element) GetAttribute(name string) (bool, string)

GetAttribute returns the searched attribute, returns false if the attribute wasn't found.

func (*Element) GetElementsByTagName

func (e *Element) GetElementsByTagName(tagName string) []*Element

func (*Element) HasAttribute

func (e *Element) HasAttribute(name string) bool

func (*Element) HasChildNodes

func (e *Element) HasChildNodes() bool

func (*Element) HasFocus

func (e *Element) HasFocus() bool

func (*Element) InnerHTML

func (e *Element) InnerHTML() string

func (*Element) InsertBefore

func (e *Element) InsertBefore(newNode, referenceNode *Element) *Element

func (*Element) IsEqualNode

func (e *Element) IsEqualNode(n *Element) bool

func (*Element) IsSameNode

func (e *Element) IsSameNode(n *Element) bool

func (*Element) LastChild

func (e *Element) LastChild() *Element

func (*Element) LookupPrefix

func (e *Element) LookupPrefix() string

func (*Element) Name added in v0.0.3

func (e *Element) Name() string

func (*Element) NextSibling

func (e *Element) NextSibling() *Element

func (*Element) NodeType

func (e *Element) NodeType() int

func (*Element) NodeValue

func (e *Element) NodeValue() string

func (*Element) Normalize

func (e *Element) Normalize()

func (*Element) OuterHTML

func (e *Element) OuterHTML() string

func (*Element) ParentNode

func (e *Element) ParentNode() *Element

func (*Element) QuerySelector

func (e *Element) QuerySelector(selectors string) *Element

func (*Element) QuerySelectorAll

func (e *Element) QuerySelectorAll(selectors string) []*Element

func (*Element) RemoveAllChildNodes

func (e *Element) RemoveAllChildNodes()

func (*Element) RemoveChild

func (e *Element) RemoveChild(c *Element) *Element

func (*Element) RemoveEventListener added in v0.0.2

func (e *Element) RemoveEventListener(t string, listener js.Func) *Element

func (*Element) ReplaceChild

func (e *Element) ReplaceChild(newChild, oldChild *Element) *Element

func (*Element) SetAttribute

func (e *Element) SetAttribute(key, value interface{}) *Element

func (*Element) SetClass added in v0.0.10

func (e *Element) SetClass(values ...string) *Element

func (*Element) SetId added in v0.0.2

func (e *Element) SetId(id string) *Element

func (*Element) SetInnerHTML

func (e *Element) SetInnerHTML(value string) *Element

func (*Element) SetMultiValueAttribute added in v0.0.10

func (e *Element) SetMultiValueAttribute(attributeName string, values ...string) *Element

func (*Element) SetName added in v0.0.3

func (e *Element) SetName(n string) *Element

func (*Element) SetNodeValue

func (e *Element) SetNodeValue(s string) *Element

func (*Element) SetOuterHTML

func (e *Element) SetOuterHTML(html string) *Element

func (*Element) SetTextContent

func (e *Element) SetTextContent(s string) *Element

func (*Element) Style added in v0.0.2

func (e *Element) Style() *CSS

func (*Element) TagName

func (e *Element) TagName() string

func (*Element) TextContent

func (e *Element) TextContent() string

type Event

type Event struct {
	js.Value
}

func (*Event) Code added in v0.0.2

func (e *Event) Code() string

func (*Event) Key added in v0.0.2

func (e *Event) Key() string

func (*Event) KeyCode added in v0.0.2

func (e *Event) KeyCode() int

func (*Event) PreventDefault

func (e *Event) PreventDefault()

func (*Event) StopImmediatePropagation

func (e *Event) StopImmediatePropagation()

func (*Event) StopPropagation

func (e *Event) StopPropagation()

func (*Event) Target

func (e *Event) Target() *Element

type History

type History struct {
	js.Value
}

func (*History) Back

func (h *History) Back()

func (*History) Forward

func (h *History) Forward()

func (*History) Go

func (h *History) Go(p int)

func (*History) Length

func (h *History) Length() int

func (*History) PushState

func (h *History) PushState(state interface{}, title, url string)

func (*History) ReplaceState

func (h *History) ReplaceState(state interface{}, title, url string)

type Location

type Location struct {
	js.Value
}

func (*Location) Host

func (l *Location) Host() string

func (*Location) Hostname

func (l *Location) Hostname() string

func (*Location) Href

func (l *Location) Href() string

func (*Location) Origin

func (l *Location) Origin() string

func (*Location) Pathname

func (l *Location) Pathname() string

func (*Location) Port

func (l *Location) Port() string

func (*Location) Protocol

func (l *Location) Protocol() string

func (*Location) Search

func (l *Location) Search() string
type Navigator struct {
	js.Value
}
func (n *Navigator) Language() string
func (n *Navigator) Languages() string

type Storage

type Storage struct {
	js.Value
}

func (*Storage) Clear

func (s *Storage) Clear()

func (*Storage) GetItem

func (s *Storage) GetItem(key string) string

func (*Storage) Key

func (s *Storage) Key(index int) string

func (*Storage) KeyExists

func (s *Storage) KeyExists(key string) bool

func (*Storage) Length

func (s *Storage) Length() int

func (*Storage) RemoveItem

func (s *Storage) RemoveItem(key string)

func (*Storage) SetItem

func (s *Storage) SetItem(key, value string)

type Target added in v0.0.3

type Target string
const (
	Blank  Target = "_blank"
	Self   Target = "_self"
	Parent Target = "_parent"
	Top    Target = "_top"
)

func (Target) String added in v0.0.3

func (t Target) String() string

type Window

type Window struct {
	js.Value
}

func GetWindow

func GetWindow() *Window

func (*Window) Alert

func (w *Window) Alert(message string)

func (*Window) History

func (w *Window) History() *History

func (*Window) Location

func (w *Window) Location() *Location

func (*Window) Navigator

func (w *Window) Navigator() *Navigator

func (*Window) PageXOffset

func (w *Window) PageXOffset() float64

func (*Window) PageYOffset

func (w *Window) PageYOffset() float64

func (*Window) PushState

func (w *Window) PushState(state interface{}, title, URL string)

func (*Window) ReplaceState

func (w *Window) ReplaceState(state interface{}, title, URL string)

func (*Window) ScrollX

func (w *Window) ScrollX() float64

func (*Window) ScrollY

func (w *Window) ScrollY() float64

type XMLHttpRequest

type XMLHttpRequest struct {
	js.Value
}

func NewXMLHttpRequest

func NewXMLHttpRequest() *XMLHttpRequest

func (*XMLHttpRequest) Abort

func (x *XMLHttpRequest) Abort()

func (*XMLHttpRequest) Open

func (x *XMLHttpRequest) Open(method, url string, args ...interface{})

func (*XMLHttpRequest) OverrideMimeType

func (x *XMLHttpRequest) OverrideMimeType(mimeType string)

func (*XMLHttpRequest) ResponseText

func (x *XMLHttpRequest) ResponseText() string

func (*XMLHttpRequest) ResponseURL

func (x *XMLHttpRequest) ResponseURL() string

func (*XMLHttpRequest) ResponseXML

func (x *XMLHttpRequest) ResponseXML() *Element

func (*XMLHttpRequest) Send

func (x *XMLHttpRequest) Send(args ...interface{})

func (*XMLHttpRequest) SetRequestHeader

func (x *XMLHttpRequest) SetRequestHeader(header, value string)

func (*XMLHttpRequest) SetWithCredentials

func (x *XMLHttpRequest) SetWithCredentials(c bool)

func (*XMLHttpRequest) StatusText

func (x *XMLHttpRequest) StatusText() string

func (*XMLHttpRequest) WithCredentials

func (x *XMLHttpRequest) WithCredentials() bool

type XSLTProcessor

type XSLTProcessor struct {
	js.Value
}

func NewXSLTProcessor

func NewXSLTProcessor() *XSLTProcessor

func (*XSLTProcessor) ImportStylesheet

func (x *XSLTProcessor) ImportStylesheet(node *Element)

func (*XSLTProcessor) TransformToDocument

func (x *XSLTProcessor) TransformToDocument(node *Element) *Element

func (*XSLTProcessor) TransformToFragment

func (x *XSLTProcessor) TransformToFragment(node, document *Element) *Element

Directories

Path Synopsis
elements
a
img
li
nav

Jump to

Keyboard shortcuts

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