Design
Code
Default
If no controlset is set the default will be controlset of full
<textarea class="ace-editor" id="defaultset">
</textarea>
Basic editor
<textarea class="ace-editor" data-ace-editor-controlset="basic" id="basicset">
</textarea>
Basic editor - max height
The editor is design to auto grow based on the size of the content inside.
The max height is the maximum height the editor will grow when content is added.
<textarea class="ace-editor" data-ace-editor-controlset="basic" data-ace-maxheight="600" id="basicsetmax">
</textarea>
Basic editor - disabled
<textarea class="ace-editor" data-ace-editor-controlset="basic" id="basicsetdisabled" disabled="disabled">
</textarea>
Full editor
<textarea class="ace-editor" data-ace-editor-controlset="full" id="fullset">
</textarea>
Event binding
<textarea class="ace-editor" id="defaultsetevents">
</textarea>
Setting a language
The editor by default will use the language set on the HTML element. If the language is not set it will default to English.
<textarea class="ace-editor" data-ace-language="zh-Hant" id="languagesetzh">
</textarea>
Javascript methods
Function | Arguments | Description | Example |
---|---|---|---|
init | Object with properties:
|
Bind all the events to editor.
Available languages: de, en (default), es, fr, it, ja, ko, nl, pt-br, ru, zh, zh-cn. |
|
destroy | elementSelector | Removes the event bindings. |
|
getValue | elementSelector | get the value programmatically. |
|
setValue | elementSelector, value | Sets value programmatically. |
|
Javascript events
Event | Arguments | Description | Example |
---|---|---|---|
ace-editor-change | data | Edtior value changed |
|
Files
Name | Required | Description | Example |
---|---|---|---|
extensions/ace-editor-with-dependencies.js | Yes | Core editor framework |
|
extensions/editorskin/ace/contents.css | Yes | Content styles, This is pulled in automatically by editor | |
extensions/editorskin/ace/dialog.css | Yes | Dialog styles, This is pulled in automatically by editor | |
extensions/editorskin/ace/editor.css | Yes | control styles, This is pulled in automatically by editor | |
extensions/editorskin/ace/skin.js | Yes | skin config file, This is pulled in automatically by editor |