<{import file="index/header.html"}> 
<link rel="stylesheet" href="<{$__PUBLIC__}>css/codemirror.css">
<style type="text/css">
.CodeMirror{ border:1px solid #ddd; }
</style>
<div class="cnav"><a href="javascript:;" class="back">主题编辑</a></div>
<div class="main"> 
	<form id="form" action="<{$__ADMIN__}>ad/theme_save" method="post">
		<{if $row.id}><input name="id" value="<{$row.id}>" type="hidden"><{/if}>
		<table class="etable"> 
			<tr>
				<td width="80">名称：</td>
				<td><input name="name" value="<{$row.name}>" type="text" size="121"></td>
			</tr>  
			<tr>
				<td valign="top" style="padding-top:8px;">代码：</td>
				<td><textarea name="html" cols="120" rows="15" id="demotext"><{$row.html}></textarea></td>
			</tr>  
			<tr>
				<td>&nbsp;</td>
				<td><input type="submit" class="submit" value="提交"/></td>
			</tr>
		</table> 
	</form> 
</div>
<{import file="index/footer.html"}> 
<script src="<{$__PUBLIC__}>plug/codemirror.js"></script>
<script type="text/javascript">
// 代码高亮 https://zhuanlan.zhihu.com/p/32126618
var editor = CodeMirror.fromTextArea(document.getElementById("demotext"), {
	mode: "text/html",		//编辑器语言 
	lineNumbers: true,		//显示行号
	matchBrackets: true,
	lineWrapping: true,
	theme: "dracula",
	gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
	matchBrackets: true,	//括号匹配
});
editor.setSize('850px', '440px');
</script>