<!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" type="text/javascript"></script>
  
  <style>
  	.set-code{ padding-right:30px;border-top:1px solid #ebebeb;}
 	#content{width:100%;border:0px;padding:15px; outline:none; font-size:13px; line-height:24px;}

  </style>    
  
</head>
<body>
   
   	
    <div class="set-code">
    
          <textarea id="content" name="content"></textarea>         

	</div>
 
    <div class="clear blank20" style="border-top:1px solid #ebebeb;"></div>
    <div class="ks-btn-center">
      <button class="ks-btn ks-btn-normal" onClick="Save()" id="btn-save">保存</button>
      &nbsp;
      <button class="ks-btn" onClick="parent.closeWindow(window.name)">取消</button>
    
    </div>
	
    
   <script src="/ks_inc/jquery.nicescroll.js"></script>
   
	<script>
		
		var $content = $('#content');
   		$(function(){			
			tabHeight();			
			
		});
		$(window).resize(function(){
			tabHeight();
		});
		
		function tabHeight(){
			var tabHeight = $(window).height()-$('.ks-btn-center').outerHeight()-70;
			$content.height(tabHeight);
			
		};
		
		var type = window.location.href.split('?type=')[1];
		if(type=='edit'||type=='editLabelCode'){
			var code = parent.htmlContent;
			$content.val(code)
		};
				
		function Save(){
			var contentVal = $content.val();
			if(type=='edit'){
				parent.$moduleObject.html(contentVal);
			}else if(type=='editLabelCode'){
				parent.ModuleBack(contentVal,'editLabelCode')
			};
			parent.loadInt();
			parent.closeWindow(window.name);
			parent.popup.tips({
				 title:'保存成功',
			});
		};
		

    </script>


</body>
</html>