Files
leanote/app/views/blog/highlight.html
2014-10-28 14:48:22 +08:00

73 lines
2.8 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- This file is Depreciated -->
<link href="/public/mdeditor/editor/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
<script src="/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
<script>
$("pre").addClass("prettyprint linenums");
prettyPrint();
</script>
<!--
<script type="text/javascript" src="/js/syntaxhighlighter/scripts/shCore.js"></script>
<link href="/js/syntaxhighlighter/styles/shCore.css" rel="stylesheet" type="text/css" />
<link href="/js/syntaxhighlighter/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
    $(function () {
var pathPrefix = "/js/syntaxhighlighter/scripts/";
        var map = {
"brush: jscript": "shBrushJScript.js",
         "brush: c#": "shBrushCSharp.js",
        "brush: css": "shBrushCss.js",
        "brush: cpp": "shBrushCpp.js",
        "brush: java": "shBrushJava.js",
        "brush: xml": "shBrushXml.js",
        "brush: php": "shBrushPhp.js",
        "brush: perl": "shBrushPerl.js",
        "brush: python": "shBrushPython.js",
        "brush: ruby": "shBrushRuby.js",
        "brush: sql": "shBrushSql.js"}
        var needLoadCount = 0;
        var alreadyLoadCount = 0;
$('pre[class]').each(function() {
var brush = $(this).attr("class");
var js = map[brush]
if (js) {
                needLoadCount++;
map[brush] = null; // 不要重复加载
loadJS(pathPrefix + js, function () {
                    alreadyLoadCount++;
                    if (alreadyLoadCount == needLoadCount) {
//setTimeout(function() {
                        SyntaxHighlighter.highlight();
//}, 500);
                    }
                });
}
});
    });
function loadJS(url, callback) {
$.getScript(url, function() {
callback();
});
}
 
/*
function loadJS(url, callback, charset) {
    var script = document.createElement('script');
    script.onload = script.onreadystatechange = function () {
        if (script && script.readyState && /^(?!(?:loaded|complete)$)/.test(script.readyState)) return;
        script.onload = script.onreadystatechange = null;
        script.src = '';
        script.parentNode.removeChild(script);
        script = null;
        if (callback) callback();
    };
    script.charset = charset || document.charset || document.characterSet;
    script.src = url;
    try { document.getElementsByTagName("head")[0].appendChild(script); } catch (e) { }
}
*/
</script>
-->