2014-05-10 16:01:50 +08:00
|
|
|
|
<!-- This file is Depreciated -->
|
|
|
|
|
|
2014-05-07 13:06:24 +08:00
|
|
|
|
<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>
|
|
|
|
|
-->
|