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

📄 index.aspx

📁 具有的功能适合于网站的运营和管理
💻 ASPX
📖 第 1 页 / 共 4 页
字号:
   var _href_;
   var ajax=new HttpAjax(); 
   var _titleObj_;
   var _explainContent=true;
   var _explainHead=true;
   this.showMenu=function(_controlId){
      _controlID_=_controlId;
       var _containerArray=document.getElementsByClassName("DragContainer");
       _control=document.getElementById(_controlId);
       _head_=document.getElementById(_controlId+"_head");
       _titleObj_=_head_.firstChild;
       _content=_control.childNodes[1];       
      _href_=(_titleObj_.childNodes[0]).getAttribute("href");    
       _currentContainer=_control.parentNode;  
       var _disableleft=false;
       var _disableright=false;
       var _disableup=false;
       var _disabledown=false;
       if(_containerArray.length>0){
           if(_containerArray[0].id==_currentContainer.id){
              _disableleft=true;
           }
           if(_containerArray[_containerArray.length-1].id==_currentContainer.id){
             _disableright=true;
           }
           cleanWhiteSpace(_currentContainer);
           if(_currentContainer.firstChild== _control){
             _disableup=true;
           }
           if(_currentContainer.lastChild== _control){
             _disabledown=true;
           }
       }
        var menuHtml="<ul id=\"navmenu\"><li><ul>";
         menuHtml+="<li><img src=\"IMS_Img/Index/refresh.gif\" />高度";
         menuHtml+="<ul>";
         menuHtml+="<li onclick=\"top.page.DragBoxMenu.changeSize('add',50)\"><img src='IMS_Img/Index/add.gif'/>增加50</li>";
         menuHtml+="<li onclick=\"top.page.DragBoxMenu.changeSize('sub',50)\"><img src='IMS_Img/Index/add.gif'/>减少50</li>";
         menuHtml+="<li onclick=\"top.page.DragBoxMenu.changeSize('add',100)\"><img src='IMS_Img/Index/add.gif'/>增加100</li>";
         menuHtml+="<li onclick=\"top.page.DragBoxMenu.changeSize('sub',100)\"><img src='IMS_Img/Index/add.gif'/>减少100</li>";         
         menuHtml+="</ul></li>";         
         menuHtml+="<li><a href='#'><img src=\"IMS_Img/Index/move.gif\" />移动</a>";
         menuHtml+="    <ul>";
         if(_disableup)
            menuHtml+="      <li id=\"Menu_moveUp\" ><img src=\"IMS_Img/Index/moveUp_U.gif\" />向上</li>";
         else
            menuHtml+="      <li id=\"Menu_moveUp\" onclick=\"top.page.DragBoxMenu.move('"+_controlId+"','up')\"><img src=\"IMS_Img/Index/moveUp.gif\" />向上</li>";
         if(_disabledown)
            menuHtml+="      <li id=\"Menu_moveDown\"><img src=\"IMS_Img/Index/moveDown_U.gif\" />向下</li>";
         else
            menuHtml+="      <li id=\"Menu_moveDown\" onclick=\"top.page.DragBoxMenu.move('"+_controlId+"','down')\"><img src=\"IMS_Img/Index/moveDown.gif\" />向下</li>";
         if(_disableleft)
            menuHtml+="      <li id=\"Menu_moveLeft\"><img src=\"IMS_Img/Index/moveLeft_U.gif\" />向左</li>";
         else
            menuHtml+="      <li id=\"Menu_moveLeft\" onclick=\"top.page.DragBoxMenu.move('"+_controlId+"','left')\"><img src=\"IMS_Img/Index/moveLeft.gif\" />向左</li>";
         if(_disableright)
            menuHtml+="      <li id=\"Menu_moveRight\"><img src=\"IMS_Img/Index/moveRight_U.gif\" />向右</li>";
         else
            menuHtml+="      <li id=\"Menu_moveRight\" onclick=\"top.page.DragBoxMenu.move('"+_controlId+"','right')\"><img src=\"IMS_Img/Index/moveRight.gif\" />向右</li>";
         menuHtml+="   </ul>";      
         menuHtml+="</li>";                
         menuHtml+="<li><a href='#'><img src=\"IMS_Img/Index/showNums.gif\" />显示数量</a>";
         menuHtml+="<ul>";
         menuHtml+="<li onclick=\"top.page.DragBoxMenu.setNums('"+_controlId+"_content',5)\"><img src='IMS_Img/Index/add.gif'/>5</li>";
         menuHtml+="<li onclick=\"top.page.DragBoxMenu.setNums('"+_controlId+"_content',10)\"><img src='IMS_Img/Index/add.gif'/>10</li>";
         menuHtml+="<li onclick=\"top.page.DragBoxMenu.setNums('"+_controlId+"_content',15)\"><img src='IMS_Img/Index/add.gif'/>15</li>";
         menuHtml+="<li onclick=\"top.page.DragBoxMenu.setNums('"+_controlId+"_content',20)\"><img src='IMS_Img/Index/add.gif'/>20</li>";
         menuHtml+="<li onclick=\"top.page.DragBoxMenu.setNums('"+_controlId+"_content')\"><img src='IMS_Img/Index/add.gif'/>全部</li>";
         menuHtml+="</ul></li>";  
         menuHtml+="<li onclick=\"top.page.DragBoxMenu.refresh('"+_controlId+"_content')\" ><img src=\"IMS_Img/Index/refresh.gif\" />刷新</li>";
         menuHtml+="<li onclick=\"top.page.DragBoxMenu.showSetTitle('"+_controlId+"_title')\"><img src=\"IMS_Img/Index/Mode.gif\" />更改标题</li>";   
         menuHtml+=" </ul></li></ul>";  
         var tmouseOffset=getMouseOffset(_titleObj_,event); 
         var tmousePos = mouseCoords(event);
         _menuObj.innerHTML=menuHtml;         
         _menuObj.style.display = "block"; 
         _menuObj.style.left= event.x-50;
         _menuObj.style.top =tmousePos.y-tmouseOffset.y+20;  
         navHover();        
   
   }
   this.hideMenu=function(){
     _menuObj.style.display="none";
   }
   this.refresh=function(_controlId){
     var refreshUrl="Passport/WebService.ashx?Action=GetRssContent&rssurl="+_href_+"&Rnd="+Math.random();   
     ajax.updateContent(refreshUrl,_controlId);
   }
   
   this.setNums=function(_controlId,DisplayNums){
      var refreshUrl="Passport/WebService.ashx?Action=GetRssContent&rssurl="+_href_+"&Rnd="+Math.random();   
      ajax.updateContent(refreshUrl,_controlId,DisplayNums);
   }
   
   this.close=function(_controlId){     
     _control=document.getElementById(_controlId);
     (_control.parentNode).removeChild(_control);
   }
  
   this.showHideContent=function(_controlId,obj){    
     _control=document.getElementById(_controlId); 
     var _display=_control.style.display;
     if(_display=="none"){
       obj.setAttribute("src","IMS_Img/Index/Box_small.gif");
       _control.style.display="block";
       _explainContent=true;
     }
     else{
        obj.setAttribute("src","IMS_Img/Index/Box_big.gif");
        _control.style.display="none";
        _explainContent=false;
     }  
     
   }
   this.changeSize=function(sizeType,sizeNums){
     var _sizeNums_=parseInt(sizeNums);
     switch(sizeType){
       case "add":      
         _content.style.height=_content.clientHeight+_sizeNums_;
         break;
       case "sub":        
          if(_content.clientHeight>_sizeNums_)
           _content.style.height=_content.clientHeight-_sizeNums_;
         break;
     }    
   
   }
  
   this.explainContent=function(){
      if(_explainHead){
      var _controlArray=document.getElementsByClassName("DragBox");   
	  for(var j=0;j<_controlArray.length;j++){	
	       _controlArray[j].childNodes[1].style.display=_explainContent?"none":"block";
	     }	  
	 	_explainContent=(_explainContent==true)?false:true;
	 }
	 else	
	    alert("很抱歉,不能在关闭眉栏时关闭内容");
   }
  
   this.explainHead=function(){
      if(_explainContent){
        //  var _ContainerArray_=document.getElementsByClassName("DragContainer");	
	      for (var i=0; i<_ContainerArray_.length; i++) {	
	         var _controlArray=_ContainerArray_[i].childNodes;	     
	         for(var j=0;j<_controlArray.length;j++){	    
	           _controlArray[j].childNodes[0].style.display=_explainHead?"none":"block";
	         }
    	  
	      }
	      _explainHead=(_explainHead==true)?false:true; 
	  }
	  else	 
	    alert("很抱歉,不能在关闭内容时关闭眉栏");
	  
   }
   
   this.move=function(_controlId,moveDirection){
      if(_control!=null&&_currentContainer!=null){     
           switch (moveDirection){
              case "up":
                 var beforeNode=_control.previousSibling;
                 if(beforeNode!=null)
                   _currentContainer.insertBefore(_control,beforeNode);
                 break;
              case "down":
                 var nextNode=_control.nextSibling;
                 if(nextNode!=null)
                   _currentContainer.insertBefore(nextNode,_control);
                 break;
              case "left":
                 var leftContainer=_currentContainer.previousSibling;
                 if(leftContainer!=null){
                    leftContainer.appendChild(_control);                   
                 }  
                 break;
              case "right":
                 var rightContainer=_currentContainer.nextSibling;
                 if(rightContainer!=null){
                     rightContainer.appendChild(_control);                   
                 }
                break;          
           }
      } 
   }
    
   this.showSetTitle=function(_controlId){
      var _title_=(_titleObj_.firstChild).innerHTML;    
      _titleObj_.innerHTML="<input type=\"text\" value=\""+_title_+"\" style=\"width:100px;\" onblur='top.page.DragBoxMenu.EndTitleSet(\""+_controlId+"\")'/>";
      _titleObj_.firstChild.focus();
   }
   this.EndTitleSet=function(_controlId){    
      var m_newTitle=_titleObj_.firstChild.value;
     _titleObj_.innerHTML="<a href='"+_href_+"'>"+m_newTitle+"</a>";
     UpdateDragBox(_controlID_,1,m_newTitle);
   }
   this.addContent=function(){
     var _addContentObj=document.getElementById("addContent");
     _addContentObj.style.display="block";   
     _addContentObj.style.position="absolute";     
     _addContentObj.innerHTML="<div style=\"top:200px;left:200px;position:absolute;\"><table border='0' cellpadding='0' cellspacing='0' width=\"627px\" style=\"background=white;\"><tr><td style=\"background:url(IMS_Img/Index/add_new_top.gif); text-align:right;\" colspan='2'><img src=\"IMS_Img/Index/red_close_windows.gif\" onClick=\"top.page.DragBoxMenu.CloseAdd()\"/></td><td width=\"7px\"><img src=\"IMS_Img/Index/add_rss_top_right.gif\"/></td></tr><tr><td style=\"background:url(IMS_Img/Index/add_rss_left.gif) repeat-y;width:6px;\"></td><td style=\"border-top:solid 1px black;\">&nbsp;&nbsp;请输入RSS名称:<input type=\"text\" name=\"RssTitle\" id=\"RssTitle\"  style=\"width:300px\"/><br/>&nbsp;&nbsp;请输入RSS地址:<input type=\"text\" name=\"RssURl\" id=\"RssUrl\" style=\"width:300px\"/><br/><center><input type=\"button\" value=\"确定\" onclick=\"top.page.DragBoxMenu.addRss();\"/></center></td><td style=\"background:url(IMS_Img/Index/add_rss_left.gif) repeat-y;width:6px;\"></td></tr><tr><td style=\"width:6px; height:10px;\"><img src=\"IMS_Img/Index/add_rss_bottom_left.gif\"/></td><td style=\"background:url(IMS_Img/Index/add_rss_bottom_right.gif) repeat-x;\"></td><td style=\"width:6px; height:10px;\"><img src=\"IMS_Img/Index/add_rss_bottom_right2.gif\"/></td></tr></table></div>";
    
   }
   var _cookie_=new Cookie();   
   
   this.CloseAdd=function(){
     document.getElementById("addContent").style.display="none";
   }
   this.addRss=function(){
      var _rssUrl=document.getElementById("RssUrl").value;
      var _rssTitle=document.getElementById("RssTitle").value;
      if(_rssUrl==""||_rssTitle=="")
         alert("输入的标题或链接地址为空");
      else{
          if(_rssUrl.indexOf("http")!=0){
            alert("输入链接地址格式不正确");
            return;
          }
          document.getElementById("addContent").style.display="none";
         _cookie_.setCookie("RssUrl",_rssUrl);        
         var _cl=userChannel.length;        
         var _newObjId="DragBox_"+parseInt(Math.random()*10000);        
         userChannel[_cl]=new Array();       
         userChannel[_cl][0]= _newObjId;
		 userChannel[_cl][1]=_rssTitle;
		 userChannel[_cl][2]=_rssUrl;
		 userChannel[_cl][3]="10";
		 userChannel[_cl][4]="1";
		 userChannel[_cl][5]="0";
		 userChannel[_cl][6]="0";
		 userChannel[_cl][7]="0";
		 userChannel[_cl][8]="Rss";
		 userChannel[_cl][9]="0";
		 userChannel[_cl][10]="0";
		
		 var userChannelObj=CreateDragBox(userChannel[_cl]);
		 DragBoxArray.push(userChannelObj);
		 DragDrops[0].push(userChannelObj);		 
	//	 var _containerArray_=document.getElementsByClassName("DragContainer");		
		 _ContainerArray_[0].insertBefore(userChannelObj,_ContainerArray_[0].childNodes[0]);
		  CreateDragContainer();
		   SaveCurrnetLayout();
		
        
      }
   }
   
   this.showRss=function(obj,nums1,nums2){
      var tmouseOffset=getMouseOffset(obj,event); 
      var tmousePos = mouseCoords(event);    
      var _rss_dtl=rss_description[nums1][nums2];
      var _rss_show=document.getElementById("showRssDtl");
      var _titleObj=obj.previousSibling;
      var _rss_title=_titleObj.innerHTML;
      var _rss_href=_titleObj.getAttribute("href");    
       _rss_show.innerHTML="<table border='0' cellpadding='0' cellspacing='0' ><tr class=\"rss_detail_title\"><td>"+_rss_title+"</td><td><img src=\"IMS_Img/Index/deleteLink.gif\" onClick=\"top.page.DragBoxMenu.closeRssDetail();\"  onMouseOver=\"this.className='buttonActive';\" onMouseOut=\"this.className='buttonBlur';\"/></td></tr><tr><td colspan='2' class=\"rss_detail_content\">"+_rss_dtl+"</td></tr><tr><td colspan='2' style=\"text-align:center;\"><a href=\""+_rss_href+"\" target=\"_blank\">全文</a></td></tr></table>"; 
       _rss_show.style.position="absolute"; 
       _rss_show.style.display = "block";
      var _rssLeft; 
      if((event.x+350)>document.body.clientWidth) 
         _rssLeft=document.body.clientWidth-400;
      else 
         _rssLeft= event.x-50;
       _rss_show.style.left= _rssLeft;
       _rss_show.style.top =tmousePos.y-tmouseOffset.y+20;     
   }
   this.closeRssDetail=function(){
      var _rss_show=document.getElementById("showRssDtl");
      _rss_show.style.display="none";
   } 
}

function Page() {
	this.DragBoxMenu=new DragBoxMenu();
}

var page;
function navHover() {
  var lis = document.getElementById("navmenu").getElementsByTagName("LI");
  for (var i=0; i<lis.length; i++) {
    lis[i].onmouseover=function() {
      this.className+=" iehover";
    }
    lis[i].onmouseout=function() {
      this.className=this.className.replace(new RegExp(" iehover\\b"), "");
    }
  }
}

function setDisplay(showtype){
  var _myTitle=document.getElementById("myTitle");
  switch(showtype){
    case "default":
      _myTitle.className="myTitleblur";
      var now = new Date();
      var nextYear = new Date(now.getYear() + 1, now.getMonth(), now.getDate());
      var _cookie=new Cookie();
      _cookie.setCookie("howave_myspace_title",_myTitle.value,nextYear);
      break;
    case "show":
       _myTitle.className="myTitileActive";
       break;
  }
  
}
    </script>
</head>
<body onload="initContainer();">
<div id="index_head"><img src="IMS_Img/Index/index_logo.gif" align="middle"/>&nbsp; <input type="text" id="myTitle" name="myTitle"  onfocus="setDisplay('show')"  onblur="setDisplay('default')" class="myTitleblur"  value="在这里输入您对此页面的描述"/></div>
<div id="index_toolbar" style="background:#969DB8; width:960px;margin:0 auto;">
<input type="button" value="添加" onclick="top.page.DragBoxMenu.addContent()" />
<input type="button" value="收起/展开内容" onclick="top.page.DragBoxMenu.explainContent()" />
<input type="button" value="收起/展开眉条"  onclick="top.page.DragBoxMenu.explainHead()"/>
<label>布局
<select name="ContainerNums" id="ContainerNums" onchange="initContainer(this.options[this.options.selectedIndex].value)">
  <option value="3">三列</option>
  <option value="2">二列</option>
  <option value="1">一列</option>
  <option value="0">自由布局</option>
</select>
</label>
&nbsp;&nbsp;&nbsp;<a href="Passport/Index.aspx?ComeUrl=MySpace.aspx">返回导航条</a>
</div>

<div id="tempscript"></div>
<div style="width:960px;margin:0 auto; height:100% ;" id="PageContent"></div>
<div id="DragBox_Menu" class="dragBoxMenu" onmousemove="this.style.display='block'" onmouseout="this.style.display='none'"  onclick="this.style.display='none'">&nbsp;</div>
<div id="bottom" style=" display:none; border-top:solid 1px gray;">
    <uc1:CopyRight ID="CopyRight1" runat="server" />
</div>
<div id="addContent"></div>
<div id="showRssDtl"  class="rss_detail"></div>
<div id="testcookie"></div>
</body>
</html>

⌨️ 快捷键说明

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