dever 6 éve
szülő
commit
2b09795185
2 módosított fájl, 21 hozzáadás és 4 törlés
  1. 19 2
      assets/lib/kindeditor/kindeditor-all-min.js
  2. 2 2
      assets/lib/manage/main.js

+ 19 - 2
assets/lib/kindeditor/kindeditor-all-min.js

@@ -7997,6 +7997,10 @@ KindEditor.plugin('media', function(K) {
 				'</span>',
 				'</div>',
 				'<div class="ke-dialog-row">',
+				'<label for="keWidth" style="width:60px;">标题</label>',
+				'<input type="text" id="keName" class="ke-input-text ke-input-number" name="name" value="" maxlength="4" />',
+				'</div>',
+				'<div class="ke-dialog-row">',
 				'<label for="keWidth" style="width:60px;">' + lang.width + '</label>',
 				'<input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="450" maxlength="4" />',
 				'</div>',
@@ -8020,6 +8024,8 @@ KindEditor.plugin('media', function(K) {
 					name : self.lang('yes'),
 					click : function(e) {
 						var url = K.trim(urlBox.val()),
+							coverUrl = K.trim(coverUrlBox.val()),
+							name = nameBox.val(),
 							width = widthBox.val(),
 							height = heightBox.val();
 						if (url == 'http://' || K.invalidUrl(url)) {
@@ -8037,7 +8043,15 @@ KindEditor.plugin('media', function(K) {
 							heightBox[0].focus();
 							return;
 						}
-						var html = K.mediaImg(self.themesPath + 'common/blank.gif', {
+
+						if (!coverUrl) {
+							var cover = self.themesPath + 'common/blank.gif';
+						} else {
+							var cover = coverUrl;
+						}
+
+						/*
+						var html = K.mediaImg(cover, {
 								src : url,
 								type : K.mediaType(url),
 								width : width,
@@ -8045,11 +8059,14 @@ KindEditor.plugin('media', function(K) {
 								autostart : autostartBox[0].checked ? 'true' : 'false',
 								loop : 'true'
 							});
+						*/
+						var html = '<img src="'+cover+'" style="width:'+width+'px;height:'+height+'px;" data-file="'+url+'||'+name+'"/>';
 						self.insertHtml(html).hideDialog().focus();
 					}
 				}
 			}),
 			div = dialog.div,
+			nameBox = K('[name="name"]', div),
 			coverUrlBox = K('[name="cover_url"]', div),
 			viewCoverServerBtn = K('[name="viewCoverServer"]', div),
 
@@ -8125,7 +8142,7 @@ KindEditor.plugin('media', function(K) {
 				});
 				uploadbuttonCover.fileBox.change(function(e) {
 					dialog.showLoading(self.lang('uploadLoading'));
-					uploadbutton.submit();
+					uploadbuttonCover.submit();
 				});
 			} else {
 				K('.ke-upload-button-cover', div).hide();

+ 2 - 2
assets/lib/manage/main.js

@@ -363,7 +363,7 @@ function loadEditorParam(e)
 				'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.line-height'
 			],
 			div : [
-				'id', 'class', 'data-id', 'data-key','.dever-video', 'align', '.border', '.margin', '.padding', '.text-align', '.color',
+				'id', 'class', 'data-file', 'data-id', 'data-key','.dever-video', 'align', '.border', '.margin', '.padding', '.text-align', '.color',
 				'.background-color', '.font-size','.letter-spacing', '.font-weight', '.background',
 				'.font-style', '.text-decoration', '.vertical-align', '.margin-left'
 			],
@@ -380,7 +380,7 @@ function loadEditorParam(e)
 			],
 			a : ['id', 'class', 'href', 'target', 'name'],
 			embed : ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess', 'wmode'],
-			img : ['id', 'class', 'data-id', 'data-key', 'src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
+			img : ['id', 'class', 'data-file', 'data-id', 'data-key', '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','.letter-spacing', '.background',
 				'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.text-indent', '.margin-left'