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

📄 operation.js

📁 里面包含各类知识
💻 JS
📖 第 1 页 / 共 2 页
字号:
		var ms=getMessage(xml);
		if(isSuccess(xml)){
			var trObj=saveDelObj.parentNode.parentNode;
			var tableObj=trObj.parentNode;
			tableObj.removeChild(tableObj.rows[trObj.rowIndex+1]);
			tableObj.removeChild(tableObj.rows[trObj.rowIndex]);
		}
	}
	else{
	    alert("删除失败!"+ms);
	}
};
function delDiary(delObj,id){
	if(confirm('您是否真的删除该日志?')){
		saveDelObj=delObj;
		diaryId=id;
		var str='<?xml version="1.0" encoding="GBK" ?><parameters>' +'<parameter><parameter-name>diaryId</parameter-name><parameter-value><![CDATA['
		       +diaryId+']]></parameter-value></parameter>' +'</parameters>';
		postAjaxXML('/control/delDiary.b',str,onDelDiaryComplete);
	}
};
/*接受删除日志响应*/
function onDelDiaryComplete(ajax){
	if(ajax.readyState==4&&ajax.status==200){
		var xml=ajax.responseXML;
		var ms=getMessage(xml);
		if(isSuccess(xml)){
			var trObj=saveDelObj.parentNode.parentNode;
			var tableObj=trObj.parentNode;
			tableObj.removeChild(tableObj.rows[trObj.rowIndex]);
		}
	}
        else{
             alert("删除失败!"+ms);
        }
};
/*接受删除日志响应*/
function delFriendBlogItem(delObj,id){
	if(confirm('您是否真的删除该友情博客?')){
		saveDelObj=delObj;
		var str='<?xml version="1.0" encoding="GBK" ?><parameters>' 
		       +'<parameter><parameter-name>favoBlog.favoBlogId</parameter-name><parameter-value>'+id+'</parameter-value></parameter>' 
		       +'</parameters>';
	    postAjaxXML('/control/delFavoBlog.b',str,onFriendBlogComplete);
	 }
};

function onFriendBlogComplete(ajax){
	if(ajax.readyState==4&&ajax.status==200){
		var xml=ajax.responseXML;
		var ms=getMessage(xml);
		if(isSuccess(xml)){
			var trObj=saveDelObj.parentNode.parentNode;
			var tableObj=trObj.parentNode;
			tableObj.removeChild(tableObj.rows[trObj.rowIndex+1]);
			tableObj.removeChild(tableObj.rows[trObj.rowIndex]);
		}
	}
    else{
           alert("删除失败!");
    }
};

function saveDiary(){
	if(checkDiary()){
		$("diary.postSet").value=1;
		showLoad();
		changeElementState();
		postAjax("/control/doPostDiary.b","frm",onPostDiaryComplete);
	}
}
function postDiary(){
	if(checkDiary()){
		$("diary.postSet").value=0;
		showLoad();
		changeElementState();
		postAjax("/control/doPostDiary.b","frm",onPostDiaryComplete);
	}
}
function onPostDiaryComplete(){
	if(ajax.readyState==4){
		if(ajax.status == 200){
			var str;
			window.scrollTo(0,0); 
			var xml=ajax.responseXML; 
			if(isSuccess(xml)){	
				alert("日志保存成功");
				if($("diary.postSet").value==1){
					window.location.href='/control/diary/listDiary.b';
				}
				else{
					window.location.href='/control/diary/postDiary.b';
				}
			}
			else{
				str=getErrorStr();
				changeElementState();
				$("alert").innerHTML=str;
				$("alert").className ="stat-erro";
				showMessage();
			}
		}
		else{
			str=getErrorStr();
			changeElementState(); 
			$("alert").innerHTML=str;
			$("alert").className ="stat-erro";
			showMessage();
		}
	}
}
function createCategory(){
	if(Check.isNull("categoryName")){
		alert("栏目名称不能为空!");
		Field.focus("categoryName");
		return false;
	}
	var str='<?xml version="1.0" encoding="GBK" ?><parameters>' 
	       +'<parameter><parameter-name>diaryCategory.categoryName</parameter-name><parameter-value><![CDATA['
	       +encodeURI(trim($("categoryName").value))+']]></parameter-value></parameter>' +'</parameters>';
	postAjaxXML("/control/addCategory.b",str,onCategoryComplete);
}
function onCategoryComplete(){
	if(ajax.readyState==4){
	     if(ajax.status==200){
		var str;
		window.scrollTo(0,0);
		var xml=ajax.responseXML;
		var ms=getMessage(xml);
		if(isSuccess(xml)){
			addSelect($("categoryName").value,ms);
			$("categoryName").value='';
			$("createCategory").style.display='none';			
			$("alert").innerHTML='栏目操作成功';
			$("alert").className ="stat-ok";
		}
		else{
			$("alert").innerHTML=getErrorStr();
			$("alert").className ="stat-erro";
			changeElementState();
		}
	    }
	    else{
			$("alert").innerHTML=getErrorStr();
			$("alert").className ="stat-erro";
			changeElementState();
	    }
	    showMessage();
	}
}

function del(element){
   if(confirm('您是否真的删除该模块?')){
      var node,node1;
      node=element.parentNode;
      if(node){
         node1=node.parentNode;
      }
      if(node1){
         if(node1.id.indexOf("user-list")==-1){
            node1.parentNode.removeChild(node1);
            var n=node1.cloneNode(false);
            n.innerHTML=node1.innerHTML;
            delObj[delObj.length]=n;
            var module=new Object();
            module.id=node1.id;
            module.flag=false;
            Module.editModule(module);
            var re=new RegExp(node1.id+"#","ig");
            saveUserModules=saveUserModules.replace(re,"");
            Element.show('alert');
          }
          else{
             if(confirm('删除会将该列表下的所有子项一并删除,是否继续?')){
                var temp=node1.id.split("-");
                var str='<?xml version="1.0" encoding="GBK" ?><parameters><parameter><parameter-name>listMain.listMainId</parameter-name><parameter-value><![CDATA['+temp[2]+']]></parameter-value></parameter></parameters>';
                listNode=node1;
                postAjaxXML('/control/removeListMain.b',str,onRemoveListComplete);
              }
            }
         }
         else{}
         node=null;
         node1=null;
       } 
       initDndMgr();
};


function postTemplate(){
	postAjaxXML('/control/saveTemplate.b',createXML(),onChangeTemplateComplete);
	Element.hide('alert');	
};
function onChangeTemplateComplete(ajax){	
	if(ajax.readyState==4&&ajax.status==200){
		window.scrollTo(0,0);
		var xml=ajax.responseXML;
		if(isIE){
			if(isSuccess(xml)){
				window.location.reload(true);
			} 
			else{
				alert('模板更换失败!');
				canelTemplate();
				Element.hide('loadDiv');
				Element.hide('alert');
				Element.show('container');
			}
		}
		else{
			if(ajax.responseText.indexOf("SUCCESS")>-1 ){
				window.location.reload(true);
			} 
			else{
				alert('模板更换失败!');
				canelTemplate();
				Element.hide('loadDiv');
				Element.hide('alert');
				Element.show('container');
			}
		}
	}
};

function selectPhoto(){
	var diaType = "scrollbars=yes,resizable=no,help=no,status=no,center=yes,width=635px,height=360px,left="+(window.screen.width-635)/2+",top=300px";
		
	var selLoaction="/pub/neweditor/editor/imgInfo.htm?ver=20061107";
	win=window.open(selLoaction,"选择照片",diaType);	
}

function doUpdatePhoto(photoPath){
	if (photoPath!=null&&photoPath!=""){
		createPhotoImg(decodeURI(photoPath));
		photoPath = photoPath.replace("&","amp;");
		var sUrl = "/info/doUpdatePhoto.b?flg=3&photoAddress="+photoPath;
		postAjaxXML(sUrl , "" , showAjaxUpdateInfo);
	}
}

function createPhotoImg(photoPath){
	var imgSpan = document.getElementById("photoDiv");
	imgSpan.style.display = "block";
	document.getElementById("photoImg").src=photoPath;
}

function showAjaxUpdateInfo(ajax){
	if(ajax.readyState==4&&ajax.status==200){
		var xml=ajax.responseXML;		
		if (document.all){	
			closeWin();
			alert('个人形象修改成功');
		}else{
			alert('个人形象修改成功');
		}
	}
}
function closeWin(){
	if (win)
		{
			win.window.close();
		}
}

function statCount(domain){
	var date = new Date();
	var options=new Object();
	options.method="get";
	options.asynchronous=true;
	options.parameters="date="+date.getYear()+date.getMonth()+date.getDay()+date.getMinutes()+date.getSeconds()+"&action=10&username="+domain+"&oid="+domain+"_WC,"+domain+"_wh";
	options.onComplete=showAllCount;	
	
	var sUrl1 = "/stats/pvcounter.fcgi?date="+date.getYear()+date.getMonth()+date.getDay()+date.getMinutes()+date.getSeconds();
	new Ajax.Request(sUrl1, options);
	
	var sUrl2 = "/statDiary.b";	
	postAjaxXML(sUrl2 , "" , showOtherCount);
}

function showAllCount(ajax){
	if(ajax.readyState==4){
		if(ajax.status==200){
			var str = ajax.responseText;
			var temp = str.split(",");
			if(str == null || str.length==0 || temp.length != 2 ){
			  document.getElementById("numstat").innerHTML  = "历史访问:统计失败<BR/>";
			}
			else{
			  document.getElementById("numstat").innerHTML = "历史访问:<strong>"+temp[1]+"</strong><BR/>";
			}
		}
		else{
			document.getElementById("numstat").innerHTML  = "历史访问:统计失败<BR/>";
		}
	}
}

function showOtherCount(ajax){
	if(ajax.readyState==4){
		if(ajax.status==200){
			var str = ajax.responseText;
			if(str == null || str.length==0){
			   document.getElementById("diarystat").innerHTML = "日志数量统计失败";
			}
			else{
			  document.getElementById("diarystat").innerHTML = str;
			}
		}
		else{
			 document.getElementById("diarystat").innerHTML = "日志数量统计失败";
		}
	}
}

function getXMLHttpRequest(){
	if (window.ActiveXObject){
	 	return new ActiveXObject((navigator.userAgent.toLowerCase().indexOf('msie 5') != -1) ? 'Microsoft.XMLHTTP' : 'Msxml2.XMLHTTP');
	}
	else  if (window.XMLHttpRequest){
	 	return new XMLHttpRequest();
	}else{
	 	return null;
	}
}

function jionChatRoom(){
	if(getBlogID() != null)	{
		document.getElementById("chatRoomFrm").submit();
	}
	else{
		document.getElementById("chatRoomFrm").url.value = "http://"+window.location.host+"/control/showChat.b?chatNamePost1="+ encodeURI(document.getElementById("chatRoomFrm").chatNamePost.value);
		document.getElementById("chatRoomFrm").action = "http://reg.bokee.com/account/LoginCtrl.b";
		document.getElementById("chatRoomFrm").submit();
	}
}

function jionChatRoomMyPhoto(){
	if(getBlogID() != null)	{
		document.getElementById("chatRoomFrmMyPhoto").submit();
	}
	else{
		document.getElementById("chatRoomFrmMyPhoto").url.value = "http://"+window.location.host+"/control/showChat.b?chatNamePost1="+ encodeURI(document.getElementById("chatRoomFrmMyPhoto").chatNamePost.value);
		document.getElementById("chatRoomFrmMyPhoto").action = "http://reg.bokee.com/account/LoginCtrl.b";
		document.getElementById("chatRoomFrmMyPhoto").submit();
	}
}

function sendMsg(blog){
   var blogID=getBlogID();
   if(blogID == null){
   		alert('未登陆!请登陆!');   		
   		window.location.href='http://reg.bokee.com/account/web/login.jsp?url='+ window.location.href;
   		return;
   }
   window.location.href='http://'+blogID+'/mes/postMessage.b?message.receiver='+blog;
}


function commendblog(blog){
   var blogID=getBlogID();
   if(blogID == null){
   		alert('未登陆!请登陆!');   		
   		window.location.href='http://reg.bokee.com/account/web/login.jsp?url='+ window.location.href;
   		return;
   }

   var sUrl ="http://"+blogID+"/sn/commendblog.b?commend=" + blog;
   var diaType = "scrollbars=no,resizable=no,help=no,status=no,center=yes,width=400px,height=330px";
   window.open(sUrl,"",diaType);
}

function popPostMsg(blog){
   var blogID=getBlogID();
   if(blogID == null){
   		alert('未登陆!请登陆!');   		
   		window.location.href='http://reg.bokee.com/account/web/login.jsp?url='+ window.location.href;
   		return;
   }
   var sUrl ="http://"+blogID+"/mes/poppostmsg.b?message.receiver="+blog;
   var diaType = "scrollbars=no,resizable=no,help=no,status=no,center=yes,width=400px,height=330px";
   window.open(sUrl,"",diaType);
}
function popNote(blogID){
   var sUrl ="http://"+blogID+"/note/popnote.b";
   var diaType = "scrollbars=no,resizable=no,help=no,status=no,center=yes,width=400px,height=230px";
   window.open(sUrl,"",diaType);
}

function getBlogIDName(){
   var blogID=getBlogID();
   if (blogID !=null) {
   	return blogID.split(".")[0];
   	}else
   	{
   	return "";
   	}
}

⌨️ 快捷键说明

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