Fixed paragraph, heading, and list menus and check state: bug 41735, r=brade

git-svn-id: svn://10.0.0.236/trunk@72384 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cmanske%netscape.com
2000-06-16 14:22:12 +00:00
parent 7d50f98cd8
commit 3d1ca91fb9
24 changed files with 743 additions and 436 deletions

View File

@@ -36,6 +36,7 @@
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="Startup()"
persist="screenX screenY"
orient="vertical">
<script language="JavaScript" src="chrome://editor/content/EdDialogCommon.js"/>

View File

@@ -32,7 +32,7 @@
<box flex="1" style="margin-top: 0.2em" autostretch="never">
<!-- This will right-align the button -->
<spring flex="1"/>
<button class="dialog" oncommand="onAdvancedEdit()" value="&AdvancedEditButton.label;"
<button class="dialog" id="AdvancedEditButton1" oncommand="onAdvancedEdit()" value="&AdvancedEditButton.label;"
tooltip="aTooltip" tooltiptext="&AdvancedEditButton.tooltip;"/>
</box>
<separator class="groove"/>

View File

@@ -28,6 +28,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
onload = "Startup()"
persist="screenX screenY"
orient="vertical">
<!-- Methods common to all editor dialogs -->

View File

@@ -45,7 +45,6 @@ function Startup()
window.close();
return;
}
dump("1\n");
// Create dialog object to store controls for easy access
dialog = new Object;
dialog.heightInput = document.getElementById("height");
@@ -56,21 +55,17 @@ dump("1\n");
dialog.shading = document.getElementById("3dShading");
dialog.pixelOrPercentMenulist = document.getElementById("pixelOrPercentMenulist");
dump("2\n");
// Make a copy to use for AdvancedEdit and onSaveDefault
globalElement = hLineElement.cloneNode(false);
dump("3 Init called...\n");
// Initialize control values based on existing attributes
InitDialog()
dump("1\n");
// SET FOCUS TO FIRST CONTROL
dialog.widthInput.focus();
// Resize window
window.sizeToContent();
dump("after sizeToContent\n");
}
// Set dialog widgets with attribute data

View File

@@ -36,6 +36,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
onload = "Startup()"
persist="screenX screenY"
orient="vertical">
<!-- Methods common to all editor dialogs -->

View File

@@ -297,7 +297,6 @@ function onMoreFewerImage()
dialog.doConstrain = dialog.constrainCheckbox.checked;
SetGlobalElementToCurrentDialogSettings();
//dialog.MoreSection.setAttribute("style","display: none");
dialog.MoreSection.setAttribute("collapsed","true");
window.sizeToContent();
dialog.MoreFewerButton.setAttribute("more","0");
@@ -310,7 +309,6 @@ function onMoreFewerImage()
}
else
{
//dialog.MoreSection.setAttribute("style","display: inherit");
dialog.MoreSection.removeAttribute("collapsed");
// Hide the "Advanced Edit" next to "More..." Use button at bottom right of dialog
dialog.AdvancedEditButton.setAttribute("style","display: none");

View File

@@ -34,6 +34,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
onload = "Startup()"
persist="screenX screenY"
orient="vertical" flex="1">
<!-- Methods common to all editor dialogs -->

View File

@@ -32,6 +32,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
onload = "Startup()"
persist="screenX screenY"
orient="vertical">
<!-- Methods common to all editor dialogs -->

View File

@@ -36,6 +36,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
onload = "Startup()"
persist="screenX screenY"
align="vertical">
<!-- Methods common to all editor dialogs -->

View File

@@ -49,7 +49,7 @@ function Startup()
BulletStyleLabel = document.getElementById("BulletStyleLabel");
StartingNumberInput = document.getElementById("StartingNumber");
StartingNumberLabel = document.getElementById("StartingNumberLabel");
AdvancedEditButton = document.getElementById("AdvancedEditButton");
AdvancedEditButton = document.getElementById("AdvancedEditButton1");
// Try to get an existing list

View File

@@ -32,6 +32,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
onload = "Startup()"
persist="screenX screenY"
align="vertical">
<!-- Methods common to all editor dialogs -->

View File

@@ -36,6 +36,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
onload = "Startup()"
persist="screenX screenY"
orient="vertical">
<!-- Methods common to all editor dialogs -->

View File

@@ -61,9 +61,15 @@ function Startup()
if (location != "about:blank")
{
dialog.PageLocation.setAttribute("value", editorShell.editorDocument.location);
// Get last-modified file date+time
// TODO: Convert this to local time?
document.getElementById("PageModDate").setAttribute("value",editorShell.editorDocument.lastModified);
var lastmod = editorShell.editorDocument.lastModified; // get string of last modified date
var lastmoddate = Date.parse(lastmod); // convert modified string to date
if(lastmoddate == 0) // unknown date (or January 1, 1970 GMT)
lastmod = GetString("Unknown");
document.getElementById("PageModDate").setAttribute("value",lastmod);
}
authorElement = GetMetaElement("author");

View File

@@ -34,6 +34,7 @@
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="Startup()"
persist="screenX screenY"
orient="vertical">
<!-- Methods common to all editor dialogs -->

View File

@@ -31,6 +31,7 @@
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload = "Startup()"
persist="screenX screenY"
orient="vertical">
<script language="JavaScript" src="chrome://editor/content/EdDialogCommon.js"/>

View File

@@ -25,31 +25,35 @@
var tagname = "table"
var TableElement;
var CellElement;
var TableCaptionElement;
var TabPanel;
var dialog;
var globalCellElement;
var globalTableElement
var captionElement;
var TablePanel = 0;
var CellPanel = 1;
var currentPanel = TablePanel;
var validatePanel;
var defHAlignIndex = 0; // = left, index=0
var charIndex = 4;
var defHAlign = "left";
var centerStr = "center"; //Index=1
var rightStr = "right"; // 2
var justifyStr = "justify"; // 3
var charStr = "char"; // 4
var defVAlignIndex = 1; // = middle
var defVAlign = "middle";
var topStr = "top";
var bottomStr = "bottom";
var bgcolor = "bgcolor";
var CellIsHeader = false;
var rowCount = 1;
var colCount = 1;
var newRowCount;
var newColCount;
var selectedCellCount = 0;
var error = 0;
var ApplyUsed = false;
// What should these be?
var maxRows = 10000;
var maxColumns = 10000;
// dialog initialization code
function Startup()
@@ -73,12 +77,23 @@ function Startup()
dialog.BorderWidthInput = document.getElementById("BorderWidthInput");
dialog.SpacingInput = document.getElementById("SpacingInput");
dialog.PaddingInput = document.getElementById("PaddingInput");
dialog.TableAlignSelect = document.getElementById("TableAlignSelect");
dialog.CaptionSelect = document.getElementById("CaptionSelect");
dialog.TableAlignList = document.getElementById("TableAlignList");
dialog.TableCaptionList = document.getElementById("TableCaptionList");
dialog.TableInheritColor = document.getElementById("TableInheritColor");
dialog.TableImageInput = document.getElementById("TableImageInput");
dialog.TableImageButton = document.getElementById("TableImageButton");
// dialog.TableLeaveLocCheck = document.getElementById("TableLeaveLocCheck");
dialog.RowsCheckbox = document.getElementById("RowsCheckbox");
dialog.ColumnsCheckbox = document.getElementById("ColumnsCheckbox");
dialog.TableHeightCheckbox = document.getElementById("TableHeightCheckbox");
dialog.TableWidthCheckbox = document.getElementById("TableWidthCheckbox");
dialog.TableBorderCheckbox = document.getElementById("TableBorderCheckbox");
dialog.CellSpacingCheckbox = document.getElementById("CellSpacingCheckbox");
dialog.CellPaddingCheckbox = document.getElementById("CellPaddingCheckbox");
dialog.TableHAlignCheckbox = document.getElementById("TableHAlignCheckbox");
dialog.TableCaptionCheckbox = document.getElementById("TableCaptionCheckbox");
dialog.TableColorCheckbox = document.getElementById("TableColorCheckbox");
dialog.TableImageCheckbox = document.getElementById("TableImageCheckbox");
// Cell Panel
dialog.SelectionList = document.getElementById("SelectionList");
@@ -92,15 +107,24 @@ function Startup()
dialog.CellWidthUnits = document.getElementById("CellWidthUnits");
dialog.RowSpanInput = document.getElementById("RowSpanInput");
dialog.ColSpanInput = document.getElementById("ColSpanInput");
dialog.CellHAlignSelect = document.getElementById("CellHAlignSelect");
dialog.CellHAlignList = document.getElementById("CellHAlignList");
dialog.CellAlignCharInput = document.getElementById("CellAlignCharInput");
dialog.CellVAlignSelect = document.getElementById("CellVAlignSelect");
dialog.HeaderCheck = document.getElementById("HeaderCheck");
dialog.NoWrapCheck = document.getElementById("NoWrapCheck");
dialog.CellVAlignList = document.getElementById("CellVAlignList");
dialog.CellStyleList = document.getElementById("CellStyleList");
dialog.TextWrapList = document.getElementById("TextWrapList");
dialog.CellInheritColor = document.getElementById("CellInheritColor");
dialog.CellImageInput = document.getElementById("CellImageInput");
dialog.CellImageButton = document.getElementById("CellImageButton");
// dialog.CellLeaveLocCheck = document.getElementById("CellLeaveLocCheck");
dialog.CellHeightCheckbox = document.getElementById("CellHeightCheckbox");
dialog.CellWidthCheckbox = document.getElementById("CellWidthCheckbox");
dialog.SpanCheckbox = document.getElementById("SpanCheckbox");
dialog.CellHAlignCheckbox = document.getElementById("CellHAlignCheckbox");
dialog.CellVAlignCheckbox = document.getElementById("CellVAlignCheckbox");
dialog.CellStyleCheckbox = document.getElementById("CellStyleCheckbox");
dialog.TextWrapCheckbox = document.getElementById("TextWrapCheckbox");
dialog.CellColorCheckbox = document.getElementById("CellColorCheckbox");
dialog.CellImageCheckbox = document.getElementById("CellImageCheckbox");
TableElement = editorShell.GetElementOrParentByTagName("table", null);
var tagNameObj = new Object;
@@ -123,7 +147,7 @@ dump("Cell is selected or is selection parent. Selected Cell count = "+selectedC
if(!TableElement)
{
dump("Failed to get selected element or create a new one!\n");
dump("Failed to get table element!\n");
window.close();
}
// We allow a missing cell -- see below
@@ -182,6 +206,10 @@ dump("Cell is selected or is selection parent. Selected Cell count = "+selectedC
rowCount = editorShell.GetTableRowCount(TableElement);
colCount = editorShell.GetTableColumnCount(TableElement);
// User can change these via textfields
newRowCount = rowCount;
newColCount = colCount;
// This uses values set on global Elements;
InitDialog();
@@ -209,23 +237,25 @@ function InitDialog()
//BUG: The align strings are converted: e.g., "center" becomes "Center";
var halign = globalTableElement.align.toLowerCase();
if (halign == centerStr)
dialog.TableAlignSelect.selectedIndex = 1;
dialog.TableAlignList.selectedIndex = 1;
else if (halign == bottomStr)
dialog.TableAlignSelect.selectedIndex = 2;
dialog.TableAlignList.selectedIndex = 2;
else // Default = left
dialog.TableAlignSelect.selectedIndex = 0;
dialog.TableAlignList.selectedIndex = 0;
captionElement = globalTableElement.caption;
dump("Caption Element = "+captionElement+"\n");
TableCaptionElement = globalTableElement.caption;
dump("Caption Element = "+TableCaptionElement+"\n");
var index = 0;
if (captionElement)
if (TableCaptionElement)
{
if(captionElement.vAlign == "top")
index = 1;
else
// Note: Other possible values are "left" and "right",
// but "align" is deprecated, so should we even support "botton"?
if (TableCaptionElement.vAlign == "bottom")
index = 2;
else
index = 1;
}
dialog.CaptionSelect.selectedIndex = index;
dialog.TableCaptionList.selectedIndex = index;
if (globalTableElement.background)
dialog.TableImageInput.value = globalTableElement.background;
@@ -261,45 +291,44 @@ dump("RowSpan="+globalCellElement.rowSpan+" ColSpan="+globalCellElement.colSpan+
var valign = globalCellElement.vAlign.toLowerCase();
if (valign == topStr)
dialog.CellVAlignSelect.selectedIndex = 0;
dialog.CellVAlignList.selectedIndex = 0;
else if (valign == bottomStr)
dialog.CellVAlignSelect.selectedIndex = 2;
dialog.CellVAlignList.selectedIndex = 2;
else // Default = middle
dialog.CellVAlignSelect.selectedIndex = 1;
dialog.CellVAlignList.selectedIndex = 1;
var halign = globalCellElement.align.toLowerCase();
switch (halign)
{
case centerStr:
dialog.CellHAlignSelect.selectedIndex = 1;
dialog.CellHAlignList.selectedIndex = 1;
break;
case rightStr:
dialog.CellHAlignSelect.selectedIndex = 2;
dialog.CellHAlignList.selectedIndex = 2;
break;
case justifyStr:
dialog.CellHAlignSelect.selectedIndex = 3;
dialog.CellHAlignList.selectedIndex = 3;
break;
case charStr:
var alignChar = globalCellElement.getAttribute(charStr);
if (alignChar && alignChar.length == 1)
{
dialog.CellAlignCharInput.value = alignChar;
dialog.CellHAlignSelect.selectedIndex = 4;
dialog.CellHAlignList.selectedIndex = 4;
} else {
// "char" align set but no alignment char value
dialog.CellHAlignSelect.selectedIndex = 0;
dialog.CellHAlignList.selectedIndex = 0;
}
break;
default: // left
dialog.CellHAlignSelect.selectedIndex = 0;
dialog.CellHAlignList.selectedIndex = 0;
break;
}
// Show/hide extra message to explain "default" case
SelectCellHAlign();
CellIsHeader = (globalCellElement.nodeName == "TH");
dialog.HeaderCheck.checked = CellIsHeader;
dialog.NoWrapCheck.checked = globalCellElement.noWrap;
dialog.CellStyleList.selectedIndex = (globalCellElement.nodeName == "TH") ? 1 : 0;
dialog.TextWrapList.selectedIndex = globalCellElement.noWrap ? 1 : 0;
SetColor("cellBackgroundCW", globalCellElement.bgColor);
@@ -321,13 +350,14 @@ function SelectCellTab()
currentPanel = CellPanel;
}
function SelectCellHAlign()
function SelectCellHAlign(checkboxID)
{
dump("dialog.CellHAlignSelect.selectedIndex ="+dialog.CellHAlignSelect.selectedIndex+"\n");
if (dialog.CellHAlignSelect.selectedIndex == 4)
dialog.CellAlignCharInput.removeAttribute("visibility");
dump("dialog.CellHAlignList.selectedIndex ="+dialog.CellHAlignList.selectedIndex+"\n");
if (dialog.CellHAlignList.selectedIndex == 4)
dialog.CellAlignCharInput.removeAttribute("collapsed");
else
dialog.CellAlignCharInput.setAttribute("visibility","hidden");
dialog.CellAlignCharInput.setAttribute("collapsed","true");
SetCheckbox(checkboxID);
}
function GetColorAndUpdate(ColorPickerID, ColorWellID, widget)
@@ -426,7 +456,7 @@ function SwitchPanel(newPanel)
// More weirdness: Can't pass in "inputWidget" -- becomes undefined?!
// Must pass in just ID and use getElementById
function ValidateNumber(inputWidgetID, selectWidget, minVal, maxVal, element, attName)
function ValidateNumber(inputWidgetID, listWidget, minVal, maxVal, element, attName)
{
var inputWidget = document.getElementById(inputWidgetID);
// Global error return value
@@ -437,8 +467,8 @@ function ValidateNumber(inputWidgetID, selectWidget, minVal, maxVal, element, at
var numString = inputWidget.value.trimString();
if (numString && numString != "")
{
if (selectWidget)
isPercent = (selectWidget.selectedIndex == 1);
if (listWidget)
isPercent = (listWidget.selectedIndex == 1);
if (isPercent)
maxLimit = 100;
@@ -467,13 +497,11 @@ function ValidateNumber(inputWidgetID, selectWidget, minVal, maxVal, element, at
return numString;
}
function SetAlign(selectWidgetID, defaultIndex, element, attName)
function SetAlign(listID, defaultValue, element, attName)
{
selectWidget = document.getElementById(selectWidgetID);
value = selectWidget.value;
var value = document.getElementById(listID).selectedItem.data;
dump("SetAlign value = "+value+"\n");
var index = selectWidget.selectedIndex;
if (index == defaultIndex)
if (value == defaultValue)
element.removeAttribute(attName);
else
element.setAttribute(attName, value);
@@ -482,52 +510,76 @@ dump("SetAlign value = "+value+"\n");
function ValidateTableData()
{
validatePanel = TablePanel;
var newRowCount = ValidateNumber("TableRowsInput", null, 1, rowCount, null, null);
if (error) return false;
if (dialog.RowsCheckbox.checked)
{
newRowCount = Number(ValidateNumber("TableRowsInput", null, 1, maxRows, null, null));
if (error) return false;
}
var newColCount = ValidateNumber("TableColumnsInput", null, 1, colCount, null, null);
if (error) return false;
if (dialog.ColumnsCheckbox.checked)
{
newColCount = Number(ValidateNumber("TableColumnsInput", null, 1, maxColumns, null, null));
if (error) return false;
}
// TODO: ADD/DELETE ROWS/COLUMNS
var temp = ValidateNumber("TableHeightInput", dialog.TableHeightUnits,
1, maxPixels, globalTableElement, "height");
if (error) return false;
temp = ValidateNumber("TableWidthInput", dialog.TableWidthUnits,
1, maxPixels, globalTableElement, "width");
if (error) return false;
if (dialog.TableHeightCheckbox.checked)
{
ValidateNumber("TableHeightInput", dialog.TableHeightUnits,
1, maxPixels, globalTableElement, "height");
if (error) return false;
}
var border = ValidateNumber("BorderWidthInput", null, 0, maxPixels, globalTableElement, "border");
// TODO: Deal with "BORDER" without value issue
if (error) return false;
if (dialog.TableWidthCheckbox.checked)
{
ValidateNumber("TableWidthInput", dialog.TableWidthUnits,
1, maxPixels, globalTableElement, "width");
if (error) return false;
}
temp = ValidateNumber("SpacingInput", null, 0, maxPixels, globalTableElement, "cellspacing");
if (error) return false;
if (dialog.TableBorderCheckbox.checked)
{
var border = ValidateNumber("BorderWidthInput", null, 0, maxPixels, globalTableElement, "border");
// TODO: Deal with "BORDER" without value issue
if (error) return false;
}
temp = ValidateNumber("PaddingInput", null, 0, maxPixels, globalTableElement, "cellpadding");
if (error) return false;
if (dialog.CellSpacingCheckbox.checked)
{
ValidateNumber("SpacingInput", null, 0, maxPixels, globalTableElement, "cellspacing");
if (error) return false;
}
SetAlign("TableAlignSelect", defHAlignIndex, globalTableElement, "align");
if (dialog.CellPaddingCheckbox.checked)
{
ValidateNumber("PaddingInput", null, 0, maxPixels, globalTableElement, "cellpadding");
if (error) return false;
}
if (dialog.TableHAlignCheckbox.checked)
SetAlign("TableAlignList", defHAlign, globalTableElement, "align");
// Color is set on globalCellElement immediately
// Background Image
var imageName = dialog.TableImageInput.value.trimString();
if (imageName && imageName != "")
if (dialog.TableImageCheckbox.checked)
{
if (IsValidImage(imageName))
globalTableElement.background = imageName;
else
var imageName = dialog.TableImageInput.value.trimString();
if (imageName && imageName != "")
{
dialog.TableImageInput.focus();
// Switch to appropriate panel for error reporting
SwitchPanel(validatePanel);
ShowInputErrorMessage(GetString("MissingImageError"));
return false;
if (IsValidImage(imageName))
globalTableElement.background = imageName;
else
{
dialog.TableImageInput.focus();
// Switch to appropriate panel for error reporting
SwitchPanel(validatePanel);
ShowInputErrorMessage(GetString("MissingImageError"));
return false;
}
} else {
globalTableElement.removeAttribute("background");
}
} else {
globalTableElement.removeAttribute("background");
}
return true;
}
@@ -535,67 +587,89 @@ function ValidateCellData()
{
validatePanel = CellPanel;
var temp;
temp = ValidateNumber("CellHeightInput", dialog.TableHeightUnits,
1, maxPixels, globalCellElement, "height");
if (error) return false;
temp = ValidateNumber("CellWidthInput", dialog.TableWidthUnits,
1, maxPixels, globalCellElement, "width");
if (error) return false;
if (dialog.CellHeightCheckbox.checked)
{
ValidateNumber("CellHeightInput", dialog.TableHeightUnits,
1, maxPixels, globalCellElement, "height");
if (error) return false;
}
if (dialog.CellWidthCheckbox.checked)
{
ValidateNumber("CellWidthInput", dialog.TableWidthUnits,
1, maxPixels, globalCellElement, "width");
if (error) return false;
}
// Vertical alignment is complicated by "char" type
var hAlign = dialog.CellHAlignSelect.value;
if (dialog.SpanCheckbox.checked)
{
ValidateNumber("ColSpanInput", null,
1, colCount, globalCellElement, "colspan");
if (error) return false;
ValidateNumber("RowSpanInput", null,
1, rowCount, globalCellElement, "rowspan");
if (error) return false;
}
if (dialog.CellHAlignCheckbox.checked)
{
// Vertical alignment is complicated by "char" type
var hAlign = dialog.CellHAlignList.selectedItem.data;
dump("Cell hAlign = "+hAlign+"\n");
var index = dialog.CellHAlignSelect.selectedIndex;
dump("HAlign index="+index+"\n");
if (index == defHAlignIndex)
{
globalCellElement.removeAttribute("hAlign");
globalCellElement.removeAttribute(charStr);
}
else
{
if (index == charIndex)
if (hAlign != charStr)
globalCellElement.removeAttribute(charStr);
if (hAlign == "left")
{
var alignChar = dialog.CellAlignCharInput.value.trimString();
globalCellElement.setAttribute(charStr, alignChar);
dump("Alignment char="+alignChar+" Align Value="+dialog.CellHAlignSelect.value+"\n");
globalCellElement.removeAttribute("align");
}
globalCellElement.setAttribute("align",dialog.CellHAlignSelect.value);
}
SetAlign("CellVAlignSelect", defVAlignIndex, globalCellElement, "valign");
var shouldBeHeader = dialog.HeaderCheck.checked;
if (shouldBeHeader != CellIsHeader)
{
//TODO: THIS IS MESSY! Convert exisisting TD to TH or vice versa
}
if (dialog.NoWrapCheck.checked)
globalCellElement.setAttribute("nowrap","true");
else
globalCellElement.removeAttribute("nowrap");
// Background Image
var imageName = dialog.TableImageInput.value.trimString();
if (imageName && imageName != "")
{
if (IsValidImage(imageName))
globalCellElement.background = imageName;
else
{
dialog.CellImageInput.focus();
// Switch to appropriate panel for error reporting
SwitchPanel(validatePanel);
ShowInputErrorMessage(GetString("MissingImageError"));
if (hAlign == charStr)
{
var alignChar = dialog.CellAlignCharInput.value.trimString();
globalCellElement.setAttribute(charStr, alignChar);
dump("Alignment char="+alignChar+"\n");
}
globalCellElement.setAttribute("align", hAlign);
}
} else {
globalCellElement.removeAttribute("background");
}
if (dialog.CellVAlignCheckbox.checked)
SetAlign("CellVAlignList", defVAlign, globalCellElement, "valign");
if (dialog.TextWrapCheckbox.checked)
{
if (dialog.TextWrapList.selectedIndex == 1)
globalCellElement.setAttribute("nowrap","true");
else
globalCellElement.removeAttribute("nowrap");
}
// Background Image
if (dialog.CellImageCheckbox.checked)
{
var imageName = dialog.TableImageInput.value.trimString();
if (imageName && imageName != "")
{
if (IsValidImage(imageName))
globalCellElement.background = imageName;
else
{
dialog.CellImageInput.focus();
// Switch to appropriate panel for error reporting
SwitchPanel(validatePanel);
ShowInputErrorMessage(GetString("MissingImageError"));
}
} else {
globalCellElement.removeAttribute("background");
}
}
return true;
}
@@ -629,27 +703,196 @@ function ValidateData()
return true;
}
function onOK()
// Call this when a textfield or menulist is changed
// so the checkbox is automatically set
function SetCheckbox(checkboxID)
{
// Set associated checkbox
document.getElementById(checkboxID).checked = true;
}
function ChangeIntTextfield(textfieldID, checkboxID)
{
// Filter input for just integers
forceInteger(textfieldID);
// Set associated checkbox
SetCheckbox(checkboxID);
}
function CloneAttribute(destElement, srcElement, attr)
{
var value = srcElement.getAttribute(attr);
// Use editorShell methods since we are always
// modifying a table in the document and
// we need transaction system for undo
if (!value || value.length == 0)
editorShell.RemoveAttribute(destElement, attr);
else
editorShell.setAttribute(destElement, attr, value);
}
function ApplyTableAttributes()
{
if (dialog.TableCaptionCheckbox.checked)
{
var newAlign = dialog.TableCaptionList.selectedItem.data;
if (!newAlign) newAlign = "";
if (TableCaptionElement)
{
// Get current alignment
var align = TableCaptionElement.align.toLowerCase();
// This is the default
if (!align) align = "top";
if (newAlign == "")
{
// Remove existing caption
editorShell.DeleteElement(TableCaptionElement);
TableCaptionElement = null;
}
else if( align != newAlign)
{
if (align == "top") // This is default, so don't explicitly set it
editorShell.RemoveAttribute(TableCaptionElement, "align");
else
editorShell.SetAttribute(TableCaptionElement, "align", newAlign);
}
}
else if (newAlign != "")
{
dump("Insert a table caption...\n");
// Create and insert a caption:
TableCaptionElement = editorShell.CreateElementWithDefaults("caption");
if (TableCaptionElement)
{
if (newAlign != "top")
TableCaptionElement.setAttribute("align", newAlign);
// Insert it into the table - caption is always inserted as first child
editorShell.InsertElement(TableCaptionElement, TableElement, 0);
}
}
}
//TODO: DOM manipulation to add/remove table rows/columns
if (dialog.RowsCheckbox.checked && newRowCount != rowCount)
{
}
if (dialog.ColumnsCheckbox.checked && newColCount != colCount)
{
}
if (dialog.TableHeightCheckbox.checked)
CloneAttribute(TableElement, globalTableElement, "height");
if (dialog.TableWidthCheckbox.checked)
CloneAttribute(TableElement, globalTableElement, "width");
if (dialog.TableBorderCheckbox.checked)
CloneAttribute(TableElement, globalTableElement, "border");
if (dialog.CellSpacingCheckbox.checked)
CloneAttribute(TableElement, globalTableElement, "cellspacing");
if (dialog.CellPaddingCheckbox.checked)
CloneAttribute(TableElement, globalTableElement, "cellpadding");
if (dialog.TableHAlignCheckbox.checked)
CloneAttribute(TableElement, globalTableElement, "align");
if (dialog.TableColorCheckbox.checked)
CloneAttribute(TableElement, globalTableElement, "bgcolor");
if (dialog.TableImageCheckbox.checked)
CloneAttribute(TableElement, globalTableElement, "background");
}
function ApplyCellAttributes(destElement)
{
if (dialog.CellHeightCheckbox.checked)
CloneAttribute(destElement, globalCellElement, "height");
if (dialog.CellWidthCheckbox.checked)
CloneAttribute(destElement, globalCellElement, "width");
if (dialog.SpanCheckbox.checked)
{
CloneAttribute(destElement, globalCellElement, "rowspan");
CloneAttribute(destElement, globalCellElement, "colspan");
}
if (dialog.CellHAlignCheckbox.checked)
{
CloneAttribute(destElement, globalCellElement, "align");
CloneAttribute(destElement, globalCellElement, charStr);
}
if (dialog.CellVAlignCheckbox.checked)
CloneAttribute(destElement, globalCellElement, "valign");
if (dialog.CellStyleCheckbox.checked)
{
var newStyleIndex = dialog.CellStyleList.selectedIndex;
var currentStyleIndex = (destElement.nodeName == "TH") ? 1 : 0;
if (newStyleIndex != currentStyleIndex)
{
//TODO: THIS IS MESSY! Convert exisisting TD to TH or vice versa
CurrentStyleIndex = newStyleIndex;
}
}
if (dialog.TextWrapCheckbox.checked)
CloneAttribute(destElement, globalCellElement, "nowrap");
if (dialog.CellColorCheckbox.checked)
CloneAttribute(destElement, globalCellElement, "bgcolor");
if (dialog.CellImageCheckbox.checked)
CloneAttribute(destElement, globalCellElement, "background");
}
function Apply()
{
if (ValidateData())
{
editorShell.BeginBatchChanges();
editorShell.CloneAttributes(TableElement, globalTableElement);
// Apply changes to all selected cells
var selectedCell = editorShell.GetFirstSelectedCell();
while (selectedCell)
// Can't use editorShell.CloneAttributes -- we must change only
// attributes that are checked!
ApplyTableAttributes();
// We may have just a table, so check for cell element
if (globalCellElement)
{
// TODO: We need to change this to set only particular attributes
// Set an "ignore" attribute on the attribute node?
editorShell.CloneAttributes(selectedCell,globalCellElement);
selectedCell = editorShell.GetNextSelectedCell();
}
//TODO: DOM manipulation to add/remove table rows/columns,
// Switch cell type to TH -- involves removing TD and replacing with TD
// Creating and moving CAPTION element
// Apply changes to all selected cells
var selectedCell = editorShell.GetFirstSelectedCell();
while (selectedCell)
{
ApplyCellAttributes(selectedCell);
selectedCell = editorShell.GetNextSelectedCell();
}
}
editorShell.EndBatchChanges();
// Change text on "Cancel" button after Apply is used
if (!ApplyUsed)
{
document.getElementById("cancel").setAttribute("value",GetString("Close"));
ApplyUsed = true;
}
return true;
}
return false;
}
function onOK()
{
// Do same as Apply and close window if ValidateData succeeded
return Apply();
}

View File

@@ -35,6 +35,7 @@
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="Startup()"
persist="screenX screenY"
orient="vertical">
<!-- Methods common to all editor dialogs -->
@@ -51,68 +52,71 @@
<tab id="CellTab" oncommand="SelectCellTab()" value="&cellTab.label;"/>
<spring flex="1"/>
</tabbox>
<tabpanel class="Padding5" orient="vertical" id="TabPanel">
<tabpanel orient="vertical" id="TabPanel">
<!-- TABLE PANEL -->
<box id="TablePanel" orient="vertical">
<titledbox><title><text value="&size.label;"/></title>
<box orient="vertical">
<box valign="baseline" autostretch="never">
<text class="MinWidth50" align="left" for="TableRowsInput" value="&tableRows.label;"/>
<textfield class="narrow" id="TableRowsInput" onkeyup="forceInteger(this.id)" disabled="true"/>
</box>
<spring class="spacer"/>
<box valign="baseline" autostretch="never">
<text class="MinWidth50" align="left" for="TableColumnsInput" value="&tableColumns.label;"/>
<textfield class="narrow" id="TableColumnsInput" onkeyup="forceInteger(this.id)" disabled="true"/>
</box>
</box>
<grid>
<columns><column/><column/></columns>
<rows>
<row valign="middle">
<checkbox id="RowsCheckbox" value="&tableRows.label;"/>
<textfield class="narrow" id="TableRowsInput" onkeyup="ChangeIntTextfield(this.id,'RowsCheckbox');"/>
</row>
<row valign="middle">
<checkbox id="ColumnsCheckbox" value="&tableColumns.label;"/>
<textfield class="narrow" id="TableColumnsInput" onkeyup="ChangeIntTextfield(this.id,'ColumnsCheckbox');"/>
</row>
</rows>
</grid>
<spring class="bigspacer"/>
<spring class="bigspacer"/>
<box orient="vertical">
<box valign="baseline" autostretch="never">
<text class="MinWidth50" align="right" for="TableHeightInput" value="&tableHeight.label;"/>
<textfield class="narrow" id="TableHeightInput" onkeyup="forceInteger(this.id)"/>
<menulist id="TableHeightUnits"/>
</box>
<spring class="spacer"/>
<box valign="baseline" autostretch="never">
<text class="MinWidth50" align="right" for="TableWidthInput" value="&tableWidth.label;"/>
<textfield class="narrow" id="TableWidthInput" onkeyup="forceInteger(this.id)"/>
<menulist id="TableWidthUnits"/>
</box>
</box>
<spring flex="1"/>
<grid>
<columns><column/><column/><column/></columns>
<rows>
<row valign="middle">
<checkbox id="TableHeightCheckbox" value="&tableHeight.label;"/>
<textfield class="narrow" id="TableHeightInput" onkeyup="ChangeIntTextfield(this.id,'TableHeightCheckbox');"/>
<menulist id="TableHeightUnits" oncommand="SetCheckbox('TableHeightCheckbox');"/>
</row>
<row valign="middle">
<checkbox id="TableWidthCheckbox" value="&tableWidth.label;"/>
<textfield class="narrow" id="TableWidthInput" onkeyup="ChangeIntTextfield(this.id,'TableWidthCheckbox');"/>
<menulist id="TableWidthUnits" oncommand="SetCheckbox('TableWidthCheckbox');"/>
</row>
</rows>
</grid>
</titledbox>
<box>
<box><!-- Border and Alignment -->
<titledbox orient="vertical"><title><text align="left" value="&tableBorderSpacing.label;"/></title>
<box valign="baseline" autostretch="never">
<text align="left" for="BorderWidthInput" value="&tableBorderWidth.label;"/>
<spring class="spacer"/>
<textfield class="narrow" id="BorderWidthInput" onkeyup="forceInteger(this.id)"/>
<text align="left" value="&pixels.label;"/>
</box>
<spring class="spacer"/>
<box valign="baseline" autostretch="never">
<text class="MinWidth50" align="left" for="SpacingInput" value="&tableSpacing.label;"/>
<textfield class="narrow" id="SpacingInput" onkeyup="forceInteger(this.id)"/>
<text align="left" value="&tablePxBetwCells.label;"/>
</box>
<spring class="spacer"/>
<box valign="baseline" autostretch="never">
<text class="MinWidth50" align="left" for="PaddingInput" value="&tablePadding.label;"/>
<textfield class="narrow" id="PaddingInput" onkeyup="forceInteger(this.id)"/>
<!-- Use DIV instead of TEXT because label has embeded <br> -->
<html:div>&tablePxBetwBrdrCellContent.label;</html:div>
</box>
<spring flex="1"/>
<grid>
<columns><column/><column/><column/></columns>
<rows>
<row valign="middle">
<checkbox id="TableBorderCheckbox" value="&tableBorderWidth.label;"/>
<textfield class="narrow" id="BorderWidthInput" onkeyup="ChangeIntTextfield(this.id,'TableBorderCheckbox');"/>
<text class="label" align="left" value="&pixels.label;"/>
</row>
<row valign="middle">
<checkbox id="CellSpacingCheckbox" value="&tableSpacing.label;"/>
<textfield class="narrow" id="SpacingInput" onkeyup="ChangeIntTextfield(this.id,'CellSpacingCheckbox');"/>
<text class="label" value="&tablePxBetwCells.label;"/>
</row>
<row valign="middle" autostretch="never">
<checkbox id="CellPaddingCheckbox" value="&tablePadding.label;"/>
<textfield class="narrow" id="PaddingInput" onkeyup="ChangeIntTextfield(this.id,'CellPaddingCheckbox');"/>
<!-- Use HTML instead of TEXT to let it wrap -->
<html flex="1">&tablePxBetwBrdrCellContent.label;</html>
</row>
</rows>
</grid>
</titledbox>
<spring class="spacer"/>
<box orient="vertical" flex="1">
<spring class="bigspacer"/>
<box orient="vertical" flex="1">
<text align="left" for="TableAlignSelect" value="&tableAlignment.label;"/>
<checkbox id="TableHAlignCheckbox" value="&tableAlignment.label;"/>
<spring class="smallspacer"/>
<menulist id="TableAlignSelect">
<menulist id="TableAlignList" oncommand="SetCheckbox('TableHAlignCheckbox');">
<menupopup>
<menuitem value="&AlignLeft.label;" data="left"/>
<menuitem value="&AlignCenter.label;" data="center"/>
@@ -120,196 +124,211 @@
</menupopup>
</menulist>
<spring class="bigspacer"/>
<text align="left" for="CaptionSelect" value="&tableCaption.label;"/>
<checkbox id="TableCaptionCheckbox" value="&tableCaption.label;"/>
<spring class="smallspacer"/>
<menulist id="CaptionSelect" disabled="true">
<menulist id="TableCaptionList" oncommand="SetCheckbox('TableCaptionCheckbox');">
<menupopup>
<menuitem value="&tableCaptionNone.label;"/>
<menuitem value="&tableCaptionAbove.label;"/>
<menuitem value="&tableCaptionBelow.label;"/>
<menuitem value="&tableCaptionNone.label;" data=""/>
<menuitem value="&tableCaptionAbove.label;" data="top"/>
<menuitem value="&tableCaptionBelow.label;" data="bottom"/>
</menupopup>
</menulist>
<spring flex="1"/>
</box>
</box>
<spring class="bigspacer"/>
</box>
</box> <!-- Border and alignment -->
<titledbox orient="vertical"><title><text align="left" value="&background.label;"/></title>
<box valign="baseline" autostretch="never">
<text class="MinWidth50" align="left" value="&color.label;"/>
<menu class="colorpicker">
<box>
<spring id="tableBackgroundCW" class="color-well"/>
<image class="popup-trigger"/>
<grid>
<columns><column/><column/></columns>
<rows>
<row valign="middle">
<checkbox id="TableColorCheckbox" value="&color.label;"/>
<box valign="middle">
<menu class="colorpicker">
<box>
<spring id="tableBackgroundCW" class="color-well"/>
<image class="popup-trigger"/>
</box>
<menupopup>
<colorpicker id="tableBackgroundCP" palettename="standard" onclick="GetColorAndUpdate('tableBackgroundCP','tableBackgroundCW',this);"/>
<button class="dialog" value="&defaultColor.label;" oncommand="GetColorAndUpdate('tableBackgroundCP','tableBackgroundCW',this)"/>
</menupopup>
</menu>
<spring class="spacer"/>
<text class="label" id="TableInheritColor" value="&tableInheritColor.label;" hidden="true"/>
</box>
<menupopup>
<colorpicker id="tableBackgroundCP" palettename="standard" onclick="GetColorAndUpdate('tableBackgroundCP','tableBackgroundCW',this);"/>
<button class="dialog" value="&defaultColor.label;" oncommand="GetColorAndUpdate('tableBackgroundCP','tableBackgroundCW',this)"/>
</menupopup>
</menu>
<spring class="spacer"/>
<text id="TableInheritColor" value="&tableInheritColor.label;" hidden="true"/>
</box>
<spring class="spacer"/>
<box valign="baseline" autostretch="never">
<text class="MinWidth50" align="left" for="TableImageInput" value="&image.label;"/>
</row>
<row valign="middle">
<checkbox id="TableImageCheckbox" value="&image.label;"/>
<textfield id="TableImageInput" flex="1"/>
<button class="dialog" value="&ChooseImage.label;" id="TableImageButton" oncommand="ChooseCellImage()"/>
</box>
<!-- Not sure if we will support this
<box valign="baseline" autostretch="never">
<spring class="MinWidth50"/>
<html:input type="checkbox" id="TableLeaveLocCheck"/>
<text align="left" for="TableLeaveLocCheck" value="&LeaveImageAtLocation.label;"/>
</box>
-->
</titledbox>
</row>
</rows>
</grid>
</titledbox><!-- Table Background -->
<spring class="spacer"/>
<box flex="1" autostretch="never">
<spring flex="1"/>
<html class="wrap" flex="1" style="width: 1em">&tableUseCheckboxHelp.label;</html>
<!-- From EdDialogOvlerlay.xul -->
<button class="dialog" id="AdvancedEditButton"/>
</box>
<spring flex="1"/>
</box>
</box><!-- Table Panel -->
<!-- CELL PANEL -->
<box id="CellPanel" orient="vertical">
<titledbox autostretch="never" valign="baseline">
<titledbox autostretch="never" valign="middle">
<title><text align="left" value="&cellSelection.label;"/></title>
<spring class="spacer"/>
<menulist class="MinWidth50" id="SelectionList">
<menupopup>
<menuitem data="1" id="SelectCellItem" value="&cellSelectionCell.label;"/>
<menuitem data="2" id="SelectRowItem" value="&cellSelectionRow.label;"/>
<menuitem data="3" id="SelectColumnItem" value="&cellSelectionColumn.label;"/>
</menupopup>
</menulist>
<spring class="bigspacer"/>
<button class="dialog MinWidth50" value="&cellSelectionPrevious.label;" oncommand="SelectPrevious()" disabled="true"/>
<spring class="bigspacer"/>
<button class="dialog MinWidth50" value="&cellSelectionNext.label;" oncommand="SelectNext()" disabled="true"/>
<grid>
<columns><column flex="1"/><column flex="1"/><column flex="1"/></columns>
<rows>
<row valign="middle" autostretch="never">
<menulist id="SelectionList" oncommand="ChangeSelection('event.target.id');">
<menupopup>
<menuitem id="SelectCellItem" value="&cellSelectionCell.label;"/>
<menuitem id="SelectRowItem" value="&cellSelectionRow.label;"/>
<menuitem id="SelectColumnItem" value="&cellSelectionColumn.label;"/>
</menupopup>
</menulist>
<button class="dialog" value="&cellSelectionPrevious.label;" oncommand="SelectPrevious()"/>
<button class="dialog" value="&cellSelectionNext.label;" oncommand="SelectNext()"/>
</row>
</rows>
</grid>
<spring flex="1"/>
</titledbox>
<!-- cell size titledbox -->
<titledbox><title><text align="left" value="&size.label;"/></title>
<box orient="vertical">
<box valign="baseline" autostretch="never">
<text class="MinWidth50" align="left" for="CellHeightInput" value="&tableHeight.label;"/>
<textfield class="narrow" id="CellHeightInput" onkeyup="forceInteger(this.id)"/>
<menulist id="CellHeightUnits"/>
</box>
<spring class="spacer"/>
<box valign="baseline" autostretch="never">
<text class="MinWidth50" align="left" for="CellWidthInput" value="&tableWidth.label;"/>
<textfield class="narrow" id="CellWidthInput" onkeyup="forceInteger(this.id)"/>
<menulist id="CellWidthUnits"/>
</box>
</box>
<grid>
<columns><column/><column/><column/></columns>
<rows>
<row valign="middle" autostretch="never">
<checkbox id="CellHeightCheckbox" value="&tableHeight.label;"/>
<textfield class="narrow" id="CellHeightInput" onkeyup="ChangeIntTextfield(this.id,'CellHeightCheckbox');"/>
<menulist id="CellHeightUnits" oncommand="SetCheckbox('CellHeightCheckbox');"/>
</row>
<row valign="middle" autostretch="never">
<checkbox id="CellWidthCheckbox" value="&tableWidth.label;"/>
<textfield class="narrow" id="CellWidthInput" onkeyup="ChangeIntTextfield(this.id,'CellWidthCheckbox');"/>
<menulist id="CellWidthUnits" oncommand="SetCheckbox('CellWidthCheckbox');"/>
</row>
</rows>
</grid>
<spring class="bigspacer"/>
<box orient="vertical">
<spring class="spacer"/>
<text for="RowSpanInput" value="&cellSpans.label;"/>
</box>
<box orient="vertical">
<box valign="baseline" autostretch="never">
<textfield class="narrow" id="RowSpanInput" onkeyup="forceInteger(this.id)"/>
<text align="left" value="&cellSpanRows.label;"/>
</box>
<spring class="spacer"/>
<box valign="baseline" autostretch="never">
<textfield class="narrow" id="ColSpanInput" onkeyup="forceInteger(this.id)"/>
<text align="left" value="&cellSpanCols.label;"/>
</box>
</box>
<grid>
<columns><column/><column/><column/></columns>
<rows>
<row valign="middle" autostretch="never">
<checkbox id="SpanCheckbox" value="&cellSpans.label;"/>
<textfield class="narrow" id="RowSpanInput" onkeyup="ChangeIntTextfield(this.id,'SpanCheckbox');"/>
<text align="left" value="&cellSpanRows.label;"/>
</row>
<row valign="middle" autostretch="never">
<spring/>
<textfield class="narrow" id="ColSpanInput" onkeyup="ChangeIntTextfield(this.id,'ColSpanInput');"/>
<text align="left" value="&cellSpanCols.label;"/>
</row>
</rows>
</grid>
</titledbox>
<box>
<box><!-- Alignment and style -->
<titledbox orient="vertical" flex="1">
<title><text align="left" value="&cellContentAlignment.label;"/></title>
<box valign="top" autostretch="never">
<text class="MinWidth70" align="right" for="CellHAlignSelect" value="&cellHorizontal.label;"/>
<menulist class="MinWidth100" id="CellHAlignSelect">
<menupopup oncommand="SelectCellHAlign()">
<menuitem value="&AlignLeft.label;" data="left"/>
<menuitem value="&AlignCenter.label;" data="center"/>
<menuitem value="&AlignRight.label;" data="right"/>
<menuitem value="&cellAlignJustify.label;" data="justify"/>
<menuitem value="&cellAlignAtChar.label;" data="char"/>
</menupopup>
</menulist>
<spring class="spacer"/>
<html:input style="width: 1em" id="CellAlignCharInput" maxlength="2" visibility="hidden"/>
</box>
<spring class="spacer"/>
<box valign="top" autostretch="never">
<text class="MinWidth70" align="right" for="CellVAlignSelect" value="&cellVertical.label;"/>
<menulist class="MinWidth100" id="CellVAlignSelect">
<menupopup>
<menuitem value="&cellAlignTop.label;" data="top"/>
<menuitem value="&cellAlignMiddle.label;" data="middle"/>
<menuitem value="&cellAlignBottom.label;" data="bottom"/>
</menupopup>
</menulist>
</box>
<grid>
<columns><column/><column/><column/></columns>
<rows>
<row valign="middle" autostretch="never">
<checkbox id="CellHAlignCheckbox" value="&cellHorizontal.label;"/>
<menulist id="CellHAlignList" oncommand="SelectCellHAlign('CellHAlignCheckbox')">
<menupopup>
<menuitem value="&AlignLeft.label;" data="left"/>
<menuitem value="&AlignCenter.label;" data="center"/>
<menuitem value="&AlignRight.label;" data="right"/>
<menuitem value="&cellAlignJustify.label;" data="justify"/>
<menuitem value="&cellAlignAtChar.label;" data="char"/>
</menupopup>
</menulist>
<textfield id="CellAlignCharInput" maxlength="2" style="width: 1em" visibility="hidden"/>
</row>
<row valign="middle" autostretch="never">
<checkbox id="CellVAlignCheckbox" value="&cellVertical.label;"/>
<menulist id="CellVAlignList" oncommand="SetCheckbox('CellVAlignCheckbox');">
<menupopup>
<menuitem value="&cellAlignTop.label;" data="top"/>
<menuitem value="&cellAlignMiddle.label;" data="middle"/>
<menuitem value="&cellAlignBottom.label;" data="bottom"/>
</menupopup>
</menulist>
<spring/>
</row>
</rows>
</grid>
</titledbox>
<spring class="spacer"/>
<titledbox orient="vertical">
<title><text align="left" value="&cellTextStyle.label;"/></title>
<box valign="baseline" autostretch="never">
<html:input type="checkbox" id="HeaderCheck"/>
<text align="left" for="HeaderCheck" value="&cellHeader.label;"/>
</box>
<box valign="baseline" autostretch="never">
<html:input type="checkbox" id="NoWrapCheck"/>
<text align="left" for="NoWrapCheck" value="&cellNoWrap.label;"/>
</box>
</titledbox>
</box>
<box orient="vertical">
<checkbox id="CellStyleCheckbox" value="&cellStyle.label;"/>
<menulist id="CellStyleList" >
<menupopup>
<menuitem value="&cellNormal.label;" data="td"/>
<menuitem value="&cellHeader.label;" data="th"/>
</menupopup>
</menulist>
<spring class="spacer"/>
<checkbox id="TextWrapCheckbox" value="&cellTextWrap.label;"/>
<menulist id="TextWrapList" oncommand="SetCheckbox('TextWrapCheckbox');">
<menupopup>
<menuitem value="&cellWrap.label;" data="wrap"/>
<menuitem value="&cellNoWrap.label;" data="nowrap"/>
</menupopup>
</menulist>
</box>
</box><!-- Alignment and Style -->
<titledbox orient="vertical"><title><text align="left" value="&background.label;"/></title>
<box valign="baseline" autostretch="never">
<text class="MinWidth50" align="left" value="&color.label;"/>
<menu class="colorpicker">
<box>
<spring id="cellBackgroundCW" class="color-well"/>
<image class="popup-trigger"/>
<grid>
<columns><column/><column/></columns>
<rows>
<row valign="middle" autostretch="never">
<checkbox id="CellColorCheckbox" value="&color.label;"/>
<box valign="middle">
<menu class="colorpicker">
<box>
<spring id="cellBackgroundCW" class="color-well"/>
<image class="popup-trigger"/>
</box>
<menupopup>
<colorpicker id="cellBackgroundCP" palettename="standard"
onclick="GetColorAndUpdate('cellBackgroundCP','cellBackgroundCW',this)"/>
<button class="dialog" value="&defaultColor.label;"
oncommand="GetColorAndUpdate('cellBackgroundCP','cellBackgroundCW',this)"/>
</menupopup>
</menu>
<spring class="spacer"/>
<text class="label" id="CellInheritColor" value="&cellInheritColor.label;" hidden="true"/>
</box>
<menupopup>
<colorpicker id="cellBackgroundCP" palettename="standard"
onclick="GetColorAndUpdate('cellBackgroundCP','cellBackgroundCW',this)"/>
<button class="dialog" value="&defaultColor.label;"
oncommand="GetColorAndUpdate('cellBackgroundCP','cellBackgroundCW',this)"/>
</menupopup>
</menu>
<spring class="spacer"/>
<text id="CellInheritColor" value="&cellInheritColor.label;" hidden="true"/>
</box>
<spring class="spacer"/>
<box valign="baseline" autostretch="never">
<text class="MinWidth50" align="left" for="CellImageInput" value="&image.label;" />
<textfield id="CellImageInput" flex="1"/>
<button class="dialog" value="&ChooseImage.label;" id="CellImageButton" oncommand="ChooseCellImage()"/>
</box>
<!-- Not sure if we will support this
<box valign="baseline" autostretch="never">
<spring class="MinWidth50"/>
<html:input type="checkbox" id="CellLeaveLocCheck"/>
<text align="left" for="CellLeaveLocCheck" value="&LeaveImageAtLocation.label;"/>
</box>
-->
</titledbox>
</row>
<row valign="middle" autostretch="never">
<checkbox id="CellImageCheckbox" value="&image.label;" />
<textfield id="CellImageInput" flex="1"/>
<button class="dialog" value="&ChooseImage.label;" id="CellImageButton" oncommand="ChooseCellImage()"/>
</row>
</rows>
</grid>
</titledbox><!-- Table Background -->
<spring class="spacer"/>
<box autostretch="never">
<spring flex="1"/>
<html class="wrap" flex="1" style="width: 1em">&cellUseCheckboxHelp.label;</html>
<!-- From EdDialogOvlerlay.xul -->
<button class="dialog" id="AdvancedEditButton2"/>
</box>
</box>
</tabpanel>
<spring class="spacer"/>
<!-- from EdDialogOverlay -->
<box>
<spring flex="1"/>
<button class="dialog" value="Apply"/>
<button class="dialog" value="Apply" oncommand="Apply();"/>
<box id="okCancelButtons"/>
</box>
</tabcontrol>

View File

@@ -36,6 +36,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
onload = "Startup()"
persist="screenX screenY"
orient="vertical">
<!-- Methods common to all editor dialogs -->

View File

@@ -28,7 +28,7 @@
<!ENTITY tableHeight.label "Height:">
<!ENTITY tableWidth.label "Width:">
<!ENTITY tableBorderSpacing.label "Borders and Spacing">
<!ENTITY tableBorderWidth.label "Border width:">
<!ENTITY tableBorderWidth.label "Border:">
<!ENTITY tableSpacing.label "Spacing:">
<!ENTITY tablePadding.label "Padding:">
<!ENTITY tablePxBetwCells.label "pixels between cells">
@@ -40,6 +40,8 @@
<!ENTITY tableCaptionBelow.label "Below Table">
<!ENTITY tableCaptionNone.label "None">
<!ENTITY tableInheritColor.label "(Let page color show through)">
<!-- Don't translate <html:br/> -->
<!ENTITY tableUseCheckboxHelp.label "Use checkboxes to control which properties<html:br/>are applied to the table">
<!ENTITY cellPercent.label "percent of table">
<!ENTITY cellSelection.label "Selection">
@@ -52,9 +54,12 @@
<!ENTITY cellContentAlignment.label "Content Alignment">
<!ENTITY cellHorizontal.label "Horizontal:">
<!ENTITY cellVertical.label "Vertical:">
<!ENTITY cellTextStyle.label "Text Style">
<!ENTITY cellStyle.label "Cell Style:">
<!ENTITY cellNormal.label "Normal">
<!ENTITY cellHeader.label "Header">
<!ENTITY cellNoWrap.label "Don't wrap text">
<!ENTITY cellTextWrap.label "Text Wrap:">
<!ENTITY cellWrap.label "Wrap">
<!ENTITY cellNoWrap.label "Don't wrap">
<!ENTITY cellAlignTop.label "Top">
<!ENTITY cellAlignMiddle.label "Middle">
<!ENTITY cellAlignBottom.label "Bottom">
@@ -63,6 +68,8 @@
<!ENTITY cellSpanRows.label "rows">
<!ENTITY cellSpanCols.label "columns">
<!ENTITY cellInheritColor.label "(Let table color show through)">
<!-- Don't translate <html:br/> -->
<!ENTITY cellUseCheckboxHelp.label "Use checkboxes to control which properties<html:br/>are applied to all selected cells">
<!-- Used in both Table and Cell panels -->
<!ENTITY defaultColor.label "Don't specify color">