注意,简单的实践是在新建一个models,然后在前一任务里边只声明一个变量content,运行完迁移任务后在controller里边设置一个方法.比如show,这个方法里边只需要有一条语句就可以了 @ artical = Artical.new
FCKeditor offers a complete JavaScript API so you can interact with it once the editor is loaded and running.
FCKeditor提供了一个完整的JavaScript API(Application Public Interface),你可以利用这些API来处理FCK编辑器,只要它被加载完成或在正在运行中.
Retrieving an editor instanceOnce loaded, the editor registers a global object called FCKeditorAPI. This object offers the entry point to interact with any editor instance placed in a page (you can have more than one). When placing the editor in the page, you give it an "instance name". So, to retrieve it, you must simply call the FCKeditorAPI.GetInstance method.
一旦编辑器实例化完成后,它都会注册一个全局的对象,叫作FCKeditorAPI. 这个对象提供一个接入点去获取在本页面内的任何已实例化的对象(不止一个).当你在页面生成一个编辑器时,你给了它一个实例名.所以,你只需简单地调用 FCKeditorAPI.GetInstance方法就可以获取到它的对象引用.
For example: var oEditor = FCKeditorAPI.GetInstance('InstanceName') ;
例如,var oEditor = FCKeditorAPI.GetInstance('InstanceName') ; 这里就是获取实例名为"InstanceName"的FCKeditor对象.
The GetInstance method returns the main FCKeditor object that gives the necessary bridge to interact with it.
This is a list of properties and methods of this object:
这是一个FCKeditor的属性和方法的列表:
* Description = string 描述
* EditMode = Integer 编辑状态
* Name = string 名字
* Status = Integer 状态
* function AttachToOnSelectionChange(functionPointer)
* function CleanAndPaste(html)
* function CreateElement(tag)
* function CreateLink(url)
* function ExecOnSelectionChange() //Fires OnSelectionChange event in event manager
* function ExecOnSelectionChangeTimer()
* function ExecuteNamedCommand(commandName, commandParameter)
* function ExecuteRedirectedNamedCommand(commandName, commandParameter)
* function Focus()
* function GetHTML(format) // doesnt work. Use GetXHTML instead.
* function GetNamedCommandState(commandName)
* function GetNamedCommandValue(commandName)
* function GetXHTML(format)
* function InitializeBehaviors()
* function InsertElement(element)
* function InsertElementAndGetIt(e)
* function InsertHtml(html)
* function IsDirty();
* function MakeEditable()
* function OnDoubleClick(element)
* function Paste()
* function PasteAsPlainText()
* function PasteFromWord()
* function Preview()
* function RegisterDoubleClickHandler(handlerFunction, tag)
* function ResetIsDirty();
* function SetHTML(html, forceWYSIWYG)
* function SetStatus()
* function ShowContextMenu(x, y)
* function SwitchEditMode()
* function UpdateLinkedField()
EventsOnce the editor loading is complete and it is ready to use (and interact with JavaScript), a standard function is called in the page that contains the editor, if the function is defined.
This function must be named "FCKeditor_OnComplete" and receives the related editor instance as the parameter. Using it, you can execute any initial code that makes the initial interaction with the editor.
This is a declaration example:
function FCKeditor_OnComplete( editorInstance ) {
alert( editorInstance.Name ) ; }
Apart the above standard event, every FCKeditor instance has a "Event" object that can be used to listen for events to be fired.
For example, the following code listens for the "OnSelectionChange" to execute custom code:
var counter = 0 ;
function DoSomething( editorInstance ) {
window.document.title = editorInstance.Name + ' : ' + ( ++counter ) ; }
function FCKeditor_OnComplete( editorInstance ) {
editorInstance.Events.AttachEvent( 'OnSelectionChange', DoSomething ) ; }
Note that every callback function receives the editor instance as a parameter.
The following is the list of events available:
OnSelectionChange: fired when the actual selection in the editor area changes (by selection I mean the cursor position too... it changes on key strokes). Note: In IE6, this event does not fire on every keystroke, but only on some random keystrokes. Handy!
OnAfterSetHTML: fired once the HTML is loaded in the editor (including when changing views).
OnStatusChange: fired when the editor status changes. The following constants are also available globally in the page: FCK_STATUS_NOTLOADED, FCK_STATUS_ACTIVE and FCK_STATUS_COMPLETE.
OnPaste: fired when something is pasted in the editor
参考:http://www.cnblogs.com/fengmk2/articles/532787.html
-----------------------------
配置选项:
AutoDetectLanguage=true/false 自动检测语言
BaseHref="" _fcksavedurl="""" 相对链接的基地址
ContentLangDirection="ltr/rtl" 默认文字方向
ContextMenu=字符串数组,右键菜单的内容
CustomConfigurationsPath="" 自定义配置文件路径和名称
Debug=true/false 是否开启调试功能,这样,当调用FCKDebug.Output()时,会在调试窗中输出内容
DefaultLanguage="" 缺省语言
EditorAreaCss="" 编辑区的样式表文件
EnableSourceXHTML=true/false 为TRUE时,当由可视化界面切换到代码页时,把HTML处理成XHTML
EnableXHTML=true/false 是否允许使用XHTML取代HTML
FillEmptyBlocks=true/false 使用这个功能,可以将空的块级元素用空格来替代
FontColors="" 设置显示颜色拾取器时文字颜色列表
FontFormats="" 设置显示在文字格式列表中的命名
FontNames="" 字体列表中的字体名
FontSizes="" 字体大小中的字号列表
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标记
相关推荐
**FCKEditor使用帮助文档** ...通过持续学习和实践,你可以根据项目需求定制FCKEditor,使其更好地服务于你的Web应用。在遇到问题时,查阅官方文档、社区资源和已有的解决方案,通常都能找到解答。
FCKeditor有持续的更新和维护,以修复已知问题和增加新功能。手册将介绍如何跟踪最新版本,以及升级现有安装的方法。 通过阅读并实践这本FCKeditor中文使用手册,开发者可以全面掌握这款编辑器的用法,提升Web应用...
**FCKeditor在JSP中的使用详解** FCKeditor是一款流行的开源富文本编辑器,它提供了丰富的文本格式化功能,使用户能够在网页上实现类似Word的编辑...记得持续关注FCKeditor的更新,以获取最新的功能和修复的安全漏洞。
3. **版本更新**:随着技术的发展,FCKeditor已被其开发者更名为CKEditor并持续升级。考虑使用最新版本以获得更好的性能和安全性。 4. **移动设备支持**:虽然FCKeditor主要面向桌面浏览器,但随着移动互联网的普及...
CKEditor作为fckEditor的升级版,持续更新并增加了更多功能,如更好的HTML5支持、更丰富的插件库以及更强的定制能力。 总的来说,fckEditor在Web开发领域留下了深刻的印记,尽管已不再活跃,但其设计理念和实现方式...
随着技术的发展,fckeditor后来被CKEditor所取代,CKEditor在继承了fckeditor优点的同时,进一步增强了性能和稳定性,增加了更多的特性,并且保持了良好的社区支持和持续更新。 总之,fckeditor作为一款经典的Web...
7. **开源**:作为一款开源软件,FCKeditor的源代码可供开发者研究和定制,促进了社区的交流与合作,同时也确保了软件的持续改进和更新。 在“FCKeditor_2.5.zip”压缩包内,主要包含的文件“fckeditor”可能是编辑...
- 开源:FCKeditor遵循开源协议,允许自由使用、修改和分发,促进了社区的持续发展和改进。 2. **下载与安装** - 访问FCKeditor官方网站下载最新版本,如2.6.4。 - 解压缩下载的文件,将FCKeditor主文件夹放置在...
10. **持续更新与维护**:虽然FCKeditor在后期发展过程中被 CKEditor 取代,但其丰富的社区资源和历史版本仍然为许多现有项目提供支持和维护。 在实际应用中,FCKeditor的压缩包文件通常包含编辑器的核心文件、语言...
**FCKeditor文本编辑器详解** FCKeditor是一款开源的Web富文本编辑器,它为网站开发者提供了一种在网页上实现类似桌面文字处理...通过不断更新和优化,FCKeditor及其后续产品CKEditor持续满足着Web开发领域的需求。
对于新的项目,开发者可能需要考虑迁移到CKEditor,以获得持续的安全更新和技术支持。 综上所述,FCKeditor JSP版本是一个强大的富文本编辑解决方案,它为Java Web开发带来了方便的文本编辑功能。不过,随着技术的...
**FCKeditor 2.6 with Media Plugin** FCKeditor是一款知名的...虽然这是一个较旧的版本,但它展示了富文本编辑器在处理复杂内容方面的能力,同时也提醒我们在现代开发中持续关注新技术和更新以保持最佳的用户体验。
因此,持续关注并及时升级到最新版本对于保持应用的安全性和功能性至关重要。 通过深入理解和运用以上知识点,开发者可以充分利用FCKeditor构建出强大且用户友好的文本编辑功能,提升应用程序的用户体验。
3. **直接部署**:描述中提到的“直接考到webroot目录下用”,意味着FCKeditor2.4.2瘦身版可以直接放到网站根目录下使用,无需复杂的配置过程,简化了网站开发和维护的工作流程。 4. **核心功能**:尽管是瘦身版,...
"Fckeditor2.0rc1.zip" 是一个包含FCKeditor 2.0 RC1版本的压缩包文件,它是Xoops内容管理系统的一个插件,用于提供在线文本...同时,由于其开源性质,FCKeditor拥有活跃的开发者社区,可以获取到持续的更新和支持。
由于FCKeditor是开源项目,它的安全性和稳定性依赖于社区的持续维护和更新。开发者需要关注官方发布的新版本,及时升级以修复已知的安全漏洞。 **总结** FCKeditor作为一款功能强大的网页文本编辑器,为Web应用...
- **CKEditor**: FCKeditor的开发者后续推出了CKEditor,功能更加完善,安全性更高,且仍在持续更新维护。 - **TinyMCE**: 另一款流行且功能强大的富文本编辑器,也是很多开发者的选择。 总的来说,FCKeditor精简版...
【FCKeditor_2.6】是一款在Java网页制作中广泛应用的开源富文本编辑器,以其功能强大和实用性而受到开发者的青睐。...同时,FCKeditor的开放源码特性也鼓励社区成员贡献自己的代码和改进,促进了软件的持续发展和优化。
3. **兼容性**:FCKeditor对各种浏览器的兼容性表现良好,但需要注意的是,随着浏览器版本的更新,可能存在部分新特性的支持问题,因此在开发和维护时要持续关注其兼容性测试。 4. **第三方库的应用**:在提供的...