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

📄 edit_html_changetable_el

📁 内容管理
💻
字号:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--

MSHTML edit dialog for changing attributes of TR and TD-elements.

Author : Michael Sch盲fer (ms@ethikom.de)

-->
<workplace>
<template>
<![CDATA[
<HTML>
<HEAD>
<TITLE> </TITLE>

<!-- Style Sheet to the Table Element Dialog -->
<STYLE TYPE="text/css">
 BODY   {margin-left:10; font-family:Verdana; font-size:12; background:menu}
 BUTTON {width:7em}
 TABLE  {font-family:Verdana; font-size:12}
 P      {text-align:center}
</STYLE>

<SCRIPT LANGUAGE=JavaScript>

<!-- Checks if a entered number is a digit or percent sign -->

function IsDigit()
{
  return ((event.keyCode >= 48) && (event.keyCode <= 57)) 
}


</SCRIPT>

<!-- Reads values received by calling function and adds them into the Form Input-Fields when the Dokument is loaded -->

<SCRIPT LANGUAGE=JavaScript FOR=window EVENT=onload>

  for ( elem in window.dialogArguments )
  {
    switch( elem )
    {
      case "bgColor":
      TBGColor.value = window.dialogArguments["bgColor"]; 

      case "borderColor":
      TBorderColor.value = window.dialogArguments["borderColor"]; 

      case "height":
      TDHeight.value = window.dialogArguments["height"]; 
      
      case "width":
      TDWidth.value = window.dialogArguments["width"]; 

      case "align":
      if(window.dialogArguments["align"] == "left") {
        TDAlign.selectedIndex = 1;
      } else if(window.dialogArguments["align"] == "right") {
        TDAlign.selectedIndex = 2;
      } else if(window.dialogArguments["align"] == "center") {
        TDAlign.selectedIndex = 3;
      } else {
        TDAlign.selectedIndex = 0;
      }

      case "vAlign":
      if(window.dialogArguments["vAlign"] == "top") {
        TDVAlign.selectedIndex = 1;
      } else if(window.dialogArguments["vAlign"] == "bottom") {
        TDVAlign.selectedIndex = 2;
      } else if(window.dialogArguments["vAlign"] == "middle") {
        TDVAlign.selectedIndex = 3;
      } else if(window.dialogArguments["vAlign"] == "center") {
        TDVAlign.selectedIndex = 4;
      } else if(window.dialogArguments["vAlign"] == "baseline") {
        TDVAlign.selectedIndex = 5;
      } else {
        TDVAlign.selectedIndex = 0;
      }

      case "error_notable":
      if(window.dialogArguments["error_notable"] == "true") {
        // Not inside table, display message and close window
        alert("]]><LABEL value="editor.message.notable" /><![CDATA[");
        window.close();
	  }	

      case "error_selection":
      if(window.dialogArguments["error_selection"] == "true") {
        // Not selection.type = "None", display message and close window
        alert("]]><LABEL value="editor.message.selection" /><![CDATA[");
        window.close();
	  }	

      break;      
    }        
  }
</SCRIPT>

<!-- When the Ok-Button is pressed, the values from the Input-Fileds are stored in to an array and returned -->
<!-- to the HTML-Editor -->

<SCRIPT LANGUAGE=JavaScript FOR=Ok EVENT=onclick>
  var varAlign = TDAlign.options[TDAlign.selectedIndex].value;
  var varVAlign = TDVAlign.options[TDVAlign.selectedIndex].value;
  var arr = new Array();
  if (TDHeight.value.length > 0) {
    arr["height"] = TDHeight.value;
  } else {
    arr["height"] = null;
  }
  if (TDWidth.value.length > 0) {
    arr["width"] = TDWidth.value;
  } else {
    arr["width"] = null;
  }
  if (varAlign.length > 0) {
    arr["align"] = varAlign;
  } else {
    arr["align"] = null;
  }
  if (varVAlign.length > 0) {
    arr["vAlign"] = varVAlign;
  } else {
    arr["vAlign"] = null;
  }
  if (TBGColor.value.length > 0) {
    arr["bgColor"] = TBGColor.value;
  }
  else {
    arr["bgColor"] = null;
  }
  if (TBorderColor.value.length > 0) {
    arr["borderColor"] = TBorderColor.value;
  }
  else {
    arr["borderColor"] = null;
  }

// This is the difference between Cancel and setting all attributes to null !!

  arr["Ok"] = "Ok";
    
  window.returnValue = arr;
  window.close();
</SCRIPT>  

<!-- Functions for calling color selection dialog -->

<SCRIPT LANGUAGE=JavaScript>

function setTBGColor(arr)
  {
  if (arr != -1) {
    if(arr == 0) {
	  TBGColor.value="";	      
	}
	else {
	  TBGColor.value = arr;	      
	}
    window.clearInterval(CheckTBGCol);
  }
}

</SCRIPT>

<SCRIPT LANGUAGE=JavaScript>

function setTBorderColor(arr)
  {
  if (arr != -1) {
    if(arr == 0) {
	  TBorderColor.value="";	      
	}
	else {
	  TBorderColor.value = arr;	      
	}
    window.clearInterval(CheckTBorderCol);
  }
}

</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=TBGColorBt EVENT=onclick>
  ColorSelected=-1;
  SelColor=-1;
  CheckTBGCol= window.setInterval("setTBGColor(SelColor)",1000);
  var SelBGColorWindow= window.open('edit_html_selcolor.html',"SelBGColor","width=500,height=400,resizable=no,top=200,left=100");
  SelBGColorWindow.opener = self;
  
</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=TBorderColorBt EVENT=onclick>
  ColorSelected=-1;
  SelColor=-1;
  CheckTBorderCol= window.setInterval("setTBorderColor(SelColor)",1000);
  var SelBorderColorWindow= window.open('edit_html_selcolor.html',"SelBorderColor","width=500,height=400,resizable=no,top=200,left=100");
  SelBorderColorWindow.opener = self;
  
</SCRIPT>
</HEAD>

<!-- Body of the Table Element Dialog. All input fields and buttons are defined and displayed -->

<BODY bgcolor="#EFEDDB">
<TABLE CELLSPACING=5 cellpadding="5" border="0" width="100%">
<!-- <TR>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
 </tr> -->
 <TR>
    <td>&nbsp;</td>
    <td colspan="2"><B><SCRIPT LANGUAGE=JavaScript>if (window.dialogArguments["title"] == "TR") {document.write("]]><LABEL value="title.changetr"/><![CDATA[");} else {document.write("]]><LABEL value="title.changetd"/><![CDATA[");}</SCRIPT></B></td>
    <td>&nbsp;</td>
 </tr>
<!-- <TR>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
 </tr> -->
 <TR>
    <td></td>
  <TD>]]><LABEL value="input.height"/><![CDATA[:</td>
  <TD><INPUT ID=TDHeight TYPE=TEXT SIZE=7 maxlength="7"  NAME="TDHeight" ONKEYPRESS="event.returnValue=IsDigit();"></td>
  <TD>]]><LABEL value="input.borderinfo"/><![CDATA[</td>
 </tr>
 <TR>
    <td></td>
  <TD>]]><LABEL value="input.width"/><![CDATA[: </td>
  <TD><INPUT ID=TDWidth TYPE=TEXT SIZE=7 maxlength="7"  NAME="TDWidth" ONKEYPRESS="event.returnValue=IsDigit();"></td>
  <TD>]]><LABEL value="input.borderinfo"/><![CDATA[</td>
 </tr>  
 <TR>
   <td></td>
  <TD>]]><LABEL value="input.align"/><![CDATA[: </td>
  <TD><select name="TDAlign" id="TDAlign" size="1" style="width:150px">
        <option value="">]]><LABEL value="input.alignstandard" /><![CDATA[</option>
        <option value="left">]]><LABEL value="input.alignleft" /><![CDATA[</option>
        <option value="right">]]><LABEL value="input.alignright" /><![CDATA[</option>
        <option value="center">]]><LABEL value="input.aligncenter" /><![CDATA[</option>
      </select>
  <TD></td>
 </tr>
 <TR>
   <td></td>
  <TD>]]><LABEL value="input.valign"/><![CDATA[: </td>
  <TD><select name="TDVAlign" id="TDVAlign" size="1" style="width:150px">
        <option value="">]]><LABEL value="input.valignstandard" /><![CDATA[</option>
        <option value="top">]]><LABEL value="input.valigntop" /><![CDATA[</option>
        <option value="bottom">]]><LABEL value="input.valignbottom" /><![CDATA[</option>
        <option value="middle">]]><LABEL value="input.valignmiddle" /><![CDATA[</option>
        <option value="center">]]><LABEL value="input.valigncenter" /><![CDATA[</option>
        <option value="baseline">]]><LABEL value="input.valignbaseline" /><![CDATA[</option>
      </select>
  <TD></td>
 </tr>
 <TR>
   <td></td>
  <TD> ]]><LABEL value="input.tbgcolor"/><![CDATA[:</td>
  <TD> <input type="text" id="TBGColor" size=7 maxlength="7" name="TBGColor"></td>
  <TD><INPUT type=button  ID=TBGColorBt value="]]><LABEL value="button.color"/><![CDATA["> </td>
</tr>
 <TR>
   <td></td>
  <TD> ]]><LABEL value="input.tbordercolor"/><![CDATA[:</td>
  <TD> <input type="text" id="TBorderColor" size=7 maxlength="7" name="TBorderColor"></td>
  <TD><INPUT type=button  ID=TBorderColorBt value="]]><LABEL value="button.color"/><![CDATA["> </td>
</tr>
</TABLE>

<P>
<BUTTON ID=Ok TYPE=SUBMIT>]]><LABEL value="button.ok"/><![CDATA[</BUTTON>
<BUTTON ONCLICK="window.close();">]]><LABEL value="button.cancel"/><![CDATA[</BUTTON>

</BODY>
</HTML>
]]>
</template>
</workplace>

⌨️ 快捷键说明

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