plugins/tpl/templates/admin/template_editor/edit_main.stpl

Summary

Maintainability
Test Coverage
<h4>edit: {stpl_name} for theme: {theme_name}, inside: {location}</h4>

{form_row("form_begin")}
    {form_row("hidden","stpl_text")}
    <div class="control-group">
        <div id="editor_html" style="width: 90%; height: 500px;">{stpl_text}</div>
    </div>
    {form_row("save_and_back")}
{form_row("form_end")}

{js()} ace-editor {/js}
{js()}
    function initAceEditor() {
        var html_editor = ace.edit("editor_html");
        html_editor.setTheme("ace/theme/tomorrow_night");
        html_editor.getSession().setMode("ace/mode/html");
        html_editor.setFontSize("16px") ;
        html_editor.setPrintMarginColumn(false);
    }
    initAceEditor();
{/js}
{jquery()}
$("#editor_html").closest("form").on("submit", function(){
    $(this).find("#stpl_text").val(html_editor.session.getValue())
    return true;
})
{/jquery}