WordPress 2.8 编辑器快速添加 CoolCode 按钮

2009-08-11  9:25  |  分类:应用技术, 程序设计  |  标签:  |  582 次浏览

打开 wp-includes/js/quicktags.dev.js ,找到

  1. edButtons[edButtons.length] =
  2. new edButton('ed_code'
  3. ,'code'
  4. ,'<code>'
  5. ,'</code>'
  6. ,'c'
  7. );

在下面添加:

  1. edButtons[edButtons.length] =
  2. new edButton('ed_coolcode'
  3. ,'coolcode'
  4. ,'<coolcode linenum=\"off\">'
  5. ,'</coolcode>'
  6. ,'x'
  7. );

再找到

t.Buttons[t.Buttons.length] = new edButton(name+'_code','code','<code>','</code>','c');

在下面添加一行:

t.Buttons[t.Buttons.length] = new edButton(name+'_coolcode','coolcode','<coolcode linenum=\"off\">','</coolcode>','x');

然后对 quicktags.js 做同样的修改。

CoolCode 的介绍: http://www.coolcode.cn/?action=show&id=26

喜欢本文,那就收藏到: Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪ViVi 365Key网摘 天极网摘 和讯网摘 博拉网 POCO网摘 添加到饭否 QQ书签 Digbuzz我挖网

发表您的评论