www.pudn.com > YHCMSstruts.rar > ubb.js


helpstat = false; 
stprompt = false; 
basic = true; 
function stringManage(strbegin,strend){ 
	if ((document.selection)&&(document.selection.type == "Text")) { 
		var range = document.selection.createRange(); 
		var ch_text=range.text; 
		range.text = strbegin + ch_text + strend; 
	}  
	else { 
		document.forms[0].content.value=document.forms[0].content.value+strbegin+strend; 
		document.forms[0].content.focus(); 
	} 
} 
function thelp(swtch){ 
	if (swtch == 0){ 
		stprompt = true; 
		basic = false; 
	} else if (swtch == 1) { 
		stprompt = false; 
		basic = true; 
	} 
} 
function AddText(NewCode) { 
	document.forms[0].content.value+=NewCode 
} 
function emailurl() { 
var txt2, txt 
	if (basic) { 
	   stringManage("[email]","[/email]"); 
	} 
	else {  
		txt2=prompt("?????????????????????EMAiL?????????. ","");  
		if (txt2!=null) { 
			txt=prompt("????????????.","mailto:");       
			if (txt!=null) { 
				if (txt2=="") { 
					AddTxt="[email]"+txt+"[/email]"; 
					AddText(AddTxt); 
				} else { 
					AddTxt="[email="+txt+"]"+txt2+"[/email]"; 
					AddText(AddTxt); 
				}          
			}  
		} 
	} 
} 
function showsize(size) { 
	if (basic) { 
		stringManage("[size="+size+"]","[/size]"); 
	} else {                        
		txt=prompt("?????????????????????????????? "+size,"??????");  
		if (txt!=null) {              
			AddTxt="[size="+size+"] "+txt+"[/size]"; 
			AddText(AddTxt); 
		}         
	} 
} 
 
function bold() { 
	if (basic) { 
		stringManage("[B]","[/B]"); 
	} else {   
		txt=prompt("???????????????????????????.","??????");      
		if (txt!=null) {            
			AddTxt="[B] "+txt+"[/B]"; 
			AddText(AddTxt); 
		}        
	} 
} 
 
function italicize() { 
	if (basic) { 
		stringManage("[I]","[/I]"); 
	} else {    
		txt=prompt("???????????????????????????","??????");      
		if (txt!=null) {            
			AddTxt="[I] "+txt+"[/I]"; 
			AddText(AddTxt); 
		}	         
	} 
} 
function quote() { 
	if (basic) { 
		stringManage(" [quote]","[/quote]"); 
	} else {    
		txt=prompt("????????????????????????","??????");      
		if(txt!=null) {           
			AddTxt=" [quote] "+txt+" [/quote]"; 
			AddText(AddTxt); 
		}	         
	} 
} 
 
function showcolor(color) { 
	if (basic) { 
		stringManage("[color="+color+"] ","[/color]"); 
	} else {   
     	txt=prompt("??????????????????????????? "+color,"??????"); 
		if(txt!=null) { 
			AddTxt="[color="+color+"] "+txt+"[/color]"; 
			AddText(AddTxt);         
		}  
	} 
} 
 
function center() { 
 	if (basic) { 
		stringManage("[center]","[/center]"); 
	} else {   
		txt=prompt("????????????????????????","??????");      
		if (txt!=null) {           
			AddTxt="[center]"+txt+"[/center]"; 
			AddText(AddTxt); 
		}	        
	} 
} 
function right() { 
 	if (basic) { 
		stringManage("[right] ","[/right]"); 
	} else {   
		txt=prompt("??????????????????????????????","??????");      
		if (txt!=null) {           
			AddTxt="[right]"+txt+"[/right]"; 
			AddText(AddTxt); 
		}	        
	} 
} 
 
function move() { 
 	if (basic) { 
		stringManage("[move]","[/move]"); 
	} else {   
		txt=prompt("??????????????????????????????","??????");      
		if (txt!=null) {           
			AddTxt="[move]"+txt+"[/move]"; 
			AddText(AddTxt); 
		}	        
	} 
} 
function fly() { 
 	if (basic) { 
		stringManage("[fly]","[/fly]"); 
	} else {   
		txt=prompt("??????????????????????????????","??????");      
		if (txt!=null) {           
			AddTxt="[fly]"+txt+"[/fly]"; 
			AddText(AddTxt); 
		}	        
	} 
} 
 
function hyperlink() { 
	if (basic) { 
		stringManage("[url]","[/url]"); 
	} else {  
		txt2=prompt("?????????????????????url??????.","");  
		if (txt2!=null) { 
			txt=prompt("??????url?????????????????????.","http://");       
			if (txt!=null) { 
				if (txt2=="") { 
					AddTxt="[url]"+txt+"[/url]"; 
					AddText(AddTxt); 
				} else { 
					AddTxt="[url="+txt+"]"+txt2+"[/url]"; 
					AddText(AddTxt); 
				}          
			}  
		} 
	} 
} 
 
function image() { 
	if (basic) { 
		stringManage("[img]","[/img]"); 
	} else {   
		txt=prompt("????????????????????????","http://");     
		if(txt!=null) {             
			AddTxt="[img]"+txt+"[/img]"; 
			AddText(AddTxt); 
		}	 
	} 
} 
function flash() { 
	if (basic) { 
		stringManage("[swf]","[/swf]"); 
	} else {   
		txt=prompt("?????????flash???????????????","http://");     
		if(txt!=null) {    
			var txt2 = prompt("SWF????????????????????? ?????????450,350 ","450,350"); 
			if (txt2!=null) { 
				var w = txt2.substring(0, txt2.indexOf(",")); 
				var h = txt2.substring(txt2.indexOf(","),txt2.length); 
				AddTxt="[swf=" + w + h + "]" + txt + "[/swf]"; 
				AddText(AddTxt); 
			} 
		}	 
	} 
} 
function showcode() { 
	if (basic) { 
		stringManage("[code]","[/code]"); 
	} else {    
		txt=prompt("????????????","");      
		if (txt!=null) {           
			AddTxt="[code]"+txt+"[/code]"; 
			AddText(AddTxt); 
		}	        
	} 
} 
 
function underline() { 
  	if (basic) { 
		stringManage("[U]","[/U]"); 
	} else {   
		txt=prompt("?????????????????????.","Text");      
		if (txt!=null) {            
			AddTxt="[U] "+txt+"[/U]"; 
			AddText(AddTxt); 
		}	         
	} 
} 
function codes() { 
  	if (basic) { 
		stringManage("[code]","[/code]"); 
	} else {   
		txt=prompt("??????????????????","Text");      
		if (txt!=null) {            
			AddTxt="[code]"+txt+"[/code]"; 
			AddText(AddTxt); 
		}	         
	} 
} 
function htmls() { 
  	if (basic) { 
		stringManage("[html]","[/html]"); 
	} else {   
		txt=prompt("?????????????????????.","Text");      
		if (txt!=null) {            
			AddTxt="[html]"+txt+"[/html]"; 
			AddText(AddTxt); 
		}	         
	} 
} 
function real() { 
  	if (basic) { 
		stringManage("[rm]","[/rm]"); 
	} else {   
		txt=prompt("???????????????????????????.","http://");      
		if (txt!=null) { 
			var txt2 = prompt("??????????????????????????? ?????????450,350 ","450,350"); 
			if (txt2!=null) { 
				var w = txt2.substring(0, txt2.indexOf(",")); 
				var h = txt2.substring(txt2.indexOf(","),txt2.length); 
				AddTxt="[rm=" + w + h + "]" + txt + "[/rm]"; 
				AddText(AddTxt); 
			} 
			 
		}	         
	} 
} 
function win() { 
  	if (basic) { 
		stringManage("[mp]","[/mp]"); 
	} else {   
		txt=prompt("???????????????????????????.","http://");      
		if (txt!=null) {        
			var txt2 = prompt("??????????????????????????? ?????????300,80 ","300,80"); 
			if (txt2!=null) { 
				var w = txt2.substring(0, txt2.indexOf(",")); 
				var h = txt2.substring(txt2.indexOf(","),txt2.length); 
				AddTxt="[mp=" + w + h + "]" + txt + "[/mp]"; 
				AddText(AddTxt); 
			} 
		}	         
	} 
} 
function showfont(font) { 
 	if (basic) { 
		stringManage("[font="+font+"]","[/font="+font+"]"); 
	} else {                   
		txt=prompt("Text to be in "+font,"Text"); 
		if (txt!=null) {              
			AddTxt="[font="+font+"]"+txt+"[/font="+font+"]"; 
			AddText(AddTxt); 
		}         
	}   
}