从fckeditor升级到ckeditor [英] upgrading from fckeditor to ckeditor

查看:129
本文介绍了从fckeditor升级到ckeditor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些旧代码,我需要快速更新,我需要用新的ckeditor替换旧的fckeditor。这里是我的调用fckeditor的javascript

I have some old code that i need to update quickly, i need to replace the old fckeditor with the new ckeditor. here's my javascript for calling fckeditor

<script type="text/javascript">
{
    function swap_to_wysiwyg_short_description()
    {
        var oFCKeditor = new FCKeditor( 'short_description' ) ;
        oFCKeditor.BasePath = 'fckeditor/' ;
        oFCKeditor.Value = 'This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.' ;
        document.getElementById('short_description_button').style.visibility = "hidden";
        oFCKeditor.ReplaceTextarea() ;
    }
}
</script>

这会调用javascript档案:

this calls the javascript file:

fckeditor/fckeditor.js

所有我的html文件我可以只编辑fckeditor,并使这个调用ckeditor?

i'm thinking instead of changing all my html files i could just edit fckeditor and make this call ckeditor?

这里是调用ckeditor的新代码:

here's the new code to call ckeditor:

<script>

        CKEDITOR.replace( 'short_description', {
filebrowserBrowseUrl: '/store/admin/kcfinder/browse.php',
filebrowserUploadUrl: '/store/admin/kcfinder/upload.php'
});

    </script>

如何改变fckeditor / fckeditor.js来调用ckeditor而不必更改所有的html页面?

How can i alter fckeditor/fckeditor.js to call ckeditor without having to change all my html pages?

推荐答案

也许以后你应该使用一个函数来调用你的wysiwyg编辑器,您将会一次性完成这项工作,而且将来更改编辑器也不会有问题。

Maybe for future you should make one function to call your wysiwyg editor and put there your code. You will make that work once and in future there will be no problem with changing editor to other one.

这篇关于从fckeditor升级到ckeditor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆