www.gusucode.com > SiteEngine(建站引擎) 7.0 个人免费版源码程序 > admin/images/js/main.js

    function selectall(){
	try{
	var ee=document.subjectform.elements
	}catch(e){
	return false
	}
	for(i=0;i<ee.length;i++){
	ee[i].checked == true ? ee[i].checked=false : ee[i].checked=true
	}
}

function checkform1(){
	if(!document.listform.Chlist.value) {
	alert('请先选择一个采集项目')
	return false
	}
	document.listform.submit()
}

function selectall2(){
var ee=document.deleteform.elements
	for(i=0;i<ee.length;i++){
	ee[i].checked == true ? ee[i].checked=false : ee[i].checked=true
	}
}

function addnewform(){
	if(document.addform.Cname.value==''){
	alert('请填写项目名称')
	document.addform.Cname.focus()
	return false
	}
	if(document.addform.Clisturl.value==''){
	alert('请填写采集地址')
	document.addform.Clisturl.focus()
	return false
	}
	if(document.addform.Clfenye.checked==true){
	if(!/^[0-9]+$/.test(document.addform.Clstart.value) || !/^[0-9]+$/.test(document.addform.Clend.value)){
	alert('请填写采集地址分页起止(数字)')
	document.addform.Clstart.focus()
	return false
	}
	}
	if(document.addform.Cmustcode.value==''){
	alert('请填写采集地址必含字符')
	document.addform.Cmustcode.focus()
	return false
	}
	if(document.addform.Ccstart.value==''){
	alert('请填写采集内容开头标记')
	document.addform.Ccstart.focus()
	return false
	}
	if(document.addform.Ccend.value==''){
	alert('请填写采集内容结尾标记')
	document.addform.Ccend.focus()
	return false
	}
	if(document.getElementById('tohtml').checked==true){
		if(document.addform.Ctohtmldir.value==''){
		alert('请填写存放文件名及路径')
		document.addform.Ctohtmldir.focus()
		return false
		}
	if(document.getElementById('Ctohntype').checked==false && !/^[\w]+$/.test(document.addform.Ctohfname.value)){
		alert('文件名前辍尽可能使用字母、数字及下划线')
		document.addform.Ctohfname.focus()
		document.addform.Ctohfname.select()
		return false
		}
	}
	if(document.getElementById('tobbs').checked==true) document.addform.Ctohtmldir.disabled=true
return true
}

function checkdata(){
if(document.phpwind.forumurl.value=='') {
alert('请填写论坛的URL')
return false
}
if(!/^[0-9]+$/.test(document.phpwind.forhtml.value) || document.phpwind.forhtml.value>1) {
alert('填写是否HTML发贴,写数字0或1')
return false
}
if(document.phpwind.forsublen.value != ''){
if(!/^[0-9]+$/.test(document.phpwind.forsublen.value)){
alert('标题长度只能填写非0开头的数字或留空')
return false
}
}
if(!/^[0-9]+$/.test(document.phpwind.limitTime.value)){
alert('填写发贴时间间隔,毫秒为单位')
return false
}
}
var ii=0

function openwind(Wn,id){
	if(ii==id) return false
	window.open(Wn,'','')
	ii=id
window.event.returnValue=true
}

function opfenye(){
	if(document.addform.Clfenye.checked==true){
	document.getElementById('fenye').style.display='block'
	}else{
	document.getElementById('fenye').style.display='none'
	}
}