⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 forumstree.aspx

📁 基于Windows平台的ASP.net框架
💻 ASPX
字号:
<%@ Page language="c#" Codebehind="ForumsTree.aspx.cs" AutoEventWireup="false" Inherits="Discuz.ForumPage.Admin.Forums.ForumsTree" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
  <HEAD id=Head1>
		<title>移动版块</title>
		<LINK href="../styles/default.css" type="text/css" rel="stylesheet">
	<style type=text/css>

	.contral{
		font-size:12px;
		width:98%;
		cursor:default;
		
	}
	
	.contral input{
		font-size:12px;
		cursor:hand;
		valign:middle;
		
	}
		
	.treenode_move {
		position:absolute;
		width:200px;
		line-height:18px;
		filter:alpha(opacity=50);
		opacity:0.5;
		z-index:110;
		display:none;
		padding-left:20px;
		background:url('../images/folder.gif') no-repeat 0px 0px;
	}

	.treenode_0_noselected{
		height:4px;
		line-height:10px;
		overflow:hidden;
		z-index:100;
		border: 0px #ffffff solid;
	}

	.treenode_0_over{
		background-color: #FCDFE9;
		height:6px;
		line-height:6px;
		overflow:hidden;
		z-index:100;
		border: 0px #933456 solid;
		
	}
	
	
	.treenode_selected{
		line-height:15px;
		z-index:100;
		background-color: #B6BDD2;
		color:#ffffff;	
		border: 0px #0A246A solid;
		
		}
	
	.treenode_noselected{
		line-height:15px;
		z-index:100;
		border: 0px #ffffff solid;
		
	}
	
	.treenode_over{
		line-height:15px;
		background-color: #C7CEE3;
		color:#ffffff;
		cursor:poiter;		
		z-index:100;
		border: 0px #4963A9 solid;
		
	}


	
</style>
<script language="javascript">

	
	var treeID = null;
	///treeID:
	function tree(treeID,treeNodes,funName){
		var fid = 0;
		var treeType = 0;
		var layer = 0;
		var parentidlist = "";
		var title = "";
		var lastDiv = null;

		this.id = treeID;
		this.drag = false;
		this.dragObj = null;
		this.oldClass = "";
		this.fid = 0;
		this.treeType = 0;
		this.layer = 0;
		this.parentidlist = "";
		this.title = ""
		this.lastDiv = null
		
		this.getPos=function(el,sProp){
			var iPos = 0;
			while (el!=null) {
				iPos+=el["offset" + sProp];
				el = el.offsetParent;
			}
			return iPos;
		}
		
		this.getETarget = function(e){
			if (!e){return null;}
			if (!e.srcElement && !e.target){return null;}
			obj = e.srcElement ? e.srcElement : e.target;
			if (obj == null){return null};
			
			while (obj.getAttribute("treetype") == null && obj.tagName != "BODY" && obj.tagName != "HTML"){
				obj = obj.parentNode;
				if(obj == null){break;}
			}
			return obj;
		}
		
		
		
		
		//鼠标按下
		this.onmousedown = function(e){
		
			if (!e){return false;}
			
			if (this.dragObj){
				this.dragObj.className = "noselected";
			}
			
			this.dragObj = this.getETarget(e);
			if (!this.dragObj){return;}
			
			if (!this.dragObj.getAttribute("treetype")){return;}
			
			var mX = e.x ? e.x : e.pageX;
			var mY = e.y ? e.y : e.pageY;
			
			this.drag = true;
			this.dragObj.className = "treenode_selected";
			this.oldClass = "treenode_selected";
			
			var textContent = this.dragObj.textContent ? this.dragObj.textContent : this.dragObj.innerText;

			this.ShowMove(mX,mY,textContent );
			
			//this.findObj(this.id + "_control").removeChild(this.dragObj);
			treeID = this;
			//alert(this.dragObj.id);
			document.onmousedown = function(){return false};
			document.onmousemove = function(e){
				if (tree==null){
					return;
				}
				treeID.document_onmousemove(e);
			}
			
		    alignElWithMouse(mX,mY);
		
		};
		
		this.onmouseup = function(e){this.document_onmouseup(e)};
		this.onmouseover = function(e){
			if (this.drag){
				this.oldClass = this.getETarget(e).className;
				if (this.getETarget(e).getAttribute("treeType")==1){
					this.getETarget(e).className = "treenode_over";
				}
				else{
					this.getETarget(e).className = "treenode_0_over";				
				}
			}
			var mX = e.x ? e.x : e.pageX;
			var mY = e.y ? e.y : e.pageY;
			alignElWithMouse(mX,mY)
			
		};
		this.onmouseout = function(e){
			if (this.drag){
				this.getETarget(e).className = this.oldClass;
				if (this.dragObj.id == this.getETarget(e).id){
					this.findObj(this.id + "_treenode_move").style.display="block";
				}
			}
			
		};
		this.init = function(){
			document.write("\n<div id=\"" + this.id + "_control\" class=\"contral\">");
			document.write("\n<div id = \"" + this.id + "_treenode_move\" class=\"treenode_move\"></div>")
			document.write("\n<div id = \"" + this.id + "_line\"></div>")
			document.write("\n<div class=\"treenode_0\" style=\"display:none;\" id = \"" + this.id + "_treenode_0\" onmouseup=\"" + this.id + ".onmouseup(event);\" onmouseover=\"" + this.id + ".onmouseover(event)\" onmouseout=\"" + this.id + ".onmouseout(event)\"></div>")
			document.write("\n<div class=\"treenode_1\" style=\"display:none;\" id = \"" + this.id + "_treenode\" onmousedown=\"" + this.id + ".onmousedown(event);\" onmouseup=\"" + this.id + ".onmouseup(event);\" onmouseover=\"" + this.id + ".onmouseover(event)\" onmouseout=\"" + this.id + ".onmouseout(event)\"></div>");
			for(i=0;i<treeNodes.length;i++){
				var nodeStr = "";
				for(treeNode in treeNodes[i]){
					nodeStr += treeNode + "=\"" + escape(treeNodes[i][treeNode]) + "\" ";
				}
				document.write("\n<div class=\"treenode_0_noselected\" id = \"" + this.id + "_treenode" + i + "_0\" index=\"" + i + "\" treetype=\"0\" ");
				document.write(nodeStr);
				document.write("onmouseup=\"" + this.id + ".onmouseup(event);\" onmouseover=\"" + this.id + ".onmouseover(event)\" onmouseout=\"" + this.id + ".onmouseout(event)\">");
				if (i>0){
					document.write(treeNodes[i].linetitle);
				}
				document.write("</div>");
				document.write("\n<div class=\"treenode_noselected\" id = \"" + this.id + "_treenode" + i + "\" index=\"" + i + "\" treetype=\"1\" ");
				document.write(nodeStr);
				if(treeNodes[i].subforumcount!='0')
				{
				     document.write("onmousedown=\"" + this.id + ".onmousedown(event);\" onmouseup=\"" + this.id + ".onmouseup(event);\" onmouseover=\"" + this.id + ".onmouseover(event)\" onmouseout=\"" + this.id + ".onmouseout(event)\">" + treeNodes[i].subject + " &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src=../images/cal_nextMonth.gif> &nbsp;<A href=\"#\" class=\"ImageTextButtonTree\"  style=\"BACKGROUND-IMAGE: url(../images/menu/add.gif);background-position=2px;\" onclick=\"javascript:window.location.href='AddForums.aspx?fid="+treeNodes[i].fid+"';\">添加</a>  <A href=\"#\" class=\"ImageTextButtonTree\"  style=\"BACKGROUND-IMAGE: url(../images/submit.gif);background-position=2px;\" onclick=\"javascript:window.location.href='EditForums.aspx?fid="+treeNodes[i].fid+"';\">编辑</a>  <A href=\"#\" class=\"ImageTextButtonTree\"  style=\"BACKGROUND-IMAGE: url(../images/del.gif);background-position=2px;\" onclick=\"javascript:if(confirm('您要删除该项吗?')){window.location.href='delforums.aspx?fid="+treeNodes[i].fid+"';}\">删除</a>  <A href=\"#\" class=\"ImageTextButtonTree\"  style=\"BACKGROUND-IMAGE: url(../images/move.gif);background-position=2px;\" onclick=\"javascript:window.location.href='forumsmove.aspx?currentfid="+treeNodes[i].fid+"';\">移动</a>   </div>");
				}
				else
				{
				     document.write("onmousedown=\"" + this.id + ".onmousedown(event);\" onmouseup=\"" + this.id + ".onmouseup(event);\" onmouseover=\"" + this.id + ".onmouseover(event)\" onmouseout=\"" + this.id + ".onmouseout(event)\">" + treeNodes[i].subject + " &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src=../images/cal_nextMonth.gif> &nbsp;<A href=\"#\" class=\"ImageTextButtonTree\"  style=\"BACKGROUND-IMAGE: url(../images/menu/add.gif);background-position=2px;\" onclick=\"javascript:window.location.href='AddForums.aspx?fid="+treeNodes[i].fid+"';\">添加</a>  <A href=\"#\" class=\"ImageTextButtonTree\"  style=\"BACKGROUND-IMAGE: url(../images/submit.gif);background-position=2px;\" onclick=\"javascript:window.location.href='EditForums.aspx?fid="+treeNodes[i].fid+"';\">编辑</a>  <A href=\"#\" class=\"ImageTextButtonTree\"  style=\"BACKGROUND-IMAGE: url(../images/del.gif);background-position=2px;\" onclick=\"javascript:if(confirm('您要删除该项吗?')){window.location.href='delforums.aspx?fid="+treeNodes[i].fid+"';}\">删除</a>  <A href=\"#\" class=\"ImageTextButtonTree\"  style=\"BACKGROUND-IMAGE: url(../images/move.gif);background-position=2px;\" onclick=\"javascript:window.location.href='forumsmove.aspx?currentfid="+treeNodes[i].fid+"';\">移动</a>   <A href=\"#\" class=\"ImageTextButtonTree\"  style=\"BACKGROUND-IMAGE: url(../images/nav/guide.gif);background-position=2px;\" onclick=\"javascript:window.location.href='forumbatchset.aspx?fid="+treeNodes[i].fid+"';\">复制论坛设置</a> </div>");
				}
			}
			

			//alert(this.id);
		
			
		}
		
		document.write("\n</div>");
			
		
		this.findObj = function(objname){
			if (document.getElementById(objname)){
				return document.getElementById(objname);
			}
			else if(document.getElementsByName(objname)){
				return document.getElementsByName(objname)
			}
			else{
				return null;
			}
		}
		
		this.HideMove = function(){
			if (this.findObj(this.id + "_treenode_move").style.display!="none"){
				this.findObj(this.id + "_treenode_move").style.display="none";
			}
		}
		
		this.ShowMove = function(mX ,mY,innerHTML){
			this.findObj(this.id + "_treenode_move").innerHTML = innerHTML;
			this.findObj(this.id + "_treenode_move").style.left =(mX + 10) + "px";
			this.findObj(this.id + "_treenode_move").style.top = (mY) + "px";
		}
		
		this.SetMove = function(e,mX,mY){
			this.findObj(this.id + "_treenode_move").style.left =(mX + 10) + "px";
			this.findObj(this.id + "_treenode_move").style.top = (mY) + "px";			
		}
		
		
		//document事件
		this.document_onmouseup = function(e){
			if (this.drag){
				this.drag = false;
				try{
					this.getETarget(e).className = this.oldClass;
					
					index = this.getETarget(e).getAttribute("index");
					eval(funName+ "(treeNodes[index],treeNodes[this.dragObj.getAttribute(\"index\")],this.getETarget(e).getAttribute(\"treetype\"))");
				}
				catch(e){}
				
				this.HideMove();
				treeID = null;
				
				document.onmousedown = function(){return true};
				document.onmousemove = function(){null;};
			}

		}
		document.onmouseup = new Function(this.id + ".document_onmouseup();");
		
		this.document_onmousemove = function(e){
			e= e ? e : window.event;
			var mX = e.x ? e.x : e.pageX;
			var mY = e.y ? e.y : e.pageY;
			this.SetMove(e,mX,mY);
			
		}
		
		this.document_onselectstart = function(){
			return !this.drag;
		}
		document.onselectstart = new Function("return " + this.id + ".document_onselectstart ();");
		
		this.init();
		
		if(this.findObj(this.id+"_treenode0"))
		{
			//alert(this.findObj(this.id+"_treenode0").id);
			//this.findObj(this.id+"_treenode0").className='treenode_selected';
		}
		
	}
	
</script>

<script language="javascript">
	function reSetTree(objN,objO,treetype){
		//alert("up=" + objN.fid);
		//alert("down=" + objO.name.fid)
		//alert(treetype);
		
		
		if(objN.fid!=objO.fid)
		{ 
		   var message='您是否要将版块\"'+objO.name+'\"称动到版块\"'+objN.name+'\"';
		   if(treetype==1)
		   {
		       message+='子版下吗 ?';
		   }
		   else
		   {
			   message+='之前吗 ?';
		   }
		  
		   if(confirm(message))
		   {
		  
	          //string currentfid,string targetfid,bool isaschildnode)	
	          window.location.href='forumstree.aspx?currentfid='+objO.fid+'&targetfid='+objN.fid+'&isaschildnode='+treetype;
	       }
	    }
	}
</script>

<SCRIPT LANGUAGE="JavaScript">
if (navigator.appName == 'Netscape')
{
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = netscapeMouseMove;
} 
function netscapeMouseMove(e) {

 if(e.screenY>(document.body.offsetHeight-10))
 {
     window.scrollTo(e.screenX, e.screenY+1000);
 }

 if(e.screenY<10)
 {
     window.scrollTo(e.screenX, e.screenY-1000);
 }
 
}

function microSoftMouseMove()
{
  //alert(window.event.y);
  //alert(document.body.offsetHeight);
 if(window.event.y>(document.body.offsetHeight-10))
 {
     window.scrollTo(window.event.x, window.event.y+1000);
 }

 if(window.event.y<10)
 {
     window.scrollTo(window.event.x, window.event.y-1000);
 }
}

var countdown=1;
var countup=1;
function alignElWithMouse(x,y)
{
     
		 if(navigator.appName.indexOf("Explorer") > -1)
         {
            //document.getElementById('x').innerText="document.body.offsetHeight:"+document.body.offsetHeight+" "+x;
           // document.getElementById('y').innerText=y;
            var pos=50;
           
			if(y>(document.body.offsetHeight-pos))
			{
				window.scrollTo(x, 30*countdown);
				// alert('y:'+y+ '\r\n'+document.body.offsetHeight);
				countdown++;
				countup=1;
			}

			if(y<pos)
			{
			    countdown=1;
				window.scrollTo(x, document.body.clientHeight-(countup*30));
				countup++;
			}
         }
        
         /*
         else
         {
            var pos=100;
            document.getElementById('x').textContent="pos:"+pos+" "+window.innerHeight;
            document.getElementById('y').textContent="y"+y;
           
		    if(y>(window.innerHeight-100))
			{
			    window.scrollTo(x, 30*countdown+window.innerHeight-450);
				// alert('y:'+y+ '\r\n'+document.body.offsetHeight);
				countdown++;
				countup=1;
               // window.scrollTo(x, y+window.innerHeight);
			}
			
		    if(((document.body.offsetHeight-y)>=(window.innerHeight-5))&&(y>window.innerHeight))
			{
				//window.scrollTo(x, y-window.innerHeight);
				countdown=1;
				countup++;
				window.scrollTo(x, document.body.clientHeight-(countup*30)-window.innerHeight+400);
				
			}
         }
         */
}



</SCRIPT>
</head>
<script language="javascript" src="../js/common.js"></script>
<body >

		<form id="Form1" runat="server" >
	<table width=98%><tr><td width=2px></td><td width="100%">
	        <asp:Label id="Label1" runat="server"></asp:Label></td></tr></table>
  	
<!--<span id=x></span>&nbsp; <span id=y></span>	  -->
<%=footer%>
</form>

	
	
	</body>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -