{% extends "layout.html" %}

{% block content %}
<div class="main-content">
    <div class="container-fluid" style="padding-bottom:50px">
        <div class="file-box bgw mtb15" style="position:relative; padding-top:110px">
            <div id="tipTools" class="plr15">
                <div class="ptb15">
                    <div class="clearfix">
                        <div class="pull-left">
                            <button id="backBtn" class="backBtn btn btn-default btn-sm glyphicon glyphicon-arrow-left pull-left" title="{{data['lan']['BTN1']}}" onClick="BackDir()"></button>
                            <button class="backBtn refreshBtn btn btn-default btn-sm glyphicon glyphicon-refresh pull-right" title="{{data['lan']['BTN2']}}" style="margin-left:-1px;"></button>
                            <span id='DirPathPlace' class="pull-left"><input id="fileInputPath" type="text"></span>
                            <span id='PathPlaceBtn' class="pull-left"></span>
                        </div>
                        <div class="pull-left mlr15" style="line-height:26px"><span id='DirInfo'></span></div>
                        <div class="search pull-right" style="position: absolute; top: 6px; right: 5px;">
                            <div class="search_box">
                                <input id="search_all" type="checkbox">
                                <label for="search_all">{{data['lan']['CONTAIN_SUBDIR']}}</label>
                            </div>
                            <form target="hid" onsubmit='GetFiles(1)'>
                                <input type="text" id="SearchValue" class="ser-text pull-left" placeholder="" />
                                <button type="button" class="ser-sub pull-left" onclick='GetFiles(1)'></button>
                            </form>
                            <iframe name='hid' id="hid" style="display:none"></iframe>
                        </div>
                    </div>
                </div>
                <div class="clearfix ptb10">
                    <button class="btn btn-default btn-sm pull-left" onclick="UploadFiles()">{{data['lan']['BTN3']}}</button>
                    <button class="btn btn-default btn-sm pull-left" onclick="DownloadFile()" title="{{data['lan']['TI1']}}" style="margin:0 5px">{{data['lan']['BTN4']}}</button>
                    <span id='BarTools'></span>
                    <span id='Batch' style="background-color:#fff;position:absolute;right:217px;z-index:10"></span>
                    <span id='comlist' class="comlist"></span>
                    <div class="btn-group btn-group-sm pull-right" style="margin-right:5px;">
                        <button id="set_icon" title="{{data['lan']['TI2']}}" type="button" class="btn btn-default">
                            <i class="glyphicon glyphicon-th"></i>
                        </button>
                        <button id="set_list" title="{{data['lan']['TI3']}}" type="button" class="btn btn-default active">
                            <i class="glyphicon glyphicon-th-list"></i>
                        </button>
                    </div>
                </div>
            </div>
            <div class="divtable pd15" id="fileCon"></div>
            <div class="dataTables_paginate paging_bootstrap pagination plr15" style="position: relative; top: -15px;">
                <ul id="filePage" class="page"></ul>
            </div>
        </div>
    </div>
</div>
<ul id="rmenu" class="dropdown-menu" style="display:none">
    <li onclick="javascript:Batch(1);"><a style="cursor: pointer;">{{data['lan']['L1']}}</a></li>
    <li onclick="javascript:Batch(2);"><a style="cursor: pointer;">{{data['lan']['L2']}}</a></li>
    <li onclick="javascript:Batch(5);"><a style="cursor: pointer;">{{data['lan']['L3']}}</a></li>
    <li onclick="javascript:Batch(3);"><a style="cursor: pointer;">{{data['lan']['L4']}}</a></li>
    <li onclick="javascript:Batch(4);"><a style="cursor: pointer;">{{data['lan']['L5']}}</a></li>
</ul>
<link rel="stylesheet" href="./static/ace/styles/icons.css">
<script type="text/tmplate" id="aceTmplate">
    <div id="ace_conter">
        <div class="ace_header">
            <span class="saveFile"><i class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></i>Save</span>
            <span class="saveFileAll"><i class="glyphicon glyphicon-duplicate" aria-hidden="true"></i>Save All</span>
            <span class="refreshs"><i class="glyphicon glyphicon-refresh" aria-hidden="true"></i>Refresh</span>
            <span class="searchs"><i class="fa fa-search" aria-hidden="true"></i>Search</span>
            <span class="replaces"><i class="fa fa-random" aria-hidden="true"></i>Replace</span>
            <span class="fontSize"><i class="glyphicon glyphicon-text-width" aria-hidden="true"></i>Font</span>
            <span class="themes"><i class="glyphicon glyphicon-magnet" aria-hidden="true"></i>Theme</span>
            <span class="setUp"><i class="glyphicon glyphicon-cog" aria-hidden="true"></i>Set</span>
            <span class="helps"><i class="glyphicon glyphicon-question-sign" aria-hidden="true"></i>Help</span>
            <div class="pull-down" title="Hide toolbar"><i class="glyphicon glyphicon-menu-down" aria-hidden="true"></i></div>
        </div>
        <div class="ace_overall">
            <!-- 编辑器目录 -->
            <div class="ace_catalogue">
                <div class="ace_catalogue_title">Favorites</div>
                <div class="ace_catalogue_list">
                    <ul class="cd-accordion-menu animated">
                        <li class="has-children "><span>Back to previous</span></li>
                        <li class="has-children">
                            <input type="checkbox" name ="group-1" id="group-1" checked>
                            <label for="group-1" class="file_fold"><span class="glyphicon glyphicon-menu-right"></span><span><i class="folder_icon"></i>Document list</span></label>
                            <ul>
                                <li class="has-children">
                                    <input type="checkbox" name ="sub-group-1" id="sub-group-1">
                                    <label for="sub-group-1">Document list</label>
                                    <ul>
                                        <li><a href="#0">Image</a></li>
                                        <li><a href="#0">Image</a></li>
                                        <li><a href="#0">Image</a></li>
                                    </ul>
                                </li>
                                <li class="has-children">
                                    <input type="checkbox" name ="sub-group-2" id="sub-group-2">
                                    <label for="sub-group-2">Sub Group 2</label>
                                    <ul>
                                        <li class="has-children">
                                            <input type="checkbox" name ="sub-group-level-3" id="sub-group-level-3">
                                            <label for="sub-group-level-3">Sub Group Level 3</label>
                                            <ul>
                                                <li><a href="#0">Image</a></li>
                                                <li><a href="#0">Image</a></li>
                                            </ul>
                                        </li>
                                        <li><a href="#0">Image</a></li>
                                    </ul>
                                </li>
                                <li><a href="#0">Image</a></li>
                                <li><a href="#0">Image</a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
            <!-- 编辑内容 -->
            <!-- <div class="ace_catalogue_sidebar"><img src="/static/img/col-resize.png" /></div> -->
            <div class="ace_editor_main">
                <div class="ace_conter_menu">
                    <div class="ace_editor_add" style="display:none;"><i class="fa fa-plus-square" aria-hidden="true"></i></div>
                </div>
                <div class="ace_editor_main_storey"></div>
                <div class="ace_conter_editor"></div>
                <div class="ace_conter_toolbar">
                    <div class="pull-left">
                        <span data-type="path"></span>
                    </div>
                    <div class="pull-right">
                        <span data-type="cursor"></span>
                        <span data-type="tab"></span>
                        <span data-type="encoding"></span>
                        <span data-type="lang"></span>
                    </div>
                </div>
            </div>
            <div class="ace_toolbar_menu" style="display: none;">
                <div class="menu-item menu-tabs" style="display: none;">
                    <div class="menu-title">Set tabs</div>
                    <ul class="tabsType">
                        <li data-value="nbsp">Indent using spaces</li>
                        <li data-value="tabs">Indent using "Tab"</li>
                    </ul>
                    <div class="menu-title" style="margin-top:15px">Set the tab length</div>
                    <ul class="tabsSize">
                        <li data-value="1">1</li>
                        <li data-value="2">2</li>
                        <li data-value="3">3</li>
                        <li data-value="4">4</li>
                        <li data-value="5">5</li>
                        <li data-value="6">6</li>
                    </ul>
                </div>
                <div class="menu-item menu-encoding" style="display: none;">
                    <div class="menu-title">Set file save encoding format</div>
                    <ul></ul>
                </div>
                <div class="menu-item menu-files" style="display: none;">
                    <div class="menu-conter">
                    	<input type="text" class="menu-input" placeholder="Input language mode">
                    	<i class="fa fa-close" aria-hidden="true"></i>
                    </div>
                    <div class="menu-title">Set file language association</div>
                    <ul></ul>
                </div>
                <div class="menu-item menu-fontSize" style="display: none;">
                    <div class="menu-title">Set editor font size</div>
                    <div class="menu-conter">
                        <div class="set_font_size">
                            <input type="number" min="12" max="45"/>
                            <span class="tips error">Font setting range 12-45</span>
                            <button class="btn-save">Save</button>
                        </div>
                    </div>
                </div>
                <div class="menu-item menu-themes" style="display: none;">
                    <div class="menu-title">Set editor theme</div>
                    <ul></ul>
                </div>
            </div>
        </div>
    </div>
</script>
<script src="/static/js/jquery-ui.min.js"></script>
<script src="/static/js/jquery.contextify.min.js"></script>
<script src="/static/js/files.js?date22={{g.version}}"></script>
<script src="/static/js/upload.js?date={{g.version}}"></script>
<script type="text/javascript" src="./static/ace/ace.js?date=2"></script>
<script type="text/javascript" src="./static/ace/ext-language_tools.js?date=2"></script>
<script type="text/javascript">
	setTimeout(function(){
		GetDisk();
	},500);
	var xPath = getCookie('Path');
	setTimeout(function(){
		GetFiles((xPath!=undefined?xPath:'/www/wwwroot'));
	},800);

	PathPlaceBtn((xPath!=undefined?xPath:'/www/wwwroot'));
	setCookie('uploadSize',1024 * 1024 * 1024);
	if(getCookie('rank') == undefined || getCookie('rank') == null){
		setCookie('rank','a');
	}
	$("#set_icon").click(function(){
		setCookie('rank','b');
		$(this).addClass("active");
		$("#set_list").removeClass("active");
		GetFiles(getCookie('Path'));
	});
	$("#set_list").click(function(){
		setCookie('rank','a');
		$(this).addClass("active");
		$("#set_icon").removeClass("active");
		GetFiles(getCookie('Path'));
	})
	$(".refreshBtn").click(function(){
		GetFiles(getCookie('Path'));
	})
</script>
{% endblock %}
