Skip to content

Commit

Permalink
Merge pull request #5 from derralf/patch-1
Browse files Browse the repository at this point in the history
Update CodeEditorField.ss and Readme
  • Loading branch information
jinjie authored Jul 16, 2019
2 parents 8242cb9 + f46f798 commit 6231d8a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,16 @@ Creates an Ace Code Editor (https://ace.c9.io/)

```php
$fields->push(CodeEditorField::create('MyCode', 'Enter Source Code Here'));
```
```

## Setting the Programming Language Mode

```php
$fields->push($myCodeEditorField = CodeEditorField::create('MyCode', 'Enter Source Code Here'));

// set mode to html
$myCodeEditorField->setMode('ace/mode/html');
// or javascript
$myCodeEditorField->setMode('ace/mode/javascript');
```
see [resources/thirdparty/ace](resources/thirdparty/ace) for available modes (mode-{language}.js)
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<div id="{$ID}_CodeEditorField" class="codeeditorfield" style="min-height: {$Height}px;" data-field="{$Name}">$Value</div>
<textarea $AttributesHTML style="display: none;">{$Value.RAW}</textarea>
<textarea $AttributesHTML style="display: none;">{$ValueEntities.RAW}</textarea>

0 comments on commit 6231d8a

Please sign in to comment.