mirror of
https://github.com/mindoc-org/mindoc.git
synced 2026-02-27 17:03:57 +08:00
feat:实现自定义模板功能
This commit is contained in:
@@ -442,14 +442,14 @@ table>tbody>tr:hover{
|
||||
|
||||
.manual-article .article-head h1 {
|
||||
margin: 0;
|
||||
font-size: 20px;
|
||||
font-weight: 300;
|
||||
font-size: 36px;
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
line-height: 30px;
|
||||
line-height: 42px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: #7e888b
|
||||
color: #636363;
|
||||
}
|
||||
.manual-article .article-head h3 {
|
||||
margin: 0;
|
||||
|
||||
@@ -101,8 +101,8 @@ $(function () {
|
||||
} else if (name === "release") {
|
||||
if (Object.prototype.toString.call(window.documentCategory) === '[object Array]' && window.documentCategory.length > 0) {
|
||||
if ($("#markdown-save").hasClass('change')) {
|
||||
var comfirm_result = confirm("编辑内容未保存,需要保存吗?")
|
||||
if (comfirm_result) {
|
||||
var confirm_result = confirm("编辑内容未保存,需要保存吗?");
|
||||
if (confirm_result) {
|
||||
saveDocument(false, releaseBook);
|
||||
return;
|
||||
}
|
||||
@@ -366,6 +366,10 @@ $(function () {
|
||||
*/
|
||||
$("#documentTemplateModal").on("click", ".section>a[data-type]", function () {
|
||||
var $this = $(this).attr("data-type");
|
||||
if($this === "customs"){
|
||||
$("#displayCustomsTemplateModal").modal("show");
|
||||
return;
|
||||
}
|
||||
var body = $("#template-" + $this).html();
|
||||
if (body) {
|
||||
window.isLoad = true;
|
||||
@@ -376,4 +380,32 @@ $(function () {
|
||||
}
|
||||
$("#documentTemplateModal").modal('hide');
|
||||
});
|
||||
|
||||
$("#displayCustomsTemplateModal").on("show.bs.modal",function () {
|
||||
window.sessionStorage.setItem("displayCustomsTemplateList",$("#displayCustomsTemplateList").html());
|
||||
|
||||
var index ;
|
||||
$.ajax({
|
||||
beforeSend: function () {
|
||||
index = layer.load(1, { shade: [0.1, '#fff'] });
|
||||
},
|
||||
url : window.template.listUrl,
|
||||
data: {"identify":window.book.identify},
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
success: function ($res) {
|
||||
|
||||
},
|
||||
error : function () {
|
||||
|
||||
},
|
||||
complete : function () {
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
$("#documentTemplateModal").modal("hide");
|
||||
}).on("hidden.bs.modal",function () {
|
||||
var cache = window.sessionStorage.getItem("displayCustomsTemplateList");
|
||||
$("#displayCustomsTemplateList").html(cache);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user