富文本编辑框资源文件

This commit is contained in:
ly19960718 2021-05-05 16:11:07 +08:00
parent 7ad9952e16
commit 839f88e04f
9 changed files with 1980 additions and 88 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -157,22 +157,12 @@ div.edui-box {
.edui-default .edui-editor-toolbarboxouter {
border-bottom: 1px solid #d4d4d4;
background-color: #fafafa;
background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2));
background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2);
background-image: -o-linear-gradient(top, #ffffff, #f2f2f2);
background-image: linear-gradient(to bottom, #ffffff, #f2f2f2);
background-repeat: repeat-x;
background-color: #FFFFFF;
/*border: 1px solid #d4d4d4;*/
-webkit-border-radius: 4px 4px 0 0;
-moz-border-radius: 4px 4px 0 0;
border-radius: 4px 4px 0 0;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0);
*zoom: 1;
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
}
.edui-default .edui-editor-toolbarboxinner {

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1,4 @@
/*可以在这里添加你自己的css*/
img {
max-width: 100%; /*图片自适应宽度*/
}

View File

@ -33,19 +33,33 @@
, serverUrl: URL.replace(/assets\/js\/vendor\/ueditor\//gi, 'api/file/ueditor')
//工具栏上的所有的功能按钮和下拉框可以在new编辑器的实例时选择自己需要的重新定义
, toolbars: [[
'fullscreen', 'source', '|', 'undo', 'redo', '|',
'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
'directionalityltr', 'directionalityrtl', 'indent', '|',
'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', /*'gmap',*/ 'insertframe', /*'insertcode', 'webapp',*/ 'pagebreak', /*'template',*/ 'background', '|',
'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',
'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
'print', 'preview', 'searchreplace', 'drafts', /*'help'*/
]]
// , toolbars: [[
// 'fullscreen', 'source', '|', 'undo', 'redo', '|',
// 'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
// 'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
// 'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
// 'directionalityltr', 'directionalityrtl', 'indent', '|',
// 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
// 'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
// 'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', /*'gmap',*/ 'insertframe', /*'insertcode', 'webapp',*/ 'pagebreak', /*'template',*/ 'background', '|',
// 'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',
// 'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
// 'print', 'preview', 'searchreplace', 'drafts', /*'help'*/
// ]]
, toolbars: [[
'fullscreen', 'source', '|',
'undo', 'redo', '|',
'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', '|',
'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|',
'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
'directionalityltr', 'directionalityrtl', 'indent', '|',
'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|',
'link', 'unlink', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
'simpleupload', 'insertimage', 'insertvideo', 'attachment', '|',
'horizontal', 'spechars', '|',
'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', '|',
'searchreplace',
]]
//当鼠标放在工具栏上时显示的tooltip提示,留空支持自动多语言配置,否则以配置值为准
//,labelMap:{
// 'anchor':'', 'undo':''
@ -58,8 +72,8 @@
//主题配置项,默认是default。有需要的话也可以使用如下这样的方式来自动多主题切换当然前提条件是themes文件夹下存在对应的主题文件
//现有如下皮肤:default
//,theme:'default'
//,themePath:URL +"themes/"
// ,theme: 'style1'
// ,themePath:URL +"themes/"
//,zIndex : 900 //编辑器层级的基数,默认是900
@ -109,36 +123,36 @@
//,emotionLocalization:false //是否开启表情本地化默认关闭。若要开启请确保emotion文件夹下包含官网提供的images表情文件夹
//粘贴只保留标签,去除标签所有属性
//,retainOnlyLabelPasted: false
,retainOnlyLabelPasted: true
//,pasteplain:false //是否默认为纯文本粘贴。false为不使用纯文本粘贴true为使用纯文本粘贴
,pasteplain: false //是否默认为纯文本粘贴。false为不使用纯文本粘贴true为使用纯文本粘贴
//纯文本粘贴模式下的过滤规则
//'filterTxtRules' : function(){
// function transP(node){
// node.tagName = 'p';
// node.setStyle();
// }
// return {
// //直接删除及其字节点内容
// '-' : 'script style object iframe embed input select',
// 'p': {$:{}},
// 'br':{$:{}},
// 'div':{'$':{}},
// 'li':{'$':{}},
// 'caption':transP,
// 'th':transP,
// 'tr':transP,
// 'h1':transP,'h2':transP,'h3':transP,'h4':transP,'h5':transP,'h6':transP,
// 'td':function(node){
// //没有内容的td直接删掉
// var txt = !!node.innerText();
// if(txt){
// node.parentNode.insertAfter(UE.uNode.createText('    '),node);
// }
// node.parentNode.removeChild(node,node.innerText())
// }
// }
//}()
,'filterTxtRules' : function(){
function transP(node){
node.tagName = 'p';
node.setStyle();
}
return {
//直接删除及其字节点内容
'-' : 'script style object iframe embed input select',
'p': {$:{}},
'br':{$:{}},
'div':{'$':{}},
'li':{'$':{}},
'caption':transP,
'th':transP,
'tr':transP,
'h1':transP,'h2':transP,'h3':transP,'h4':transP,'h5':transP,'h6':transP,
'td':function(node){
//没有内容的td直接删掉
var txt = !!node.innerText();
if(txt){
node.parentNode.insertAfter(UE.uNode.createText('    '),node);
}
node.parentNode.removeChild(node,node.innerText())
}
}
}()
//,allHtmlEnabled:false //提交到后台的数据是否包含整个html字符串
@ -430,69 +444,44 @@
};
function getUEBasePath(docUrl, confUrl) {
var basePath = getBasePath(docUrl || self.document.URL || self.location.href, confUrl || getConfigFilePath());
return basePath;
}
function getConfigFilePath() {
var configPath = document.getElementsByTagName('script');
configPath = configPath[ configPath.length - 1 ].src;
return configPath;
}
function getBasePath(docUrl, confUrl) {
var basePath = confUrl;
if (/^(\/|\\\\)/.test(confUrl)) {
basePath = /^.+?\w(\/|\\\\)/.exec(docUrl)[0] + confUrl.replace(/^(\/|\\\\)/, '');
} else if (!/^[a-z]+:/i.test(confUrl)) {
docUrl = docUrl.split("#")[0].split("?")[0].replace(/[^\\\/]+$/, '');
basePath = docUrl + "" + confUrl;
}
return optimizationPath(basePath);
}
function optimizationPath(path) {
var protocol = /^[a-z]+:\/\//.exec(path)[ 0 ],
tmp = null,
res = [];
path = path.replace(protocol, "").split("?")[0].split("#")[0];
path = path.replace(/\\/g, '/').split(/\//);
path[ path.length - 1 ] = "";
while (path.length) {
if (( tmp = path.shift() ) === "..") {
res.pop();
} else if (tmp !== ".") {
res.push(tmp);
}
}
return protocol + res.join("/");
}
window.UE = {
getUEBasePath: getUEBasePath
};
})();

View File

@ -11,7 +11,7 @@
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-anim layui-anim-fadein">
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-card">