Authored by 张帅

增加后台发布笔记的文字长度限制

... ... @@ -66,8 +66,8 @@
<td>
<span style="color:red">*</span><label style="font-size: 14px;">文字内容(必填项,内容不能为空)</label> <br>
<div style="width:600px; word-wrap:break-word;float: left;position: relative" >
<textarea rows="5" id="content" style="width:60%; white-space: pre-wrap;" name = "content" class="form-control" placeholder="请在这里输入1-500字的笔记" required="" maxlength="500"></textarea>
<div style="position: absolute;bottom:0;right:-50px"> <span id="content-count">0</span>/500</div>
<textarea rows="5" id="content" style="width:60%; white-space: pre-wrap;" name = "content" class="form-control" placeholder="请在这里输入1-2000字的笔记" required="" maxlength="2000"></textarea>
<div style="position: absolute;bottom:0;right:-50px"> <span id="content-count">0</span>/2000</div>
</div>
</td>
... ... @@ -297,8 +297,8 @@
var $this = $(this);
var count = $this[0].getText().length;
var content = $this[0].getText();
if(count>500){
$this[0].setText(content.substring(0,500));
if(count>2000){
$this[0].setText(content.substring(0,2000));
count = $this[0].getText().length;
}
$("#content-count").text(count);
... ... @@ -453,8 +453,8 @@
$.messager.alert("保存失败", "请输入文字内容", "error");
return false;
}
if(content.length>500){
$.messager.alert("发布失败", "内容长度超过500,请重新输入", "error");
if(content.length>2000){
$.messager.alert("发布失败", "内容长度超过2000,请重新输入", "error");
return false;
}
$("#draftType").val(2);
... ... @@ -536,8 +536,8 @@
$.messager.alert("保存失败", "请输入文字内容", "error");
return false;
}
if(content.length>500){
$.messager.alert("发布失败", "内容长度超过500,请重新输入", "error");
if(content.length>2000){
$.messager.alert("发布失败", "内容长度超过2000,请重新输入", "error");
return false;
}
$("#draftType").val(1);
... ... @@ -768,8 +768,8 @@
$.messager.alert("保存失败", "请输入文字内容", "error");
return false;
}
if(content.length>500){
$.messager.alert("发布失败", "内容长度超过500,请重新输入", "error");
if(content.length>2000){
$.messager.alert("发布失败", "内容长度超过2000,请重新输入", "error");
return false;
}
$("#draftType").val(3);
... ...
... ... @@ -78,8 +78,8 @@
<span style="color:red">*</span><label style="font-size: 14px;">文字内容(必填项,内容不能为空)</label> <br>
<div style="width:600px; word-wrap:break-word;float: left;position: relative" >
<textarea rows="5" id="content" style="width:60%; white-space: pre-wrap;" name = "content" class="form-control" placeholder="请在这里输入1-500字的笔记" required="" maxlength="500"></textarea>
<div style="position: absolute;bottom:0;right:-50px"> <span id="content-count">0</span>/500</div>
<textarea rows="5" id="content" style="width:60%; white-space: pre-wrap;" name = "content" class="form-control" placeholder="请在这里输入1-2000字的笔记" required="" maxlength="2000"></textarea>
<div style="position: absolute;bottom:0;right:-50px"> <span id="content-count">0</span>/2000</div>
</div>
... ... @@ -336,8 +336,8 @@
var $this = $(this);
var count = $this[0].getText().length;
var content = $this[0].getText();
if(count>500){
$this[0].setText(content.substring(0,500));
if(count>2000){
$this[0].setText(content.substring(0,2000));
count = $this[0].getText().length;
}
$("#content-count").text(count);
... ... @@ -467,8 +467,8 @@
$.messager.alert("发布失败", "请输入文字内容", "error");
return false;
}
if(content.length>500){
$.messager.alert("发布失败", "内容长度超过500,请重新输入", "error");
if(content.length>2000){
$.messager.alert("发布失败", "内容长度超过2000,请重新输入", "error");
return false;
}
var imgs = '';
... ... @@ -549,8 +549,8 @@
$.messager.alert("保存失败", "请输入文字内容", "error");
return false;
}
if(content.length>500){
$.messager.alert("发布失败", "内容长度超过500,请重新输入", "error");
if(content.length>2000){
$.messager.alert("发布失败", "内容长度超过2000,请重新输入", "error");
return false;
}
var imgs = '';
... ... @@ -721,8 +721,8 @@
$.messager.alert("保存失败", "请输入文字内容", "error");
return false;
}
if(content.length>500){
$.messager.alert("发布失败", "内容长度超过500,请重新输入", "error");
if(content.length>2000){
$.messager.alert("发布失败", "内容长度超过2000,请重新输入", "error");
return false;
}
param.publishTime =time;
... ...