Even more embeddable code editor Custom Element - just one tag, and no JS needed to provide Ace - The High Performance Code Editor
Based on pjako's fork of PolymerLabs ace-element.
Polymer 1.2 ready
Install the component using Bower:
$ bower install LostInBrittany/ace-widget --save
Or download as ZIP.
-
Import Web Components' polyfill (if needed):
<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>
-
Import Custom Element:
<link rel="import" href="bower_components/ace-widget/ace-widget.html">
-
Start using it!
<ace-widget>Editable code here</ace-widget>
Attribute | Options | Default | Description |
---|---|---|---|
theme |
String | `` | Editor#setTheme at Ace API |
mode |
String | `` | EditSession#setMode at Ace API |
font-size |
String | `` | Editor#setFontSize at Ace API |
softtabs |
Boolean | `` | EditSession#setUseSoftTabs() at Ace API |
tab-size |
Boolean | `` | Session#setTabSize() at Ace API |
readonly |
Boolean | `` | Editor#setReadOnly() at Ace API |
wrap |
Boolean | `` | Session#setWrapMode() at Ace API |
autoComplete |
Object | `` | Callback for langTools.addCompleter like the example at Ace API |
minlines |
Number | 15 | Editor.setOptions({minlines: minlines}) |
maxlines |
Number | 30 | Editor.setOptions({minlines: maxlines}) |
initialFocus |
Boolean | `` | If true, Editor.focus() is called upon initialisation |
Name | Description |
---|---|
editor |
Ace editor object. |
value |
editor.get-/setValue() |
Name | Description |
---|---|
editor-content |
Triggered when editor content gets changed |
editor-ready |
Triggered once Ace editor instance is created. |
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D