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

📄 function.js

📁 vc-mfc编程实例 很简单的东西,以后回多传自己的东西
💻 JS
📖 第 1 页 / 共 3 页
字号:
function $() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1) 
      return element;

    elements.push(element);
  }

  return elements;
}
 

function $F(element)
{
	 return $(element).value;
}

function $I(element)
{
	 return $(element).innerHTML;
}

function js_request(par)
{
	var thisLocation;
	var tmpStr1="";
	var Arr2=new Array();
	var expKey;
	var outString;
	lct=window.location.toString();
	lct=unescape(lct);
	lct=lct.replace("[|L]","\/")
	lct=lct.replace("[|R]","\\")
	var tmpArr1=lct.split("?");
	for (i=1;i<tmpArr1.length;i++)
	{
		tmpStr1+=tmpArr1[i]+"?";
	}
	tmpStr1=tmpStr1.substr(0,tmpStr1.length-1)
	tmpStr1=tmpStr1+"&.="
	var expKey1=eval("/"+par+"\\=([^\*]+?)\\&[^&]+\\=/");
	var outTmpArray=tmpStr1.match(expKey1);
	if(outTmpArray==null)
	{
		return "";
	}
	return outTmpArray[1];
}

function Request(par)
{
	var thisLocation;
	var tmpStr1="";
	var Arr2=new Array();
	var expKey;
	var outString;
	lct=window.location.toString();
	lct=unescape(lct);
	lct=lct.replace("[|L]","\/")
	lct=lct.replace("[|R]","\\")
	var tmpArr1=lct.split("?");
	for (i=1;i<tmpArr1.length;i++)
	{
		tmpStr1+=tmpArr1[i]+"?";
	}
	tmpStr1=tmpStr1.substr(0,tmpStr1.length-1)
	tmpStr1=tmpStr1+"&.="
	var expKey1=eval("/"+par+"\\=([^\*]+?)\\&[^&]+\\=/");
	var outTmpArray=tmpStr1.match(expKey1);
	if(outTmpArray==null)
	{
		return "";
	}
	return outTmpArray[1];
}
function left(str,leng){ return str.substring(0,leng); }
function len(str){ return str.length; }

////////////////function pop message box
function DC3RIT_popMsg(url,width,height,buttontype,msg,msgtype)
{    
	var beforeSetString = window.external.GetStaticData();
	window.external.SetStaticData(msg);
	var returnFlag = 2;
	width += 30;
	height += 30;
	var tmpCont=window.external.GetStaticData();
	var isDoingThing=window.external.IsPendClose();
		if (msgtype=="erase")
		{
			window.external.SetStaticData("cancel");
			window.external.Navigate("mainui/ChangeEraseCancelDisc.htm?width=350&height=170", 350, 170);
			returnStr=window.external.GetStaticData();
			window.external.PendClose(isDoingThing);
			window.external.SetStaticData(tmpCont);
			return returnStr;
		}
	
	switch (msgtype)
	{
		case "confirm":
			returnFlag = window.external.Navigate("mainui/alertmsg.htm?width="+width+"&height="+height+"&msgtype="+msgtype, width, height);
			break;
		case "okcancel":
			returnFlag = window.external.Navigate("mainui/alertmsg.htm?msg=a&width="+width+"&height="+height+"&msgtype="+msgtype, width, height);
			break;
		case "yesno":
			returnFlag = window.external.Navigate("mainui/alertmsg.htm?msg=a&width="+width+"&height="+height+"&msgtype="+msgtype, width, height);
			break;
		case "tryagain":
			returnFlag = window.external.Navigate("mainui/alertmsg.htm?msg=a&width="+width+"&height="+height+"&msgtype="+msgtype, width, height);
			break;
		case "FinishMount":
			returnFlag = window.external.Navigate("mainui/alertmsg.htm?msg=a&width="+width+"&height="+height+"&msgtype="+msgtype, width, height);
			break;
		default:
			window.external.Navigate("mainui/alertmsg.htm?msg=a&width="+width+"&height="+height+"&msgtype="+msgtype, width, height);
			break;
	}
	window.external.SetStaticData(beforeSetString);
	switch (returnFlag) {
		case 0:
			return "yes";
			break;
		case 1:
			return "no";
			break;
		case 2:
			return;
			break;
	}
}
//////////////////////////////////////
////////////////function pop message box
function DC3RIT_popMsg(url,width,height,buttontype,msg,msgtype)
{    
	var beforeSetString = window.external.GetStaticData();
	window.external.SetStaticData(msg);
	var returnFlag = 2;
	width += 30;
	height += 30;
	var tmpCont=window.external.GetStaticData();
	var isDoingThing=window.external.IsPendClose();
		if (msgtype=="erase")
		{
			window.external.SetStaticData("cancel");
			window.external.Navigate("mainui/ChangeEraseCancelDisc.htm?width=350&height=170", 350, 170);
			returnStr=window.external.GetStaticData();
			window.external.PendClose(isDoingThing);
			window.external.SetStaticData(tmpCont);
			return returnStr;
		}
	
	switch (msgtype)
	{
		case "confirm":
			returnFlag = window.external.Navigate("mainui/alertmsg.htm?width="+width+"&height="+height+"&msgtype="+msgtype, width, height);
			break;
		case "okcancel":
			returnFlag = window.external.Navigate("mainui/alertmsg.htm?msg=a&width="+width+"&height="+height+"&msgtype="+msgtype, width, height);
			break;
		case "yesno":
			returnFlag = window.external.Navigate("mainui/alertmsg.htm?msg=a&width="+width+"&height="+height+"&msgtype="+msgtype, width, height);
			break;
		case "tryagain":
			returnFlag = window.external.Navigate("mainui/alertmsg.htm?msg=a&width="+width+"&height="+height+"&msgtype="+msgtype, width, height);
			break;
		case "FinishMount":
			returnFlag = window.external.Navigate("mainui/alertmsg.htm?msg=a&width="+width+"&height="+height+"&msgtype="+msgtype, width, height);
			break;
		default:
			window.external.Navigate("mainui/alertmsg.htm?msg=a&width="+width+"&height="+height+"&msgtype="+msgtype, width, height);
			break;
	}
	window.external.SetStaticData(beforeSetString);
	switch (returnFlag) {
		case 0:
			return "yes";
			break;
		case 1:
			return "no";
			break;
		case 2:
			return;
			break;
	}
}
//////////////////////////////////////
/////////////////////
//Cut string(get short string)
//////////////////////
function getCuttedString(str,len,leftLen)
{
	if (str.length<=len)
	{
		return str;
	}
	else
	{
		rightLen=len-leftLen;
		leftStr=str.substr(0,leftLen);
		rightStr=str.substr(str.length-rightLen,rightLen)
		return (leftStr+"..."+rightStr);
	}
}
//////////////////////////////////////////////////
////////////summary function ///////////////
function SetSummaryBack(divObj) {
	var clickDivID = divObj.id;
	if ( clickDivID == "Summary_Summary" ) {
		$("Summary_Summary").style.background="url(images/summary_click_background.gif)";
		window.location="summary.htm";
	}
	else {
		$("Summary_Summary").style.background="url(images/summary_unclick_background.gif)";
	}
	if ( clickDivID == "Summary_Jobs" ) {
		$("Summary_Jobs").style.background="url(images/summary_click_background.gif)";
		window.location="Jobs.html";
	}
	else {
		$("Summary_Jobs").style.background="url(images/summary_unclick_background.gif)";
	}
	if ( clickDivID == "Summary_LogView" ) {
		$("Summary_LogView").style.background="url(images/summary_click_background.gif)";
		window.location="ViewLogs.htm";
	}
	else {
		$("Summary_LogView").style.background="url(images/summary_unclick_background.gif)";
	}
}
////////////summary function ///////////////

///////////////////set window size/////////////////
function SetWindowWidthAndHeight(wWidth,wHeight)
{
	SetDivWidhtAndHeight("windows-table",wWidth,wHeight);
	SetDivWidhtAndHeight("windows-02",wWidth-15-64,30);
	SetDivWidhtAndHeight("windows-04",15,wHeight-30-17);
	SetDivWidhtAndHeight("windows-05",wWidth-15-14,wHeight-30-17);
	SetDivWidhtAndHeight("windows-06",14,wHeight-30-17);
	SetDivWidhtAndHeight("windows-08",wWidth-15-14,17);
	var topRelativeSize=wHeight-17;
	topRelativeSize+="px";
	var leftRelativeSize=wWidth-14;
	leftRelativeSize+="px";
	var window3Left=wWidth-64;
	window3Left+="px";
	document.getElementById("windows-07").style.top = topRelativeSize;
	document.getElementById("windows-08").style.top = topRelativeSize;
	document.getElementById("windows-09").style.top = topRelativeSize;
	document.getElementById("windows-03").style.left = window3Left;
	document.getElementById("windows-06").style.left = leftRelativeSize;
	document.getElementById("windows-09").style.left = leftRelativeSize;
}
function SetDivWidhtAndHeight(divId,wWidth,wHeight)
{
	try
	{
		with(document.getElementById(divId).style)
		{
			width=wWidth+"px";
			height=wHeight+"px";
		}
	}
	catch(e)
	{
		
	}
}
function windowMoveWindow(){ window.external.OnMoveWindow(); }
/////////////////////set location 
function BackupLocation( locationValue ) {
	if ( parent.processFlag ) { return; }
	var openURL;
	switch ( parseInt(locationValue) ) {
		case 0:
			openURL = "backupDriver.htm?clearFlag=1";
			break;
		case 1:
			openURL = "FileBackupName.htm";
			break;
		case 2:
			openURL = "Startup_Disk.html";
			break;
	}
	return openURL;
}
function RestoreLocation( locationValue ) {
	if ( parent.processFlag ) { return; }
	var openURL;
	switch ( parseInt(locationValue) ) {
		case 0:
			openURL = "Restore_Driver.htm";
			break;
		case 1:
			openURL = "customrestore.htm";
			break;
		case 2:
			openURL = "Mount.htm";
			break;
	}
	return openURL;
}
function CloneLocation( locationValue ) {
	if ( parent.processFlag ) { return; }
	var openURL;
	switch ( parseInt(locationValue) ) {
		case 0:
			openURL = "Clone_Partition.html?clearFlag=1";
			break;
		case 1:
			//IframeMainUI.location = "Clone-Disk.html";

⌨️ 快捷键说明

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