<%@ page language="C#" masterpagefile="~/HL_Admin/AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_Template, HoWaveVGO" title="Untitled Page" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script src="Js/tabpane.js" type="text/javascript"></script>
<style type="text/css">
.label_square{width:100px;height:30px;line-height:30px;border:solid 1px #449AE8;background:#E0EEF5;text-align:center;margin:5px;float:left;cursor: pointer;}
.drag_lablestyle{width:100px;height:30px;line-height:30px;border:solid 1px #449AE8;background:#E0EEFE;text-align:center;margin:5px;float:left;}
.TextBoxStyle{

}
</style>
<script id="pejs" type="text/javascript">
<!--
var dragspan;
var src;
var labeltype;

function dit(outype)
{
    window.drag = 1;
    window.event.returnValue = false;
    
    dragspan = document.createElement('div');
    dragspan.style.position = "absolute";
    dragspan.className = "drag_lablestyle";
    var mousePos = mouseCoords(window.event);
    dragspan.style.left = mousePos.x + 10;
    dragspan.style.top = mousePos.y + 8;
    dragspan.style.zIndex = 100;
    dragspan.appendChild(document.createTextNode(window.event.srcElement.innerHTML));
    if(outype == 0)
    {
        src = "{HL.Config." + window.event.srcElement.getAttribute("value") + "}";
    }
    else if(outype == 1)
    {
        src = window.event.srcElement.getAttribute("value");
    }
    else if(outype == 2)
    {
        src = window.event.srcElement.getAttribute("value");
    }
    else if(outype == 3)
    {
        src = window.event.srcElement.getAttribute("value");
    }
    else
    {
        src = "<xsl:value-of select=\"$" + window.event.srcElement.getAttribute("value") + "\"/>";
    }
    labeltype = outype; 
    document.body.appendChild(dragspan);
}
    
function cit()
{
    var target =document.getElementById('ctl00_ContentPlaceHolder1_TemplateContent');
    target.focus();
    if(labeltype == 1 || labeltype == 2 || labeltype == 3)
    {
        var link;
        var ret;
        var rnd=Math.random();
        if (labeltype == 2){
            link= "admin_Pagelabelparameter.aspx?n=" + escape(src)+"&rnd="+rnd;
            ret = showModalDialog(link,window,'dialogWidth:500px; dialogHeight:350px; help: no; scroll: no; status: no; edge: sunken;');
        }else if(labeltype == 3){
            link= "admin_Csslabelparameter.aspx?n=" + escape(src)+"&rnd="+rnd;
            ret = showModalDialog(link,window,'dialogWidth:500px; dialogHeight:350px; help: no; scroll: no; status: no; edge: sunken;');
        }else{
            link= "Admin_labelparameter.aspx?n=" + escape(src)+"&rnd="+rnd;;
            ret = showModalDialog(link,'','dialogWidth:500px; dialogHeight:350px; help: no; scroll: auto; status: no; edge: sunken;');        
        }
        if (ret != null)
        {
            if (ret.replace(/^\s+|\s+$/g,"") == "")
            {
                alert("不能输入空值");
            }
            else
            {
                target.focus();
                var tarobj = document.selection.createRange();
                tarobj.text = ret;
            }
        }
    }
    else
    {
        var tarobj = document.selection.createRange();
        tarobj.text = src;
    }
    if(window.drag)
    {
        window.drag = 0;
        window.event.returnValue = true;
    }
}

function dragend()
{
    if(window.drag)
    {
        document.body.removeChild(dragspan);
        cit();
    }
    
}

function dragmove()
{
    if(window.drag)
    {
        var ev = ev || window.event;
        var mousePos = mouseCoords(ev);

        ev.returnValue = false;
                 
        dragspan.style.left = mousePos.x + 10;
        dragspan.style.top = mousePos.y + 8;
    }
}

function dragclear()
{
    if(window.drag)
    {
        document.body.removeChild(dragspan);
        window.drag = 0;
        window.event.returnValue = true;
    }
    
}
   
function mouseCoords(ev) {
    if(ev.pageX || ev.pageY) {
      return {x:ev.pageX, y:ev.pageY};
    }
    return {
      x:ev.clientX + document.documentElement.scrollLeft - document.body.clientLeft,
      y:ev.clientY + document.documentElement.scrollTop - document.body.clientTop
    };
}

function movePoint() 
{
    if(window.drag)
    {
        var rng = event.srcElement.createTextRange(); 
        rng.moveToPoint(event.x,event.y); 
        rng.select(); 
    }
}

var fpath = '/App_Themes/AdminDefaultTheme/';

function sizeChange(size){
    var obj=document.getElementById('ctl00_ContentPlaceHolder1_TemplateContent');
    var height = parseInt(obj.offsetHeight);
    if (height+size>=100){
        obj.style.height=height+size;
    }
}
-->
</script>
<div style="width:98%;clear:both; margin:5px auto; height:20px;">
    <div style="float:left">
       <asp:literal runat="server" ID="TemplateTitle" Text="填写文件名：" /><asp:Literal ID="TemPath" runat="server" /><asp:Literal ID="TemplateFileName" runat="server" /><asp:TextBox ID="TemplateName" runat="server" />(不需要写后缀)
    </div>
    <div style="float:right"><a href="Admin_ManageTemplate.aspx">返回上一级</a></div>
</div>
<table class="nick" cellpadding="1" cellspacing="1" onmouseup="dragclear()" onmousemove="dragmove()">
      <tr><td class="tit" colspan="3">模板内容编辑</td></tr>
      <tr>
          <td style="text-align:left; vertical-align:top; width:65%">
              <asp:TextBox ID="TemplateContent" TextMode="MultiLine" Wrap="true" Height="435px" Width="670"  runat="server" CssClass="TextBoxStyle"/>
          </td>
          <td style="cursor:hand; cursor:pointer; width:2%"></td>
          <td style="text-align:left; vertical-align:top;padding-top:5px; width: 270px;" id="LabelTitle">
              
             <div class="tab-page" id="labeltempate_module">
                <script type="text/javascript">
                   var tabPane1 = new WebFXTabPane( document.getElementById( "labeltempate_module" ), 1 )
                </script>
                
                <div class="tab-page" id="label_label">
                   <h2 class="tab" style="height:16px;">内容标签</h2>
                   <script type="text/javascript">
                       tabPane1.addTabPage( document.getElementById( "label_label" ) );
                   </script>
                   <div>
                        <asp:DropDownList ID="LabelClassSelect" runat="server" AutoPostBack="true" OnSelectedIndexChanged="select_LabelClassSelect" AppendDataBoundItems="true">
                           <asp:ListItem Text="全部标签" Value="全部标签" />
                        </asp:DropDownList>
                        </div>
                        <div id="SysLabelDiv" style="overflow: auto; height:390px;">
                            <asp:Literal ID="LabelList" runat="server" />      
                        </div>           
                </div>
                
                <div class="tab-page" id="label_parm">
                   <h2 class="tab" style="height:18px;">分页标签</h2>
                   <script type=text/javascript>
                      tabPane1.addTabPage( document.getElementById( "label_parm" ) );
                   </script>
                   <div>
                       <asp:DropDownList ID="PageLabelClassSelect" runat="server" AutoPostBack="true" OnSelectedIndexChanged="BindPageLabel_Change" AppendDataBoundItems="true">
                           <asp:ListItem Text="全部分页标签" Value="全部分页标签" />
                        </asp:DropDownList>
                   </div>
                   <div style="overflow: auto; height:390px;">
                     <asp:Literal ID="PageLabelList" runat="server" />
                   </div>
                </div>
                
                <div class="tab-page" id="label_function">
                   <h2 class="tab" style="height:18px;">系统标签</h2>
                   <script type="text/javascript">
                       tabPane1.addTabPage( document.getElementById( "label_function" ) );
                   </script>
                   <asp:Literal ID="SysLabell" runat="server" />
                </div>
               
             </div>  
          </td>
      </tr>
   </table>  
   <div class="div_btm">      
       <asp:Button ID="SaveTemplateButton" runat="server"  Text="保 存" OnClick="SaveTemplateButton_Click" />&nbsp;
       <input id="Button1" type="button" value="后退" onclick="javascript:history.go(-1)"  style="cursor: pointer; cursor: hand; width: 88px;" />&nbsp;
       <input id="BtnCancel" type="button" value="返回模板首页" onclick="window.location.href='Admin_ManageTemplate.aspx'"  style="cursor: pointer; cursor: hand; width: 88px;" />
   </div>
</asp:Content>

