<?php

//载入全局配置和函数包
require_once dirname(__FILE__).'/../include/global.php';

?>
<!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=<?php echo $_G['product']['charset'];?>" />
<title>Editor - Powered By VeryIDE</title>
<?php
	echo loader_style(VI_BASE."style/share.css","utf-8",$_G['product']['version']);

    echo loader_script(array(VI_BASE."editor/kindeditor.js",VI_BASE."editor/lang/zh_CN.js"),'utf-8',$_G['product']['version']);
?>
</head>

<body>

<p style="text-align:right; overflow:hidden;">
    <textarea name="content" cols="50" rows="10" id="content" style="width:100%;height:320px; display:none;"></textarea>
</p>
<p style="text-align:right;">
    <button class="button" name="finish">完成</button>
    <button class="cancel" name="cancel">取消</button>
</p>

<script type="text/javascript">
var editor;
KindEditor.ready(function(K) {
						  
	editor = K.create('#content', {
		resizeType : 2,
		newlineTag : 'p',
		allowFileManager : false,
		filterMode : false,
		loadStyleMode : true,
		urlType : 'domain',
		items : [
			'source', '|', 'undo', 'redo', '|', 'template', 'cut', 'copy', 'paste',
			'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
			'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
			'superscript', 'clearhtml', 'quickformat', 'selectall','/',
			'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
			'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
			'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons','link', 'unlink', '|', 'fullscreen'
		],
		uploadJson : '<?php echo VI_BASE;?>editor/upload.php?watermark=true' // 相对于当前页面的路径
	});
	
	editor.html( parent.Editor.getData() );
	
	K.query('button[name=finish]').onclick = function(){
		parent.Editor.setData( editor.html() );
	};
	
	K.query('button[name=cancel]').onclick = function(){
		parent.Editor.Remove();
	};

});

</script>


</body>
</html>
