wasm

package
v0.0.0-...-dcddd34 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllTemplates map[string]any
View Source
var EmbeddedTemplates embed.FS
View Source
var UseLive = true

Functions

func AddClass

func AddClass(w js.Value, className string)

func DoBearerDelete

func DoBearerDelete(bearer, urlString string) int

func DoBearerGet

func DoBearerGet(bearer, urlString string) (string, int)

func DoBearerPatch

func DoBearerPatch(bearer, urlString string, payload any) int

func DoBearerPost

func DoBearerPost(bearer, urlString string, payload any) (string, int)

func DoDelete

func DoDelete(urlString string) int

func DoGet

func DoGet(urlString string) string

func DoHttpBearerRead

func DoHttpBearerRead(bearer string, request *http.Request) (string, int)

func DoHttpRead

func DoHttpRead(request *http.Request) (string, int)

func DoPatch

func DoPatch(urlString string, payload any) (string, int)

func DoPost

func DoPost(urlString string, payload any) (string, int)

func DoPut

func DoPut(urlString string, payload any) (string, int)

func GetItemMap

func GetItemMap(item js.Value, count int) map[string]any

func HasClass

func HasClass(w js.Value, className string) bool

func LoadAllTemplates

func LoadAllTemplates(files []fs.DirEntry)

func NewGlobal

func NewGlobal() (*Global, *Document)

func RemoveClass

func RemoveClass(w js.Value, className string)

func Render

func Render(name string, vars any) string

Types

type Document

type Document struct {
	Document js.Value
}

func NewDocument

func NewDocument(g *Global) *Document

func (*Document) AppendTo

func (d *Document) AppendTo(id, jsonString, template string)

func (*Document) ById

func (d *Document) ById(id string) js.Value

func (*Document) ByIdString

func (d *Document) ByIdString(id string) string

func (*Document) ByIdWrap

func (d *Document) ByIdWrap(id string) *Wrapper

func (*Document) ByIdWrapped

func (d *Document) ByIdWrapped(id string) *Wrapper

func (*Document) Id

func (d *Document) Id(id string) *Wrapper

func (*Document) NewTag

func (d *Document) NewTag(t, s string) *Wrapper

func (*Document) Render

func (d *Document) Render(name string, vars any) string

func (*Document) RenderAndAppend

func (d *Document) RenderAndAppend(location, template, key, jsonString string) *Wrapper

func (*Document) RenderToId

func (d *Document) RenderToId(id, name string, vars any) *Wrapper

func (*Document) RenderToNewDiv

func (d *Document) RenderToNewDiv(name string, vars any) js.Value

func (*Document) SelectAllFrom

func (d *Document) SelectAllFrom(id, s string) []*Wrapper

type Global

type Global struct {
	Global       *js.Value
	Document     *Document
	Navigator    *Wrapper
	LocalStorage *Wrapper
	Window       *Wrapper
	Location     *Location
	Start        string
	Ready        chan bool
	Space        map[string]string
	Storage      map[string]any
	Stack        []*StackItem
}

func (*Global) Change

func (g *Global) Change(id string, fn func(js.Value, []js.Value) any)

func (*Global) Click

func (g *Global) Click(id string, fn func(js.Value, []js.Value) any)

func (*Global) Event

func (g *Global) Event(id string, fn func())

func (*Global) Focus

func (g *Global) Focus(id string, fn func(js.Value, []js.Value) any)

func (*Global) IsBottom

func (g *Global) IsBottom() bool

func (*Global) SetClipboard

func (g *Global) SetClipboard(s string)

func (*Global) Submit

func (g *Global) Submit(id string, fn func(js.Value, []js.Value) any)

func (*Global) SubmitEvent

func (g *Global) SubmitEvent(id string, fn func())

func (*Global) WasmReady

func (g *Global) WasmReady(this js.Value, p []js.Value) any

type Location

type Location struct {
	Value  js.Value
	Href   string
	Params url.Values
}

func NewLocation

func NewLocation(g *Global) *Location

func (*Location) GetParam

func (l *Location) GetParam(id string) string

func (*Location) Set

func (l *Location) Set(id, value string)

type Settable

type Settable interface {
	Set(id, value string)
}

type StackItem

type StackItem struct {
	HTML     string
	Callback func()
}

func NewStackItem

func NewStackItem(s string) *StackItem

type Wrapper

type Wrapper struct {
	JValue  js.Value
	Name    string
	Id      string
	Value   string
	Checked bool
}

func NewWrapper

func NewWrapper(v js.Value) *Wrapper

func (*Wrapper) AddClass

func (w *Wrapper) AddClass(c string)

func (*Wrapper) AppendChild

func (w *Wrapper) AppendChild(c any)

func (*Wrapper) Blur

func (w *Wrapper) Blur()

func (*Wrapper) Call

func (w *Wrapper) Call(s string, thing any) any

func (*Wrapper) Click

func (w *Wrapper) Click(fn func(js.Value, []js.Value) any)

func (*Wrapper) Event

func (w *Wrapper) Event(fn func(id string))

func (*Wrapper) EventWithId

func (w *Wrapper) EventWithId(fn func())

func (*Wrapper) FireClick

func (w *Wrapper) FireClick()

func (*Wrapper) FireSubmit

func (w *Wrapper) FireSubmit()

func (*Wrapper) Focus

func (w *Wrapper) Focus()

func (*Wrapper) Get

func (w *Wrapper) Get(s string) string

func (*Wrapper) GetAttribute

func (w *Wrapper) GetAttribute(s string) string

func (*Wrapper) GetBool

func (w *Wrapper) GetBool(s string) bool

func (*Wrapper) GetInt

func (w *Wrapper) GetInt(s string) int

func (*Wrapper) GetItem

func (w *Wrapper) GetItem(key any) string

func (*Wrapper) HasClass

func (w *Wrapper) HasClass(c string) bool

func (*Wrapper) Hide

func (w *Wrapper) Hide()

func (*Wrapper) IsNull

func (w *Wrapper) IsNull() bool

func (*Wrapper) MapOfInputs

func (w *Wrapper) MapOfInputs() map[string]any

func (*Wrapper) NoClearInputs

func (w *Wrapper) NoClearInputs(prefix string) map[string]any

func (*Wrapper) RemoveClass

func (w *Wrapper) RemoveClass(c string)

func (*Wrapper) SelectAll

func (w *Wrapper) SelectAll(s string) []*Wrapper

func (*Wrapper) SelectAllByClass

func (w *Wrapper) SelectAllByClass(s string) []*Wrapper

func (*Wrapper) SelectAllByQuery

func (w *Wrapper) SelectAllByQuery(call, s string) []*Wrapper

func (*Wrapper) Set

func (w *Wrapper) Set(s string, thing any)

func (*Wrapper) SetItem

func (w *Wrapper) SetItem(key, value any)

func (*Wrapper) Show

func (w *Wrapper) Show()

Jump to

Keyboard shortcuts

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