分类目录
-
最近文章
Recent Comments
- 正在加载...
标签
centos command css debian Desktop eAccelerator Eagles Eminem FireFox freebsd godaddy Godaddy域名优惠码 google hostname Lady Antebellum linkinpark linux live Love The Way You Lie mbstring mb_substr mp3 Music mv namecheap namecheap coupon code namecheap优惠码 namecheap最新优惠码 need you now payoneer photo php php_mbstring Picture rihanna the cure wordpress zeus 便宜vps 创意广告 域名优惠码 富士康 电影 翻墙 闫凤娇链接表
Tag Archives: SyntaxHighlighterl
WordPress2.9.1编辑器添加代码高亮自定义按钮
本文以为wordpress2.9.1后台编写文章时候的编辑器添加高亮代码插件SyntaxHighlighterl按钮来介绍如何简单的为wordpress2.9.1编辑器添加自定义按钮。 控制显示编辑器按钮的文件在wordpress2.9.1中有两个文件,\wp-includes\js\目录下的quicktags.dev.js和quicktags.js 1、首先修改quicktags.dev.js 在quicktags.dev.js文件中找到如下代码处 edButtons[edButtons.length] = new edButton(‘ed_code’ ,’code’ ,’<code>’ ,’</code>’ ,’c’ ); 在上面的代码下添加 edButtons[edButtons.length] = new edButton(‘ed_mcode’//mcode是编辑器显示的按钮名称,以下同 ,’mcode’ ,’<pre class=\"brush:php\">’ ,’</pre>’ ,’x’ ); 再往下继续找到如下代码 t.Buttons[t.Buttons.length] = new edButton(name+’_code’,'code’,'<code>’,'</code>’,'c’); 在上面的代码下添加如下代码 t.Buttons[t.Buttons.length] = new edButton(name+’_mcode’,'mcode’,’[php]‘,’[/php]‘,’x'); //这里以添加php代码按钮为例,可以改为其他的或者添加多个按钮,以下同 quicktags.dev.js文件修改完毕,保存退出。 2、修改quicktags.js文件 找到如下代码 edButtons[edButtons.length]=new edButton("ed_code","code","<code>","</code>","c"); … Continue reading