<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="eKindEditor.aspx.cs" Inherits="WebApp.Wpedt.eKindEditor" %>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>ContentEditor</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <script type="text/javascript" charset="utf-8" src="kindeditor.js"></script>

    <script type="text/javascript" charset="utf-8" src="lang/zh_CN.js"></script>

    <script type="text/javascript" language="javascript">
    
    var editor;
    
			KindEditor.ready(function(K) {
				editor = K.create('textarea[name="content"]', {
				    designMode : true,
	                fullscreenMode : false,
	                filterMode : false,//是否开启过滤HTML代码
	                wellFormatMode : true,
	                shadowMode : true,
	                loadStyleMode : true,
	                basePath : K.basePath,
	                themesPath : K.basePath + 'themes/',
	                langPath : K.basePath + 'lang/',
	                pluginsPath : K.basePath + 'plugins/',
	                themeType : 'default',
	                langType : 'zh_CN',
	                urlType : '',
	                newlineTag : 'p',
	                resizeType : 2,
	                syncType : 'form',
	                pasteType : 2,
	                dialogAlignType : 'page',
	                useContextmenu : true,//是否启用右键菜单
	                fullscreenShortcut : false,
	                bodyClass : 'ke-content',
	                indentChar : '\t',
	                cssPath : '../plugins/code/prettify.css',
	                cssData : '',
	                width : '100%',
	                minWidth : 650,
	                minHeight : 100,
	                minChangeSize : 5,
	                items : [
		                'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
		                'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
		                'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
		                'superscript', 'clearhtml', 'selectall', '|', 'fullscreen', '/',
		                'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
		                'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'flash',
		                'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
		                'anchor', 'link', 'unlink', '|', 'quickformat'
	                ],
	                noDisableItems : ['source', 'fullscreen'],
	                colorTable : [
		                ['#E53333', '#E56600', '#FF9900', '#64451D', '#DFC5A4', '#FFE500'],
		                ['#009900', '#006600', '#99BB00', '#B8D100', '#60D978', '#00D5FF'],
		                ['#337FE5', '#003399', '#4C33E5', '#9933E5', '#CC33E5', '#EE33EE'],
		                ['#FFFFFF', '#CCCCCC', '#999999', '#666666', '#333333', '#000000']
	                ],
	                fontSizeTable : ['9px', '10px', '12px', '14px', '16px', '18px', '24px', '32px'],
	                htmlTags : {
		                font : ['color', 'size', 'face', '.background-color'],
		                span : [
			                '.color', '.background-color', '.font-size', '.font-family', '.background',
			                '.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.line-height'
		                ],
		                div : [
			                'align', '.border', '.margin', '.padding', '.text-align', '.color',
			                '.background-color', '.font-size', '.font-family', '.font-weight', '.background',
			                '.font-style', '.text-decoration', '.vertical-align', '.margin-left'
		                ],
		                table: [
			                'border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'bordercolor',
			                '.padding', '.margin', '.border', 'bgcolor', '.text-align', '.color', '.background-color',
			                '.font-size', '.font-family', '.font-weight', '.font-style', '.text-decoration', '.background',
			                '.width', '.height', '.border-collapse'
		                ],
		                'td,th': [
			                'align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor',
			                '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight',
			                '.font-style', '.text-decoration', '.vertical-align', '.background', '.border'
		                ],
		                a : ['href', 'target', 'name'],
		                embed : ['src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'],
		                img : ['src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
		                'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [
			                'align', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.background',
			                '.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.text-indent', '.margin-left'
		                ],
		                pre : ['class'],
		                hr : ['class', '.page-break-after'],
		                'br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del' : []
	                },
	                layout : '<div class="container"><div class="toolbar"></div><div class="edit"></div><div class="statusbar"></div></div>',
	                
				    uploadJson : 'aspnet/upload_json.ashx',
				    fileManagerJson : 'aspnet/file_manager_json.ashx',
				    allowFileManager : true,
				    afterCreate : function() {
					    var self = this;
					    K.ctrl(document, 13, function() {
						    self.sync();
						    K('form[name=example]')[0].submit();
					    });
					    K.ctrl(self.edit.doc, 13, function() {
						    self.sync();
						    K('form[name=example]')[0].submit();
					    });
				    }
					
					
				});
			});
			
    </script>

</head>
<body>
    <form id="form1" runat="server">

    <textarea name="content" style="width: 780px; height:500px; visibility: hidden;" ></textarea>

    </form>
</body>
</html>
