回到顶部

SyntaxHighlighter 页面动态js加载方式整理

时间:5年前   作者:庞顺龙   浏览:253   [站内原创,转载请注明出处]

标签: Syntaxhighlighter  

SyntaxHighlighter 页面动态js加载方式整理

首先页面引用插件js文件:


单独的js处理,直接贴代码,如下:

function HighLine() {
    SyntaxHighlighter.config.clipboardSwf = '../Syntaxhighlighter/src/clipboard.swf';
    SyntaxHighlighter.autoloader(
    ['applescript', '../Syntaxhighlighter/scripts/shBrushAppleScript.js'],
    ['actionscript3', 'as3', '../Syntaxhighlighter/scripts/shBrushAS3.js'],
    ['bash', 'shell', '../Syntaxhighlighter/scripts/shBrushBash.js'],
    ['coldfusion', 'cf', '../Syntaxhighlighter/scripts/shBrushColdFusion.js'],
    ['cpp', 'c', '../Syntaxhighlighter/scripts/shBrushCpp.js'],
    ['c#', 'c-sharp', 'csharp', '../Syntaxhighlighter/scripts/shBrushCSharp.js'],
    ['css', '../Syntaxhighlighter/scripts/shBrushCss.js'],
    ['delphi', 'pascal', '../Syntaxhighlighter/scripts/shBrushDelphi.js'],
    ['diff', 'patch', 'pas', '../Syntaxhighlighter/scripts/shBrushDiff.js'],
    ['erl', 'erlang', '../Syntaxhighlighter/scripts/shBrushErlang.js'],
    ['groovy', '../Syntaxhighlighter/scripts/shBrushGroovy.js'],
    ['java', '../Syntaxhighlighter/scripts/shBrushJava.js'],
    ['jfx', 'javafx', '../Syntaxhighlighter/scripts/shBrushJavaFX.js'],
    ['js', 'jscript', 'javascript', '../Syntaxhighlighter/scripts/shBrushJScript.js'],
    ['perl', 'pl', '../Syntaxhighlighter/scripts/shBrushPerl.js'],
    ['php', '../Syntaxhighlighter/scripts/shBrushPhp.js'],
    ['text', 'plain', '../Syntaxhighlighter/scripts/shBrushPlain.js'],
    ['py', 'python', '../Syntaxhighlighter/scripts/shBrushPython.js'],
    ['ruby', 'rails', 'ror', 'rb', '../Syntaxhighlighter/scripts/shBrushRuby.js'],
    ['sass', 'scss', '../Syntaxhighlighter/scripts/shBrushSass.js'],
    ['scala', '../Syntaxhighlighter/scripts/shBrushScala.js'],
    ['sql', '../Syntaxhighlighter/scripts/shBrushSql.js'],
    ['vb', 'vbnet', '../Syntaxhighlighter/scripts/shBrushVb.js'],
    ['xml', 'xhtml', 'xslt', 'html', '../Syntaxhighlighter/scripts/shBrushXml.js']
    );

    SyntaxHighlighter.all();
}

$(function () {
	//加载高亮js
    HighLine(); 
})

庞顺龙最后编辑于:5年前

内容均为作者独立观点,不代表八零IT人立场,如涉及侵权,请及时告知。

评论努力加载中...
暂无评论
暂无评论

手机扫码阅读

热门相关

加载中...
关于我们   联系我们   申请友链   赞助记录   站点地图
© 2014 - 2017 www.80iter.com All Rights Reserved. 京ICP备14042174号-1
本站遵循 CC BY 4.0 协议,转载请注明出处 。