Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

plugin_syntaxhighlighter

1 view
Skip to first unread message

elleryq

unread,
Dec 19, 2007, 8:50:21 PM12/19/07
to blogger-ext2
我寫了一個把 dp.syntaxhighlighter 包起來的 plugin

使用說明可以參考: http://blog.elleryq.idv.tw/2007/12/notepluginsyntaxhighlighter.html

程式如下:
// Register dp.SyntaxHighLight
// Dependency:
// jQuery-1.2.1
// blogger-ext2-core

BloggerExt.SH = function() {
// Plugin 會由此開始
if( dp!='undefined' ) {
jQuery("pre > br").each( function()
{ jQuery(this).replaceWith( "\n" ); } );
jQuery("textarea > br").each( function()
{ jQuery(this).replaceWith( "\n" ); } );
dp.SyntaxHighlighter.ClipboardSwf = 'http://
syntaxhighlighter.googlecode.com/svn/tags/1.5.1/Scripts/
clipboard.swf';
dp.SyntaxHighlighter.HighlightAll('code');
}
};
BloggerExt.SH.user_pref = function() {
var prefs = [];
return prefs;
};
BloggerExt.SH.update_pref = function(prefs) {
};
BloggerExt.register('SH', { SH: true} );
Reply all
Reply to author
Forward
0 new messages