📄 table.vm
字号:
if (!MoreThanOne(d_row,"$action.getText('webeditor.dialog.table.rowProperty')")) return;
// 列数的有效性
if (!MoreThanOne(d_col,"$action.getText('webeditor.dialog.table.colProperty')")) return;
// 边线粗细的有效性
if (d_border.value == "") d_border.value = "0";
if (d_cellpadding.value == "") d_cellpadding.value = "0";
if (d_cellspacing.value == "") d_cellspacing.value = "0";
// 去前导0
d_border.value = parseFloat(d_border.value);
d_cellpadding.value = parseFloat(d_cellpadding.value);
d_cellspacing.value = parseFloat(d_cellspacing.value);
// 宽度有效值性
var sWidth = "";
if (d_widthcheck.checked){
if (!MoreThanOne(d_widthvalue,"$action.getText('webeditor.dialog.table.errorWidth')")) return;
sWidth = d_widthvalue.value + d_widthunit.value;
}
// 高度有效值性
var sHeight = "";
if (d_heightcheck.checked){
if (!MoreThanOne(d_heightvalue,"$action.getText('webeditor.dialog.table.errorHeight')")) return;
sHeight = d_heightvalue.value + d_heightunit.value;
}
sRow = d_row.value;
sCol = d_col.value;
sAlign = d_align.options[d_align.selectedIndex].value;
sBorder = d_border.value;
sCellPadding = d_cellpadding.value;
sCellSpacing = d_cellspacing.value;
sImage = d_image.value;
sRepeat = d_repeat.value;
sAttachment = d_attachment.value;
sBorderStyle = d_borderstyle.options[d_borderstyle.selectedIndex].value;
if (sImage!="") {
sImage = "url(" + sImage + ")";
}
if (sAction == "MODI") {
// 修改行数
var xCount = sRow - oControl.rows.length;
if (xCount > 0)
for (var i = 0; i < xCount; i++) InsertRows(oControl);
else
for (var i = 0; i > xCount; i--) DeleteRows(oControl);
// 修改列数
var xCount = sCol - getColCount(oControl);
if (xCount > 0)
for (var i = 0; i < xCount; i++) InsertCols(oControl);
else
for (var i = 0; i > xCount; i--) DeleteCols(oControl);
try {
oControl.width = sWidth;
oControl.style.width = sWidth;
}
catch(e) {
//alert("对不起,请您输入有效的宽度值!\n(如:90% 200 300px 10cm)");
}
try {
oControl.height = sHeight;
oControl.style.height = sHeight;
}
catch(e) {
//alert("对不起,请您输入有效的高度值!\n(如:90% 200 300px 10cm)");
}
oControl.align = sAlign;
oControl.border = sBorder;
oControl.cellSpacing = sCellSpacing;
oControl.cellPadding = sCellPadding;
oControl.borderColor = sBorderColor;
oControl.bgColor = sBgColor;
oControl.style.backgroundImage = sImage;
oControl.style.backgroundRepeat = sRepeat;
oControl.style.backgroundAttachment = sAttachment;
oControl.style.borderStyle = sBorderStyle;
}else{
var sTable = "<table align='"+sAlign+"' border='"+sBorder+"' cellpadding='"+sCellPadding+"' cellspacing='"+sCellSpacing+"' width='"+sWidth+"' heihgt='"+sHeight+"' bordercolor='"+sBorderColor+"' bgcolor='"+sBgColor+"' style='background-image:"+sImage+";background-repeat:"+sRepeat+";background-attachment:"+sAttachment+";border-style:"+sBorderStyle+";'>";
for (var i=1;i<=sRow;i++){
sTable = sTable + "<tr>";
for (var j=1;j<=sCol;j++){
sTable = sTable + "<td> </td>";
}
sTable = sTable + "</tr>";
}
sTable = sTable + "</table>";
dialogArguments.insertHTML(sTable);
}
window.returnValue = null;
window.close();
</SCRIPT>
</head>
<body bgcolor=menu onload="InitDocument()">
<table border=0 cellpadding=0 cellspacing=0 align=center>
<tr>
<td>
<fieldset>
<legend>$action.getText('webeditor.dialog.table.size')</legend>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=9 height=5></td></tr>
<tr>
<td width=7></td>
<td>$action.getText('webeditor.dialog.table.rowNum')</td>
<td width=5></td>
<td><input type=text id=d_row size=10 value="" ONKEYPRESS="event.returnValue=IsDigit();" maxlength=3></td>
<td width=40></td>
<td>$action.getText('webeditor.dialog.table.colNum')</td>
<td width=5></td>
<td><input type=text id=d_col size=10 value="" ONKEYPRESS="event.returnValue=IsDigit();" maxlength=3></td>
<td width=7></td>
</tr>
<tr><td colspan=9 height=5></td></tr>
</table>
</fieldset>
</td>
</tr>
<tr><td height=5></td></tr>
<tr>
<td>
<fieldset>
<legend>$action.getText('webeditor.dialog.table.position')</legend>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=9 height=5></td></tr>
<tr>
<td width=7></td>
<td>$action.getText('webeditor.dialog.table.alignType')</td>
<td width=5></td>
<td>
<select id="d_align" style="width:72px">
#webEditor_tableAlign()
</select>
</td>
<td width=40></td>
<td>$action.getText('webeditor.dialog.img.border')</td>
<td width=5></td>
<td><input type=text id=d_border size=10 value="" ONKEYPRESS="event.returnValue=IsDigit();"></td>
<td width=7></td>
</tr>
<tr><td colspan=9 height=5></td></tr>
<tr>
<td width=7></td>
<td>$action.getText('webeditor.dialog.table.cellspacing')</td>
<td width=5></td>
<td><input type=text id=d_cellspacing size=10 value="" ONKEYPRESS="event.returnValue=IsDigit();" maxlength=3></td>
<td width=40></td>
<td>$action.getText('webeditor.dialog.table.cellpadding')</td>
<td width=5></td>
<td><input type=text id=d_cellpadding size=10 value="" ONKEYPRESS="event.returnValue=IsDigit();" maxlength=3></td>
<td width=7></td>
</tr>
<tr><td colspan=9 height=5></td></tr>
</table>
</fieldset>
</td>
</tr>
<tr><td height=5></td></tr>
<tr>
<td>
<fieldset>
<legend>$action.getText('webeditor.dialog.table.tablesize')</legend>
<table border=0 cellpadding=0 cellspacing=0 width='100%'>
<tr><td colspan=9 height=5></td></tr>
<tr>
<td width=7></td>
<td onclick="d_widthcheck.click()" noWrap valign=middle><input id="d_widthcheck" type="checkbox" onclick="d_widthvalue.disabled=(!this.checked);d_widthunit.disabled=(!this.checked);" value="1"> $action.getText('webeditor.dialog.table.appointWidth')</td>
<td align=right width="60%">
<input name="d_widthvalue" type="text" value="" size="5" ONKEYPRESS="event.returnValue=IsDigit();" maxlength="4">
<select name="d_widthunit">
<option value='px'>$action.getText('webeditor.dialog.table.widthPX')</option>
<option value='%'>$action.getText('webeditor.dialog.table.widthPercent')</option>
</select>
</td>
<td width=7></td>
</tr>
<tr><td colspan=9 height=5></td></tr>
<tr>
<td height=7></td>
<td onclick="d_heightcheck.click()" noWrap valign=middle><input id="d_heightcheck" type="checkbox" onclick="d_heightvalue.disabled=(!this.checked);d_heightunit.disabled=(!this.checked);" value="1"> $action.getText('webeditor.dialog.table.appointHeight')</td>
<td align=right height="60%">
<input name="d_heightvalue" type="text" value="" size="5" ONKEYPRESS="event.returnValue=IsDigit();" maxlength="4">
<select name="d_heightunit">
<option value='px'>$action.getText('webeditor.dialog.table.heightunitPX')</option>
<option value='%'>$action.getText('webeditor.dialog.table.heightunitPercent')</option>
</select>
</td>
<td width=7></td>
</tr>
<tr><td colspan=9 height=5></td></tr>
</table>
</fieldset>
</td>
</tr>
<tr><td height=5></td></tr>
<tr>
<td>
<fieldset>
<legend>$action.getText('webeditor.dialog.table.tableStyle')</legend>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=9 height=5></td></tr>
<tr>
<td width=7></td>
<td>$action.getText('webeditor.dialog.fieldset.colorForBorder')</td>
<td width=5></td>
<td><input type=text id=d_bordercolor size=7 value=""></td>
<td><img border=0 src="${action.getText('config.webeditor.path.img')}/rect.gif" width=18 style="cursor:hand" id=s_bordercolor onclick="SelectColor('bordercolor')"></td>
<td width=40></td>
<td>$action.getText('webeditor.dialog.table.borderStyle')</td>
<td width=5></td>
<td colspan=2>
<select id=d_borderstyle size=1 style="width:72px">
#webEditor_borderStyle()
</select>
</td>
<td width=7></td>
</tr>
<tr><td colspan=9 height=5></td></tr>
<tr>
<td width=7></td>
<td>$action.getText('webeditor.dialog.fieldset.colorForBg')</td>
<td width=5></td>
<td><input type=text id=d_bgcolor size=7 value=""></td>
<td><img border=0 src="${action.getText('config.webeditor.path.img')}/rect.gif" width=18 style="cursor:hand" id=s_bgcolor onclick="SelectColor('bgcolor')"></td>
<td width=40></td>
<td>$action.getText('webeditor.dialog.fieldset.imgForBg')</td>
<td width=5></td>
<td><input type=text id=d_image size=7 value=""><input type=hidden id=d_repeat><input type=hidden id=d_attachment></td>
<td><img border=0 src="${action.getText('config.webeditor.path.img')}/rectcmg.gif" width=18 style="cursor:hand" id=s_bgimage onclick="SelectImage()" alt="$action.getText('webeditor.dialog.table.setbgimg')"></td>
<td width=7></td>
</tr>
<tr><td colspan=9 height=5></td></tr>
</table>
</fieldset>
</td>
</tr>
<tr><td height=5></td></tr>
<tr><td align=right><input type=submit value="$action.getText('webeditor.dialog.ok')" id=Ok> <input type=button value="$action.getText('webeditor.dialog.cancel')" onclick="window.close();"></td></tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -