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

📄 toolbar.js

📁 TUSB3410 win9x和win xp 驱动源代码,包含开发测试工具
💻 JS
📖 第 1 页 / 共 3 页
字号:
	if (IsMouseout)
	{
		color = IsMSMenu? aDefMSColor[1] : aDefICPColor[1];
		if (MenuIDStr == CurICPMenu && aCurICPColor[1] != "") 
			color = aCurICPColor[1];
	}
	else
	{
		color = IsMSMenu? aDefMSColor[2] : aDefICPColor[2];
		if (MenuIDStr == CurICPMenu && aCurICPColor[2] != "") 
			color = aCurICPColor[2];
	}
	window.event.srcElement.style.color = color;
}

function doMenu(MenuIDStr) 
{
	var thisMenu = document.all(MenuIDStr);
	if (ToolbarMenu == null || thisMenu == null || thisMenu == ToolbarMenu) 
	{
		window.event.cancelBubble = true;
		return false;
	}
	// Reset dropdown menu
	window.event.cancelBubble = true;
	ToolbarMenu.style.display = "none";
	showElement("SELECT");
	showElement("OBJECT");
	ToolbarMenu = thisMenu;
	IsMSMenu = (MenuIDStr.toUpperCase().indexOf("MS_") != -1);

	// Set dropdown menu display position
	x  = window.event.srcElement.offsetLeft +
	 	 window.event.srcElement.offsetParent.offsetLeft;
	if (RTL){
		// RTL correction:
		var ICPstart = 0;
		if (!IsMSMenu)
		{
			if (isIE5)
				ICPstart = window.event.srcElement.offsetParent.offsetParent.offsetLeft;
			else // for IE4 we must use...
				ICPstart = window.event.srcElement.offsetParent.offsetParent.offsetParent.offsetParent.offsetWidth -
					window.event.srcElement.offsetParent.offsetParent.offsetWidth;
			x += ICPstart;
		}
		x -= thisMenu.style.posWidth;
		x += IsMSMenu ? 8 : -2;
		if (x < 0) x = 0;
		// End of RTL Correction
	
	} 	 
	if (MenuIDStr == LastMSMenu){ 
		if (!RTL){
			x += (window.event.srcElement.offsetWidth - thisMenu.style.posWidth);
		}else if (RTL){
			if (x < 0) x = 0;
		}	
	}
	x2 = x + window.event.srcElement.offsetWidth;
	y  = (IsMSMenu)? 
		 (idRow1.offsetHeight) :
		 (idRow1.offsetHeight + idRow2.offsetHeight + idRow3.offsetHeight);
	if (RTL){
			// Get main menu width
			// RTL Correction:
		if (IsMSMenu)
			x2 = window.event.srcElement.offsetLeft - window.event.srcElement.offsetWidth;
		else
			x2 = window.event.srcElement.offsetParent.offsetLeft + ICPstart;
		// End of RTL Correction.
		// Get dropdown menu width
		x3 = x + 160;
		for (i = 0; i < TotalMenu; i++){
			if (arrMenuInfo[i].IDStr == MenuIDStr)
			{
				x3 = x+ arrMenuInfo[i].unit;
				break;
			}
		}
	
	}	 
		 
	thisMenu.style.top  = y;
	thisMenu.style.left = x;
	thisMenu.style.clip = "rect(0 0 0 0)";
	thisMenu.style.display = "block";
	thisMenu.style.zIndex = 102;

	// delay 2 millsecond to allow the value of ToolbarMenu.offsetHeight be set
	window.setTimeout("showMenu()", 2);
	return true;
}

function showMenu() 
{
	if (ToolbarMenu != null) 
	{ 
		IsMenuDropDown = (Frame_Supported && IsMSMenu == false)? false : true;
		if (IsMenuDropDown == false)
		{
			y = (y - ToolbarMenu.offsetHeight - idRow3.offsetHeight);
			if (y < 0) y = 0;
			ToolbarMenu.style.top = y;
		}
		y2 = y + ToolbarMenu.offsetHeight;

		ToolbarMenu.style.clip = "rect(auto auto auto auto)";
		hideElement("SELECT");
		hideElement("OBJECT");
		if (!RTL)
			x2 = x + ToolbarMenu.offsetWidth;
			hideElement("IFRAME");  //FRANKLO
	}
}


function hideMenu()
{
	if (ToolbarMenu != null && ToolbarMenu != StartMenu) 
	{
		// Don't hide the menu if the mouse move between the menu and submenus

		if (!RTL){
			cY = event.clientY + document.body.scrollTop;
			cX = event.clientX; 
			if (document.body.offsetWidth > x && scFlag) {
				cX = x + 9;
			}
			if ( (cX >= (x+5) && cX<=x2) &&
			 ((IsMenuDropDown == true  && cY > (y-10) && cY <= y2)      ||
			  (IsMenuDropDown == false && cY >= y     && cY <= (y2+10)) ))
			{
				window.event.cancelBubble = true;
				return; 
			}
		}else if(RTL){
			var cX = event.clientX //+ document.body.scrollLeft;
			// RTL correction: considers left scrollbar width!
			if (isRTL) cX -= 16;
			var cY = event.clientY + document.body.scrollTop;
			var bHideMenu = true;
			if (cX > document.body.scrollLeft && document.body.scrollLeft > 1){
				cX = x3;	//x + 9;
			}
			if (IsMenuDropDown == true)
			{// RTL Correction: cY-8 instead of cY
				if ( cY-8 >= (y - idRow3.offsetHeight) && cY < y)
				{// RTL Correction: [x,x2] --> [x2,x3]
					if (cX >= (x2+5) && cX <= x3) bHideMenu = false;
				}
				else if (cY >= y && cY <= y2)
				{
					if (cX > (x+5) && cX <= x3) bHideMenu = false;
				}
			}
			else
			{
				if (cY >= y2 && cY < (y2 + idRow3.offsetHeight))
				{// RTL Correction: [x,x2] --> [x2,x3]
					if (cX >= (x2+5) && cX <= x3) bHideMenu = false;
				}
				else if (cY >= y && cY <= y2)
				{
					if (cX > (x+5) && cX <= x3) bHideMenu = false;
				}
			}

			if (! bHideMenu) 
			{
				window.event.cancelBubble = true;
				return; 
			}
		}	

		ToolbarMenu.style.display = "none";
		ToolbarMenu = StartMenu;
		window.event.cancelBubble = true;

		showElement("SELECT");
		showElement("OBJECT");
		if(!RTL){
			showElement("IFRAME"); //FRANKLO
		}	
	}
}

function hideElement(elmID)
{
	for (i = 0; i < document.all.tags(elmID).length; i++)
	{
		obj = document.all.tags(elmID)[i];
		if (! obj || ! obj.offsetParent)
			continue;

		// Find the element's offsetTop and offsetLeft relative to the BODY tag.
		objLeft   = obj.offsetLeft;
		objTop    = obj.offsetTop;
		objParent = obj.offsetParent;
		while (objParent.tagName.toUpperCase() != "BODY")
		{
			objLeft  += objParent.offsetLeft;
			objTop   += objParent.offsetTop;
			objParent = objParent.offsetParent;
		}
		// Adjust the element's offsetTop relative to the dropdown menu
		objTop = objTop - y;

		if (x > (objLeft + obj.offsetWidth) || objLeft > (x + ToolbarMenu.offsetWidth))
			;
		else if (objTop > ToolbarMenu.offsetHeight)
			;
		else if (IsMSMenu && (y + ToolbarMenu.offsetHeight) <= 80)
			;
		else
			obj.style.visibility = "hidden";
	}
}

function showElement(elmID)
{
	for (i = 0; i < document.all.tags(elmID).length; i++)
	{
		obj = document.all.tags(elmID)[i];
		if (! obj || ! obj.offsetParent)
			continue;
		obj.style.visibility = "";
	}
}

function formatURL(URLStr, InstrumentStr)
{
	var tempStr = URLStr;

	if (DoInstrumentation && URLStr != "" )
	{
		var ParamPos1 = URLStr.indexOf("?");
		var ParamPos2 = URLStr.lastIndexOf("?");
		var ParamPos3 = URLStr.toLowerCase().indexOf("target=");
		var ParamPos4 = URLStr.indexOf("#");
		var Bookmark  = "";
		var URL = URLStr;
		if (ParamPos4 >= 0)
		{
		 	URL = URLStr.substr(0, ParamPos4);
			Bookmark = URLStr.substr(ParamPos4);
		}
		
		if (ParamPos1 == -1)
			tempStr = "?MSCOMTB=";
		else if (ParamPos1 == ParamPos2 && ParamPos3 == -1)	
			tempStr = "&MSCOMTB=";
		else if (ParamPos1 == ParamPos2 && ParamPos3 != -1)	
			tempStr = "?MSCOMTB=";
		else if (ParamPos1 < ParamPos2)
			tempStr = "&MSCOMTB=";

		tempStr = URL + tempStr + InstrumentStr.replace(" ","%20") + Bookmark;
	}
	return tempStr;
}

function prepTrackingString(ts, type)
{
	var rArray;
	var rString;
	var pName = '';
	if (0 == type)
	{
		pName = 'p=';
		rString = ts.substring(1);
		rArray = rString.split('/');
	}
	if (1 == type)
	{
		pName = 'qs=';
		rString = ts.substring(1);
		rArray = rString.split('&');		
	}
	if (2 == type)
	{
		pName = 'f=';
		rString = escape(ts);
		return pName + rString;
	}
	if (3 == type)
	{
		pName = 'tPage=';
		rString = escape(ts);
		return pName+rString;
	}
	if (4 == type)
	{
		pName = 'sPage=';
		rString = escape(ts);
		return pName + rString;
	}
	if (5 == type)
	{
		pName = 'r=';
		rString = escape(ts);
		return pName + rString;
	}
	if (6 == type)
	{
		pName = 'MSID=';
		rString = escape(ts);
		return pName + rString;
	}
	if (7 == type)
	{
		pName = 'source=';
		rString = ts.toLowerCase();
		if(rString.indexOf("microsoft.com") != -1)
		{
			rString = rString.substring(0,rString.indexOf("microsoft.com"));
			if('' == rString)
			{
				rString = "www";
			}	
			else
			{
				rString = rString.substring(0,rString.length -1);
			}
		}
		return pName + rString;
	}
	if (8 == type)
	{
		pName = 'TYPE=';
		rString = escape(ts);
		return pName + rString;
	}
	rString = '';
	if(null != rArray)
	{
		if(0 == type)
		{
			for( j=0; j < rArray.length - 1; j++)
			{	
				rString += rArray[j] + '_';  
			} 
		}
		else
		{
			for( j=0; j < rArray.length  ; j++)
			{
				rString += rArray[j] + '_';  
			} 
		}
	}
	rString = rString.substring(0, rString.length - 1);  	 	
	return pName + rString;
}

function buildIMG(pArr)
{
	var TG = '<LAYER visibility="hide"><div style="display:none;"><IMG src="' + location.protocol + '//c.microsoft.com/trans_pixel.asp?';
	for(var i=0; i<pArr.length; i++)
	{
		if(0 == i)
		{
			TG +=  pArr[i];
		}
		else
		{
			TG += '&' + pArr[i];
		}
	}
	TG +='" height="0" width="0" hspace="0" vspace="0" Border="0"></div></layer>';
    if (!RTL){
		document.writeln(TG);
		return;
	}else if (RTL){
		document.write(TG);
	}	
}

function setToolbarLocale(toolbarLocale)
{
	document.writeln("<" + "script language='JavaScript' src='/library/toolbar/loc/global-" + toolbarLocale + ".js' type='text/javascript'></" + "script>");
	return;
}
function scrollbaroptions(){
scrollcount ++;
if ( scrollcount < 3  )
	{
		scFlag = true;
	}else{
		scrollcount = 0;
		scFlag = false;
	}	
}

⌨️ 快捷键说明

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