mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-19 01:58:00 +08:00
实现文档编辑
This commit is contained in:
@@ -6,12 +6,19 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>编辑文档 - Powered by MinDoc</title>
|
||||
<script type="text/javascript">window.editor = null;</script>
|
||||
<script type="text/javascript">
|
||||
window.editor = null;
|
||||
window.imageUploadURL = "{{urlfor "DocumentController.Upload" "identify" .Model.Identify}}";
|
||||
window.fileUploadURL = "{{urlfor "DocumentController.Upload" "identify" .Model.Identify}}";
|
||||
window.documentCategory = {{.Result}};
|
||||
window.book = {{.ModelResult}};
|
||||
</script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/static/font-awesome/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="/static/jstree/3.3.4/themes/default/style.min.css" rel="stylesheet">
|
||||
<link href="/static/editor.md/css/editormd.css" rel="stylesheet">
|
||||
<link href="/static/css/jstree.css" rel="stylesheet">
|
||||
<link href="/static/css/markdown.css" rel="stylesheet">
|
||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
@@ -61,7 +68,6 @@
|
||||
<a href="javascript:;" data-toggle="tooltip" data-title="添加表格"><i class="fa fa-table item" name="table" unselectable="on"></i></a>
|
||||
<a href="javascript:;" data-toggle="tooltip" data-title="引用"><i class="fa fa-quote-right item" name="quote" unselectable="on"></i></a>
|
||||
<a href="javascript:;" data-toggle="tooltip" data-title="GFM 任务列表"><i class="fa fa-tasks item" name="tasks" aria-hidden="true"></i></a>
|
||||
<a href="javascript:;" data-toggle="tooltip" data-title="插入视频"><i class="fa fa-file-video-o" name="video" aria-hidden="true"></i></a>
|
||||
<a href="javascript:;" data-toggle="tooltip" data-title="附件"><i class="fa fa-paperclip last" aria-hidden="true" name="attachment"></i></a>
|
||||
</div>
|
||||
|
||||
@@ -84,46 +90,65 @@
|
||||
</div>
|
||||
<div class="manual-body">
|
||||
<div class="manual-category" id="manualCategory">
|
||||
<div class="manual-nav">
|
||||
<div class="nav-item active"><i class="fa fa-bars" aria-hidden="true"></i> 目录</div>
|
||||
<div class="nav-plus pull-right" id="btnAddDocument" data-toggle="tooltip" data-title="创建目录" data-direction="right"><i class="fa fa-plus" aria-hidden="true"></i></div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="manual-tree" id="sidebar">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="manual-editor-container" id="manualEditorContainer">
|
||||
<div id="docEditor"></div>
|
||||
<div class="manual-editormd" id="docEditor"></div>
|
||||
<div class="manual-editor-status">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="addDocumentModal" tabindex="-1" role="dialog" aria-labelledby="addDocumentModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<form method="post" action="{{urlfor "DocumentController.Create" ":key" .Model.Identify}}" id="addDocumentForm" class="form-horizontal">
|
||||
<input type="hidden" name="identify" value="{{.Model.Identify}}">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel">添加目录</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">目录名称 <span class="error-message">*</span></label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="doc_name" id="documentName" placeholder="目录名称" class="form-control" maxlength="50">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">目录标识</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="doc_identify" id="documentIdentify" placeholder="目录唯一标识" class="form-control" maxlength="50">
|
||||
<p style="color: #999;font-size: 12px;">文档标识只能包含小写字母、数字,以及“-”和“_”符号,并且只能小写字母开头</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<span id="add-error-message" class="error-message"></span>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button type="submit" class="btn btn-primary" id="btnSaveDocument" data-loading-text="保存中...">立即保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/static/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="/static/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="/static/jstree/3.3.4/jstree.min.js" type="text/javascript"></script>
|
||||
<script src="/static/editor.md/editormd.js" type="text/javascript"></script>
|
||||
<script src="/static/editor.md/plugins/video-dialog/video-dialog.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="/static/layer/layer.js"></script>
|
||||
<script src="/static/js/jquery.form.js" type="text/javascript"></script>
|
||||
<script src="/static/js/markdown.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$("#sidebar").jstree({
|
||||
'plugins':["wholerow","types"],
|
||||
"types": {
|
||||
"default" : {
|
||||
"icon" : false // 删除默认图标
|
||||
}
|
||||
},
|
||||
'core' : {
|
||||
'check_callback' : false,
|
||||
"multiple" : false ,
|
||||
'animation' : 0
|
||||
}
|
||||
});
|
||||
|
||||
$("[data-toggle='tooltip']").hover(function () {
|
||||
var title = $(this).attr('data-title');
|
||||
index = layer.tips(title,this,{
|
||||
tips : 3
|
||||
});
|
||||
},function () {
|
||||
layer.close(index);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user