<div class="uk-layui-form">
    <form class="layui-form uk-form" action="/admin/template/codesave.html">
    	<input type="hidden" name="templettype" value="${sysDic.id!''}">
    	<input type="hidden" name="id" value="${template.id!''}">
    	<div class="layui-form-item">
            <textarea name="templettext" id="templettext" style="display:none;">${template.templettext!''}</textarea>
			<div id="editor">${template.templettext!''}</div>	
        </div>
        
        <div class="layui-form-button">
            <div class="layui-button-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<script language="javascript">
	$(document).ready(function(){
	    var editor = ace.edit("editor");
	    editor.setTheme("ace/theme/chrome");
	    editor.getSession().setMode("ace/mode/xml");
		var textarea = $("#templettext");
		editor.getSession().on("change", function () {
			textarea.val(editor.getSession().getValue());
		});
	});
</script>

