富文本中文处理
This commit is contained in:
parent
c93f54a812
commit
d0bd515ed4
|
|
@ -1233,8 +1233,7 @@ var table = {
|
||||||
seeSummernoteDetail: function(index,fild) {
|
seeSummernoteDetail: function(index,fild) {
|
||||||
table.set();
|
table.set();
|
||||||
var row = $("#" + table.options.id).bootstrapTable('getData')[index];
|
var row = $("#" + table.options.id).bootstrapTable('getData')[index];
|
||||||
console.log(row)
|
var content = decodeURI(window.atob(row[fild]));
|
||||||
var content =window.atob(row[fild]);
|
|
||||||
var htmlcontent = [
|
var htmlcontent = [
|
||||||
"<div style='padding:20px;'>",
|
"<div style='padding:20px;'>",
|
||||||
content,
|
content,
|
||||||
|
|
|
||||||
|
|
@ -156,10 +156,10 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">${comment}:</label>
|
<label class="col-sm-3 control-label">${comment}:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="file-loading">
|
|
||||||
<input type="hidden" name="${field}">
|
<input type="hidden" name="${field}">
|
||||||
|
<div class="file-loading">
|
||||||
<input class="form-control file-upload" name="file" id="${field}"
|
<input class="form-control file-upload" name="file" id="${field}"
|
||||||
type="file" #if($column.required) required#end>
|
type="file" >
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -261,7 +261,7 @@
|
||||||
callbacks: {
|
callbacks: {
|
||||||
onChange: function (contents, $edittable) {
|
onChange: function (contents, $edittable) {
|
||||||
// Xss 过滤掉了html 内容 ,所以用base64 保存
|
// Xss 过滤掉了html 内容 ,所以用base64 保存
|
||||||
$("input[name='" + this.id + "']").val(window.btoa(contents))
|
$("input[name='" + this.id + "']").val(window.btoa(encodeURI(contents)));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -157,15 +157,14 @@
|
||||||
required#end>[[*{${field}}]]</textarea>
|
required#end>[[*{${field}}]]</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
#elseif($column.htmlType == "upload" || $column.htmlType == "uploads")
|
#elseif($column.htmlType == "upload")
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">${comment}:</label>
|
<label class="col-sm-3 control-label">${comment}:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="file-loading">
|
|
||||||
<input type="hidden" th:field="*{${field}}">
|
<input type="hidden" th:field="*{${field}}">
|
||||||
|
<div class="file-loading">
|
||||||
<input class="form-control file-upload" name="file" id="${field}"
|
<input class="form-control file-upload" name="file" id="${field}"
|
||||||
type="file" #if($column.htmlType == "uploads")
|
type="file">
|
||||||
multiple#end #if($column.required) required#end>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -267,14 +266,14 @@
|
||||||
$(function () {
|
$(function () {
|
||||||
$('.summernote').each(function (i) {
|
$('.summernote').each(function (i) {
|
||||||
var content = $("input[name='" + this.id + "']").val()
|
var content = $("input[name='" + this.id + "']").val()
|
||||||
content = window.atob(content);
|
content = decodeURI(window.atob(content));
|
||||||
this.innerHTML = content;
|
this.innerHTML = content;
|
||||||
$(this).summernote({
|
$(this).summernote({
|
||||||
height: 100,
|
height: 100,
|
||||||
lang: 'zh-CN',
|
lang: 'zh-CN',
|
||||||
callbacks: {
|
callbacks: {
|
||||||
onChange: function (contents, $edittable) {
|
onChange: function (contents, $edittable) {
|
||||||
$("input[name='" + this.id + "']").val(window.btoa(contents))
|
$("input[name='" + this.id + "']").val(window.btoa(encodeURI(contents)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue