Fixed problems relating to new XUL 1.0 changes, b=108670, r=timeless, sr=hewitt

This commit is contained in:
cmanske%netscape.com 2001-11-07 05:42:41 +00:00
parent c30f013e2b
commit 5dc5ffad3a
19 changed files with 82 additions and 64 deletions

View File

@ -62,7 +62,7 @@ function BuildHTMLAttributeNameList()
var popup = gDialog.AddHTMLAttributeNameInput.firstChild;
if (popup)
{
var sep = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuseparator");
var sep = document.createElementNS(XUL_NS, "menuseparator");
if (sep)
popup.appendChild(sep);
}
@ -246,7 +246,7 @@ function onInputHTMLAttributeName()
var popup = gDialog.AddHTMLAttributeValueInput.firstChild;
if (popup)
{
var sep = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuseparator");
var sep = document.createElementNS(XUL_NS, "menuseparator");
if (sep)
popup.appendChild(sep);
}

View File

@ -53,7 +53,7 @@ function BuildJSEAttributeNameList()
popup = gDialog.AddJSEAttributeNameList.firstChild;
if (popup)
{
sep = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuseparator");
sep = document.createElementNS(XUL_NS, "menuseparator");
if (sep)
popup.appendChild(sep);
}
@ -68,7 +68,7 @@ function BuildJSEAttributeNameList()
if (!popup)
popup = gDialog.AddJSEAttributeNameList.firstChild;
sep = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuseparator");
sep = document.createElementNS(XUL_NS, "menuseparator");
if (popup && sep)
popup.appendChild(sep);

View File

@ -50,6 +50,7 @@ function Startup()
gDialog.ColorInput = document.getElementById("ColorInput");
gDialog.LastPickedButton = document.getElementById("LastPickedButton");
gDialog.LastPickedColor = document.getElementById("LastPickedColor");
gDialog.CellOrTableGroup = document.getElementById("CellOrTableGroup");
gDialog.TableRadio = document.getElementById("TableRadio");
gDialog.CellRadio = document.getElementById("CellRadio");
gDialog.Ok = document.getElementById("ok");
@ -96,13 +97,13 @@ function Startup()
if (gColorObj.TableColor)
{
gColor = gColorObj.TableColor;
gDialog.TableRadio.checked = true;
gDialog.CellOrTableGroup.selectedItem = gDialog.TableRadio;
gDialog.TableRadio.focus();
}
else
{
gColor = gColorObj.CellColor;
gDialog.CellRadio.checked = true;
gDialog.CellOrTableGroup.selectedItem = gDialog.CellRadio;
gDialog.CellRadio.focus();
}
break;
@ -275,7 +276,7 @@ function onOK()
gColorObj.LastBackgroundColor = gColor;
}
// If table or cell requested, tell caller which element to set on
if (TableOrCell && gDialog.TableRadio.checked)
if (TableOrCell && gDialog.TableRadio.selected)
gColorObj.Type = "Table";
}
SaveWindowLocation();

View File

@ -45,7 +45,7 @@
<keyset id="dialogKeys"/>
<hbox id="TableOrCellGroup" align="center" collapsed="true">
<label value="&background.label;"/>
<radiogroup id="1" orient="horizontal">
<radiogroup id="CellOrTableGroup" orient="horizontal">
<radio id="TableRadio" label="&table.label;"/>
<radio id="CellRadio" label="&cell.label;"/>
</radiogroup>

View File

@ -74,6 +74,7 @@ function Startup()
gDialog.LinkText = document.getElementById("LinkText");
gDialog.ActiveLinkText = document.getElementById("ActiveLinkText");
gDialog.VisitedLinkText = document.getElementById("VisitedLinkText");
gDialog.PageColorGroup = document.getElementById("PageColorGroup");
gDialog.DefaultColorsRadio = document.getElementById("DefaultColorsRadio");
gDialog.CustomColorsRadio = document.getElementById("CustomColorsRadio");
gDialog.BackgroundImageInput = document.getElementById("BackgroundImageInput");
@ -108,10 +109,7 @@ function Startup()
InitDialog();
if (gDialog.DefaultColorsRadio.checked)
gDialog.DefaultColorsRadio.focus();
else
gDialog.CustomColorsRadio.focus();
gDialog.PageColorGroup.focus();
SetWindowLocation();
}
@ -155,12 +153,12 @@ function InitDialog()
if (haveCustomColor)
{
// If any colors are set, then check the "Custom" radio button
gDialog.CustomColorsRadio.checked = true;
gDialog.PageColorGroup.selectedItem = gDialog.CustomColorsRadio;
UseCustomColors();
}
else
{
gDialog.DefaultColorsRadio.checked = true;
gDialog.PageColorGroup.selectedItem = gDialog.DefaultColorsRadio;
UseDefaultColors();
}
}
@ -168,7 +166,7 @@ function InitDialog()
function GetColorAndUpdate(ColorWellID)
{
// Only allow selecting when in custom mode
if (!gDialog.CustomColorsRadio.checked) return;
if (!gDialog.CustomColorsRadio.selected) return;
var colorObj = new Object;
var colorWell = document.getElementById(ColorWellID);
@ -380,7 +378,7 @@ function ValidateAndPreviewImage(ShowErrorMessage)
function ValidateData()
{
// Colors values are updated as they are picked, no validation necessary
if (gDialog.DefaultColorsRadio.checked)
if (gDialog.DefaultColorsRadio.selected)
{
globalElement.removeAttribute(textStr);
globalElement.removeAttribute(linkStr);

View File

@ -47,7 +47,7 @@
<groupbox align="start">
<caption label="&pageColors.label;"/>
<radiogroup id="pageColorGroup">
<radiogroup id="PageColorGroup">
<radio id="DefaultColorsRadio" label="&defaultColorsRadio.label;" oncommand="UseDefaultColors()"
tooltip="aTooltip" tooltiptext="&defaultColorsRadio.tooltip;" />
<radio id="CustomColorsRadio" label="&customColorsRadio.label;" oncommand="UseCustomColors()"

View File

@ -47,13 +47,13 @@ function Startup()
{
case gCommaIndex:
default:
document.getElementById("comma").checked = true;
gDialog.sepRadioGroup.selectedItem = document.getElementById("comma");
break;
case gSpaceIndex:
document.getElementById("space").checked = true;
gDialog.sepRadioGroup.selectedItem = document.getElementById("space");
break;
case gOtherIndex:
document.getElementById("other").checked = true;
gDialog.sepRadioGroup.selectedItem = document.getElementById("other");
break;
}

View File

@ -35,7 +35,8 @@
<window class="dialog" title="&windowTitle.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload = "Startup()"
onunload="onCancel()">
onunload="onCancel()"
style="min-width:20em">
<!-- Methods common to all editor dialogs -->
<script type="application/x-javascript" src="chrome://editor/content/EdDialogCommon.js"/>
@ -46,7 +47,8 @@
<spacer id="location" offsetY="50" persist="offsetX offsetY"/>
<keyset id="dialogKeys"/>
<popupset id="aTooltipSet"/>
<description flex="1">&instructions.label;</description>
<description class="wrap" flex="1">&instructions1.label;</description>
<description class="wrap" flex="1">&instructions2.label;</description>
<radiogroup id="SepRadioGroup" persist="index character" index="0" character="">
<radio id="comma" label="&commaRadio.label;" oncommand="SelectCharacter('0');"/>
<vbox>

View File

@ -29,6 +29,9 @@
var bundle = srGetStrBundle("chrome://global/locale/filepicker.properties");
*/
/**** NAMESPACES ****/
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
// Each editor window must include this file
// Variables shared by all dialogs:
var editorShell;
@ -437,7 +440,6 @@ function GetAppropriatePercentString(elementForAtt, elementInDoc)
return GetString("PercentOfTable");
// Check if element is within a table cell
// Check if current selection anchor node is within a table cell
if (editorShell.GetElementOrParentByTagName("td", elementInDoc))
return GetString("PercentOfCell");
else
@ -498,7 +500,7 @@ function AppendStringToMenulist(menulist, string)
// May not have any popup yet -- so create one
if (!menupopup)
{
menupopup = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menupopup");
menupopup = document.createElementNS(XUL_NS, "menupopup");
if (menupopup)
menulist.appendChild(menupopup);
else
@ -507,7 +509,7 @@ function AppendStringToMenulist(menulist, string)
return null;
}
}
var menuItem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem");
var menuItem = document.createElementNS(XUL_NS, "menuitem");
if (menuItem)
{
menuItem.setAttribute("label", string);
@ -526,7 +528,7 @@ function AppendLabelAndValueToMenulist(menulist, labelStr, valueStr)
// May not have any popup yet -- so create one
if (!menupopup)
{
menupopup = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menupopup");
menupopup = document.createElementNS(XUL_NS, "menupopup");
if (menupopup)
menulist.appendChild(menupopup);
else
@ -535,7 +537,7 @@ function AppendLabelAndValueToMenulist(menulist, labelStr, valueStr)
return null;
}
}
var menuItem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem");
var menuItem = document.createElementNS(XUL_NS, "menuitem");
if (menuItem)
{
menuItem.setAttribute("label", labelStr);
@ -587,7 +589,7 @@ function AppendStringToTreelist(tree, string)
var treechildren = treecols.nextSibling;
if (!treechildren)
{
treechildren = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treechildren");
treechildren = document.createElementNS(XUL_NS, "treechildren");
if (treechildren)
{
treechildren.setAttribute("flex","1");
@ -599,9 +601,9 @@ function AppendStringToTreelist(tree, string)
return null;
}
}
var treeitem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treeitem");
var treerow = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treerow");
var treecell = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treecell");
var treeitem = document.createElementNS(XUL_NS, "treeitem");
var treerow = document.createElementNS(XUL_NS, "treerow");
var treecell = document.createElementNS(XUL_NS, "treecell");
if (treeitem && treerow && treecell)
{
treerow.appendChild(treecell);

View File

@ -46,6 +46,7 @@ function Startup()
gDialog.leftAlign = document.getElementById("leftAlign");
gDialog.centerAlign = document.getElementById("centerAlign");
gDialog.rightAlign = document.getElementById("rightAlign");
gDialog.alignGroup = gDialog.rightAlign.radioGroup;
gDialog.shading = document.getElementById("3dShading");
gDialog.pixelOrPercentMenulist = document.getElementById("pixelOrPercentMenulist");
@ -83,12 +84,24 @@ function InitDialog()
gDialog.widthInput.value = InitPixelOrPercentMenulist(globalElement, hLineElement, "width","pixelOrPercentMenulist");
align = globalElement.getAttribute("align");
if (align)
align = align.toLowerCase();
if (!align)
align = "";
align = align.toLowerCase();
gDialog.centerAlign.checked = (align == "center" || !align);
gDialog.rightAlign.checked = (align == "right");
gDialog.leftAlign.checked = (align == "left");
var selectedRadio = gDialog.centerAlign;
var radioGroup = gDialog.centerAlign.radioGroup
switch (align)
{
case "left":
gDialog.alignGroup.selectedItem = gDialog.leftAlign;
break;
case "right":
gDialog.alignGroup.selectedItem = gDialog.rightAlign;
break;
default:
gDialog.alignGroup.selectedItem = gDialog.centerAlign;
break;
}
// This is tricky! Since the "noshade" attribute doesn't always have a value,
// we can't use getAttribute to figure out if it's set!
@ -170,10 +183,10 @@ function ValidateData()
return false;
align = "left";
if (gDialog.centerAlign.checked) {
if (gDialog.centerAlign.selected) {
// Don't write out default attribute
align = "";
} else if (gDialog.rightAlign.checked) {
} else if (gDialog.rightAlign.selected) {
align = "right";
}
if (align)

View File

@ -71,12 +71,11 @@ function onAccept()
CategoryGroup.setAttribute("category", category);
CategoryGroup.setAttribute("letter_index", indexL);
CategoryGroup.setAttribute("char_index", indexM);
return true;
// Don't close the dialog
return false;
}
// Return true only for modal window
//return true;
// Don't allow inserting in HTML Source Mode
function onFocus()
{
@ -87,10 +86,11 @@ function onFocus()
SetElementEnabledById("ok", enable);
}
function Unload()
function onClose()
{
window.opener.InsertCharWindow = null;
SaveWindowLocation();
return true;
}
//------------------------------------------------------------------
@ -141,24 +141,24 @@ function StartupLatin()
switch (category)
{
case "AccentUpper": // Uppercase Diacritical
AccentUpper.checked = true;
CategoryGroup.selectedItem = AccentUpper;
indexM_AU = indexM;
break;
case "AccentLower": // Lowercase Diacritical
AccentLower.checked = true;
CategoryGroup.selectedItem = AccentLower;
indexM_AL = indexM;
break;
case "Upper": // Uppercase w/o Diacritical
Upper.checked = true;
CategoryGroup.selectedItem = Upper;
indexM_U = indexM;
break;
case "Lower": // Lowercase w/o Diacritical
Lower.checked = true;
CategoryGroup.selectedItem = Lower;
indexM_L = indexM;
break;
default:
category = "Symbol";
Symbol.checked = true;
CategoryGroup.selectedItem = Symbol;
indexM_S = indexM;
break;
}

View File

@ -35,7 +35,7 @@
onload = "Startup()"
onfocus = "onFocus()"
ondialogaccept = "return onAccept();"
ondialogcancel = "return Unload();">
ondialogcancel = "return onClose();">
<!-- Methods common to all editor dialogs -->
<script type="application/x-javascript" src="chrome://editor/content/EdDialogCommon.js"/>

View File

@ -66,9 +66,9 @@ function Startup()
{
// Radio button index is persistant
if (gDialog.RadioGroup.getAttribute("index") == "1")
gDialog.ChangeSelectedRadio.checked = true;
gDialog.RadioGroup.selectedItem = gDialog.ChangeSelectedRadio;
else
gDialog.ChangeAllRadio.checked = true;
gDialog.RadioGroup.selectedItem = gDialog.ChangeAllRadio;
}
InitDialog();
@ -322,12 +322,12 @@ function onOK()
editorShell.BeginBatchChanges();
// Remember which radio button was checked
// Remember which radio button was selected
if (ListElement)
gDialog.RadioGroup.setAttribute("index", gDialog.ChangeAllRadio.checked ? "0" : "1");
gDialog.RadioGroup.setAttribute("index", gDialog.ChangeAllRadio.selected ? "0" : "1");
var changeList;
if (ListElement && gDialog.ChangeAllRadio.checked)
if (ListElement && gDialog.ChangeAllRadio.selected)
{
changeList = true;
}
@ -336,7 +336,7 @@ function onOK()
if (changeList)
{
editorShell.MakeOrChangeList(ListType, gDialog.ChangeAllRadio.checked);
editorShell.MakeOrChangeList(ListType, gDialog.ChangeAllRadio.selected);
if (ListType)
{

View File

@ -68,6 +68,7 @@
</rows>
</grid>
<spacer class="bigspacer"/>
<description class="wrap" flex="1">&EditHEADSource.label;</description>
<label value="&EditHEADSource1.label;"/>
<description class="wrap" flex="1">&EditHEADSource2.label;</description>
<separator class="groove"/>
</dialog>

View File

@ -55,7 +55,7 @@
<!-- TABLE PANEL -->
<vbox id="TablePanel">
<groupbox><caption label="&size.label;"/>
<groupbox orient="horizontal"><caption label="&size.label;"/>
<grid>
<columns><column/><column/></columns>
<rows>
@ -79,6 +79,7 @@
<menulist id="TableWidthUnits"/>
</row>
</rows>
<!-- KEEP GRID LAYOUT here since we will be adding back support for table HEIGHT via CSS -->
</grid>
</groupbox>
<groupbox><caption label="&tableBorderSpacing.label;"/>
@ -143,7 +144,7 @@
<!-- CELL PANEL -->
<vbox id="CellPanel">
<groupbox align="center">
<groupbox orient="horizontal" align="center">
<caption label="&cellSelection.label;"/>
<vbox>
<menulist id="SelectionList" oncommand="ChangeSelection(event.target.value)" flex="1">

View File

@ -23,8 +23,8 @@
<!-- Window title -->
<!ENTITY windowTitle.label "Convert To Table">
<!--LOCALIZATION NOTE Don't translate <html:br/> Place where needed to control linebreaks in message -->
<!ENTITY instructions.label "Composer creates a new table row<html:br/>for each paragraph in the selection.<html:br/><html:br/>Choose the character used<html:br/>to separate the selection into columns:">
<!ENTITY instructions1.label "Composer creates a new table row for each paragraph in the selection.">
<!ENTITY instructions2.label "Choose the character used to separate the selection into columns:">
<!ENTITY commaRadio.label "Comma">
<!ENTITY spaceRadio.label "Space">
<!ENTITY otherRadio.label "Other Character:">

View File

@ -27,7 +27,7 @@
<!ENTITY ListType.label "List Type">
<!ENTITY bulletStyle.label "Bullet Style:">
<!ENTITY startingNumber.label "Start at:">
<!ENTITY startingHelp.label "E.g.: use &quot;2&quot; to start at<html:br/>2, II, ii, B, or b">
<!ENTITY startingHelp.label "E.g.: use &quot;2&quot; to start at 2, II, ii, B, or b">
<!ENTITY none.value "None">
<!ENTITY bulletList.value "Bullet (Unnumbered) List">
<!ENTITY numberList.value "Numbered List">

View File

@ -28,4 +28,5 @@
<!ENTITY authorInput.label "Author:">
<!ENTITY descriptionInput.label "Description:">
<!ENTITY locationNewPage.label "[New page, not saved yet]">
<!ENTITY EditHEADSource.label "Advanced users:<html:br/>To edit other contents of the &lt;head&gt; region, use &quot;HTML Source&quot; in the View Menu or Edit Mode Toolbar.">
<!ENTITY EditHEADSource1.label "Advanced users:">
<!ENTITY EditHEADSource2.label "To edit other contents of the &lt;head&gt; region, use &quot;HTML Source&quot; in the View Menu or Edit Mode Toolbar.">

View File

@ -69,8 +69,7 @@
<!ENTITY cellAlignJustify.label "Justify">
<!ENTITY cellAlignAtChar.label "At Character:">
<!ENTITY cellInheritColor.label "(Let table color show through)">
<!-- Don't translate <html:br/> -->
<!ENTITY cellUseCheckboxHelp.label "Use checkboxes to determine which properties<html:br/>are applied to all selected cells">
<!ENTITY cellUseCheckboxHelp.label "Use checkboxes to determine which properties are applied to all selected cells">
<!-- Used in both Table and Cell panels -->
<!ENTITY size.label "Size">