用户登录
用户注册

分享至

ASP 编写 TinyMCE编辑器 上传组件

  • 作者: Kop杰拉德
  • 来源: 51数据库
  • 2022-08-17
/**
 * $Id: editor_plugin.js 201 2008-02-2 Guangzhou $
 */

(function() {
tinymce.PluginManager.requireLangPack('upload_image');
tinymce.create('tinymce.plugins.UploadImagePlugin', {
createControl: function(n, cm) {
switch (n) {
case 'upload_image':
var mlb = cm.createListBox('upload_image', {
title : 'upload.title',
onselect : function(v) {
var arr = document.cookie.match(new RegExp("(^| )SID=([^;]*)(;|$)"));
var site = (arr != null)?unescape(arr[2]):null;
if(v=='insert')	                     		
tinyMCE.activeEditor.execCommand('mceImage', true);
else if(v=='upload'){
var url = '/mceUpload.asp';
tinyMCE.activeEditor.windowManager.open({file:url,width:400,height:230,inline:1});
}}
});

// Add some values to the list box
mlb.add('upload.upload_image', 'upload');
mlb.add('upload.insert_image', 'insert');

// Return the new listbox instance
return mlb;	
}
	
return null;
},
	    
getInfo : function() {
return {
longname : 'Upload Image plugin',
author : 'Winter Lau',
authorurl : 'http://www.51sjk.com/Upload/Articles/1/0/323/323431_20220817165934935.jpg',
version : "1.0"
};
}
});

// Register plugin
tinymce.PluginManager.add('upload_image', tinymce.plugins.UploadImagePlugin);
})();
软件
前端设计
程序设计
Java相关