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

📄 ig_weblistbarie4.js

📁 研究怎样通过手写代码来完成自动生成代码
💻 JS
📖 第 1 页 / 共 2 页
字号:
	this.expanded=expanded;
	this.getExpanded=iglbar_getExpanded;
	this.setExpanded=iglbar_expandGroup;
	var header=iglbar_getElementById(id+"_header");
	if(this.HeaderAppearance!=null&&header!=null){
		this.HeaderAppearance.Element=header;
		this.HeaderAppearance.Id=id+"_header";
	}
	this.valueChanged=false;
	var i=0;
	this.Control=null;
	if(items!=null){
		while(items[i]){
			items[i].Group=this;
			i++;
		}
	}
}
function iglbar_getExpanded(){
	return this.expanded;
}
function iglbar_ListbarGroup(id,text,key,enabled,groupStyle,buttonStyle,buttonHovStyle,buttonSelStyle,itemIconStyle,itemSelectionStyle,targetUrl,targetFrame,items){
	this.Id=id;
	this.topElement=iglbar_getElementById(id+"_top");
	this.bottomElement=iglbar_getElementById(id+"_bottom");
	this.Element=new Array(2);
	this.Element[0]=this.topElement;
	this.Element[1]=this.bottomElement;
	this.Key=key;
	this.enabled=enabled;
	this.getEnabled=iglbar_isGroupEnabled;
	this.setEnabled=iglbar_setEnabled;
	this.GroupStyleClassName=groupStyle;
	this.ButtonStyleClassName=buttonStyle;
	this.ButtonHoverStyleClassName=buttonHovStyle;
	this.ButtonSelectedStyleClassName=buttonSelStyle;
	this.ItemIconStyle=itemIconStyle;
	this.ItemSelectionStyle=itemSelectionStyle;
	this.Items=items;
	this.Items.ValueChanged=false;
	//this.SelectedItem=null;
	this.selected=false;
	this.TargetUrl=targetUrl;
	this.TargetFrame=targetFrame;
	this.setSelected=iglbar_selectGroup;
	this.getSelected=iglbar_getSelected;
	this.valueChanged=false;
	var i=0;
	this.Control=null;
	if(items!=null){
		while(items[i]){
			items[i].Group=this;
			i++;
		}
	}
}

function iglbar_Item(id,text,key,defStyle,hovStyle,selStyle,targetUrl,targetFrame,image,selectedImage,enabled){
	this.Id=id;
	this.Element=iglbar_getElementById(id);
	this.Key=key;
	this.DefaultStyleClassName=defStyle;
	this.HoverStyleClassName=hovStyle;
	this.SelectedStyleClassName=selStyle;
	this.TargetUrl=targetUrl;
	this.TargetFrame=targetFrame;
	this.Group=null;
	this.ImageUrl=image;
	this.SelectedImageUrl=selectedImage;
	this.getImage=iglbar_getImage;
	this.selected=false;
	this.setSelected=iglbar_selectItem;
	this.getSelected=iglbar_getSelected;
	this.valueChanged=false;
	this.enabled=enabled;
	this.getEnabled=iglbar_isItemEnabled;
	this.setEnabled=iglbar_setEnabled;
}
function iglbar_getSelected(){
	return this.selected;
}
function iglbar_getEnabled(){
	return this.enabled;
}
function iglbar_isGroupEnabled(){
	return this.enabled&&this.Control.getEnabled();
}
function iglbar_isItemEnabled(){
	return this.enabled&&this.Group.getEnabled();
}
function iglbar_setEnabled(enabled){
	this.enabled=enabled;
	if(enabled)this.Element.removeAttribute("disabled");
	else this.Element.setAttribute("disabled","disabled");
}

function iglbar_toggleGroup(e,src){
	e = (e) ? e : ((window.event) ? window.event : "");	
	var group=iglbar_getGroupById(src.id);
	if((src.tagName=="IMG"&&group.Control.HeaderClickAction==0)||!group.getEnabled()){
		return true;
	}
	group.setExpanded(!group.getExpanded(),true);
}
function iglbar_expandGroup(expand,byMouse){
	if((!this.Enabled)&&byMouse)return;
	this.expanded=expand;
	if(expand){
		if(this.Control!=null&&this.Control.PostBackOnGroupExpanded)__doPostBack(eval(this.Control.Id+"UniqueID"),this.Id+":GroupExpanded");		
		iglbar_getElementById(this.Id+"_items").style.display="";
		this.HeaderAppearance.ExpansionIndicator.src=this.HeaderAppearance.ExpandedAppearance.ExpansionIndicatorImageUrl;
		iglbar_getElementById(this.Id+"_header").className=this.HeaderAppearance.ExpandedAppearance.ClassName;
		if(this.HeaderAppearance.LeftCornerImage!=null)
			this.HeaderAppearance.LeftCornerImage.src=this.HeaderAppearance.ExpandedAppearance.LeftCornerImageUrl;
		if(this.HeaderAppearance.RightCornerImage!=null)
			this.HeaderAppearance.RightCornerImage.src=this.HeaderAppearance.ExpandedAppearance.RightCornerImageUrl;
		if(this.HeaderAppearance.Image!=null)
			this.HeaderAppearance.Image.src=this.HeaderAppearance.ExpandedAppearance.ImageUrl;
	}
	else{
		if(this.Control!=null&&this.Control.PostBackOnGroupCollapsed)__doPostBack(eval(this.Control.Id+"UniqueID"),this.Id+":GroupCollapsed");		
		iglbar_getElementById(this.Id+"_items").style.display="none";
		this.HeaderAppearance.ExpansionIndicator.src=this.HeaderAppearance.CollapsedAppearance.ExpansionIndicatorImageUrl;
		iglbar_getElementById(this.Id+"_header").className=this.HeaderAppearance.CollapsedAppearance.ClassName;
		if(this.HeaderAppearance.LeftCornerImage!=null)
			this.HeaderAppearance.LeftCornerImage.src=this.HeaderAppearance.CollapsedAppearance.LeftCornerImageUrl;
		if(this.HeaderAppearance.RightCornerImage!=null)
			this.HeaderAppearance.RightCornerImage.src=this.HeaderAppearance.CollapsedAppearance.RightCornerImageUrl;
		if(this.HeaderAppearance.Image!=null)
			this.HeaderAppearance.Image.src=this.HeaderAppearance.CollapsedAppearance.ImageUrl;
	}
	if(byMouse)iglbar_groupHeaderMouseOver(null,this.HeaderAppearance.Element);
}
function iglbar_getImage(){
	return iglbar_getElementById(this.Id+"_img");
}

function iglbar_getListbarById(id){
	lbarObj=eval(id.split("_")[0]+"_obj");
	if(lbarObj==null){
		lbarObj= new UltraWebListbar(id,eval(id+"_groupsArray"));
		lbarObj.Element.style.display="";	
	}
	return lbarObj;
}
function iglbar_selectGroup(select){
/*******
 * We only care about group.Element[0] which is the button which appears in the top
 * Group of buttons.  Since this style is only applied when a group is selected, it
 * will never be applied to the bottom list of groups.
 ******/  
	if(select){
		if(this.Control!=null&&this.Control.PostBackOnGroupClick)__doPostBack(eval(this.Control.Id+"UniqueID"),this.Id+":GroupSelected");
		if(this.Control.SelectedGroup!=null)this.Control.SelectedGroup.setSelected(false);
		this.selected=true;
		this.Control.SelectedGroup=this;
		this.Element[0].className=this.ButtonSelectedStyleClassName;
		this.Element[1].className=this.ButtonStyleClassName; //The button may not receive the mouseout event.  In this case, we need to change the style back to the Default style manually.
		iglbar_updatePostField(this.Control);
		iglbar_adjust(this.Control);
	}else{
		this.selected=false;
		if(this.Control.SelectedGroup==this)this.Control.SelectedGroup=null;
		this.Element[0].className=this.ButtonStyleClassName;
	}
}
function iglbar_selectItem(select){
	if(select){
		if(this.Group.Control!=null&&this.Group.Control.PostBackOnItemClick)__doPostBack(eval(this.Group.Control.Id+"UniqueID"),this.Id+":ItemSelected");
		//if(this.Group!=this.Group.Control.SelectedGroup)this.Group.setSelected(true);
		if(this.Group.Control.SelectedItem!=null)this.Group.Control.SelectedItem.setSelected(false);
		this.Group.Control.SelectedItem=this;
		this.selected=true;
		iglbar_navigate(this.TargetUrl,this.TargetFrame);
		if(this.SelectionStyle==1)
			this.getImage().className=this.SelectedStyleClassName;
		else this.Element.className=this.SelectedStyleClassName;
		if(this.SelectedImageUrl!=null&&this.SelectedImageUrl.length>0)
			this.getImage().src=this.SelectedImageUrl;
	}else{
		if(this.Group.Control.SelectedItem!=this)this.Group.Control.SelectedItem=null;
		this.selected=false;
		if(this.SelectionStyle==1)
			this.getImage().className=this.DefaultStyleClassName;
		else this.Element.className=this.DefaultStyleClassName;
		if(this.ImageUrl!=null&&this.ImageUrl.length>0)
			this.getImage().src=this.ImageUrl;	
	}
	iglbar_updatePostField(this.Group.Control);
}
function iglbar_isSelectedItem(){
}
function iglbar_updatePostField(listbar){
	var postData="";
	postData="SelectGroup\02"+listbar.SelectedGroup.Id+"\01";
	if(listbar.SelectedItem!=null)postData+="SelectItem\02"+listbar.SelectedItem.Id+"\01";
	var i=0;
	if(listbar.Groups.valueChanged){
		var newOrder="GroupSwapped";
		while(listbar.Groups[i]!=null){
			newOrder+="\02"+listbar.Groups[i].getVisibleIndex().toString();
			if(listbar.Groups[i].valueChanged){
				postData+="GroupTextChanged\02"+listbar.Groups[i].Id+"\02"+listbar.Groups[i].getText()+"\01";
			}
			if(listbar.Groups[i].Items.valueChanged){
				var j=0;
				while(listbar.Groups[i].Items[j]!=null){
					if(listbar.Groups[i].Items[j].valueChanged){
						postData+="ItemTextChanged\02"+listbar.Groups[i].Items[j].Id+"\02"+listbar.Groups[i].Items[j].getText()+"\01";
					}
					j++;
				}
			}
			
			i++;
		}
		postData+=newOrder;
	}
	iglbar_getElementById(listbar.uniqueID+"_hidden").value=postData;
}


function iglbar_killEvent(evt){
	window.status="kill event";
	evt = (evt) ? evt : ((window.event) ? window.event : "");
	//evt.cancelBubble=true;
	return false;
}

⌨️ 快捷键说明

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