Skip to content

让codecolorer默认语言为php

2010 三月 4
by 荒野无灯

折腾php的,发文章时自然是发php代码比较多,此举可以让你少敲3个字符。
打开codecolorer/js/quicktags.js
在prompt函数调用处设置第二个参数的默认值为php即可,修改后的insertCodeColorer函数如下:

1
2
3
4
5
6
7
8
9
10
11
function insertCodeColorer() {
      if (!edCheckOpenTags(codeTagIndex)) {
        var URL = prompt(codeColorerL10n.enterLanguage, 'php');
        if (URL) {
          edButtons[codeTagIndex].tagStart = '[cc lang="' + URL + '"]';
          edInsertTag(edCanvas, codeTagIndex);
        }
      } else {
        edInsertTag(edCanvas, codeTagIndex);
      }
    }

插入代码时效果如下:

还有就是让cc标签与代码分开,即标签开始和结束分别换行:
这个简单,加个

1
 \n

就可以了

喜欢这篇文章吗?

请订阅本站 RSS feed填写您的邮件地址,订阅我们的精彩内容:,欢迎点击这里捐赠以支持荒野无灯转播到腾讯微博 转播到腾讯微博

作者:荒野无灯
出处:Hacklog【Hacklog】

声明: 本站遵循 署名-非商业性使用-相同方式共享 3.0 共享协议. 转载请注明转自Hacklog【荒野无灯weblog】

本文链接: http://ihacklog.com/?p=3498

2 Responses Post a comment
  1. 三月 4, 2010

    还真是懒的可以。。呼。

Leave a Reply

Allowed Tags - You may use these HTML tags and attributes in your comment.

<a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <q cite=""> <strong>

 :wink:  :-|  :-x  :twisted:  :)  8-O  :(  :roll:  :-P  :oops:  :-o  :mrgreen:  :lol:  :idea:  :-D  :evil:  :cry:  8)  :arrow:  :-?  :?:  :!:

Note: You may use basic HTML in your comments. Your email address will not be published.

Subscribe to this comment feed via RSS