18 lines
598 B
Plaintext
18 lines
598 B
Plaintext
extends ./editor_template
|
|
block content
|
|
pre#editor #{ editor_code ? editor_code : '' }
|
|
input#preset_mode(type='hidden' value=editor_lang ? editor_lang : 'ace/mode/text')
|
|
block scripts
|
|
script(src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.5/ace.js")
|
|
script.
|
|
const readonly = #{!!readonly}
|
|
const preset_mode = document.getElementById('preset_mode').value
|
|
const editor = ace.edit('editor');
|
|
editor.setTheme(window.devbug_editor_theme);
|
|
console.log('preset mode: ', preset_mode);
|
|
editor.session.setMode(preset_mode);
|
|
|
|
if ( readonly ){
|
|
editor.setOption('readOnly', true)
|
|
}
|