dever 6 years ago
parent
commit
e57fd4460b

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

@@ -279,6 +279,7 @@ K.options = {
 		['#FFFFFF', '#CCCCCC', '#999999', '#666666', '#333333', '#000000']
 	],
 	fontSizeTable : ['9px', '10px', '12px', '14px', '16px', '18px', '24px', '32px'],
+	fontHeightTable : ['0px', '0.25px', '0.5px', '1px', '1.5px', '2px', '2.5px', '3px', '4px', '5px'],
 	htmlTags : {
 		font : ['id', 'class', 'color', 'size', 'face', '.background-color'],
 		span : [
@@ -3111,6 +3112,13 @@ _extend(KCmd, {
 			}
 			return lc(val);
 		}
+		if (key === 'fontheight') {
+			knode = self.commonNode({'*' : '.letter-spacing'});
+			if (knode) {
+				val = knode.css('letter-spacing');
+			}
+			return lc(val);
+		}
 		if (key === 'forecolor') {
 			knode = self.commonNode({'*' : '.color'});
 			if (knode) {
@@ -3179,6 +3187,9 @@ _extend(KCmd, {
 	fontsize : function(val) {
 		return this.wrap('<span style="font-size:' + val + ';"></span>').select();
 	},
+	fontheight : function(val) {
+		return this.wrap('<span style="letter-spacing:' + val + ';"></span>').select();
+	},
 	fontname : function(val) {
 		return this.fontfamily(val);
 	},
@@ -5792,6 +5803,23 @@ _plugin('core', function(K) {
 			});
 		});
 	});
+	self.clickToolbar('fontheight', function() {
+		var curVal = self.cmd.val('fontheight'),
+			menu = self.createMenu({
+				name : 'fontsize',
+				width : 150
+			});
+		_each(self.fontHeightTable, function(i, val) {
+			menu.addItem({
+				title : '<span unselectable="on">' + val + '</span>',
+				height : 20,
+				checked : curVal === val,
+				click : function() {
+					self.exec('fontheight', val).hideMenu();
+				}
+			});
+		});
+	});
 	_each('forecolor,hilitecolor'.split(','), function(i, name) {
 		self.clickToolbar(name, function() {
 			self.createMenu({
@@ -6247,6 +6275,7 @@ KindEditor.lang({
 	formatblock : '段落',
 	fontname : '字体',
 	fontsize : '文字大小',
+	fontheight : '文字间距',
 	forecolor : '文字颜色',
 	hilitecolor : '文字背景',
 	bold : '粗体(Ctrl+B)',
@@ -10142,8 +10171,9 @@ function autoImg(self) {
     $(img).each(function (i) {
         var that = $(this);
         var host = gethost(self.uploadJson);
+        var yhost = '';
         if (self.uploadYunJson && self.uploadYunJson.host) {
-        	var host = gethost(self.uploadYunJson.host);
+        	yhost = gethost(self.uploadYunJson.host);
         }
         
         if (that.attr("src").indexOf("http://") >= 0 || that.attr("src").indexOf("https://") >= 0) {

+ 5 - 0
assets/lib/kindeditor/themes/default/default.css

@@ -153,6 +153,11 @@
 	width: 23px;
 	height: 16px;
 }
+.ke-icon-fontheight {
+	background-position: 0px -352px;
+	width: 23px;
+	height: 16px;
+}
 .ke-icon-forecolor {
 	background-position: 0px -384px;
 	width: 20px;

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

@@ -391,15 +391,24 @@ function loadEditorParam(e)
 			iframe : ['id', 'class', 'src', 'frameborder', 'width', 'height', '.width', '.height']
 		},
 
+		items : [
+		        'preview', 'redo', '|', 'cut', 'copy', 'paste',
+		        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
+		        'justifyfull', 'indent', 'outdent', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', 'source', '/',
+		        'formatblock', 'fontsize', 'fontheight', '|', 'forecolor', 'hilitecolor', 'bold',
+		        'italic', 'underline', 'lineheight', 'removeformat', '|', 'image','table', 'hr', 'link', 'unlink'
+		]
+		/*
 		items : [
 		        'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
 		        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
 		        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
 		        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
-		        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
+		        'formatblock', 'fontsize', 'fontheight', '|', 'forecolor', 'hilitecolor', 'bold',
 		        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage','table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
 		        'anchor', 'link', 'unlink'
 		]
+		*/
 		//media
 		/*
 		items : [