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

📄 component.htm

📁 Windows Web脚本开发指南/(美) Dan Heflin, Todd Ney著 的源码
💻 HTM
字号:
<html XMLNS:UD>

<head>
	<title>HTC Wizard</title>
</head>
<script src="utilVBS.vbs" language="VBScript"></script>
<script src="utilJS.js" language="JScript"></script>
<script language="JavaScript">
function saveData(){
	if (validData()){
		document.all.objUD.setAttribute(document.all.txtCompFileLoc.id, trimText(document.all.txtCompFileLoc.value));
		document.all.objUD.setAttribute(document.all.txtCompName.id, trimText(document.all.txtCompName.value));
		if (document.all.txtCompID.value == "")
			document.all.objUD.setAttribute(document.all.txtCompID.id, "");
		else	
			document.all.objUD.setAttribute(document.all.txtCompID.id, trimText(document.all.txtCompID.value));
		document.all.objUD.setAttribute(document.all.txtCompUrn.id, trimText(document.all.txtCompUrn.value));
		document.all.objUD.setAttribute("DWBtnAction", document.all.btnNext.value);
		
		document.all.objUD.save("DHTMLWiz");	
		window.navigate("property.htm");		
	}
}
function validData(){
var valid = true;

	if (trimText(document.all.txtCompFileLoc.value) == ""){
		alert("File location is required.");
		valid = false;
	}
	else{
		if (! isValidDir(document.all.txtCompFileLoc.value)){
			alert("The file location is not a valid directory.");
			valid = false;
		}
	}
	
	if (trimText(document.all.txtCompName.value) == ""){
		alert("The name is required.");
		valid = false;
	}
	
	return valid;
	
}
function isValidDir(dir){

  var fso;
  fso = new ActiveXObject("Scripting.FileSystemObject");
  if (fso.FolderExists(dir))
    return true;
  else 
    return false;

}
function initText(){
var action;	
	document.all.objUD.load("DHTMLWiz");
	action = document.all.objUD.getAttribute("DWBtnAction");
	if (action == document.all.btnBack.value){
		document.all.txtCompFileLoc.value = trimText(document.all.objUD.getAttribute(document.all.txtCompFileLoc.id));
		document.all.txtCompName.value =	trimText(document.all.objUD.getAttribute(document.all.txtCompName.id));
		document.all.txtCompID.value = trimText(document.all.objUD.getAttribute(document.all.txtCompID.id));
		document.all.txtCompUrn.value = trimText(document.all.objUD.getAttribute(document.all.txtCompUrn.id));
	}
	else{
		removeUDAttributes();
	}
	
}
function removeUDAttributes(){
	document.all.objUD.removeAttribute(document.all.txtCompFileLoc.id);
	document.all.objUD.removeAttribute(document.all.txtCompName.id);
	document.all.objUD.removeAttribute(document.all.txtCompID.id);
	document.all.objUD.removeAttribute(document.all.txtCompUrn.id);
	document.all.objUD.save("DHTMLWiz");	
}
</script>

<body bgcolor="#00CCFF" onload="initText()">
<UD:UserData id="objUD" style="behavior:url(#default#userdata)" />
<p align="center">
<br>
<b><font size="6">HTML Component Wizard<br>
</font></b>
<font size="4">
      The HTML Component Wizard will take you through the process of creating a
      HTML Component.</font><b><font size="4"><br>
</font>
<br>
<font size="5">Create Component Element Page</font></b>
<table border="1" width="100%" height="195">
  <tr>
    <td width="30%" height="189" valign="top">
      The component page will create a HTC file that contains the HTML
      Component. It
      will also create the component's element in the file.<br>
      <br>
      <font color="#FF0000">*</font>  required field
    </td>
    <td width="70%" height="189">
		<form >
		<table border="1" width="534">
    		<tr>
      			<td width="191"><font color="#000000"><b>File Location: </b></font><font color="#FF0000">*</font> </td>
      			<td width="347"><input type="text" id="txtCompFileLoc" size="48"></td>
    		</tr>
    		<tr>
      			<td width="191"><b>File/Component Name: </b><font color="#FF0000">*</font> </td>
      			<td width="347"><input type="text" id="txtCompName" size="48"></td>
    		</tr>
    		<tr>
      			<td width="191"><b>ID: </b></td>
      			<td width="347"><input type="text" id="txtCompID" size="48"></td>
    		</tr>
    		<tr>
      			<td width="191"><b>URN: </b></td>
      			<td width="347"><input type="text" id="txtCompUrn" size="48"></td>
    		</tr>
  			</table>
		</form>
  	</tr>
</table>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<table border="0" width="100%">
	<tr>
   		<td width="50%"></td>
   		<td width="20%"><input type="button" value="Close" onclick="closeWindow()" id="btnCancel" name="btnCancel"></td>
   		<td width="15%"><input type="button" value="<< Back"  name="btnBack" style="display:none"></td>
   		<td width="15%"><input type="button" value="Next >>" onclick="saveData()" id="btnNext" name="btnNext"></td>
   </tr>
</table>
</body>

</html>

⌨️ 快捷键说明

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