dever 6 years ago
parent
commit
6ca48273f6
2 changed files with 36 additions and 2 deletions
  1. 1 1
      assets/lib/kindeditor/kindeditor-all-min.js
  2. 35 1
      assets/lib/manage/main.js

+ 1 - 1
assets/lib/kindeditor/kindeditor-all-min.js

@@ -302,7 +302,7 @@ K.options = {
 			'.font-style', '.text-decoration', '.vertical-align', '.background', '.border'
 		],
 		a : ['id', 'class', 'href', 'target', 'name'],
-		embed : ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess', 'wmode'],
+		//embed : ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess', 'wmode'],
 		img : ['id', 'class', 'src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
 		'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [
 			'id', 'class', 'align', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.background',

+ 35 - 1
assets/lib/manage/main.js

@@ -346,7 +346,7 @@ function loadEditorParam(e)
 		allowImageRemote : true, //上传图片框网络图片的功能,false为隐藏,默认为true
 		allowFileManager : true, //浏览图片空间
 		allowMediaUpload : true,
-		filterMode : false, //HTML特殊代码过滤
+		filterMode : true, //HTML特殊代码过滤
 		themeType : 'default',
 		filePostName : 'file',
 		dialogOffset : 0, //对话框距离页面顶部的位置,默认为0居中,
@@ -355,6 +355,40 @@ function loadEditorParam(e)
 		uploadYunJson : yun,
 		fileManagerJson : view + '.files?key=' + media,
 
+		htmlTags : {
+			font : ['id', 'class', 'color', 'size', 'face', '.background-color'],
+			span : [
+				'id', 'class', '.color', '.background-color', '.font-size', '.font-family', '.background',
+				'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.line-height'
+			],
+			div : [
+				'id', 'class', 'align', '.border', '.margin', '.padding', '.text-align', '.color',
+				'.background-color', '.font-size', '.font-family', '.font-weight', '.background',
+				'.font-style', '.text-decoration', '.vertical-align', '.margin-left'
+			],
+			table: [
+				'id', 'class', 'border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'bordercolor',
+				'.padding', '.margin', '.border', 'bgcolor', '.text-align', '.color', '.background-color',
+				'.font-size', '.font-family', '.font-weight', '.font-style', '.text-decoration', '.background',
+				'.width', '.height', '.border-collapse'
+			],
+			'td,th': [
+				'id', 'class', 'align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor',
+				'.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight',
+				'.font-style', '.text-decoration', '.vertical-align', '.background', '.border'
+			],
+			a : ['id', 'class', 'href', 'target', 'name'],
+			img : ['id', 'class', 'src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
+			'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [
+				'id', 'class', 'align', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.background',
+				'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.text-indent', '.margin-left'
+			],
+			pre : ['id', 'class'],
+			hr : ['id', 'class', '.page-break-after'],
+			'br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del' : ['id', 'class'],
+			iframe : ['id', 'class', 'src', 'frameborder', 'width', 'height', '.width', '.height']
+		},
+
 		items : [
 		        'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
 		        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',