主题: 如何插入高亮code
作者: uuiso, 发布日期: 2011-12-29 11:47:09, 浏览数: 3266
<?php

class MyClass()
{
    private function test()
    {
        echo '---';
    }
}

?>
作者: test110, 发布日期: 2013-01-01 21:47:38
我也测试测试高亮了吗>?>>
<!DOCTYPE HTML>
<html>
<head>
    <title></title>
    <meta charset="utf-8"/>
    <link rel="stylesheet" href="./plugins/code/prettify.css"/>  

    <script charset="utf-8" src="kindeditor-min.js"></script>
    <script charset="utf-8" src="./lang/zh_CN.js"></script>
    <script tcharset="utf-8" src="./plugins/code/prettify.js"></script>

    <script>
        var editor;
        KindEditor.ready(function(K) {
            editor = K.create('#editor_id',{
                cssPath : ['plugins/code/prettify.css']
            });
            prettyPrint();
        });

    </script>
</head>
<body>
<textarea id="editor_id" name="content" style="width:700px;height:300px;">
</textarea>
</body>
</html>

 

回复
作者: 手动阀, 发布日期: 2013-08-07 15:14:08
$aa=123;
echo $aa;
回复
作者: litie123, 发布日期: 2014-10-03 05:17:22
回复test110:
<!doctype html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>Custom Plugin Examples</title>
		<style>
			form {
				margin: 0;
			}
			textarea {
				display: block;
			}
			.ke-icon-example1 {
				background-image: url(../themes/default/default.gif);
				background-position: 0px -672px;
				width: 16px;
				height: 16px;
			}
			.ke-icon-example2 {
				background-image: url(../themes/default/default.gif);
				background-position: 0px -672px;
				width: 16px;
				height: 16px;
			}
		</style>
		<link rel="stylesheet" href="../themes/default/default.css" />
		<script charset="utf-8" src="../kindeditor-min.js"></script>
		<script charset="utf-8" src="../lang/zh_CN.js"></script>
		<script>
			// 自定义插件 #1
			KindEditor.lang({
				example1 : '插入HTML'
			});
			KindEditor.plugin('example1', function(K) {
				var self = this, name = 'example1';
				self.clickToolbar(name, function() {
					self.insertHtml('<strong>测试内容</strong>');
				});
			});
			// 自定义插件 #2
			KindEditor.lang({
				example2 : 'CLASS样式'
			});
			KindEditor.plugin('example2', function(K) {
				var self = this, name = 'example2';
				function click(value) {
					var cmd = self.cmd;
					if (value === 'adv_strikethrough') {
						cmd.wrap('<span style="background-color:#e53333;text-decoration:line-through;"></span>');
					} else {
						cmd.wrap('<span class="' + value + '"></span>');
					}
					cmd.select();
					self.hideMenu();
				}
				self.clickToolbar(name, function() {
					var menu = self.createMenu({
						name : name,
						width : 150
					});
					menu.addItem({
						title : '红底白字',
						click : function() {
							click('red');
						}
					});
					menu.addItem({
						title : '绿底白字',
						click : function() {
							click('green');
						}
					});
					menu.addItem({
						title : '黄底白字',
						click : function() {
							click('yellow');
						}
					});
					menu.addItem({
						title : '自定义删除线',
						click : function() {
							click('adv_strikethrough');
						}
					});
				});
			});
			KindEditor.ready(function(K) {
				K.create('#content1', {
					cssPath : ['../plugins/code/prettify.css', 'index.css'],
					items : ['source', 'removeformat', 'example1', 'example2', 'code']
				});
			});
		</script>
	</head>
	<body>
		<script type="text/javascript"><!--
		google_ad_client = "ca-pub-7116729301372758";
		/* 更多演示(728x90) */
		google_ad_slot = "5052271949";
		google_ad_width = 728;
		google_ad_height = 90;
		//-->
		</script>
		<script type="text/javascript"
		src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
		</script>
		<h3>自定义插件</h3>
		<textarea id="content1" name="content" style="width:700px;height:200px;visibility:hidden;"></textarea>
	</body>
</html>
回复
发表新帖 发表回复