|
@@ -30,7 +30,8 @@
|
|
|
UEDITOR_HOME_URL: URL
|
|
|
|
|
|
// 服务器统一请求接口路径
|
|
|
- , serverUrl: URL + "jsp/controller.jsp"
|
|
|
+ // , serverUrl: URL + "jsp/controller.jsp"
|
|
|
+ , serverUrl: "/api/admin/uploadfile"
|
|
|
|
|
|
//工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的重新定义
|
|
|
, toolbars: [[
|
|
@@ -355,78 +356,78 @@
|
|
|
//,allowDivTransToP:true //允许进入编辑器的div标签自动变成p标签
|
|
|
//,rgb2Hex:true //默认产出的数据中的color自动从rgb格式变成16进制格式
|
|
|
|
|
|
- // 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', 'class', 'style'],
|
|
|
- abbr: ['title', 'class', 'style'],
|
|
|
- address: ['class', 'style'],
|
|
|
- area: ['shape', 'coords', 'href', 'alt'],
|
|
|
- article: [],
|
|
|
- aside: [],
|
|
|
- audio: ['autoplay', 'controls', 'loop', 'preload', 'src', 'class', 'style'],
|
|
|
- b: ['class', 'style'],
|
|
|
- bdi: ['dir'],
|
|
|
- bdo: ['dir'],
|
|
|
- big: [],
|
|
|
- blockquote: ['cite', 'class', 'style'],
|
|
|
- br: [],
|
|
|
- caption: ['class', 'style'],
|
|
|
- center: [],
|
|
|
- cite: [],
|
|
|
- code: ['class', 'style'],
|
|
|
- col: ['align', 'valign', 'span', 'width', 'class', 'style'],
|
|
|
- colgroup: ['align', 'valign', 'span', 'width', 'class', 'style'],
|
|
|
- dd: ['class', 'style'],
|
|
|
- del: ['datetime'],
|
|
|
- details: ['open'],
|
|
|
- div: ['class', 'style'],
|
|
|
- dl: ['class', 'style'],
|
|
|
- dt: ['class', 'style'],
|
|
|
- em: ['class', 'style'],
|
|
|
- font: ['color', 'size', 'face'],
|
|
|
- footer: [],
|
|
|
- h1: ['class', 'style'],
|
|
|
- h2: ['class', 'style'],
|
|
|
- h3: ['class', 'style'],
|
|
|
- h4: ['class', 'style'],
|
|
|
- h5: ['class', 'style'],
|
|
|
- h6: ['class', 'style'],
|
|
|
- header: [],
|
|
|
- hr: [],
|
|
|
- i: ['class', 'style'],
|
|
|
- img: ['src', 'alt', 'title', 'width', 'height', 'id', '_src', 'loadingclass', 'class', 'data-latex'],
|
|
|
- ins: ['datetime'],
|
|
|
- li: ['class', 'style'],
|
|
|
- mark: [],
|
|
|
- nav: [],
|
|
|
- ol: ['class', 'style'],
|
|
|
- p: ['class', 'style'],
|
|
|
- pre: ['class', 'style'],
|
|
|
- s: [],
|
|
|
- section:[],
|
|
|
- small: [],
|
|
|
- span: ['class', 'style'],
|
|
|
- sub: ['class', 'style'],
|
|
|
- sup: ['class', 'style'],
|
|
|
- strong: ['class', 'style'],
|
|
|
- table: ['width', 'border', 'align', 'valign', 'class', 'style'],
|
|
|
- tbody: ['align', 'valign', 'class', 'style'],
|
|
|
- td: ['width', 'rowspan', 'colspan', 'align', 'valign', 'class', 'style'],
|
|
|
- tfoot: ['align', 'valign', 'class', 'style'],
|
|
|
- th: ['width', 'rowspan', 'colspan', 'align', 'valign', 'class', 'style'],
|
|
|
- thead: ['align', 'valign', 'class', 'style'],
|
|
|
- tr: ['rowspan', 'align', 'valign', 'class', 'style'],
|
|
|
- tt: [],
|
|
|
- u: [],
|
|
|
- ul: ['class', 'style'],
|
|
|
- video: ['autoplay', 'controls', 'loop', 'preload', 'src', 'height', 'width', 'class', 'style']
|
|
|
- }
|
|
|
+ // 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', 'class', 'style'],
|
|
|
+ abbr: ['title', 'class', 'style'],
|
|
|
+ address: ['class', 'style'],
|
|
|
+ area: ['shape', 'coords', 'href', 'alt'],
|
|
|
+ article: [],
|
|
|
+ aside: [],
|
|
|
+ audio: ['autoplay', 'controls', 'loop', 'preload', 'src', 'class', 'style'],
|
|
|
+ b: ['class', 'style'],
|
|
|
+ bdi: ['dir'],
|
|
|
+ bdo: ['dir'],
|
|
|
+ big: [],
|
|
|
+ blockquote: ['cite', 'class', 'style'],
|
|
|
+ br: [],
|
|
|
+ caption: ['class', 'style'],
|
|
|
+ center: [],
|
|
|
+ cite: [],
|
|
|
+ code: ['class', 'style'],
|
|
|
+ col: ['align', 'valign', 'span', 'width', 'class', 'style'],
|
|
|
+ colgroup: ['align', 'valign', 'span', 'width', 'class', 'style'],
|
|
|
+ dd: ['class', 'style'],
|
|
|
+ del: ['datetime'],
|
|
|
+ details: ['open'],
|
|
|
+ div: ['class', 'style'],
|
|
|
+ dl: ['class', 'style'],
|
|
|
+ dt: ['class', 'style'],
|
|
|
+ em: ['class', 'style'],
|
|
|
+ font: ['color', 'size', 'face'],
|
|
|
+ footer: [],
|
|
|
+ h1: ['class', 'style'],
|
|
|
+ h2: ['class', 'style'],
|
|
|
+ h3: ['class', 'style'],
|
|
|
+ h4: ['class', 'style'],
|
|
|
+ h5: ['class', 'style'],
|
|
|
+ h6: ['class', 'style'],
|
|
|
+ header: [],
|
|
|
+ hr: [],
|
|
|
+ i: ['class', 'style'],
|
|
|
+ img: ['src', 'alt', 'title', 'width', 'height', 'id', '_src', 'loadingclass', 'class', 'data-latex'],
|
|
|
+ ins: ['datetime'],
|
|
|
+ li: ['class', 'style'],
|
|
|
+ mark: [],
|
|
|
+ nav: [],
|
|
|
+ ol: ['class', 'style'],
|
|
|
+ p: ['class', 'style'],
|
|
|
+ pre: ['class', 'style'],
|
|
|
+ s: [],
|
|
|
+ section: [],
|
|
|
+ small: [],
|
|
|
+ span: ['class', 'style'],
|
|
|
+ sub: ['class', 'style'],
|
|
|
+ sup: ['class', 'style'],
|
|
|
+ strong: ['class', 'style'],
|
|
|
+ table: ['width', 'border', 'align', 'valign', 'class', 'style'],
|
|
|
+ tbody: ['align', 'valign', 'class', 'style'],
|
|
|
+ td: ['width', 'rowspan', 'colspan', 'align', 'valign', 'class', 'style'],
|
|
|
+ tfoot: ['align', 'valign', 'class', 'style'],
|
|
|
+ th: ['width', 'rowspan', 'colspan', 'align', 'valign', 'class', 'style'],
|
|
|
+ thead: ['align', 'valign', 'class', 'style'],
|
|
|
+ tr: ['rowspan', 'align', 'valign', 'class', 'style'],
|
|
|
+ tt: [],
|
|
|
+ u: [],
|
|
|
+ ul: ['class', 'style'],
|
|
|
+ video: ['autoplay', 'controls', 'loop', 'preload', 'src', 'height', 'width', 'class', 'style']
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
function getUEBasePath(docUrl, confUrl) {
|
|
@@ -439,7 +440,7 @@
|
|
|
|
|
|
var configPath = document.getElementsByTagName('script');
|
|
|
|
|
|
- return configPath[ configPath.length - 1 ].src;
|
|
|
+ return configPath[configPath.length - 1].src;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -466,7 +467,7 @@
|
|
|
|
|
|
function optimizationPath(path) {
|
|
|
|
|
|
- var protocol = /^[a-z]+:\/\//.exec(path)[ 0 ],
|
|
|
+ var protocol = /^[a-z]+:\/\//.exec(path)[0],
|
|
|
tmp = null,
|
|
|
res = [];
|
|
|
|
|
@@ -474,11 +475,11 @@
|
|
|
|
|
|
path = path.replace(/\\/g, '/').split(/\//);
|
|
|
|
|
|
- path[ path.length - 1 ] = "";
|
|
|
+ path[path.length - 1] = "";
|
|
|
|
|
|
while (path.length) {
|
|
|
|
|
|
- if (( tmp = path.shift() ) === "..") {
|
|
|
+ if ((tmp = path.shift()) === "..") {
|
|
|
res.pop();
|
|
|
} else if (tmp !== ".") {
|
|
|
res.push(tmp);
|