texteditor

package
v2.9.4 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Placeholder string
	Value       string

	ButtonSize int
	Width      string
	Height     string
	MinHeight  string
	MaxHeight  string
	MinWidth   string
	MaxWidth   string

	AllowResizeX bool
	AllowResizeY bool

	LintElements     map[string]*LintElement // [name]LintElement
	LintElementOrder []string
	Options          []TextEditorOption
}

func (*Config) AddLintElement

func (c *Config) AddLintElement(name string, svgFunc func(w, h int) *jse.SVG, onclick func(*Editor), config map[string]interface{})

func (*Config) AddLintElementCommand

func (c *Config) AddLintElementCommand(name string, svgFunc func(w, h int) *jse.SVG, command string)

func (*Config) Defaults

func (c *Config) Defaults()

func (*Config) SetOrder

func (c *Config) SetOrder(order ...string)

type Editor

type Editor struct {
	*jse.Element              // The root element
	Lint         *jse.Element // Lint element
	Editor       *jse.Element // Editor element
	Footer       *jse.Element // Footer element
	Conf         *Config
}

func New

func New(conf *Config) *Editor

func (*Editor) CurrentlySelectedText

func (e *Editor) CurrentlySelectedText() string

func (*Editor) JSValue

func (e *Editor) JSValue() js.Value

func (*Editor) Value

func (e *Editor) Value() *jse.Element

type LintElement

type LintElement struct {
	*jse.Element
	OnClick    func(*Editor)
	ConfigData map[string]interface{}
}

type TextEditorOption

type TextEditorOption func(*Editor)

func WithEditorHeight

func WithEditorHeight(h string) TextEditorOption

func WithEditorWidth

func WithEditorWidth(w string) TextEditorOption

Jump to

Keyboard shortcuts

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