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

📄 layout.js

📁 TurboCWCShop v1.6.7 is make in the Utility-LAYer Framework.
💻 JS
字号:
function getLayout()
{
	var strLayout='<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr>\n';
	strLayout+='<td id="IdPad" nowrap width="20%">'+langPublicAlign+'<label for="Align" accesskey="A">(<u>A</u>): </label></td><td id="IdPad" nowrap width="30%">'+getAlign()+'</td>\n';
	strLayout+='<td id="IdPad" nowrap width="20%">'+langPublicHSpace+'<label for="HSpace" accesskey="H">(<u>H</u>): </label></td><td id="IdPad" nowrap width="30%"><input type="text" id="HSpace" size="6" onchange="doValueChange(this)"></td>\n';
	strLayout+='</tr><tr>';
	strLayout+='<td id="IdPad" nowrap width="20%">'+langPublicBorder+'<label for="Border" accesskey="D">(<u>D</u>): </label></td><td id="IdPad" nowrap width="30%"><input type="text" id="Border" size="6" onchange="doValueChange(this)"></td>\n';
	strLayout+='<td id="IdPad" nowrap width="20%">'+langPublicVSpace+'<label for="VSpace" accesskey="V">(<u>V</u>): </label></td><td id="IdPad" nowrap width="30%"><input type="text" id="VSpace" size="6" onchange="doValueChange(this)"></td>\n';
	strLayout+='</tr></table>\n';
	return strLayout;
}
function getAlign()
{
	var arrAlign=new Array("",langPublicDefault,"left",langPublicAlignLeft,"center",langPublicAlignCenter,"right",langPublicAlignRight,"top",langPublicAlignTop,"texttop",langPublicAlignTextTop,"middle",langPublicAlignMiddle,"absmiddle",langPublicAlignAbsMiddle,"baseline",langPublicAlignBaseLine,"bottom",langPublicAlignBottom,"absbottom",langPublicAlignAbsBottom);
	var numLen=arrAlign.length;
	var strAlign='<select id="Align" size="1">\n';
	for(var numI=0;numI<numLen;numI+=2)
	{
		var strValue=arrAlign[numI];
		var strText=arrAlign[numI+1];
		strAlign+='<option value="'+strValue+'"';
		if(numI==0)strAlign+=' selected';
		strAlign+='>'+strText+'</option>\n';
	}
	strAlign+='</select>\n';
	return strAlign;
}
function getSize(numWidth,numHeight,numType)
{
	if(numWidth==null)numWidth=240;
	if(numHeight==null)numHeight=240;

	var strSize='<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr>\n';
	if(numType!=1)strSize+='<td id="IdPad" nowrap width="28%"><input type="checkbox" id="SetSize" checked onclick="doSetSize(this)">'+langPublicSizeSetSize+'<label for="SetSize" accesskey="C">(<u>C</u>): </label></td>\n';
	strSize+='<td id="IdPad" nowrap width="18%">'+langPublicSizeWidth+'<label for="Width" accesskey="W">(<u>W</u>): </label></td>\n';
	strSize+='<td id="IdPad" nowrap width="18%"><input type="text" id="Width" size="6" value="'+numWidth+'" '+((numType==1)?'':' onkeyup="setRateSize(this)" onmouseup="setRateSize(this)"')+' onchange="doValueChange(this)"></td>\n';
	strSize+='<td id="IdPad" nowrap width="18%">'+langPublicSizeHeight+'<label for="Height" accesskey="E">(<u>E</u>): </label></td>\n';
	strSize+='<td id="IdPad" nowrap width="18%"><input type="text" id="Height" size="6" value="'+numHeight+'" '+((numType==1)?'':' onkeyup="setRateSize(this)" onmouseup="setRateSize(this)"')+' onchange="doValueChange(this)"></td>\n';
	strSize+='</tr><tr>';
	if(numType!=1)strSize+='<td id="IdPad" nowrap width="28%"><input type="checkbox" id="KeepRate" checked>'+langPublicSizeKeepRate+'<label for="KeepRate" accesskey="K">(<u>K</u>): </label></td>\n';
	strSize+='<td id="IdPad" nowrap width="18%"></td>\n';
	strSize+='<td id="IdPad" nowrap width="18%">'+getSizeAdd("W",numType)+'</td>\n';
	strSize+='<td id="IdPad" nowrap width="18%"></td>\n';
	strSize+='<td id="IdPad" nowrap width="18%">'+getSizeAdd("H",numType)+'</td>\n';
	strSize+='</tr></table>\n';
	return strSize;
}
function getSizeAdd(strId,numType)
{
	var strRate='<input type="radio" name="'+strId+'" id="Rate'+strId+'" checked onclick="doKeepRate(this)">'+langPublicSizePixel;
	strRate+='<br><input type="radio" name="'+strId+'" id="Rate'+strId+'" onclick="doKeepRate(this)">'+langPublicSizePercent;
	return strRate;
}
function doSetSize(objE)
{
	var blnChecked=!objE.checked;
	GetObj("Width").disabled=blnChecked;
	GetObj("Height").disabled=blnChecked;
	var objW=document.getElementsByName("W");
	objW[0].disabled=blnChecked;
	objW[1].disabled=blnChecked;
	var objH=document.getElementsByName("H");
	objH[0].disabled=blnChecked;
	objH[1].disabled=blnChecked;
	GetObj("KeepRate").disabled=blnChecked;
}
function doKeepRate(objE)
{
	var objW=document.getElementsByName("W");
	var objH=document.getElementsByName("H");
	var blnChecked=(objW[1].checked||objH[1].checked);
	if(objE.name=="W"){
		if(objW[1].checked)GetObj("Width").value=100;
	}else{
		if(objH[1].checked)GetObj("Height").value=100;
	}
	var objKeepRate=GetObj("KeepRate");
	if(objKeepRate){
		if(objW[1].checked&&objH[1].checked)blnChecked=false;
		objKeepRate.disabled=blnChecked;
	}
}
var numBaseSizeRate=1;
function setRateSize(objE)
{
	var objKeeyRate=GetObj("KeepRate");
	if(objKeeyRate.checked&&!objKeeyRate.disabled)
	{
		var numWidth=parseFloat(GetObj("Width").value);
		if(isNaN(numWidth))numWidth=0;
		var numHeight=parseFloat(GetObj("Height").value);
		if(isNaN(numHeight))numHeight=0;
		
		if(numWidth>=0&&numHeight>=0)
		{
			if(numBaseSizeRate>0)
			{
				var blnWidth=(objE.id=="Width");
				if(blnWidth)
				{
					numHeight=Math.round(numWidth/numBaseSizeRate);
					GetObj("Height").value=numHeight;
				}
				else 
				{
					numWidth=Math.round(numHeight*numBaseSizeRate);
					GetObj("Width").value=numWidth;
				}
			}
		}
	}
}

⌨️ 快捷键说明

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