diff --git a/jflow-core/src/main/java/bp/wf/httphandler/WF_Comm.java b/jflow-core/src/main/java/bp/wf/httphandler/WF_Comm.java index d3c54f5df502689f853d5797240d09938e3df338..824fa45783365bebafc26eb6d1ccd5907b4336c0 100644 --- a/jflow-core/src/main/java/bp/wf/httphandler/WF_Comm.java +++ b/jflow-core/src/main/java/bp/wf/httphandler/WF_Comm.java @@ -2,6 +2,7 @@ package bp.wf.httphandler; import bp.da.*; import bp.difference.SystemConfig; +import bp.difference.handler.CommonFileUtils; import bp.difference.handler.WebContralBase; import bp.sys.*; import bp.sys.xml.ActiveAttr; @@ -16,6 +17,9 @@ import bp.wf.*; import bp.wf.Glo; import bp.wf.port.WFEmp; import java.util.*; + +import javax.servlet.http.HttpServletRequest; + import java.io.*; import java.lang.reflect.InvocationTargetException; import java.math.*; @@ -26,6 +30,35 @@ import java.math.*; public class WF_Comm extends WebContralBase { +public final String RichUploadFile() throws Exception { + + File xmlFile = null; + String fileName = ""; + String savePath = ""; + HttpServletRequest request = getRequest(); + String contentType = request.getContentType(); + if (contentType != null && contentType.indexOf("multipart/form-data") != -1) { + fileName = CommonFileUtils.getOriginalFilename(request, "upfile"); + // pr 增加 + request.getParameter("WorkID") ,获取 GET 参数,路径拼接加上 workid 命名的文件夹 + savePath = SystemConfig.getPathOfDataUser() + "RichTextFile/"+ request.getParameter("WorkID"); + if (new File(savePath).exists() == false) + new File(savePath).mkdirs(); + savePath = savePath + "/" + fileName; + xmlFile = new File(savePath); + if (xmlFile.exists()) { + xmlFile.delete(); + } + + try { + CommonFileUtils.upload(request, "upfile", xmlFile); + } catch (Exception e) { + e.printStackTrace(); + return "err@执行失败"; + } + } + return savePath; + } + ///树的实体. /** 获得树的结构 diff --git a/jflow-web/src/main/webapp/WF/Comm/umeditor1.2.3-utf8/umeditor.config.js b/jflow-web/src/main/webapp/WF/Comm/umeditor1.2.3-utf8/umeditor.config.js index 0c0d86357dd6de109aa28cdb8ec6b2f001ca759c..39cb16122a2b52530b88dcffd6bbb0eca5c11ef0 100644 --- a/jflow-web/src/main/webapp/WF/Comm/umeditor1.2.3-utf8/umeditor.config.js +++ b/jflow-web/src/main/webapp/WF/Comm/umeditor1.2.3-utf8/umeditor.config.js @@ -10,347 +10,351 @@ **************************提示********************************/ etpl.config({ - commandOpen: '<%', - commandClose: '%>' + commandOpen: '<%', + commandClose: '%>' }); (function () { - /** - * 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。 - * 鉴于很多同学在使用编辑器的时候出现的种种路径问题,此处强烈建议大家使用"相对于网站根目录的相对路径"进行配置。 - * "相对于网站根目录的相对路径"也就是以斜杠开头的形如"/myProject/umeditor/"这样的路径。 - * 如果站点中有多个不在同一层级的页面需要实例化编辑器,且引用了同一UEditor的时候,此处的URL可能不适用于每个页面的编辑器。 - * 因此,UEditor提供了针对不同页面的编辑器可单独配置的根路径,具体来说,在需要实例化编辑器的页面最顶部写上如下代码即可。当然,需要令此处的URL等于对应的配置。 - * window.UMEDITOR_HOME_URL = "/xxxx/xxxx/"; - */ - window.UMEDITOR_HOME_URL = "../Comm/umeditor1.2.3-utf8/"; - var URL = window.UMEDITOR_HOME_URL || (function () { + /** + * 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。 + * 鉴于很多同学在使用编辑器的时候出现的种种路径问题,此处强烈建议大家使用"相对于网站根目录的相对路径"进行配置。 + * "相对于网站根目录的相对路径"也就是以斜杠开头的形如"/myProject/umeditor/"这样的路径。 + * 如果站点中有多个不在同一层级的页面需要实例化编辑器,且引用了同一UEditor的时候,此处的URL可能不适用于每个页面的编辑器。 + * 因此,UEditor提供了针对不同页面的编辑器可单独配置的根路径,具体来说,在需要实例化编辑器的页面最顶部写上如下代码即可。当然,需要令此处的URL等于对应的配置。 + * window.UMEDITOR_HOME_URL = "/xxxx/xxxx/"; + */ + window.UMEDITOR_HOME_URL = basePath+"/WF/Comm/umeditor1.2.3-utf8/"; + + var URL = window.UMEDITOR_HOME_URL || (function () { - function PathStack() { + function PathStack() { - this.documentURL = self.document.URL || self.location.href; + this.documentURL = self.document.URL || self.location.href; - this.separator = '/'; - this.separatorPattern = /\\|\//g; - this.currentDir = './'; - this.currentDirPattern = /^[.]\/]/; + this.separator = '/'; + this.separatorPattern = /\\|\//g; + this.currentDir = './'; + this.currentDirPattern = /^[.]\/]/; - this.path = this.documentURL; - this.stack = []; + this.path = this.documentURL; + this.stack = []; - this.push(this.documentURL); + this.push(this.documentURL); - } + } - PathStack.isParentPath = function (path) { - return path === '..'; - }; + PathStack.isParentPath = function (path) { + return path === '..'; + }; - PathStack.hasProtocol = function (path) { - return !!PathStack.getProtocol(path); - }; + PathStack.hasProtocol = function (path) { + return !!PathStack.getProtocol(path); + }; - PathStack.getProtocol = function (path) { + PathStack.getProtocol = function (path) { - var protocol = /^[^:]*:\/*/.exec(path); + var protocol = /^[^:]*:\/*/.exec(path); - return protocol ? protocol[0] : null; + return protocol ? protocol[0] : null; - }; + }; - PathStack.prototype = { - push: function (path) { + PathStack.prototype = { + push: function (path) { - this.path = path; + this.path = path; - update.call(this); - parse.call(this); + update.call(this); + parse.call(this); - return this; + return this; - }, - getPath: function () { - return this + ""; - }, - toString: function () { - return this.protocol + (this.stack.concat([''])).join(this.separator); - } - }; + }, + getPath: function () { + return this + ""; + }, + toString: function () { + return this.protocol + (this.stack.concat([''])).join(this.separator); + } + }; - function update() { + function update() { - var protocol = PathStack.getProtocol(this.path || ''); + var protocol = PathStack.getProtocol(this.path || ''); - if (protocol) { + if (protocol) { - //根协议 - this.protocol = protocol; + //根协议 + this.protocol = protocol; - //local - this.localSeparator = /\\|\//.exec(this.path.replace(protocol, ''))[0]; + //local + this.localSeparator = /\\|\//.exec(this.path.replace(protocol, ''))[0]; - this.stack = []; - } else { - protocol = /\\|\//.exec(this.path); - protocol && (this.localSeparator = protocol[0]); - } + this.stack = []; + } else { + protocol = /\\|\//.exec(this.path); + protocol && (this.localSeparator = protocol[0]); + } - } + } - function parse() { + function parse() { - var parsedStack = this.path.replace(this.currentDirPattern, ''); + var parsedStack = this.path.replace(this.currentDirPattern, ''); - if (PathStack.hasProtocol(this.path)) { - parsedStack = parsedStack.replace(this.protocol, ''); - } + if (PathStack.hasProtocol(this.path)) { + parsedStack = parsedStack.replace(this.protocol, ''); + } - parsedStack = parsedStack.split(this.localSeparator); - parsedStack.length = parsedStack.length - 1; + parsedStack = parsedStack.split(this.localSeparator); + parsedStack.length = parsedStack.length - 1; - for (var i = 0, tempPath, l = parsedStack.length, root = this.stack; i < l; i++) { - tempPath = parsedStack[i]; - if (tempPath) { - if (PathStack.isParentPath(tempPath)) { - root.pop(); - } else { - root.push(tempPath); - } - } + for (var i = 0, tempPath, l = parsedStack.length, root = this.stack; i < l; i++) { + tempPath = parsedStack[i]; + if (tempPath) { + if (PathStack.isParentPath(tempPath)) { + root.pop(); + } else { + root.push(tempPath); + } + } - } + } - } + } - var currentPath = document.getElementsByTagName('script'); + var currentPath = document.getElementsByTagName('script'); - currentPath = currentPath[currentPath.length - 1].src; + currentPath = currentPath[currentPath.length - 1].src; - return new PathStack().push(currentPath) + ""; + return new PathStack().push(currentPath) + ""; - })(); + })(); - /** - * 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。 - */ - var richurl; - var directory = GetQueryString("EnName"); - if (directory == null || directory == "undefined") - directory = "ND" + GetQueryString("FK_Flow"); + /** + * 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。 + */ + var richurl; + var directory = GetQueryString("EnName"); + if (directory == null || directory == "undefined") + directory = "ND" + GetQueryString("FK_Flow"); - if (plant == "CCFlow") { - // CCFlow - var handlerUrl = basePath+"/WF/Comm/Handler.ashx"; - richurl = handlerUrl + '?DoType=HttpHandler&DoMethod=RichUploadFile&HttpHandlerName=BP.WF.HttpHandler.WF_Comm_Sys&Directory=' + directory; - } else { - // JFlow - var handlerUrl = basePath + "/WF/Comm/ProcessRequest.do"; - richurl = handlerUrl + '?DoType=RichUploadFile&Directory=' + directory; - } + if (plant == "CCFlow") { + // CCFlow + var handlerUrl = basePath+"/WF/Comm/Handler.ashx"; + richurl = handlerUrl + '?DoType=HttpHandler&DoMethod=RichUploadFile&HttpHandlerName=BP.WF.HttpHandler.WF_Comm_Sys&Directory=' + directory; + } else { + // JFlow + var handlerUrl = basePath + "/WF/Comm/ProcessRequest.do"; + richurl = handlerUrl + '?DoType=RichUploadFile&Directory=' + directory; + richurl += "&DoMethod=RichUploadFile"; + richurl += "&HttpHandlerName=BP.WF.HttpHandler.WF_Comm_Sys"; + } - //richurl = '/WF/Comm/Sys/Handler.ashx?DoType=RichUploadFile&Directory='+directory; - window.UMEDITOR_CONFIG = { + //richurl = '/WF/Comm/Sys/Handler.ashx?DoType=RichUploadFile&Directory='+directory; + window.UMEDITOR_CONFIG = { - //为编辑器实例添加一个路径,这个不能被注释 - UMEDITOR_HOME_URL: URL + //为编辑器实例添加一个路径,这个不能被注释 + UMEDITOR_HOME_URL: URL - //图片上传配置区 - , imageUrl: richurl //图片上传提交地址 - , imagePath: URL + "asp/" //图片修正地址,引用了fixedImagePath,如有特殊需求,可自行配置 - , imageFieldName: "upfile" //图片数据的key,若此处修改,需要在后台对应文件修改对应参数 + //图片上传配置区 + // pr 增加 +"&WorkID="+ GetQueryString("WorkID") 传入WorkID参数 + , imageUrl: richurl+"&WorkID="+ GetQueryString("WorkID") //图片上传提交地址 + , imagePath: URL + "asp/" //图片修正地址,引用了fixedImagePath,如有特殊需求,可自行配置 + , imageFieldName: "upfile" //图片数据的key,若此处修改,需要在后台对应文件修改对应参数 - //工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的从新定义 - , toolbar: [ - 'source | undo redo | bold italic underline strikethrough | superscript subscript | forecolor backcolor | removeformat |', - 'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize', - '| justifyleft justifycenter justifyright justifyjustify |', - 'link unlink | emotion image video | map', - '| horizontal print preview ', 'drafts', 'formula' - ] + //工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的从新定义 + , toolbar: [ + 'source | undo redo | bold italic underline strikethrough | superscript subscript | forecolor backcolor | removeformat |', + 'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize', + '| justifyleft justifycenter justifyright justifyjustify |', + 'link unlink | emotion image video | map', + '| horizontal print preview ', 'drafts', 'formula' + ] - //语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件: - //lang值也可以通过自动获取 (navigator.language||navigator.browserLanguage ||navigator.userLanguage).toLowerCase() - //,lang:"zh-cn" - //,langPath:URL +"lang/" + //语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件: + //lang值也可以通过自动获取 (navigator.language||navigator.browserLanguage ||navigator.userLanguage).toLowerCase() + //,lang:"zh-cn" + //,langPath:URL +"lang/" - //ie下的链接自动监测 - //,autourldetectinie:false + //ie下的链接自动监测 + //,autourldetectinie:false - //主题配置项,默认是default。有需要的话也可以使用如下这样的方式来自动多主题切换,当然,前提条件是themes文件夹下存在对应的主题文件: - //现有如下皮肤:default - //,theme:'default' - //,themePath:URL +"themes/" + //主题配置项,默认是default。有需要的话也可以使用如下这样的方式来自动多主题切换,当然,前提条件是themes文件夹下存在对应的主题文件: + //现有如下皮肤:default + //,theme:'default' + //,themePath:URL +"themes/" - //针对getAllHtml方法,会在对应的head标签中增加该编码设置。 - //,charset:"utf-8" + //针对getAllHtml方法,会在对应的head标签中增加该编码设置。 + //,charset:"utf-8" - //常用配置项目 - //,isShow : true //默认显示编辑器 + //常用配置项目 + //,isShow : true //默认显示编辑器 - //,initialContent:'欢迎使用UMEDITOR!' //初始化编辑器的内容,也可以通过textarea/script给值,看官网例子 + //,initialContent:'欢迎使用UMEDITOR!' //初始化编辑器的内容,也可以通过textarea/script给值,看官网例子 - //,initialFrameWidth:500 //初始化编辑器宽度,默认500 - //,initialFrameHeight:500 //初始化编辑器高度,默认500 - - //,autoClearinitialContent:true //是否自动清除编辑器初始内容,注意:如果focus属性设置为true,这个也为真,那么编辑器一上来就会触发导致初始化的内容看不到了 - - //,textarea:'editorValue' // 提交表单时,服务器获取编辑器提交内容的所用的参数,多实例时可以给容器name属性,会将name给定的值最为每个实例的键值,不用每次实例化的时候都设置这个值 - - //,focus:false //初始化时,是否让编辑器获得焦点true或false - - //,autoClearEmptyNode : true //getContent时,是否删除空的inlineElement节点(包括嵌套的情况) - - //,fullscreen : false //是否开启初始化时即全屏,默认关闭 - - //,readonly : false //编辑器初始化结束后,编辑区域是否是只读的,默认是false - - //,zIndex : 900 //编辑器层级的基数,默认是900 - - //如果自定义,最好给p标签如下的行高,要不输入中文时,会有跳动感 - //注意这里添加的样式,最好放在.edui-editor-body .edui-body-container这两个的下边,防止跟页面上css冲突 - //,initialStyle:'.edui-editor-body .edui-body-container p{line-height:1em}' - - //,autoSyncData:true //自动同步编辑器要提交的数据 - - //,emotionLocalization:false //是否开启表情本地化,默认关闭。若要开启请确保emotion文件夹下包含官网提供的images表情文件夹 - - //,allHtmlEnabled:false //提交到后台的数据是否包含整个html字符串 - - //fontfamily - //字体设置 - , 'fontfamily': [ - { label: '', name: 'songti', val: '宋体,SimSun' }, - { label: '', name: 'FangSong_GB2312', val: '仿宋_GB2312 ,FangSong_GB2312' }, - { label: '', name: 'kaiti', val: '楷体,楷体_GB2312, SimKai' }, - { label: '', name: 'yahei', val: '微软雅黑,Microsoft YaHei' }, - { label: '', name: 'heiti', val: '黑体, SimHei' }, - { label: '', name: 'lishu', val: '隶书, SimLi' }, - { label: '', name: 'andaleMono', val: 'andale mono' }, - { label: '', name: 'arial', val: 'arial, helvetica,sans-serif' }, - { label: '', name: 'arialBlack', val: 'arial black,avant garde' }, - { label: '', name: 'comicSansMs', val: 'comic sans ms' }, - { label: '', name: 'impact', val: 'impact,chicago' }, - { label: '', name: 'timesNewRoman', val: 'times new roman' } - ] - //fontsize - //字号 - //,'fontsize':[10, 11, 12, 14, 16, 18, 20, 24, 36] - - //paragraph - //段落格式 值留空时支持多语言自动识别,若配置,则以配置值为准 - //,'paragraph':{'p':'', 'h1':'', 'h2':'', 'h3':'', 'h4':'', 'h5':'', 'h6':''} - - //undo - //可以最多回退的次数,默认20 - //,maxUndoCount:20 - //当输入的字符数超过该值时,保存一次现场 - //,maxInputCount:1 - - //imageScaleEnabled - // 是否允许点击文件拖拽改变大小,默认true - //,imageScaleEnabled:true - - //dropFileEnabled - // 是否允许拖放图片到编辑区域,上传并插入,默认true - , dropFileEnabled: true - - //pasteImageEnabled - // 是否允许粘贴QQ截屏,上传并插入,默认true - , pasteImageEnabled: true - - //autoHeightEnabled - // 是否自动长高,默认true - //,autoHeightEnabled:true - - //autoFloatEnabled - //是否保持toolbar的位置不动,默认true - //,autoFloatEnabled:true - - //浮动时工具栏距离浏览器顶部的高度,用于某些具有固定头部的页面 - //,topOffset:30 - - //填写过滤规则 - , filterRules: {} - // xss 过滤是否开启,inserthtml等操作 - , xssFilterRules: true - //input xss过滤 - , inputXssFilter: true - //output xss过滤 - , outputXssFilter: true - // xss过滤白名单 名单来源: https://raw.githubusercontent.com/leizongmin/js-xss/master/lib/default.js - , whiteList: { - a: ['target', 'href', 'title', 'style', 'class', 'id'], - abbr: ['title', 'style', 'class', 'id'], - address: ['style', 'class', 'id'], - area: ['shape', 'coords', 'href', 'alt', 'style', 'class', 'id'], - article: ['style', 'class', 'id'], - aside: ['style', 'class', 'id'], - audio: ['autoplay', 'controls', 'loop', 'preload', 'src', 'style', 'class', 'id'], - b: ['style', 'class', 'id'], - bdi: ['dir'], - bdo: ['dir'], - big: [], - blockquote: ['cite', 'style', 'class', 'id'], - br: [], - caption: ['style', 'class', 'id'], - center: [], - cite: [], - code: ['style', 'class', 'id'], - col: ['align', 'valign', 'span', 'width', 'style', 'class', 'id'], - colgroup: ['align', 'valign', 'span', 'width', 'style', 'class', 'id'], - dd: ['style', 'class', 'id'], - del: ['datetime', 'style', 'class', 'id'], - details: ['open', 'style', 'class', 'id'], - div: ['style', 'class', 'id'], - dl: ['style', 'class', 'id'], - dt: ['style', 'class', 'id'], - em: ['style', 'class', 'id'], - embed: ['style', 'class', 'id', '_url', 'type', 'pluginspage', 'src', 'width', 'height', 'wmode', 'play', 'loop', 'menu', 'allowscriptaccess', 'allowfullscreen'], - font: ['color', 'size', 'face', 'style', 'class', 'id'], - footer: ['style', 'class', 'id'], - h1: ['style', 'class', 'id'], - h2: ['style', 'class', 'id'], - h3: ['style', 'class', 'id'], - h4: ['style', 'class', 'id'], - h5: ['style', 'class', 'id'], - h6: ['style', 'class', 'id'], - header: ['style', 'class', 'id'], - hr: ['style', 'class', 'id'], - i: ['style', 'class', 'id'], - iframe: ['style', 'class', 'id', 'src', 'frameborder', 'data-latex'], - img: ['src', 'alt', 'title', 'width', 'height', 'style', 'class', 'id', '_url'], - ins: ['datetime', 'style', 'class', 'id'], - li: ['style', 'class', 'id'], - mark: [], - nav: [], - ol: ['style', 'class', 'id'], - p: ['style', 'class', 'id'], - pre: ['style', 'class', 'id'], - s: [], - section: [], - small: ['style', 'class', 'id'], - span: ['style', 'class', 'id'], - sub: ['style', 'class', 'id'], - sup: ['style', 'class', 'id'], - strong: ['style', 'class', 'id'], - table: ['width', 'border', 'align', 'valign', 'style', 'class', 'id'], - tbody: ['align', 'valign', 'style', 'class', 'id'], - td: ['width', 'rowspan', 'colspan', 'align', 'valign', 'style', 'class', 'id'], - tfoot: ['align', 'valign', 'style', 'class', 'id'], - th: ['width', 'rowspan', 'colspan', 'align', 'valign', 'style', 'class', 'id'], - thead: ['align', 'valign', 'style', 'class', 'id'], - tr: ['rowspan', 'align', 'valign', 'style', 'class', 'id'], - tt: ['style', 'class', 'id'], - u: [], - ul: ['style', 'class', 'id'], - svg: ['style', 'class', 'id', 'width', 'height', 'xmlns', 'fill', 'viewBox'], - video: ['autoplay', 'controls', 'loop', 'preload', 'src', 'height', 'width', 'style', 'class', 'id'] - } - }; + //,initialFrameWidth:500 //初始化编辑器宽度,默认500 + //,initialFrameHeight:500 //初始化编辑器高度,默认500 + + //,autoClearinitialContent:true //是否自动清除编辑器初始内容,注意:如果focus属性设置为true,这个也为真,那么编辑器一上来就会触发导致初始化的内容看不到了 + + //,textarea:'editorValue' // 提交表单时,服务器获取编辑器提交内容的所用的参数,多实例时可以给容器name属性,会将name给定的值最为每个实例的键值,不用每次实例化的时候都设置这个值 + + //,focus:false //初始化时,是否让编辑器获得焦点true或false + + //,autoClearEmptyNode : true //getContent时,是否删除空的inlineElement节点(包括嵌套的情况) + + //,fullscreen : false //是否开启初始化时即全屏,默认关闭 + + //,readonly : false //编辑器初始化结束后,编辑区域是否是只读的,默认是false + + //,zIndex : 900 //编辑器层级的基数,默认是900 + + //如果自定义,最好给p标签如下的行高,要不输入中文时,会有跳动感 + //注意这里添加的样式,最好放在.edui-editor-body .edui-body-container这两个的下边,防止跟页面上css冲突 + //,initialStyle:'.edui-editor-body .edui-body-container p{line-height:1em}' + + //,autoSyncData:true //自动同步编辑器要提交的数据 + + //,emotionLocalization:false //是否开启表情本地化,默认关闭。若要开启请确保emotion文件夹下包含官网提供的images表情文件夹 + + //,allHtmlEnabled:false //提交到后台的数据是否包含整个html字符串 + + //fontfamily + //字体设置 + , 'fontfamily': [ + { label: '', name: 'songti', val: '宋体,SimSun' }, + { label: '', name: 'FangSong_GB2312', val: '仿宋_GB2312 ,FangSong_GB2312' }, + { label: '', name: 'kaiti', val: '楷体,楷体_GB2312, SimKai' }, + { label: '', name: 'yahei', val: '微软雅黑,Microsoft YaHei' }, + { label: '', name: 'heiti', val: '黑体, SimHei' }, + { label: '', name: 'lishu', val: '隶书, SimLi' }, + { label: '', name: 'andaleMono', val: 'andale mono' }, + { label: '', name: 'arial', val: 'arial, helvetica,sans-serif' }, + { label: '', name: 'arialBlack', val: 'arial black,avant garde' }, + { label: '', name: 'comicSansMs', val: 'comic sans ms' }, + { label: '', name: 'impact', val: 'impact,chicago' }, + { label: '', name: 'timesNewRoman', val: 'times new roman' } + ] + //fontsize + //字号 + //,'fontsize':[10, 11, 12, 14, 16, 18, 20, 24, 36] + + //paragraph + //段落格式 值留空时支持多语言自动识别,若配置,则以配置值为准 + //,'paragraph':{'p':'', 'h1':'', 'h2':'', 'h3':'', 'h4':'', 'h5':'', 'h6':''} + + //undo + //可以最多回退的次数,默认20 + //,maxUndoCount:20 + //当输入的字符数超过该值时,保存一次现场 + //,maxInputCount:1 + + //imageScaleEnabled + // 是否允许点击文件拖拽改变大小,默认true + //,imageScaleEnabled:true + + //dropFileEnabled + // 是否允许拖放图片到编辑区域,上传并插入,默认true + , dropFileEnabled: true + + //pasteImageEnabled + // 是否允许粘贴QQ截屏,上传并插入,默认true + , pasteImageEnabled: true + + //autoHeightEnabled + // 是否自动长高,默认true + //,autoHeightEnabled:true + + //autoFloatEnabled + //是否保持toolbar的位置不动,默认true + //,autoFloatEnabled:true + + //浮动时工具栏距离浏览器顶部的高度,用于某些具有固定头部的页面 + //,topOffset:30 + + //填写过滤规则 + , filterRules: {} + // xss 过滤是否开启,inserthtml等操作 + , xssFilterRules: true + //input xss过滤 + , inputXssFilter: true + //output xss过滤 + , outputXssFilter: true + // xss过滤白名单 名单来源: https://raw.githubusercontent.com/leizongmin/js-xss/master/lib/default.js + , whiteList: { + a: ['target', 'href', 'title', 'style', 'class', 'id'], + abbr: ['title', 'style', 'class', 'id'], + address: ['style', 'class', 'id'], + area: ['shape', 'coords', 'href', 'alt', 'style', 'class', 'id'], + article: ['style', 'class', 'id'], + aside: ['style', 'class', 'id'], + audio: ['autoplay', 'controls', 'loop', 'preload', 'src', 'style', 'class', 'id'], + b: ['style', 'class', 'id'], + bdi: ['dir'], + bdo: ['dir'], + big: [], + blockquote: ['cite', 'style', 'class', 'id'], + br: [], + caption: ['style', 'class', 'id'], + center: [], + cite: [], + code: ['style', 'class', 'id'], + col: ['align', 'valign', 'span', 'width', 'style', 'class', 'id'], + colgroup: ['align', 'valign', 'span', 'width', 'style', 'class', 'id'], + dd: ['style', 'class', 'id'], + del: ['datetime', 'style', 'class', 'id'], + details: ['open', 'style', 'class', 'id'], + div: ['style', 'class', 'id'], + dl: ['style', 'class', 'id'], + dt: ['style', 'class', 'id'], + em: ['style', 'class', 'id'], + embed: ['style', 'class', 'id', '_url', 'type', 'pluginspage', 'src', 'width', 'height', 'wmode', 'play', 'loop', 'menu', 'allowscriptaccess', 'allowfullscreen'], + font: ['color', 'size', 'face', 'style', 'class', 'id'], + footer: ['style', 'class', 'id'], + h1: ['style', 'class', 'id'], + h2: ['style', 'class', 'id'], + h3: ['style', 'class', 'id'], + h4: ['style', 'class', 'id'], + h5: ['style', 'class', 'id'], + h6: ['style', 'class', 'id'], + header: ['style', 'class', 'id'], + hr: ['style', 'class', 'id'], + i: ['style', 'class', 'id'], + iframe: ['style', 'class', 'id', 'src', 'frameborder', 'data-latex'], + img: ['src', 'alt', 'title', 'width', 'height', 'style', 'class', 'id', '_url'], + ins: ['datetime', 'style', 'class', 'id'], + li: ['style', 'class', 'id'], + mark: [], + nav: [], + ol: ['style', 'class', 'id'], + p: ['style', 'class', 'id'], + pre: ['style', 'class', 'id'], + s: [], + section: [], + small: ['style', 'class', 'id'], + span: ['style', 'class', 'id'], + sub: ['style', 'class', 'id'], + sup: ['style', 'class', 'id'], + strong: ['style', 'class', 'id'], + table: ['width', 'border', 'align', 'valign', 'style', 'class', 'id'], + tbody: ['align', 'valign', 'style', 'class', 'id'], + td: ['width', 'rowspan', 'colspan', 'align', 'valign', 'style', 'class', 'id'], + tfoot: ['align', 'valign', 'style', 'class', 'id'], + th: ['width', 'rowspan', 'colspan', 'align', 'valign', 'style', 'class', 'id'], + thead: ['align', 'valign', 'style', 'class', 'id'], + tr: ['rowspan', 'align', 'valign', 'style', 'class', 'id'], + tt: ['style', 'class', 'id'], + u: [], + ul: ['style', 'class', 'id'], + svg: ['style', 'class', 'id', 'width', 'height', 'xmlns', 'fill', 'viewBox'], + video: ['autoplay', 'controls', 'loop', 'preload', 'src', 'height', 'width', 'style', 'class', 'id'] + } + }; })();