JQ Syntaxhighlighter 插件优化设置

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Syntaxhighlighter 插件</title>
<script type="text/javascript" src="syntaxhighlighter/scripts/shCore.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shBrushCss.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJava.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shBrushPhp.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shBrushPlain.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shBrushRuby.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shBrushSql.js"></script>
<link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shCore.css"/>
<link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shThemeDefault.css"/>
<script type="text/javascript">
SyntaxHighlighter.config.clipboardSwf = 'syntaxhighlighter/scripts/clipboard.swf';
SyntaxHighlighter.config.strings = {
	expandSource :'展开代码',
	viewSource :'查看代码',
	copyToClipboard :'复制代码',
	copyToClipboardConfirmation :'代码复制成功',
	print :'打印',
	help:'?',
	alert:'',
	noBrush:'请联系管理员,错误码: ',
	brushNotHtmlScript:'没有这类型的代码,错误码:',
	aboutDialog:'一站式网络'
};
SyntaxHighlighter.all();
//屏蔽工具条显示
//SyntaxHighlighter.defaults['toolbar'] = false;
</script>
<style type="text/css">
.syntaxhighlighter .toolbar .item.printSource{ display: none !important;}
.syntaxhighlighter .toolbar .item.about{ display: none !important;}
</style>
</head>
<body>
<pre class="brush:html;">
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;UTF-8&quot;&gt;
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no&quot;&gt;
&lt;title&gt;新建H5模板&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
    body{ font-family:\5FAE\8F6F\96C5\9ED1,&#39;Arial&#39;; color:#5b5b5b; background-color:#fff; font-size:14px; overflow-x:hidden;}
    a{ color:#333; text-decoration:none;}
    a:hover{ color:#333; text-decoration:none;}
    img{ border:none;}
    i,em{ font-style:normal;}
    li{ list-style-type:none;}
    textarea{ resize:vertical;}
    input, select, textarea{ font-family:\5FAE\8F6F\96C5\9ED1,&#39;Arial&#39;; background-color:#fff margin:0; padding:0; outline:none;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;h3&gt;阅谁问君诵,水落清香浮&lt;/h3&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
        alert(&quot;测试吧&quot;);
    &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
</body>
</html>

Syntaxhighlighter 插件优化设置如下:禁止打印图标和帮助图标的显示,把提示的内容修改为中文,提供了禁止工具条显示的方法。

效果图:
JQ Syntaxhighlighter 插件优化设置
 

相关推荐