dever 6 lat temu
rodzic
commit
2dfad464bd
1 zmienionych plików z 26 dodań i 3 usunięć
  1. 26 3
      assets/lib/manage/main.js

+ 26 - 3
assets/lib/manage/main.js

@@ -77,10 +77,33 @@ function initUpdate()
 			$(this).bind('click', function()
 			{
 				var url = $(this).attr('key');
+				var value = $(this).attr('editor_id');
 				var title = $(this).attr('value');
 				$.get(url, {}, function(t)
 				{
-					showAlert(t, false, title);
+					var func = function() {
+						var url = $('#editor_applet_pic').val();
+						var appid = $('#editor_applet_id').val();
+						var path = $('#editor_applet_path').val();
+						if (!appid) {
+							alert('请选择小程序');
+							return;
+						}
+						if (!path) {
+							alert('请填写路径');
+							return;
+						}
+						if (!url) {
+							alert('请上传封面');
+							return;
+						}
+						
+						
+						var w = 750/2;
+						KindEditor.insertHtml('#' + value, '<img src="'+url+'" style="width:'+w+'px;" data-applet="'+url+'||'+appid+'||'+path+'"/>');
+						layer.closeAll();
+					};
+					showAlert(t, func, title);
 					image();
 				})
 			})
@@ -383,7 +406,7 @@ function loadEditorParam(e)
 				'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.line-height'
 			],
 			div : [
-				'id', 'class', 'data-file', 'data-id', 'data-key','.dever-video', 'align', '.border', '.margin', '.padding', '.text-align', '.color',
+				'id', 'class', 'data-applet', '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'
 			],
@@ -400,7 +423,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-file', 'data-id', 'data-key', 'src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
+			img : ['id', 'class', 'data-applet', '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'