走向云和山的彼端 | 世外悠悠隔人间,不忍萋萋乱世烟

如果你有RSS阅读器或者浏览器RSS订阅插件,欢迎 订阅我的博客 (RSS) 和 订阅留言 (RSS)。 Rss
homehome

我的标签汇总:

三红 刷新心得 刷机 固件刷新 射手网 播放器 澳洲 破解 adobe cs3 Agile Development BEA brochure design Canon Digital Camera css div div+css ECLIPSE EJB3 FCKeditor firefox Flash font-size Glassfish Google Chrome html IE iXtreme j2ee JAVA 7 Java7 JavaEE 5 JAVA EE 6 javascript JDK7 Joomla Jungle Flasher media player MPC Mysql Netbeans photos resize SenseArt SPRING vBadvanced vBulletin CMPS Dynamics web design Web Page Design wordpress theme xbox360 Xbox 360

The FCK editor configuration file

分类:Java 作者: 秋天 时间: 08-09-2007

Configurations File

The editor comes with a rich set of configurations that makes it possible to customize its appearance, features and behaviors. The main configuration file is named “fckconfig.js“.

You can either edit the main configuration file or just override the stuff you want to change in a separate file. JavaScript syntax is used to configure FCKeditor.

 

Available configuration options

A list of available configuration options gives descriptions of each option (work in progress).

 

Overriding the Default Configurations

To simplify updating FCKeditor on your sites, the best approach is to put all your configuration in a separate file, outside the editor’s package directory structure. In this way, you just need to overwrite the editor’s directory to update it to a newer version.

For example, suppose you want to force FCKeditor to always use the French language for its interface. To do so, you just need to create a file called, for example, “myconfig.js” and put it in the root directory of the site (or wherever you want). Just put the following lines into that file:

FCKConfig.AutoDetectLanguage = false ;
FCKConfig.DefaultLanguage = “fr” ;

Now we have to tell the editor that it has to load my custom configuration. The first way to do that is changing the following line in the main configuration file (fckconfig.js):

FCKConfig.CustomConfigurationsPath = "/myconfig.js" ;

The above method is good, but, as you can imagine, you lose the facility not to touch the original files. In any case it is easier to remember that you just need to change one line, and all the other things remain separated.

There is an even better way to have the same results as described above, but without touching the fckconfig.js file. You can set the custom configurations path from the page that uses the editor.

For example, with JavaScript, you could do something like this:

var oFCKeditor = new FCKeditor( "FCKeditor1" ) ;
oFCKeditor.Config[”CustomConfigurationsPath”] = “/myconfig.js”  ;
oFCKeditor.Create() ;

The same method can be used with your preferred server side language. Take a look at the samples to find out how to manipulate the configurations by code.

When overriding configurations, the following steps are done:

  1. The configuration in the main configuration file (fckconfig.js) are loaded.
  2. The configuration is overridden by the settings in the custom configuration file (if provided).
  3. The configuration is overridden by the settings done in the editor page (if provided), except for the “CustomConfigurationsPath”, that is set after step 1.

You don’t need to include all configuration options in your custom file, just those you want to change. Your file will “override” the original one.

/!\ You need to keep the original configuration file, “fckconfig.js“, in the editor directory. Don’t delete it.

 

Browser Caching

/!\ Important: remember to clear your browser cache when making changes to the configuration files, otherwise you may not see your changes. This is especially important when working behind a proxy which may cache your .js files more persistently than pages.

There are a few tricks that can be used while developing to retrieve the latest version of the configuration file:

  • If you are using Internet Explorer, hitting CTRL + F5 should suffice to fetch the latest versions of the script. No need to manually clear the browser cache.
  • If you are using Firefox or other Mozilla’s children, hitting Shift+CTRL + R should fetch the latest version with no need to clear the cache (although this method doesn’t seem to work at all times, if this fails clear cache manually).
  • You could add a number or code in the end of the custom configuration path, so the browser would be forced to load it every time:

var oFCKeditor = new FCKeditor( "FCKeditor1" ) ;
oFCKeditor.Config[”CustomConfigurationsPath”] = “/myconfig.js?” + ( new Date() * 1 ) ;
oFCKeditor.Create() ;
暂时没有评论
本文永久链接

Leave a Reply


SATECH网站系统继续策划中
  • 网志分类

    • 电影 (5)
    • 精心品乐 (5)
    • 计算机与互联网 (91)
      • 程序设计 (3)
      • 网页&平面设计 (10)
      • IDE开发环境 (6)
      • Java (22)
      • Joomla (1)
      • Middleware (1)
      • Web UI & Ajax (5)
      • Wordpress (15)
      • 多媒体技术 (3)
      • 数据库 (2)
      • 服务器端技术 (10)
    • 摄影 (22)
      • 器材 (5)
      • 我的片片 (3)
    • 杂记 (37)
    • 游戏 (24)
      • PS2 (8)
      • PSP (6)
      • XBOX 360 (4)
  • 资料收集

    • 关于秋天(About me)
    • Book Wanted
    • 秋天的软件工具箱
    • 秋天的数码暗房
    • Emu Forever
    • My WP Plug-in
    • PSP Game Collect
    • PSP TOOLS
    • ROM Forever
    • 我的标签归档(Tags)
  • Archives

    • October 2009
    • September 2009
    • June 2009
    • April 2009
    • December 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • September 2007
    • August 2007
    • February 2007
    • September 2006
    • August 2006
    • July 2006
    • June 2006
    • May 2006
    • April 2006
    • March 2006
    • February 2006
    • January 2006
    • December 2005
    • November 2005
    • August 2005
    • May 2005
  • 排行和统计

    • Alexa
    • PageRank
  • 网志日历

    October 2009
    S M T W T F S
    « Sep    
     123
    45678910
    11121314151617
    18192021222324
    25262728293031
  • 酷站推荐

    • 射手网
    • 中华模拟器联盟
    • CCF
    • 色影无忌
    • TLF
    • WP Theme
  • 我的朋友圈

    • 只喝可乐的猫
    • 人命关天
    • 张华的网络日志
    • 低调的华丽
    • 地球冒险
    • 痛并快乐着
    • 诸恶莫作 众善奉行
    • seamers’s spaces
    • TAB
    • 欣事欣情
  • Meta

    • Register
    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
  • Comments

    • vancl: 很强大啊。
    • 秋天: 整个过程其实只是按照当前的值,重载了样式表,并且按照百分比给 字体增加了大小而已。 和现在流行的各种重型Ajax framework比起来,这种运算九牛一毛吧。似乎谈不上运算 量?...
    • bolo: 这个方法似乎不太好,运算量太大。 ps:为什么要注册才能评论呢?很麻烦
    • 只喝可乐的猫: 虽然找就知道这些,不过再看一遍还是引人深思啊~~
    • 只喝可乐的猫: 你被BLOCK是肯定的了,我还想让我妈上你这里看民工照片呢~ ~~

走向云和山的彼端 & 中华模拟器联盟 版权所有( Chinaemu.net | Chinaemu.cn | Occm.cn). Copyright @ 2005-2008 All Rights Received 滇ICP备 05004538 | 滇ICP备 05009010
Weblog Application Proudly Powered by Wordpress. Website designed and hosted by 秋天(Sam).