<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_AddPageLabel, WebApp_deploy" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<style type="text/css">
    .label_square{width:80px;height:25px;line-height:25px;border:solid 1px #449AE8;background:#E0EEF5;text-align:center;margin:5px;float:left;cursor: pointer;}
    .drag_lablestyle{width:80px;height:25px;line-height:25px;border:solid 1px #449AE8;background:#E0EEFE;text-align:center;margin:5px;float:left;}
</style>
<script type="text/jscript" language="javascript">
/* 拖放插入控制 */
var ie = (document.getElementById && document.all);
var presskey = 'none';
var dragspan;
var src;
var labeltype=0;

document.onkeyup = function(e) { 
    if(ie) e = event;
    presskey = 'none';
} 

document.onkeydown =function(e) { 
    if(ie) e = event;
    if(e.keyCode == 18)
    {
        presskey = 'alt';
    }
    else if(e.keyCode == 17)
    {
        presskey = 'ctrl';
    }
    else
    {
        presskey = 'none';
    }
} 

function dit(outype)
{
    window.drag = 1;
    window.event.returnValue = false;
    
    dragspan = document.createElement('div');
    dragspan.style.position = "absolute";
    switch (presskey)
    {
    case 'ctrl':
        dragspan.className = "dragspandiv_ctrl";
        break;
    case 'alt':
        dragspan.className = "dragspandiv_alt";
        break;
    default:
        dragspan.className = "drag_lablestyle";
        break;
    }     
    var mousePos = mouseCoords(window.event);
    dragspan.style.left = mousePos.x + 15;
    dragspan.style.top = mousePos.y + 11;
    dragspan.style.zIndex = 100 ;
    dragspan.appendChild(document.createTextNode(window.event.srcElement.innerText));
    txtproce(outype, window.event.srcElement);
    
    document.body.appendChild(dragspan);
}

function txtproce(outype, selectobj)
{

    src = selectobj.value;
    labeltype = outype;
}

function cit()
{
   var target = document.getElementById('ctl00_ContentPlaceHolder1_TemplateContent');
   target.focus();
   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 + 15;
        dragspan.style.top = mousePos.y + 11;
    }
}

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(); 
    }
}

</script>

<table class="adminheading">                       
   <tr>
      <th class="edit">分页标签管理</th> 
      <td align="right"><div style="width:50px"><a href="Admin_PageLable.aspx">返回</a></div></td>
      <td class="rtdw"></td>
   </tr>                        
</table>

<table class="nick" cellpadding="1" cellspacing="1" border="0"  onmouseup="dragclear()" onmousemove="dragmove()">
       <tr>
       <td class="tit" colspan="2"><b>编辑分页标签</b></td>
       </tr>
       <tr>
       <td class="ltd">标签名称：</td>
            <td  class="rtd" style="width: 79%" ><asp:TextBox ID="LabelName"　 runat="server" Width="200px" /><asp:Label id="LabelNameErr" runat="server"></asp:Label></td>
       </tr>
       <tr>
           <td class="ltd">标签分类：</td>
            <td  class="rtd">
                <asp:TextBox ID="LabelClass"　 runat="server" Width="200px" />
                <asp:DropDownList ID="LabelClassSelect" runat="server"  AppendDataBoundItems="true">
                   <asp:ListItem Text="全部分类" Value="全部分类" />
                </asp:DropDownList><asp:Label id="LabelClassErr" runat="server"></asp:Label>
            </td>
       </tr>
       <tr>
           <td class="ltd">参数：</td>
            <td  class="rtd">
            <div style="width:600px;">
                <div  class="label_square" onclick="cit()" onmousedown="dit(0)" value="{@ItemNum}">信息总数</div>
                <div  class="label_square" onclick="cit()" onmousedown="dit(0)" value="{@AllPage}">总页数</div>
                <div  class="label_square" onclick="cit()" onmousedown="dit(0)" value="{@MaxPerPage}">每页信息数</div>
                <div  class="label_square" onclick="cit()" onmousedown="dit(0)" value="{@LastPageID}">上一页ID</div>
                <div  class="label_square" onclick="cit()" onmousedown="dit(0)" value="{@PageID}">当前页ID</div>
                <div  class="label_square" onclick="cit()" onmousedown="dit(0)" value="{@NextPageID}">下一页ID</div>
                <div  class="label_square" onclick="cit()" onmousedown="dit(0)" value="{@FinallyPageID}">尾页ID</div>
                <div  class="label_square" onclick="cit()" onmousedown="dit(0)" value="{@FrontPageUrl}">首页地址</div>
                <div  class="label_square" onclick="cit()" onmousedown="dit(0)" value="{@LastPageUrl}">上一页地址</div>
                <div  class="label_square" onclick="cit()" onmousedown="dit(0)" value="{@PageUrl}">当前页地址</div>
                <div  class="label_square" onclick="cit()" onmousedown="dit(0)" value="{@NextPageUrl}">下一页地址</div>
                <div  class="label_square" onclick="cit()" onmousedown="dit(0)" value="{@FinallyPageUrl}">尾页地址</div>
            </div>
            </td>
       </tr>
       <tr>
           <td class="ltd">标签内容：</td>
            <td  class="rtd">
               <asp:Label ID="temErr" runat="server"></asp:Label>
               <asp:TextBox ID="TemplateContent" runat="server" TextMode="MultiLine" Width="600" Height="300"></asp:TextBox> 
            </td>
       </tr>
       <tr>
           <td class="btm" colspan="2">
               <asp:Button ID="submit" runat="server" OnClick="onClick_submit" Text="提 交" /> 
               <input ID="Button1" value="取 消" onclick="location.href='admin_pagelable.aspx';" type="Button" />
            </td>
       </tr>
</table>
<table class="adminlist"></table>

</asp:Content>