import CodeEditorViewController from '~/controllers/CodeEditorViewController.js'
CodeEditorViewController
Extends:
OO-wrapper for a codeeditor.
Constructor Summary
Public Constructor | ||
public |
constructor(element: HTMLTextArea, theme: CodeEditorTheme, opts: Object) Creates CodeEditor wrapper for element. |
Member Summary
Public Members | ||
public set |
If should auto resize (i.e. |
|
public |
|
|
public set |
lines: nuumber Sets the height in the # of lines that should be shown |
|
public set |
Checks if should be validated |
|
public |
|
|
public get |
Returns value of editor |
|
public set |
Sets the value of the editor |
Method Summary
Public Methods | ||
public |
Adds a DOM element as a widget |
|
public |
observeValue(): Observable Obtains observable of value |
|
public |
async setLanguage(lang: Language | string) Sets the language if possible |
|
public |
async setThemeType(type: CodeEditorThemeType) Sets the theme given a type |
Inherited Summary
From class ViewController | ||
public static |
Creates a view controller directly for all members of a class. |
|
public static |
of(elem: string | Element): ViewController Returns a canolical VC of an element if it exists |
Public Constructors
public constructor(element: HTMLTextArea, theme: CodeEditorTheme, opts: Object) source
Creates CodeEditor wrapper for element. Reccomended to use a Random to create a unique name.
Override:
ViewController#constructorParams:
Name | Type | Attribute | Description |
element | HTMLTextArea | element id. If an HTMLElement w/o parent then appending |
|
theme | CodeEditorTheme | Theme to use for Ace. |
|
opts | Object |
|
config opts |
opts.lines | number |
|
amont of lines to show |
opts.autoresize | number |
|
If to autoresize the box |
Public Members
public delegate: ActionControllerDelegate source
public theme: CodeEditorTheme source
Public Methods
public async setThemeType(type: CodeEditorThemeType) source
Sets the theme given a type
Params:
Name | Type | Attribute | Description |
type | CodeEditorThemeType | Type of theme |