1. 文章编辑加入未保存浏览器缓存
2. 文章编辑标题加入长度检查
This commit is contained in:
@@ -19,7 +19,13 @@
|
||||
</a>
|
||||
<h2>
|
||||
<a class="layui-badge">#(x.typeName)</a>
|
||||
<a href="/jie/detail/#(x.contentId)">#(x.title)</a>
|
||||
<a href="/jie/detail/#(x.contentId)">
|
||||
#if(x.top == 3)
|
||||
<span style="color: #AB5D7C;font-weight: bold;">#(x.title)</span>
|
||||
#else
|
||||
#(x.title)
|
||||
#end
|
||||
</a>
|
||||
</h2>
|
||||
<div class="fly-list-info">
|
||||
<a href="/user/#(x.userId)" link>
|
||||
@@ -34,6 +40,7 @@
|
||||
<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>
|
||||
-->
|
||||
<span class="fly-list-nums">
|
||||
<i class="iconfont" title="人气"></i> #(x.viewNum??0)
|
||||
<i class="iconfont icon-pinglun1" title="回答"></i> #(x.replyNum??0)
|
||||
</span>
|
||||
</div>
|
||||
@@ -90,6 +97,7 @@
|
||||
<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>
|
||||
-->
|
||||
<span class="fly-list-nums">
|
||||
<i class="iconfont" title="人气"></i> #(x.viewNum??0)
|
||||
<i class="iconfont icon-pinglun1" title="回答"></i> #(x.replyNum??0)
|
||||
</span>
|
||||
</div>
|
||||
|
@@ -254,7 +254,17 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'face'], f
|
||||
var E = window.wangEditor;
|
||||
var editor = new E('#editor');
|
||||
editor.customConfig.uploadImgServer = '/upload/img';
|
||||
editor.create()
|
||||
|
||||
var cache_key = "content_" + $("input[name='contentId']").val();
|
||||
var html = localStorage.getItem(cache_key);
|
||||
|
||||
editor.customConfig.onblur = function (html) {
|
||||
localStorage.setItem(cache_key, html);
|
||||
};
|
||||
|
||||
editor.create();
|
||||
|
||||
if (html) editor.txt.html(html);//缓存的内容
|
||||
|
||||
return editor;
|
||||
}
|
||||
@@ -319,11 +329,11 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'face'], f
|
||||
return arguments.callee;
|
||||
}
|
||||
|
||||
,userstat: function () {
|
||||
/*,userstat: function () {
|
||||
$.getJSON("/os/user/stat",{},function (data) {
|
||||
$("#user_count").html(data.count);
|
||||
});
|
||||
}
|
||||
}*/
|
||||
|
||||
};
|
||||
|
||||
|
@@ -247,7 +247,9 @@ layui.define(['fly','laypage'], function(exports){
|
||||
bean:JSON.stringify(bean)
|
||||
},function (res) {
|
||||
layer.msg("发布成功",{time:2000},function () {
|
||||
location.href = "/";
|
||||
var cache_key = "content_" + $("input[name='contentId']").val();
|
||||
localStorage.removeItem(cache_key);
|
||||
location.href = "/user";
|
||||
});
|
||||
});
|
||||
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
|
||||
|
@@ -288,7 +288,8 @@ layui.define(['laypage', 'fly', 'element', 'flow'], function(exports){
|
||||
bean:JSON.stringify({username:fdata.username, password:fdata.password})
|
||||
,vercode:fdata.vercode
|
||||
},function (data) {
|
||||
data = JSON.parse(data);
|
||||
console.log(data);
|
||||
//data = JSON.parse(data);
|
||||
if(data.retcode != 0){
|
||||
layer.msg(data.retinfo);
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user