Documentation
¶
Index ¶
- Constants
- Variables
- func And(c ...Condition) _and
- func FloaterToStr(n any) string
- func GreaterThan(left, right Expression) _Gt
- func GreaterThanEquals(left, right Expression) _Gte
- func IF(cond Condition, statements ...Statement) *_if
- func InterToStr(n any) string
- func Is(left, right Expression) equals
- func IsEmptyString(expr Expression) equals
- func IsNot(left, right Expression) notEquals
- func JS(jser ...Statement) string
- func LessThan(left, right Expression) _Lt
- func LessThanEquals(left, right Expression) _Lte
- func New(jser ...Statement) *_JS
- func Not(c Condition) not
- func ObjecterToStr(n any) string
- func Or(c ...Condition) _or
- func SWITCH(exp Expression) *_switch
- func StringerToStr(n any) string
- type Any
- type Array
- type Block
- type Callback
- type Condition
- func Exists(x Expression) Condition
- func HasAttr[O Objecter, A Stringer](elm O, attr A) Condition
- func HasClass[O Objecter, T Stringer](elm O, classStr T) Condition
- func HasKey[O Objecter, S Stringer](obj O, key S) Condition
- func IsEmpty[O Objecter](obj O) Condition
- func IsFalse(x Expression) Condition
- func IsNotNull(x Expression) Condition
- func IsNull(x Expression) Condition
- func IsTrue(x Expression) Condition
- func NotExists(x Expression) Condition
- func NotHasKey[O Objecter, S Stringer](obj O, key S) Condition
- type Expression
- type Float
- type Floater
- type Func
- type Int
- type Inter
- type Label
- type LogMap
- type Object
- type Objecter
- type Raw
- func Anonymous(stmts ...Statement) Raw
- func AppendChild[O Objecter, C Objecter](elm O, child C) Raw
- func AppendHTML[O Objecter, S Stringer](elm O, html S) Raw
- func Child[O Objecter, I Inter](elm O, idx I) Raw
- func Children[O Objecter](elm O) Raw
- func CreateNodeFromHTML[S Stringer](html S) Raw
- func FirstChild[O Objecter](elm O) Raw
- func GetAttr[O Objecter, T Stringer](elm O, attrStr T) Raw
- func GetElementByID(s Expression) Raw
- func GetHTML[O Objecter](elm O) Raw
- func GetText[O Objecter](elm O) Raw
- func GetVal[O Objecter](elm O) Raw
- func JSONparse(str Expression) Raw
- func JSONtoString(obj Expression) Raw
- func LastChild[O Objecter](elm O) Raw
- func Length(arr Expression) Raw
- func Literal(format string, expr ...Expression) Raw
- func LocalStorageGet[S Stringer](keystr S) Raw
- func Method(x Expression, methodName string, expr ...Expression) Raw
- func Nth[T Inter](arr Expression, n T) Raw
- func PropertyOf[O Objecter](x O, prop string) Raw
- func Query[S Stringer](selector S) Raw
- func QueryAll[S Stringer](selector S) Raw
- func RemoveChildren[O Objecter](elm O) Raw
- func SetTimeout[I Inter](t I, stmts ...Statement) Raw
- func SetValOf[O Objecter, S Stringer](x O, key S, v Expression) Raw
- func ValOf[O Objecter, S Stringer](x O, key S) Raw
- type Statement
- func AddClass[O Objecter, T Stringer](elm O, classStr T) Statement
- func Append[O Objecter, I Objecter](elmOuter, elm Expression) Statement
- func Break(l Label) Statement
- func ClipBoardWriteText[T Stringer](str T) Statement
- func Continue(l Label) Statement
- func DO_WHILE(cond Condition, stmts ...Statement) Statement
- func DeleteKey[O Objecter, S Stringer](x O, key S) Statement
- func Each(varval string, obj Expression, stmts ...Statement) Statement
- func EachPair(varidx, varval string, obj Expression, stmts ...Statement) Statement
- func EachProperty(varprop string, obj Expression, stmts ...Statement) Statement
- func FOR(initSt Raw, cond Condition, postSt Raw, stmts ...Statement) Statement
- func LocalStorageSet[S Stringer](keystr S, valstr Expression) Statement
- func Log(expr ...Expression) Statement
- func LogExpressions(expr ...Expression) Statement
- func Prepend[O Objecter, I Objecter](elmOuter O, elm I) Statement
- func Push(arr Expression, item Expression) Statement
- func RemoveClass[O Objecter, T Stringer](elm O, classStr T) Statement
- func RemoveElement[O Objecter](elm O) Statement
- func Set(s Expression, x Expression) Statement
- func SetAttr[O Objecter, S Stringer, V Stringer](elm O, attrStr S, val V) Statement
- func SetHTML[O Objecter, V Stringer](elm O, val V) Statement
- func SetPropertyIfNotExists[O Objecter](x O, prop string, val Expression) Statement
- func SetPropertyOf[O Objecter](x O, prop string, val Expression) Statement
- func SetText[O Objecter, V Stringer](elm O, val V) Statement
- func SetVal[O Objecter, V Stringer](elm O, val V) Statement
- func WHILE(cond Condition, stmts ...Statement) Statement
- type String
- type Stringer
- type Variable
- type XMLHttpRequest
- func (me *XMLHttpRequest) OnError(stmts ...Statement) *XMLHttpRequest
- func (me *XMLHttpRequest) OnSuccess(stmts ...Statement) *XMLHttpRequest
- func (me *XMLHttpRequest) Send() Statement
- func (me *XMLHttpRequest) WithData(s Expression) *XMLHttpRequest
- func (me *XMLHttpRequest) WithDataJSON(s Expression) *XMLHttpRequest
- func (me *XMLHttpRequest) WithHeader(key string, value Expression) *XMLHttpRequest
- func (me *XMLHttpRequest) WithResponseJSON() *XMLHttpRequest
- func (me *XMLHttpRequest) WithResponseType(s string) *XMLHttpRequest
Constants ¶
View Source
const FALSE = _bool(false)
View Source
const NULL = expr("null")
View Source
const RETURN = Raw("return")
View Source
const TRUE = _bool(true)
View Source
const UNDEFINED = expr("undefined")
Variables ¶
View Source
var AjaxResponse = ajaxResponse{}
View Source
var THIS = Raw("this")
Functions ¶
func FloaterToStr ¶
func GreaterThan ¶
func GreaterThan(left, right Expression) _Gt
func GreaterThanEquals ¶
func GreaterThanEquals(left, right Expression) _Gte
func InterToStr ¶
func Is ¶
func Is(left, right Expression) equals
func IsEmptyString ¶ added in v0.13.66
func IsEmptyString(expr Expression) equals
func IsNot ¶
func IsNot(left, right Expression) notEquals
func LessThan ¶
func LessThan(left, right Expression) _Lt
func LessThanEquals ¶
func LessThanEquals(left, right Expression) _Lte
func ObjecterToStr ¶
func SWITCH ¶
func SWITCH(exp Expression) *_switch
func StringerToStr ¶
Types ¶
type Any ¶
type Any interface { Statement Expression }
type Array ¶
type Array []Expression
type Condition ¶
type Condition interface {
Cond() string
}
func Exists ¶
func Exists(x Expression) Condition
func IsFalse ¶
func IsFalse(x Expression) Condition
func IsNotNull ¶
func IsNotNull(x Expression) Condition
func IsNull ¶
func IsNull(x Expression) Condition
func IsTrue ¶
func IsTrue(x Expression) Condition
func NotExists ¶
func NotExists(x Expression) Condition
type Expression ¶
type Expression interface {
JsValue() string
}
type Object ¶
type Object map[string]Expression
type Raw ¶
type Raw string
func AppendChild ¶ added in v0.13.66
func AppendHTML ¶ added in v0.13.66
func CreateNodeFromHTML ¶ added in v0.13.66
func FirstChild ¶
func GetElementByID ¶
func GetElementByID(s Expression) Raw
func JSONparse ¶
func JSONparse(str Expression) Raw
func JSONtoString ¶
func JSONtoString(obj Expression) Raw
func Length ¶
func Length(arr Expression) Raw
func Literal ¶
func Literal(format string, expr ...Expression) Raw
func LocalStorageGet ¶
func Method ¶
func Method(x Expression, methodName string, expr ...Expression) Raw
func Nth ¶
func Nth[T Inter](arr Expression, n T) Raw
func PropertyOf ¶
func RemoveChildren ¶
func SetTimeout ¶ added in v0.13.66
func (Raw) JsStatement ¶
func (Raw) Statements ¶
type Statement ¶
type Statement interface {
JsStatement() string
}
func ClipBoardWriteText ¶
func Each ¶
func Each(varval string, obj Expression, stmts ...Statement) Statement
Each ranges over iterables, just by value
func EachPair ¶
func EachPair(varidx, varval string, obj Expression, stmts ...Statement) Statement
EachPair ranges over iterables by key/index and value
func EachProperty ¶
func EachProperty(varprop string, obj Expression, stmts ...Statement) Statement
EachProperty ranges over the properties of an object
func LocalStorageSet ¶
func LocalStorageSet[S Stringer](keystr S, valstr Expression) Statement
func Log ¶
func Log(expr ...Expression) Statement
func LogExpressions ¶
func LogExpressions(expr ...Expression) Statement
func Push ¶
func Push(arr Expression, item Expression) Statement
func RemoveClass ¶
func RemoveElement ¶
func Set ¶
func Set(s Expression, x Expression) Statement
func SetPropertyIfNotExists ¶ added in v0.13.66
func SetPropertyIfNotExists[O Objecter](x O, prop string, val Expression) Statement
func SetPropertyOf ¶
func SetPropertyOf[O Objecter](x O, prop string, val Expression) Statement
type Variable ¶
type Variable[T Expression] struct { Name string Val T // contains filtered or unexported fields }
func Const ¶
func Const[T Expression](name string, val T) *Variable[T]
func Let ¶
func Let[T Expression](name string, val T) *Variable[T]
func Var ¶
func Var[T Expression](name string, val T) *Variable[T]
func (*Variable[T]) JsStatement ¶
func (*Variable[T]) Set ¶
func (me *Variable[T]) Set(x Expression) Statement
func (*Variable[T]) SetIfNotNull ¶ added in v0.13.66
func (me *Variable[T]) SetIfNotNull(x Expression) Statement
type XMLHttpRequest ¶
type XMLHttpRequest struct {
// contains filtered or unexported fields
}
func AjaxDELETE ¶
func AjaxDELETE[S Stringer](url S) *XMLHttpRequest
func AjaxGET ¶
func AjaxGET[S Stringer](url S) *XMLHttpRequest
func AjaxHEAD ¶
func AjaxHEAD[S Stringer](url S) *XMLHttpRequest
func AjaxPATCH ¶
func AjaxPATCH[S Stringer](url S) *XMLHttpRequest
func AjaxPOST ¶
func AjaxPOST[S Stringer](url S) *XMLHttpRequest
func AjaxPUT ¶
func AjaxPUT[S Stringer](url S) *XMLHttpRequest
func (*XMLHttpRequest) OnError ¶
func (me *XMLHttpRequest) OnError(stmts ...Statement) *XMLHttpRequest
func (*XMLHttpRequest) OnSuccess ¶
func (me *XMLHttpRequest) OnSuccess(stmts ...Statement) *XMLHttpRequest
func (*XMLHttpRequest) Send ¶
func (me *XMLHttpRequest) Send() Statement
func (*XMLHttpRequest) WithData ¶
func (me *XMLHttpRequest) WithData(s Expression) *XMLHttpRequest
func (*XMLHttpRequest) WithDataJSON ¶
func (me *XMLHttpRequest) WithDataJSON(s Expression) *XMLHttpRequest
func (*XMLHttpRequest) WithHeader ¶
func (me *XMLHttpRequest) WithHeader(key string, value Expression) *XMLHttpRequest
func (*XMLHttpRequest) WithResponseJSON ¶
func (me *XMLHttpRequest) WithResponseJSON() *XMLHttpRequest
func (*XMLHttpRequest) WithResponseType ¶
func (me *XMLHttpRequest) WithResponseType(s string) *XMLHttpRequest
Source Files
¶
Click to show internal directories.
Click to hide internal directories.