goplayspace: github.com/iafan/goplayspace/client/js/textarea Index | Files

package textarea

import "github.com/iafan/goplayspace/client/js/textarea"

Index

Package Files

textarea.go

type Textarea Uses

type Textarea struct {
    *js.Object
}

Textarea provides wrapper functions for <textarea> object

func (*Textarea) Focus Uses

func (t *Textarea) Focus()

Focus sets focus to the control

func (*Textarea) GetSelectionEnd Uses

func (t *Textarea) GetSelectionEnd() int

GetSelectionEnd returns selection end utf8 byte position Note that JavaScript strings are UTF-16-encoded, and selectionStart returns a position in the UTF-16 array representing the textarea value

func (*Textarea) GetSelectionStart Uses

func (t *Textarea) GetSelectionStart() int

GetSelectionStart returns selection start utf8 byte position Note that JavaScript strings are UTF-16-encoded, and selectionStart returns a position in the UTF-16 array representing the textarea value

func (*Textarea) GetSymbolWidthsAround Uses

func (t *Textarea) GetSymbolWidthsAround(before, after int) (wBefore, wAfter int)

GetSymbolWidthsAround returns the size of the unicode symbols in utf8 bytes before and after a given utf8 byte range in a string

func (*Textarea) GetSymbolsAroundSelection Uses

func (t *Textarea) GetSymbolsAroundSelection() (before, after string)

GetSymbolsAroundSelection returns one symbol before and one symbol after selection (or around the caret, if there's no selection); one or both strings can be empty if caret is placed at the beginning or the end of the document, or if the document is blank

func (*Textarea) GetValue Uses

func (t *Textarea) GetValue() string

GetValue returns current textarea value (text)

func (*Textarea) InsertText Uses

func (t *Textarea) InsertText(text string)

InsertText replaces selection with the provided text And adjusts the caret pos

func (*Textarea) SetHeight Uses

func (t *Textarea) SetHeight(val int)

SetHeight sets textarea height in pixels

func (*Textarea) SetSelectionEnd Uses

func (t *Textarea) SetSelectionEnd(val int)

SetSelectionEnd sets selection end character

func (*Textarea) SetSelectionStart Uses

func (t *Textarea) SetSelectionStart(val int)

SetSelectionStart sets selection start character

func (*Textarea) SetState Uses

func (t *Textarea) SetState(val string, selStart, selEnd int)

SetState sets textarea value (text) and selection

func (*Textarea) SetValue Uses

func (t *Textarea) SetValue(val string)

SetValue sets textarea value (text) while preserving selection

func (*Textarea) WrapSelection Uses

func (t *Textarea) WrapSelection(begin, end string)

WrapSelection wraps selection with the provided starting and ending text snippets and places the caret before the `end` part

Package textarea imports 4 packages (graph) and is imported by 1 packages. Updated 2017-08-28. Refresh now. Tools for package owners.