99 lines
3.6 KiB
HTML
99 lines
3.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>关于-闲言轻博客</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
{{ template "shares/link.html". }}
|
|
<style>
|
|
.layui-form-label {
|
|
width: 50px;
|
|
}
|
|
.layui-input-block {
|
|
margin-left: 80px;
|
|
}
|
|
@media screen and (max-width: 450px) {
|
|
.layui-form-item .layui-input-inline {
|
|
margin: 0 0 10px 80px;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body class="lay-blog">
|
|
{{ template "shares/header.html". }}
|
|
<div class="container-wrap">
|
|
<div class="container container-message container-details container-about">
|
|
<div class="contar-wrap">
|
|
<div class="item">
|
|
<div class="item-box">
|
|
<form class="layui-form layui-form-pane" action="">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">标题</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" name="title" required=""
|
|
value="{{ .note.Title }}"
|
|
lay-verify="required" placeholder="请输入标题"
|
|
autocomplete="off" class="layui-input">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-form-item layui-form-text">
|
|
<label class="layui-form-label">内容</label>
|
|
<div class="layui-input-block">
|
|
<div id="edit">
|
|
{{ if .note }}
|
|
{{ str2html .note.Content }}
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item">
|
|
<button class="layui-btn" lay-submit=""
|
|
lay-filter="save">提交
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{ template "shares/footer.html". }}
|
|
<script type="text/javascript" src="/static/lib/wangEditor/wangEditor.min.js"></script>
|
|
<script>
|
|
layui.use(['form', 'jquery', 'layer', 'sysn'], function () {
|
|
var form = layui.form,
|
|
sysn = layui.sysn,
|
|
$ = layui.jquery,
|
|
layer = layui.layer;
|
|
//监听提交
|
|
form.on('submit(save)', function (formData) {
|
|
var fdata = formData.field;
|
|
fdata.content = editor.txt.html();
|
|
|
|
sysn.post("/note/save/{{ .key }}", fdata)
|
|
// .setTimeout(5000)
|
|
.success(function (data) {
|
|
layer.msg(data.msg);
|
|
if (data.action) {
|
|
setTimeout(function () {
|
|
window.location.href = data.action;
|
|
}, 300)
|
|
}
|
|
}).run();
|
|
return false;
|
|
});
|
|
|
|
// 初始化 wangEditor
|
|
var E = window.wangEditor;
|
|
var editor = new E('#edit');
|
|
// 图片不采用上传模式,直接保存到数据库
|
|
editor.customConfig.uploadImgShowBase64 = true;
|
|
editor.customConfig.pasteFilterStyle = false;
|
|
editor.customConfig.zIndex = 1;
|
|
editor.create();
|
|
});
|
|
|
|
</script>
|
|
</body>
|
|
</html> |