1、
下载的版本为:
ckeditor_3.5.zip
ckfinder_asp_2.0.1.zip
ASP下CKEditor集成CKFinder的设置方法:
第一步先引入CKEditor的JS文件和CKFinder的JS文件
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="ckfinder/ckfinder.js"></script>
第二步加载编辑器:
<textarea id="content" name="content" class="ckeditor">初始化内容...</textarea>
<script type="text/javascript">
if (typeof CKEDITOR == 'undefined') {
document.write('加载CKEditor失败');
}
else {
var editor = CKEDITOR.replace('content');
CKFinder.SetupCKEditor(editor, 'ckfinder/'); //ckfinder总目录的相对路径.
}
</script>
第三步配置CKEditor下的config.js文件:
config.filebrowserBrowseUrl = '/ckfinder/ckfinder.html';
config.filebrowserImageBrowseUrl = '/ckfinder/ckfinder.html?Type=Images';
config.filebrowserFlashBrowseUrl = '/ckfinder/ckfinder.html?Type=Flash';
config.filebrowserUploadUrl = '/ckfinder/core/connector/asp/connector.asp?command=QuickUpload&type=Files';
config.filebrowserImageUploadUrl = '/ckfinder/core/connector/asp/connector.asp?command=QuickUpload&type=Images';
config.filebrowserFlashUploadUrl = '/ckfinder/core/connector/asp/connector.asp?command=QuickUpload&type=Flash';
此代码为启用上传图片的功能
第四步修改ckeditor/plugins/image/dialogs/image.js 文件:
// hidden: ture, 为原来的默认值,浏览按钮为不显示。改为 hidden:false,
{type:'button',id:'browse',style:'display:inline-block;margin-top:10px;',align:'center',label:q.lang.common.browseServer,hidden:false,filebrowser:'info:txtUrl'}
第五步修改/ckfinder/config.asp(1)查找CheckAuthentication
修改CheckAuthentication = false为true '只适合本机测试,否则很危险
如果挂上互联网,还需检测权限,以我的代码为例
if Session("admin") <> true then
CheckAuthentication = false
else
CheckAuthentication = true
end if
(2)文件设置上传的保存目录,记得为这个目录开写权限
baseUrl = "/uploadfiles/"
其他设置:
1.ckfinder上传图片默认文件名为上传本地的文件名,若有重名会提示是否覆盖,不覆盖的话会以形如a(1).jpg形式保存,下面的方法的作用是生成按上传时间的文件名命名:
修改ckfinder\core\connector\asp\CommandHandler/FileUpload.asp
在115行下加入以下代码
Dim sTime, sFile
sTime=now()
sFile=year(sTime)&month(sTime)&day(sTime)&hour(sTime)&minute(sTime)&second(sTime)
sFileName = sFile & "." & sExtension
这样就上传后的图片就以上传时间命名了。
2、
<script type="text/javascript">
if (typeof CKEDITOR == 'undefined') {
document.write('加载CKEditor失败');
}
else {
var editor = CKEDITOR.replace('content',{
toolbarStartupExpanded:false, //初始化的时候,是否展开菜单
enterMode:CKEDITOR.ENTER_BR, //回车使用哪个字符表示,br或者p
extraPlugins : 'uicolor',
width:511,height:130,
resize_enabled:true,resize_maxHeight:600,resize_maxWidth:500,resize_minHeight:130,resize_minWidth:300,
scayt_autoStartup:false, //去拼写检查
toolbar:[[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],['TextColor','BGColor']] //自定义工具栏
});
CKFinder.SetupCKEditor(editor, 'ckfinder/'); //ckfinder总目录的相对路径.
}
</script>
说明:
toolbar: [['Source','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
'/',
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
'/',
['Styles','Format','Font','FontSize'],
['TextColor','BGColor']];
是完整的菜单,可以自定义选择。
3、
一、使用方法:
1、在页面<head>中引入ckeditor核心文件ckeditor.js
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
2、在使用编辑器的地方插入HTML控件<textarea>
<textarea id="TextArea1" cols="20" rows="2" class="ckeditor"></textarea>
如果是ASP.NET环境,也可用服务器端控件<TextBox>
<asp:TextBox ID="tbContent" runat="server" TextMode="MultiLine" class="ckeditor"></asp:TextBox>
注意在控件中加上 class="ckeditor" 。
3、将相应的控件替换成编辑器代码
<script type="text/javascript">
CKEDITOR.replace('TextArea1');
//如果是在ASP.NET环境下用的服务器端控件<TextBox>
CKEDITOR.replace('tbContent');
//如果<TextBox>控件在母版页中,要这样写
CKEDITOR.replace('<%=tbContent.ClientID.Replace("_","$") %>');
</script>
4、配置编辑器
ckeditor的配置都集中在 ckeditor/config.js 文件中,下面是一些常用的配置参数:
// 界面语言,默认为 'en'
config.language = 'zh-cn';
// 设置宽高
config.width = 400;
config.height = 400;
// 编辑器样式,有三种:'kama'(默认)、'office2003'、'v2'
config.skin = 'v2';
// 背景颜色
config.uiColor = '#FFF';
// 工具栏(基础'Basic'、全能'Full'、自定义)plugins/toolbar/plugin.js
config.toolbar = 'Basic';
config.toolbar = 'Full';
这将配合:
config.toolbar_Full = [
['Source','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
'/',
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
'/',
['Styles','Format','Font','FontSize'],
['TextColor','BGColor']
];
//工具栏是否可以被收缩
config.toolbarCanCollapse = true;
//工具栏的位置
config.toolbarLocation = 'top';//可选:bottom
//工具栏默认是否展开
config.toolbarStartupExpanded = true;
// 取消 “拖拽以改变尺寸”功能 plugins/resize/plugin.js
config.resize_enabled = false;
//改变大小的最大高度
config.resize_maxHeight = 3000;
//改变大小的最大宽度
config.resize_maxWidth = 3000;
//改变大小的最小高度
config.resize_minHeight = 250;
//改变大小的最小宽度
config.resize_minWidth = 750;
// 当提交包含有此编辑器的表单时,是否自动更新元素内的数据
config.autoUpdateElement = true;
// 设置是使用绝对目录还是相对目录,为空为相对目录
config.baseHref = ''
// 编辑器的z-index值
config.baseFloatZIndex = 10000;
//设置快捷键
config.keystrokes = [
[ CKEDITOR.ALT + 121 /*F10*/, 'toolbarFocus' ], //获取焦点
[ CKEDITOR.ALT + 122 /*F11*/, 'elementsPathFocus' ], //元素焦点
[ CKEDITOR.SHIFT + 121 /*F10*/, 'contextMenu' ], //文本菜单
[ CKEDITOR.CTRL + 90 /*Z*/, 'undo' ], //撤销
[ CKEDITOR.CTRL + 89 /*Y*/, 'redo' ], //重做
[ CKEDITOR.CTRL + CKEDITOR.SHIFT + 90 /*Z*/, 'redo' ], //
[ CKEDITOR.CTRL + 76 /*L*/, 'link' ], //链接
[ CKEDITOR.CTRL + 66 /*B*/, 'bold' ], //粗体
[ CKEDITOR.CTRL + 73 /*I*/, 'italic' ], //斜体
[ CKEDITOR.CTRL + 85 /*U*/, 'underline' ], //下划线
[ CKEDITOR.ALT + 109 /*-*/, 'toolbarCollapse' ]
]
//设置快捷键 可能与浏览器快捷键冲突 plugins/keystrokes/plugin.js.
config.blockedKeystrokes = [
CKEDITOR.CTRL + 66 /*B*/,
CKEDITOR.CTRL + 73 /*I*/,
CKEDITOR.CTRL + 85 /*U*/
]
//设置编辑内元素的背景色的取值 plugins/colorbutton/plugin.js.
config.colorButton_backStyle = {
element : 'span',
styles : { 'background-color' : '#(color)' }
}
//设置前景色的取值 plugins/colorbutton/plugin.js
config.colorButton_colors = '000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,
006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,
A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
CkEditor ASP上传整合版(20110211).rar (1092个子文件)
ckeditor.asp 30KB
Image.asp 27KB
FileSystem.asp 12KB
config.asp 11KB
MoveFiles.asp 11KB
Config.asp 11KB
plugin.asp 11KB
CopyFiles.asp 10KB
Netrube_upload.asp 10KB
ckfinder.asp 9KB
FileUpload.asp 8KB
ResourceTypeConfig.asp 8KB
AccessControlConfig.asp 7KB
sha1.asp 6KB
FolderHandler.asp 5KB
init.asp 5KB
RenameFile.asp 4KB
RenameFolder.asp 4KB
events.asp 4KB
Xml.asp 4KB
ThumbnailsConfig.asp 4KB
hooks.asp 4KB
plugin.asp 4KB
GetFiles.asp 4KB
QuickUpload.asp 4KB
FileUpload.asp 4KB
Thumbnail.asp 4KB
DeleteFile.asp 3KB
Connector.asp 3KB
CreateFolder.asp 3KB
commandHandlerBase.asp 3KB
advanced.asp 3KB
Factory.asp 3KB
GetFolders.asp 3KB
DeleteFolder.asp 3KB
DownloadFile.asp 3KB
ImagesConfig.asp 3KB
xmlNode.asp 3KB
replaceall.asp 3KB
http.asp 3KB
standalone.asp 3KB
connector.asp 3KB
replace.asp 2KB
Translator.asp 2KB
standalone.asp 2KB
errors.asp 2KB
XmlCommandHandlerBase.asp 2KB
Base.asp 2KB
ckeditor.asp 2KB
fckeditor.asp 2KB
plugin.asp 2KB
index.asp 2KB
QuickUpload.asp 1KB
RegExp.asp 1KB
Time.asp 1KB
sample_posteddata.asp 1KB
popups.asp 1KB
popup.asp 1KB
loopback.aspx 41KB
run.bat 270B
web.config 677B
app.css 43KB
app.css 39KB
editor.css 34KB
editor.css 30KB
editor.css 30KB
dialog.css 20KB
dialog.css 18KB
dialog.css 17KB
dialog.css 16KB
dialog.css 15KB
uipanel.css 14KB
host.css 14KB
uipanel.css 14KB
dialog.css 13KB
toolbar.css 12KB
host.css 11KB
toolbar.css 10KB
toolbar.css 10KB
richcombo.css 8KB
richcombo.css 7KB
icons.css 7KB
richcombo.css 7KB
icons.css 6KB
icons.css 6KB
menu.css 6KB
menu.css 6KB
menu.css 5KB
richcombo.css 5KB
richcombo.css 4KB
mainui.css 4KB
panel.css 4KB
panel.css 4KB
panel.css 4KB
mainui.css 3KB
yui.css 3KB
mainui.css 3KB
yui.css 3KB
output_xhtml.css 2KB
templates.css 2KB
共 1092 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
gaoyong1983
- 粉丝: 8
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
前往页