专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »Java教程 » fckeditor使用:FCKeditor的使用 »正文

fckeditor使用:FCKeditor的使用

来源: 发布时间:星期一, 2009年3月16日 浏览:0次 评论:0
.预览功能: <%@ page c%> 试题内容: : 2.FCKeditor配置(fckconfig.js详解)修改配置文件的后如若没有效果清空浏览器缓存Cache ().修改语言配置 FCKConfig.AutoDetectLanguage = true ;//浏览器自动检测语言 FCKConfig.DefaultLanguage = 'en' ;//默认语言为英文修改为: FCKConfig.AutoDetectLanguage = false ; FCKConfig.DefaultLanguage = 'zh-cn' ; ( 2).修改皮肤配置 FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/defult/' ; //默认皮肤修改为: FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/office2003/' ; ( 3).添加中文字体 FCKConfig.FontNames = 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ; 修改为: FCKConfig.FontNames = '宋体;黑体;隶书;楷体_GB2312;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ; ( 4).打造个性在线编辑器 AutoDetectLanguage=true/false 自动检测语言 BaseHref="" 相对链接基地址 ContentLangDirection="ltr/rtl" 默认文字方向 ContextMenu=,右键菜单内容 CustomC 自定义配置文件路径和名称 Debug=true/false 是否开启调试功能,这样,当FCKDebug.Output时,会在调试窗中输出内容 DefaultLanguage="" 缺省语言 EditorAreaCss="" 编辑区样式表文件 EnableSourceXHTML=true/false 为TRUE时,当由可视化界面切换到代码页时,把HTML处理成XHTML EnableXHTML=true/false 是否允许使用XHTML取代HTML FillEmptyBlocks=true/false 使用这个功能,可以将空块级元素用空格来替代 F 设置显示颜色拾取器时文字颜色列表 F 设置显示在文字格式列表中命名 F 字体列表中字体名 F 字体大小中字号列表 ForcePasteAsPlainText=true/false 强制粘贴为纯文本 ForceSimpleAmpersand=true/false 是否不把&符号转换为XML实体 FormatIndentator="" 当在源码格式下缩进代码使用 FormatOutput=true/false 当输出内容时是否自动格式化代码 FormatSource=true/false 在切换到代码视图时是否自动格式化代码 FullPage=true/false 是否允许编辑整个HTML文件,还是仅允许编辑BODY间内容 GeckoUseSPAN=true/false 是否允许SPAN标记代替B,I,U标记 IeSpellDownloadUrl=""下载拼写检查器网址 ImageBrowser=true/false 是否允许浏览服务器功能 ImageBrowserURL="" 浏览服务器时运行URL ImageBrowserWindowHeight="" 图像浏览器窗口高度 ImageBrowserWindowWidth="" 图像浏览器窗口宽度 LinkBrowser=true/false 是否允许在插入链接时浏览服务器 LinkBrowserURL="" 插入链接时浏览服务器URL LinkBrowserWindowHeight=""链接目标浏览器窗口高度 LinkBrowserWindowWidth=""链接目标浏览器窗口宽度 Plugins=object 注册插件 PluginsPath="" 插件文件夹 ShowBorders=true/false 合并边框 SkinPath="" 皮肤文件夹位置 SmileyColumns=12 图符窗列数 SmileyImages= 图符窗中图片文件名 SmileyPath="" 图符文件夹路径 SmileyWindowHeight 图符窗口高度 SmileyWindowWidth 图符窗口宽度 SpellChecker="ieSpell/Spellerpages" 设置拼写检查器 StartupFocus=true/false 开启时FOCUS到编辑器 StylesXmlPath="" 设置定义CSS样式列表XML文件位置 TabSpaces=4 TAB键产生空格数 ToolBarCanCollapse=true/false 是否允许展开/折叠工具栏 ToolbarSets=object 允许使用TOOLBAR集合 ToolbarStartExpanded=true/false 开启是TOOLBAR是否展开 UseBROnCarriageReturn=true/false 当回车时是产生BR标记还是P或者DIV标记 F 字体列表中字体名 F 字体大小中字号列表 ForcePasteAsPlainText=true/false 强制粘贴为纯文本 ForceSimpleAmpersand=true/false 是否不把&符号转换为XML实体 FormatIndentator="" 当在源码格式下缩进代码使用 FormatOutput=true/false 当输出内容时是否自动格式化 3.FCKeditor图片上传问题 ernal server error 500:...... ...... 解决: 第步:下载xalan-j_2_7_0-bin-2jars.tar.gz软件Software包 解压;第 2步:将解压得到两个jar包 xalan.jar serializer.jarcopy到WEB-INF/lib目录下第 3步:上传文件性能良好中文支持问题:图片从服务器到页面引用不支持中文中文传输问题加Filter过滤器!~ 4.FCKeditor 介绍 FCKeditor 这个开源HTML 文本编辑器可以让web 拥有如MS Word 这样强大编辑功能.FCKeditor 支持当前流行浏览器如IE 5.5+, Firefox 1.0+, Mozilla 1.3+和Netscape 7+等 FCKeditor官司方网址:http://www.fckeditor.net/ FCKeditor在线DEMO:http://www.fckeditor.net/demo FCKeditor下载直址:http://www.fckeditor.net/download (该版本为2.3.2)最新版已经是2.4了 5.FCKeditor.java介绍不能直接在JSP项目中使用需要FCKeditor.java库支持 FCKeditor.java是针对对JAVA中使用FCKeditor由Simone Chiaretta开发FCKeditorJAVA实现下载地址:http://www.fckeditor.net/download (最近版本为2.3) 6.FCKeditor配置(web.xml详解) web.xml配置详解(根据实际应用来修改配置文件): 1. xml version="1.0" encoding="UTF-8"?> 2. FCKeditordisplay-name> 7. 8. Connectorservlet-name> 9. 10. com.fredck.FCKeditor.connector.ConnectorServlet 11. servlet-> 12. 13. baseDirparam-name> 14. 15. /UserFiles/param-value> 16. init-param> 17. 18. debugparam-name> 19. trueparam-value> 20. init-param> 21. 1load-on-startup> 22. servlet> 23. 24. SimpleUploaderservlet-name> 25. 26. com.fredck.FCKeditor.uploader.SimpleUploaderServlet 27. servlet-> 28. 29. baseDirparam-name> 30. 31. 32. /UserFiles/param-value> 33. init-param> 34. 35. debugparam-name> 36. trueparam-value> 37. init-param> 38. 39. 40. enabledparam-name> 41. falseparam-value> 42. init-param> 43. 44. AllowedExtensionsFileparam-name> 45. param-value> 46. init-param> 47. 48. 49. DeniedExtensionsFileparam-name> 50. 51. php|php3|php5|phtml|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|dll|reg|cgi 52. param-value> 53. init-param> 54. 55. AllowedExtensionsImageparam-name> 56. jpg|g|jpeg|png|bmpparam-value> 57. init-param> 58. 59. DeniedExtensionsImageparam-name> 60. param-value> 61. init-param> 62. 63. AllowedExtensionsFlashparam-name> 64. swf|flaparam-value> 65. init-param> 66. 67. DeniedExtensionsFlashparam-name> 68. param-value> 69. init-param> 70. 1load-on-startup> 71. servlet> 72. 73. Connectorservlet-name> 74. 75. /editor/filemanager/browser/default/connectors/jsp/connector 76. url-pattern> 77. servlet-mapping> 78. 79. SimpleUploaderservlet-name> 80. 81. /editor/filemanager/upload/simpleuploader 82. url-pattern> 83. servlet-mapping> 84. web-app> 7.FCKeditor配置(后续) 第步:将/FCKeditor2.3/src下FCKeditor.tld文件复制WEB_INF目录下在web.xml中添加: /FCKeditor /WEB-INF/FCKeditor.tld 第 2步:修改fckconfig.js 将其中下列语句修改为: FCKConfig.LinkBrowser = true ; [此处修改主要参考jsp/simple02.jsp] FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/jsp/connector'; FCKConfig.LinkBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70% FCKConfig.LinkBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70% FCKConfig.ImageBrowser = true ; FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector= connectors/jsp/connector' ; FCKConfig.ImageBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70% ; FCKConfig.ImageBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70% ; FCKConfig.FlashBrowser = true ; FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector= connectors/jsp/connector'; FCKConfig.FlashBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; //70% ; FCKConfig.FlashBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; //70% ; FCKConfig.LinkUpload = true ; FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=File' ; FCKConfig.LinkUploadAllowedExtensions = "" ; // empty for all FCKConfig.LinkUploadDeniedExtensions = ".(html|htm|php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|com|dll|vbs|js|reg|cgi|htaccess|asis|sh|shtml|shtm|phtm)$" ; // empty for no _disibledevent=>
  • Constructor
    1. Properties
      • InstanceName
        Width Height ToolbarSet Value BasePath CheckBrowser DisplayErrors Collections
        • Config
          Methods
          • Create
            ReplaceTextarea Constructor FCKeditor( instanceName[, width, height, toolbarSet, value] )
            • 宽度:默认100%
            • 高度:默认200
            • 工具栏:默认Default
            • 内容:默认为空
              Example: var oFCKeditor = FCKeditor( 'FCKeditor1' ) ;//建立FCKeditor名字 Properties InstanceName The name of the this editor instance. Width The width of the editor in pixels or percent. Numeric values are handled as pixels. Default Value: "100%" Examples: oFCKeditor.Width = 400 ; // 400 pixels oFCKeditor.Width = "250" ; // 250 pixels oFCKeditor.Width = "80%" ; // 80 percent Height The height of the editor in pixels or percent. Numeric values are handled as pixels. Default Value: "200" Examples: oFCKeditor.Height = 400 ; // 400 pixels oFCKeditor.Height = "250" ; // 250 pixels oFCKeditor.Height = "100%" ; // 100 percent ToolbarSet The Toolbar to use. Refers to the configuration in the fckconfig.js file. Default Value: "Default" Example: oFCKeditor.ToolbarSet = "MyToolbar" ; Value The initial value (the HTML) to show in the editor at startup. Default Value: Example: oFCKeditor.Value = "

              Testing

              This is a sample." ; This value can not contain line characters such as "\n" and "\r". So you need to strip them out before you assign a to oFCKeditor.Value. You also have to escape each " with a \. see below oFCKeditor.Value = "The book is called \"The Last Minute\"" ; BasePath The path used by the editor to find its code base. In other words, the directory where the editor’s package has been ed in your site (the directory containing the editor directory and fckconfig.js, fckeditor.js, etc.). Default Value: "/fckeditor/" Example: oFCKeditor.BasePath = "/Components/FCKeditor/" ; Remarks: Avoid using relative paths. It is preferable to the base path starting from the root (/). Always finish the path with a slash (/). CheckBrowser Tells this instance to check the browser compatibility when rendering the editor. Default Value: true Example: oFCKeditor.CheckBrowser = true ; Remarks:
              • This option could be useful the check was made at the server side.
                DisplayErrors Tells this instance to show error messages _disibledevent=> in the page with the FCKeditor instance. The Textarea must have its "id" to the editor InstanceName. If the "id" is not found, the editor uses the TEXTAREA "name" for the replacement. Example: window.onload = function { var oFCKeditor = FCKeditor( 'MyTextarea ' ) ; oFCKeditor.ReplaceTextarea ; } ... <textarea id="MyTextarea" name= "MyTextarea"> This is <b>the</b> initial value. If you end to post the editor contents through a form (the most obvious use of the editor), you must the "name" attribute of the TEXTAREA. It is useful, to not get confused, to use the same value as used for the "id" attribute. 9.FCKeditor瘦身 ()将FCKeditor目录下些文件删除(JSP开发) sudo rm *.afp *.asp *.cfc *.lasso *.php *.pl *.py *.txt ( 2)将FCKeditor/editor目录下以"_"开头目录删除 sudo rm -r _*

                TAG: FCKeditor
                0

                相关文章

                读者评论

                发表评论

                • 昵称:
                • 内容: