{template "header.html"}

<form action="" class="form-horizontal" method="post" name="myform" id="myform">
    {$form}
    <div class="portlet bordered light myfbody">
        <div class="portlet-title tabbable-line">
            <ul class="nav nav-tabs" style="float:left;">
                <li class="{if $page==0}active{/if}">
                    <a href="#tab_0" data-toggle="tab" onclick="$('#dr_page').val('0')"> <i class="fa fa-cog"></i> {dr_lang('插件设置')} </a>
                </li>
            </ul>
        </div>
        <div class="portlet-body">
            <div class="tab-content">
                <div class="tab-pane {if $page==0}active{/if}" id="tab_0">
                     <div class="form-body">
                         <div class="form-group">
                             <label class="col-md-2 control-label">设置 CDN</label>
                             <div class="col-md-9">

                                <label>
                                    <select class="form-control bs-select" data-live-search="true" data-actions-box="true" id="dr_cdn" name="data[cdn]" onchange="show_field_option(this.value)" tabindex="-98">
                                        {loop $cdn $t}
                                        <option value="{$t['name']}" {if $t['name'] == $info['cdn']['value']}selected{/if}> {$t['cname']} </option>
                                        {/loop}
                                    </select>
                                                                          
                                </label>
                                
                             </div>
                         </div>

                         <div class="form-group">
                             <label class="col-md-2 control-label">编辑器样式</label>
                             <div class="col-md-9">

                                <label>
                                    <select class="form-control bs-select" data-live-search="true" data-actions-box="true" id="dr_mode" name="data[mode]" onchange="show_field_option(this.value)" tabindex="-98">
                                        <option value="ir" {if 'ir' == $info['mode']['value']}selected{/if}> 即时渲染 </option>
                                        <option value="wysiwyg" {if 'wysiwyg' == $info['mode']['value']}selected{/if}> 所见即所得 </option>
                                        <option value="sv" {if $info['mode']['value'] == 'sv'}selected{/if}> 分屏预览 </option>
                                    </select>
                                                                          
                                </label>
                                
                             </div>
                         </div>
                         
                         <div class="form-group">
                             <label class="col-md-2 control-label">图标样式</label>
                             <div class="col-md-9">

                                <label>  
                                    <select class="form-control bs-select" data-live-search="true" data-actions-box="true" id="dr_icon" name="data[icon]" onchange="show_field_option(this.value)" tabindex="-98">
                                        <option value="ant" {if 'ant' == $info['icon']['value']}selected{/if}> Ant Design </option>
                                        <option value="material" {if 'material' == $info['icon']['value']}selected{/if}> Material </option>
                                    </select>
                                                                          
                                </label>
                                
                             </div>
                         </div>

                         <div class="form-group">
                             <label class="col-md-2 control-label">语言</label>
                             <div class="col-md-9">

                                <label>  
                                    <select class="form-control bs-select" data-live-search="true" data-actions-box="true" id="dr_lang" name="data[lang]" onchange="show_field_option(this.value)" tabindex="-98">
                                        <option value="zh_CN" {if 'zh_CN' == $info['lang']['value']}selected{/if}> 中文 </option>
                                        <option value="en_US" {if 'en_US' == $info['lang']['value']}selected{/if}> 英文 </option>
                                        <option value="ko_KR" {if 'ko_KR' == $info['lang']['value']}selected{/if}> 韩文 </option>
                                        <option value="ja_JP" {if 'ja_JP' == $info['lang']['value']}selected{/if}> 日文 </option>
                                    </select>
                                                                          
                                </label>
                                
                             </div>
                         </div>

                         <div class="form-group">
                             <label class="col-md-2 control-label">大纲位置</label>
                             <div class="col-md-9">

                                <label>  
                                    <select class="form-control bs-select" data-live-search="true" data-actions-box="true" id="dr_outline" name="data[outline]" onchange="show_field_option(this.value)" tabindex="-98">
                                        <option value="false" {if 'false' == $info['outline']['value']}selected{/if}> 不开启 </option>
                                        <option value="left" {if 'left' == $info['outline']['value']}selected{/if}> 左边 </option>
                                        <option value="right" {if 'right' == $info['outline']['value']}selected{/if}> 右边 </option>
                                    </select>
                                                                          
                                </label>
                                
                             </div>
                         </div>

                         <div class="form-group">
                             <label class="col-md-2 control-label">字数统计</label>
                             <div class="col-md-9">

                                <label>  
                                    <select class="form-control bs-select" data-live-search="true" data-actions-box="true" id="dr_counter" name="data[counter]" onchange="show_field_option(this.value)" tabindex="-98">
                                        <option value="false" {if 'false' == $info['counter']['value']}selected{/if}> 不开启 </option>
                                        <option value="markdown" {if 'markdown' == $info['counter']['value']}selected{/if}> Markdown 字数统计 </option>
                                        <option value="text" {if 'text' == $info['counter']['value']}selected{/if}> 文本字数统计 </option>
                                    </select>
                                                                          
                                </label>
                                
                             </div>
                         </div>

                         <div class="form-group">
                             <label class="col-md-2 control-label">是否渲染代码块</label>
                             <div class="col-md-9">

                                <label>  
                                    <select class="form-control bs-select" data-live-search="true" data-actions-box="true" id="dr_codeBlock_preview" name="data[codeBlock_preview]" onchange="show_field_option(this.value)" tabindex="-98">
                                        <option value="false" {if 'false' == $info['codeBlock_preview']['value']}selected{/if}> 不渲染 </option>
                                        <option value="true" {if 'true' == $info['codeBlock_preview']['value']}selected{/if}> 渲染 </option>
                                    </select>
                                                                          
                                </label>
                                
                             </div>
                         </div>

                         <div class="form-group">
                             <label class="col-md-2 control-label">代码块行号显示</label>
                             <div class="col-md-9">

                                <label>  
                                    <select class="form-control bs-select" data-live-search="true" data-actions-box="true" id="dr_codeBlock_lineNumber" name="data[codeBlock_lineNumber]" onchange="show_field_option(this.value)" tabindex="-98">
                                        <option value="false" {if 'false' == $info['codeBlock_lineNumber']['value']}selected{/if}> 不开启 </option>
                                        <option value="true" {if 'true' == $info['codeBlock_lineNumber']['value']}selected{/if}> 开启 </option>
                                    </select>
                                                                          
                                </label>
                                
                             </div>
                         </div>

                         <div class="form-group">
                             <label class="col-md-2 control-label">代码块高亮显示</label>
                             <div class="col-md-9">

                                <label>  
                                    <select class="form-control bs-select" data-live-search="true" data-actions-box="true" id="dr_codeBlock_theme" name="data[codeBlock_theme]" onchange="show_field_option(this.value)" tabindex="-98">
                                        <option value="false" {if 'false' == $info['codeBlock_theme']['value']}selected{/if}> 不开启 </option>
                                        <option value="true" {if 'true' == $info['codeBlock_theme']['value']}selected{/if}> 开启 </option>
                                    </select>
                                                                          
                                </label>
                                
                             </div>
                         </div>
                         
                         <div class="form-group">
                             <label class="col-md-2 control-label">工具栏列表</label>
                             <div class="col-md-9">

                                <textarea id="sql" class="form-control" style="height:200px" name="data[toolbar]">{$toolbar}</textarea>  
                                
                             </div>
                         </div>

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

                    </div>
                </div>
            </div>
        </div>
    </div>


    <div class="portlet-body form myfooter">
        <div class="form-actions text-center">
            <button type="button" onclick="dr_ajax_submit('{dr_now_url()}', 'myform', '2000')" class="btn blue"> 
                <i class="fa fa-save"></i> 保存内容
            </button>

            {if $reply_url}
                <button type="button" onclick="dr_ajax_submit('{dr_now_url()}', 'myform', '2000', '{$reply_url}')" class="btn yellow">
                    <i class="fa fa-mail-reply-all"></i> 保存并返回
                </button>
            {/if}
        </div>
    </div>
</form>

{template "footer.html"}