<!doctype html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="renderer" content="webkit"> 
  <title>编辑html元素</title>
  <link type="text/css" rel="Stylesheet" href="/admin/drag/css/drag.base.css">
  <link type="text/css" rel="Stylesheet" href="/admin/drag/css/kesion.form.css">
  <script src="/KS_inc/jquery.js"></script>
   
  <style>
  	#edui1_toolbarboxouter{ background:#fafafa; box-shadow:0px 0px 0px;}
	.edui-editor{border:0px !important;}
	#edui1_bottombar{ display:none;}
	body{border-top:1px solid #ebebeb;}
  </style>  
</head>
<body>
   
   	
    <div id="set-text">
          <textarea id="Content" name="content"></textarea>
          <%Kesion.APPCode.EditorAPI.EchoHead(); %>
          <%Kesion.APPCode.EditorAPI.EchoEditor("editor", "Content", "DragText" );%>
	</div>
 
    <div class="ks-btn-center" style="padding-top:15px;border-top:1px solid #ebebeb;">
      <button class="ks-btn ks-btn-normal" onClick="page.save()" id="btn-save">保存</button>
      &nbsp;
      <button class="ks-btn" onClick="parent.closeWindow(window.name)">取消</button>
    
    </div>
	
    <div id="labelCont" class="d-none"></div>
   
    <script src="/admin/drag/js/utils.js"></script>
   	<script>utils.loadJs(['nicescroll'])</script>
  
	<script>
		var page = new utils.page({
			ready:function(){
   				$('#labelCont').html(parent.$moduleObject.find('[drag-mark="true"]').html());
   				$('#labelCont').find('.drag-setup-btn').remove();
   				//检测编辑器是否加载完成
				var texting = setInterval(e,100);
				function e(){
					if(editor){
						//编辑状态
						
						editor.setContent($('#labelCont').html());
					
						clearInterval(texting);
						
					};
				};


				var tabHeight = $(window).height()-$('.ks-btn-center').outerHeight()-40;
				$('#Content').height(tabHeight);
			},
			save:function(){

				var text = editor.getContent();
				parent.$moduleObject.find('[drag-mark="true"]').html(text);
				var labelName = utils.getUrlParameter().labelName;
				parent.staticLabel.Save(labelName,window.name);

			}
		});
		
		
				

    </script>


</body>
</html>