{template "header.html"}


<link href="{THEME_PATH}assets/global/plugins/codemirror/lib/codemirror.css" rel="stylesheet" type="text/css" />
<link href="{THEME_PATH}assets/global/plugins/codemirror/theme/neat.css" rel="stylesheet" type="text/css" />

<script src="{THEME_PATH}assets/global/plugins/codemirror/lib/codemirror.js" type="text/javascript"></script>
<script src="{THEME_PATH}assets/global/plugins/codemirror/mode/javascript/javascript.js" type="text/javascript"></script>


<script type="text/javascript">
    jQuery(document).ready(function() {
        var myTextArea = document.getElementById('file_code');
        var myCodeMirror = CodeMirror.fromTextArea(myTextArea, {
            lineNumbers: true,
            matchBrackets: true,
            styleActiveLine: true,
            theme: "neat",
            mode: 'javascript'
        });
    });

    var getWindowSize = function(){
        return ["Height","Width"].map(function(name){
            return window["inner"+name] ||
                document.compatMode === "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ]
        });
    }

    function wSize(){
        var str=getWindowSize();
        var strs= new Array(); //定义一数组
        strs=str.toString().split(","); //字符分割
        var heights = strs[0]-140,Body = $('body');
        $('#file_code').height(heights);
        $('.CodeMirror').height(heights);
    }

    $(function(){
        wSize();
    });

</script>

<div class="note note-danger" style="margin-top: -20px;">
    <p>{dr_safe_replace_path($file)}</p>
</div>
<div class="form-group">
    <textarea id="file_code" name="code">{$code}</textarea>
</div>

{template "footer.html"}