front

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Include = gox.Elem(func(cur gox.Cursor) error {
	core := cur.Context().Value(ctex.KeyCore).(core.Core)
	conf := core.Conf()
	registry := core.ResourceRegistry()
	pathMaker := core.PathMaker()
	if err := cur.InitVoid("link"); err != nil {
		return err
	}
	{
		if err := cur.AttrSet("rel", "stylesheet"); err != nil {
			return err
		}
		if err := cur.AttrSet("href", pathMaker.Resource(registry.MainStyle(), "d0r.css")); err != nil {
			return err
		}
	}
	if err := cur.Submit(); err != nil {
		return err
	}
	if err := cur.Init("script"); err != nil {
		return err
	}
	{
		if err := cur.AttrSet("src", pathMaker.Resource(registry.MainScript(), "d0r.js")); err != nil {
			return err
		}
		if err := cur.AttrSet("id", core.InstanceID()); err != nil {
			return err
		}
		if err := cur.AttrSet("data-prefix", pathMaker.Prefix()); err != nil {
			return err
		}
		if err := cur.AttrSet("data-root", core.RootID()); err != nil {
			return err
		}
		if err := cur.AttrSet("data-ttl", conf.InstanceTTL.Milliseconds()); err != nil {
			return err
		}
		if err := cur.AttrSet("data-disconnect", conf.DisconnectHiddenTimer.Milliseconds()); err != nil {
			return err
		}
		if err := cur.AttrSet("data-request", conf.RequestTimeout.Milliseconds()); err != nil {
			return err
		}
		if err := cur.AttrSet("data-ping", conf.SolitairePing.Milliseconds()); err != nil {
			return err
		}
		if lic := core.License(); lic != "" {
			if err := cur.AttrSet("data-lic", lic); err != nil {
				return err
			}
		}
		if err := cur.Submit(); err != nil {
			return err
		}
	}
	if err := cur.Close(); err != nil {
		return err
	}
	return nil
})

Functions

func AttrsAppendCapture

func AttrsAppendCapture(attrs gox.Attrs, capture Capture, hook Hook)

func AttrsAppendDyn

func AttrsAppendDyn(attrs gox.Attrs, id uint64, name string)

func AttrsSetActive

func AttrsSetActive(attrs gox.Attrs, active []any)

func AttrsSetData

func AttrsSetData(attrs gox.Attrs, name string, data any)

func AttrsSetDoor

func AttrsSetDoor(attrs gox.Attrs, id uint64, container bool)

func AttrsSetHook

func AttrsSetHook(attrs gox.Attrs, name string, hook Hook)

func AttrsSetParent

func AttrsSetParent(attrs gox.Attrs, parent uint64)

Types

type AutoId

type AutoId struct {
	// contains filtered or unexported fields
}

func (*AutoId) Id

func (s *AutoId) Id(inst core.Core) string

type Capture

type Capture interface {
	Name() string
	Listen() string
}

type ChangeCapture

type ChangeCapture struct {
}

func (ChangeCapture) Listen

func (c ChangeCapture) Listen() string

func (ChangeCapture) Name

func (c ChangeCapture) Name() string

type ChangeEvent

type ChangeEvent struct {
	Type      string     `json:"type"`
	Name      string     `json:"name"`
	Value     string     `json:"value"`
	Number    *float64   `json:"number"`
	Date      *time.Time `json:"date"`
	Selected  []string   `json:"selected"`
	Checked   bool       `json:"checked"`
	Timestamp time.Time  `json:"timestamp"`
}

ChangeEvent describes a committed form value change.

type FocusCapture

type FocusCapture struct {
	Event string `json:"-"`
}

func (FocusCapture) Listen

func (c FocusCapture) Listen() string

func (FocusCapture) Name

func (c FocusCapture) Name() string

type FocusEvent

type FocusEvent struct {
	Type      string    `json:"type"`
	Timestamp time.Time `json:"timestamp"`
}

FocusEvent mirrors the browser FocusEvent payload sent to Doors.

type FocusIOCapture

type FocusIOCapture struct {
	Event           string `json:"-"`
	StopPropagation bool   `json:"sp"`
	ExactTarget     bool   `json:"et"`
}

func (FocusIOCapture) Listen

func (c FocusIOCapture) Listen() string

func (FocusIOCapture) Name

func (c FocusIOCapture) Name() string

type FormCapture

type FormCapture struct {
}

func (FormCapture) Listen

func (c FormCapture) Listen() string

func (FormCapture) Name

func (c FormCapture) Name() string

type Hook

type Hook struct {
	Before   action.Actions
	OnError  action.Actions
	Scope    []ScopeSet
	Indicate []Indicate
	core.Hook
}

func (Hook) MarshalJSON

func (h Hook) MarshalJSON() ([]byte, error)

type Indicate

type Indicate struct {
	// contains filtered or unexported fields
}

func IndicateAttr

func IndicateAttr(s Selector, name string, value string) Indicate

func IndicateClass

func IndicateClass(s Selector, class string) Indicate

func IndicateClassRemove

func IndicateClassRemove(s Selector, class string) Indicate

func IndicateContent

func IndicateContent(s Selector, content string) Indicate

func IntoIndicate

func IntoIndicate(indicator []Indicator) []Indicate

func (Indicate) MarshalJSON

func (i Indicate) MarshalJSON() ([]byte, error)

type Indicator

type Indicator interface {
	Indicate() Indicate
}

type InputCapture

type InputCapture struct {
	ExcludeValue bool `json:"ev"`
}

func (InputCapture) Listen

func (c InputCapture) Listen() string

func (InputCapture) Name

func (c InputCapture) Name() string

type InputEvent

type InputEvent struct {
	Type      string `json:"type"`
	Name      string `json:"name"`
	Data      string
	Date      *time.Time `json:"date"`
	Value     string     `json:"value"`
	Number    *float64   `json:"number"`
	Selected  []string   `json:"selected"`
	Checked   bool       `json:"checked"`
	Timestamp time.Time  `json:"timestamp"`
}

InputEvent describes a live form value edit.

type KeyboardEvent

type KeyboardEvent struct {
	Type      string    `json:"type"`
	Key       string    `json:"key"`
	Code      string    `json:"code"`
	Repeat    bool      `json:"repeat"`
	CtrlKey   bool      `json:"ctrlKey"`
	ShiftKey  bool      `json:"shiftKey"`
	AltKey    bool      `json:"altKey"`
	MetaKey   bool      `json:"metaKey"`
	Timestamp time.Time `json:"timestamp"`
}

KeyboardEvent mirrors the browser KeyboardEvent payload sent to Doors.

type KeyboardEventCapture

type KeyboardEventCapture struct {
	Event           string   `json:"-"`
	Filter          []string `json:"fr"`
	PreventDefault  bool     `json:"pd"`
	StopPropagation bool     `json:"sp"`
	ExactTarget     bool     `json:"et"`
}

func (KeyboardEventCapture) Listen

func (c KeyboardEventCapture) Listen() string

func (KeyboardEventCapture) Name

func (c KeyboardEventCapture) Name() string

type LinkCapture

type LinkCapture struct {
	StopPropagation bool `json:"sp"`
}

func (LinkCapture) Listen

func (c LinkCapture) Listen() string

func (LinkCapture) Name

func (c LinkCapture) Name() string

type PointerCapture

type PointerCapture struct {
	Event           string `json:"-"`
	PreventDefault  bool   `json:"pd"`
	StopPropagation bool   `json:"sp"`
	ExactTarget     bool   `json:"et"`
}

func (PointerCapture) Listen

func (pc PointerCapture) Listen() string

func (PointerCapture) Name

func (pc PointerCapture) Name() string

type PointerEvent

type PointerEvent struct {
	Type               string    `json:"type"`
	PointerID          int       `json:"pointerId"`
	Width              float64   `json:"width"`
	Height             float64   `json:"height"`
	Pressure           float64   `json:"pressure"`
	TangentialPressure float64   `json:"tangentialPressure"`
	TiltX              float64   `json:"tiltX"`
	TiltY              float64   `json:"tiltY"`
	Twist              float64   `json:"twist"`
	Buttons            int       `json:"buttons"`
	Button             int       `json:"button"`
	PointerType        string    `json:"pointerType"`
	IsPrimary          bool      `json:"isPrimary"`
	ClientX            float64   `json:"clientX"`
	ClientY            float64   `json:"clientY"`
	ScreenX            float64   `json:"screenX"`
	ScreenY            float64   `json:"screenY"`
	PageX              float64   `json:"pageX"`
	PageY              float64   `json:"pageY"`
	Timestamp          time.Time `json:"timestamp"`
}

PointerEvent mirrors the browser PointerEvent payload sent to Doors.

type Scope

type Scope interface {
	Scope(core core.Core) ScopeSet
}

type ScopeSet

type ScopeSet struct {
	Type string
	Id   string
	Opt  any
}

func BlockingScope

func BlockingScope(id string) ScopeSet

func ConcurrentScope

func ConcurrentScope(id string, groupId int) ScopeSet

func DebounceScope

func DebounceScope(id string, duration time.Duration, limit time.Duration) ScopeSet

func FrameScope

func FrameScope(id string, frame bool) ScopeSet

func FreeScope

func FreeScope(id string) ScopeSet

func IntoScopeSet

func IntoScopeSet(inst core.Core, scope []Scope) []ScopeSet

func LatestScope

func LatestScope(id string) ScopeSet

func SerialScope

func SerialScope(id string) ScopeSet

func (ScopeSet) MarshalJSON

func (s ScopeSet) MarshalJSON() ([]byte, error)

type Selector

type Selector struct {
	// contains filtered or unexported fields
}

func SelectQuery

func SelectQuery(query string) Selector

func SelectQueryAll

func SelectQueryAll(query string) Selector

func SelectQueryParent

func SelectQueryParent(query string) Selector

func SelectTarget

func SelectTarget() Selector

func (Selector) MarshalJSON

func (s Selector) MarshalJSON() ([]byte, error)

type SelectorMode

type SelectorMode string
const (
	SelectModeTarget      SelectorMode = "target"
	SelectModeQuery       SelectorMode = "query"
	SelectModeQueryAll    SelectorMode = "query_all"
	SelectModeParentQuery SelectorMode = "parent_query"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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