diff --git a/mozilla/editor/ui/dialogs/content/EdColorProps.js b/mozilla/editor/ui/dialogs/content/EdColorProps.js
index ab3ea7d821c..96862528c6a 100644
--- a/mozilla/editor/ui/dialogs/content/EdColorProps.js
+++ b/mozilla/editor/ui/dialogs/content/EdColorProps.js
@@ -63,8 +63,8 @@ var vlinkStr = "vlink";
var alinkStr = "alink";
var bgcolorStr = "bgcolor";
var backgroundStr = "background";
-var colorStyle = "color:";
-var backImageStyle = " background-image:";
+var colorStyle = "color: ";
+var backImageStyle = " background-image: url(";
// dialog initialization code
function Startup()
@@ -218,9 +218,8 @@ function SetColor(ColorWellID, color)
// Must combine background color and image style values
styleValue = colorStyle+color;
if (dialog.backgroundImage > 0)
- {
- styleValue += ";"+backImageStyle+backImageStyle+";";
- }
+ styleValue += ";"+backImageStyle+backImageStyle+");";
+
dialog.ColorPreview.setAttribute(styleStr,styleValue);
break;
}
@@ -277,7 +276,7 @@ function onBackgroundImageCheckbox()
if (dialog.BackgroundImageCheckbox.checked && ValidateImage())
{
// Append image style
- styleValue += backImageStyle+dialog.BackgroundImage+";";
+ styleValue += backImageStyle+dialog.BackgroundImage+");";
}
dump(styleValue+"=style value when setting image\n")
// Set style on preview (removes image if not checked or not valid)
diff --git a/mozilla/editor/ui/dialogs/content/EdColorProps.xul b/mozilla/editor/ui/dialogs/content/EdColorProps.xul
index bfc97ec5ae7..131909248cf 100644
--- a/mozilla/editor/ui/dialogs/content/EdColorProps.xul
+++ b/mozilla/editor/ui/dialogs/content/EdColorProps.xul
@@ -42,92 +42,85 @@
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
diff --git a/mozilla/editor/ui/dialogs/content/EdDialogCommon.js b/mozilla/editor/ui/dialogs/content/EdDialogCommon.js
index afc90a7abf2..5c5222dd327 100644
--- a/mozilla/editor/ui/dialogs/content/EdDialogCommon.js
+++ b/mozilla/editor/ui/dialogs/content/EdDialogCommon.js
@@ -95,7 +95,7 @@ function ReplaceStringInList(list, index, string)
}
// THESE WILL BE REMOVE ONCE ALL DIALOGS ARE CONVERTED TO NEW WIDGETS
-function AppendStringToListByID(list, stringID)
+function AppendStringToListById(list, stringID)
{
AppendStringToList(list, editorShell.GetString(stringID));
}
@@ -215,7 +215,7 @@ function PrepareStringForURL(string)
// this function takes an elementID and a flag
// if the element can be found by ID, then it is either enabled (by removing "disabled" attr)
// or disabled (setAttribute) as specified in the "doEnable" parameter
-function SetElementEnabledByID( elementID, doEnable )
+function SetElementEnabledById( elementID, doEnable )
{
element = document.getElementById(elementID);
if ( element )
@@ -231,7 +231,7 @@ function SetElementEnabledByID( elementID, doEnable )
}
else
{
- dump("Element "+elementID+" not found in SetElementEnabledByID\n");
+ dump("Element "+elementID+" not found in SetElementEnabledById\n");
}
}
@@ -241,7 +241,7 @@ function SetElementEnabledByID( elementID, doEnable )
// The class is set to either "enabled" or "disabled" depending on the flag passed in.
// This function relies on css having a special appearance for these two classes.
-function SetClassEnabledByID( elementID, doEnable )
+function SetClassEnabledById( elementID, doEnable )
{
element = document.getElementById(elementID);
if ( element )
@@ -310,7 +310,7 @@ function InitPixelOrPercentMenulist(elementForAtt, elementInDoc, attribute, menu
return size;
}
-function AppendStringToMenulistByID(menulist, stringID)
+function AppendStringToMenulistById(menulist, stringID)
{
return AppendStringToMenulist(menulist, editorShell.GetString(stringID));
}
@@ -366,7 +366,7 @@ dump(menulist+"=menulist in ClearMenulist\n");
*/
-function AppendStringToTreelistByID(tree, stringID)
+function AppendStringToTreelistById(tree, stringID)
{
return AppendStringToTreelist(tree, editorShell.GetString(stringID));
}
@@ -393,10 +393,13 @@ dump("Failed to create \n");
if (treeitem && treerow && treecell)
{
treerow.appendChild(treecell);
- treeeitem.appendChild(treerow);
+ treeitem.appendChild(treerow);
treechildren.appendChild(treeitem)
treecell.setAttribute("value", string);
- return menuItem;
+ var len = Number(tree.getAttribute("length"));
+ if (!len) len = -1;
+ tree.setAttribute("length",len+1);
+ return treeitem;
}
}
return null;
@@ -405,8 +408,13 @@ dump("Failed to create \n");
function ClearTreelist(tree)
{
if (tree)
+ {
while (tree.firstChild)
tree.removeChild(tree.firstChild);
+
+ // Count list items
+ tree.setAttribute("length", 0);
+ }
}
function GetSelectedTreelistValue(tree)
@@ -620,6 +628,7 @@ function InitMoreFewer()
// attribute on the dialog.MoreFewerButton button
// onMoreFewer will toggle it and redraw the dialog
SeeMore = (dialog.MoreFewerButton.getAttribute("more") != "1");
+dump(SeeMore+"=SeeMore - InitMoreFewer\n");
onMoreFewer();
}
@@ -628,6 +637,8 @@ function onMoreFewer()
if (SeeMore)
{
dialog.MoreSection.setAttribute("style","display: none");
+ //TODO: Bugs in box layout prevent us from using this:
+ //dialog.MoreSection.setAttribute("style","visibility: collapse");
window.sizeToContent();
dialog.MoreFewerButton.setAttribute("more","0");
dialog.MoreFewerButton.setAttribute("value",GetString("MoreProperties"));
@@ -636,6 +647,7 @@ function onMoreFewer()
else
{
dialog.MoreSection.setAttribute("style","display: inherit");
+ //dialog.MoreSection.setAttribute("style","visibility: inherit");
window.sizeToContent();
dialog.MoreFewerButton.setAttribute("more","1");
dialog.MoreFewerButton.setAttribute("value",GetString("FewerProperties"));
diff --git a/mozilla/editor/ui/dialogs/content/EdHLineProps.xul b/mozilla/editor/ui/dialogs/content/EdHLineProps.xul
index b9b2d71ce40..9a4e4555833 100644
--- a/mozilla/editor/ui/dialogs/content/EdHLineProps.xul
+++ b/mozilla/editor/ui/dialogs/content/EdHLineProps.xul
@@ -43,18 +43,18 @@
-
+
-
-
-
+
+
+
-
-
+
+
diff --git a/mozilla/editor/ui/dialogs/content/EdImageProps.js b/mozilla/editor/ui/dialogs/content/EdImageProps.js
index 466b9db2425..3edfe410dd2 100644
--- a/mozilla/editor/ui/dialogs/content/EdImageProps.js
+++ b/mozilla/editor/ui/dialogs/content/EdImageProps.js
@@ -268,6 +268,8 @@ function onMoreFewerImage()
SetGlobalElementToCurrentDialogSettings();
dialog.MoreSection.setAttribute("style","display: none");
+ //TODO: Bugs in box layout prevent us from using this:
+ //dialog.MoreSection.setAttribute("style","visibility: collapse");
// Show the "Advanced Edit" button on same line as "More Properties"
dialog.AdvancedEditButton2.setAttribute("style","display: inherit");
window.sizeToContent();
@@ -278,6 +280,7 @@ function onMoreFewerImage()
else
{
dialog.MoreSection.setAttribute("style","display: inherit");
+ //dialog.MoreSection.setAttribute("style","visibility: inherit");
// Hide the "Advanced Edit" next to "More..." Use button at bottom right of dialog
dialog.AdvancedEditButton2.setAttribute("style","display: none");
window.sizeToContent();
@@ -309,18 +312,18 @@ function doDimensionEnabling( doEnable )
// Enabled only if "Custom" is checked
var enable = (doEnable && dialog.customsizeRadio.checked);
- SetElementEnabledByID( "widthInput", enable );
- SetElementEnabledByID( "widthLabel", enable);
- SetElementEnabledByID( "widthUnitsMenulist", enable );
+ SetElementEnabledById( "widthInput", enable );
+ SetElementEnabledById( "widthLabel", enable);
+ SetElementEnabledById( "widthUnitsMenulist", enable );
- SetElementEnabledByID( "heightInput", enable );
- SetElementEnabledByID( "heightLabel", enable );
- SetElementEnabledByID( "heightUnitsMenulist", enable );
+ SetElementEnabledById( "heightInput", enable );
+ SetElementEnabledById( "heightLabel", enable );
+ SetElementEnabledById( "heightUnitsMenulist", enable );
var constrainEnable = enable
&& ( dialog.widthUnitsMenulist.selectedIndex == 0 )
&& ( dialog.heightUnitsMenulist.selectedIndex == 0 );
- SetElementEnabledByID( "constrainCheckbox", constrainEnable );
+ SetElementEnabledById( "constrainCheckbox", constrainEnable );
}
function doOverallEnabling()
@@ -331,37 +334,37 @@ function doOverallEnabling()
wasEnableAll = canEnableAll;
- SetElementEnabledByID("ok", canEnableAll );
- SetElementEnabledByID( "altTextLabel", canEnableAll );
+ SetElementEnabledById("ok", canEnableAll );
+ SetElementEnabledById( "altTextLabel", canEnableAll );
// Do widgets for sizing
- SetElementEnabledByID( "dimensionsLabel", canEnableAll );
+ SetElementEnabledById( "dimensionsLabel", canEnableAll );
doDimensionEnabling( canEnableAll );
- SetElementEnabledByID("alignLabel", canEnableAll );
- SetElementEnabledByID("alignTypeSelect", canEnableAll );
+ SetElementEnabledById("alignLabel", canEnableAll );
+ SetElementEnabledById("alignTypeSelect", canEnableAll );
// spacing Box
- SetElementEnabledByID( "spacingLabel", canEnableAll );
- SetElementEnabledByID( "imageleftrightInput", canEnableAll );
- SetElementEnabledByID( "leftrightLabel", canEnableAll );
- SetElementEnabledByID( "leftrighttypeLabel", canEnableAll );
+ SetElementEnabledById( "spacingLabel", canEnableAll );
+ SetElementEnabledById( "imageleftrightInput", canEnableAll );
+ SetElementEnabledById( "leftrightLabel", canEnableAll );
+ SetElementEnabledById( "leftrighttypeLabel", canEnableAll );
- SetElementEnabledByID( "imagetopbottomInput", canEnableAll );
- SetElementEnabledByID( "topbottomLabel", canEnableAll );
- SetElementEnabledByID( "topbottomtypeLabel", canEnableAll );
+ SetElementEnabledById( "imagetopbottomInput", canEnableAll );
+ SetElementEnabledById( "topbottomLabel", canEnableAll );
+ SetElementEnabledById( "topbottomtypeLabel", canEnableAll );
- SetElementEnabledByID( "border", canEnableAll );
- SetElementEnabledByID( "borderLabel", canEnableAll );
- SetElementEnabledByID( "bordertypeLabel", canEnableAll );
+ SetElementEnabledById( "border", canEnableAll );
+ SetElementEnabledById( "borderLabel", canEnableAll );
+ SetElementEnabledById( "bordertypeLabel", canEnableAll );
// This shouldn't find button, but it does!
- SetElementEnabledByID( "AdvancedEditButton2", canEnableAll );
- SetElementEnabledByID( "AdvancedEditButton3", canEnableAll );
+ SetElementEnabledById( "AdvancedEditButton2", canEnableAll );
+ SetElementEnabledById( "AdvancedEditButton3", canEnableAll );
- SetElementEnabledByID( "editImageMap", canEnableAll );
+ SetElementEnabledById( "editImageMap", canEnableAll );
// TODO: ADD APPROPRIATE DISABLING BASED ON EXISTENCE OF IMAGE MAP
- SetElementEnabledByID( "removeImageMap", canEnableAll && canRemoveImageMap);
+ SetElementEnabledById( "removeImageMap", canEnableAll && canRemoveImageMap);
}
// constrainProportions contribution by pete@postpagan.com
diff --git a/mozilla/editor/ui/dialogs/content/EdImageProps.xul b/mozilla/editor/ui/dialogs/content/EdImageProps.xul
index 0c12452b230..e90f531874d 100644
--- a/mozilla/editor/ui/dialogs/content/EdImageProps.xul
+++ b/mozilla/editor/ui/dialogs/content/EdImageProps.xul
@@ -49,259 +49,207 @@
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
+ id = "srcInput"
+ class = "MinWidth20em"
+ onkeyup = "doOverallEnabling()"
+ onmouseup = "doOverallEnabling()"
+ onchange = "doOverallEnabling()" />
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ id ="altTextInput"
+ class = "MinWidth20em"
+ onchange = "doOverallEnabling()"/>
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/editor/ui/dialogs/content/EdInsSrc.js b/mozilla/editor/ui/dialogs/content/EdInsSrc.js
index 64668730d62..497a20cabcb 100644
--- a/mozilla/editor/ui/dialogs/content/EdInsSrc.js
+++ b/mozilla/editor/ui/dialogs/content/EdInsSrc.js
@@ -21,8 +21,7 @@
*/
/* Insert Source HTML dialog */
-
-var dialog;
+var srcInput;
// dialog initialization code
function Startup()
@@ -33,32 +32,21 @@ function Startup()
doSetOKCancel(onOK, null);
// Create dialog object to store controls for easy access
- dialog = new Object;
- dialog.srcInput = document.getElementById("srcInput");
-
- // Kinda clunky: Message was wrapped in a
,
- // so actual message is a child text node
- dialog.srcMessage = (document.getElementById("srcMessage")).firstChild;
-
- if (null == dialog.srcInput ||
- null == dialog.srcMessage )
- {
- dump("Not all dialog controls were found!!!\n");
- }
+ srcInput = document.getElementById("srcInput");
selection = editorShell.GetContentsAs("text/html", 35);
selection = (selection.replace(/
]*>/,"")).replace(/<\/body>/,"");
if (selection != "")
- dialog.srcInput.value = selection;
+ srcInput.value = selection;
// Set initial focus
- dialog.srcInput.focus();
+ srcInput.focus();
}
function onOK()
{
- if (dialog.srcInput.value != "")
- editorShell.InsertSource(dialog.srcInput.value);
+ if (srcInput.value != "")
+ editorShell.InsertSource(srcInput.value);
else {
dump("Null value -- not inserting\n");
return false;
diff --git a/mozilla/editor/ui/dialogs/content/EdInsSrc.xul b/mozilla/editor/ui/dialogs/content/EdInsSrc.xul
index 529ab504049..a1e2d6dced7 100644
--- a/mozilla/editor/ui/dialogs/content/EdInsSrc.xul
+++ b/mozilla/editor/ui/dialogs/content/EdInsSrc.xul
@@ -44,10 +44,16 @@
-
-
+
+
-
+
+
+
+
+
+
+
diff --git a/mozilla/editor/ui/dialogs/content/EdInsertTable.xul b/mozilla/editor/ui/dialogs/content/EdInsertTable.xul
index 1c325bc4293..ddb613e1306 100644
--- a/mozilla/editor/ui/dialogs/content/EdInsertTable.xul
+++ b/mozilla/editor/ui/dialogs/content/EdInsertTable.xul
@@ -48,33 +48,33 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
diff --git a/mozilla/editor/ui/dialogs/content/EdLinkProps.js b/mozilla/editor/ui/dialogs/content/EdLinkProps.js
index 3886b5b3e01..50b9ca2f136 100644
--- a/mozilla/editor/ui/dialogs/content/EdLinkProps.js
+++ b/mozilla/editor/ui/dialogs/content/EdLinkProps.js
@@ -62,11 +62,10 @@ function Startup()
dialog.AdvancedEditSection = document.getElementById("AdvancedEdit");
var selection = editorShell.editorSelection;
- if (selection) {
+ if (selection)
dump("There is a selection: collapsed = "+selection.isCollapsed+"\n");
- } else {
+ else
dump("Failed to get selection\n");
- }
// See if we have a single selected image
imageElement = editorShell.GetSelectedElement("img");
@@ -139,11 +138,10 @@ function Startup()
if (insertLinkAtCaret)
{
- // Note: Use linkTextMessage for normal weight,
- // because linkTextCaption is bold (set in EdDialog.css)
- dialog.linkTextMessage.setAttribute("value",GetString("EnterLinkText"));
- // Hide the other string
- dialog.linkTextCaption.setAttribute("hidden","true");
+ // Titledbox caption:
+ dialog.linkTextCaption.setAttribute("value",GetString("LinkText"));
+ // Message above input field:
+ dialog.linkTextMessage.setAttribute("value", GetString("EnterLinkText"));
}
else
{
@@ -244,20 +242,25 @@ function FillListboxes()
{
var NamedAnchorNodeList = editorShell.editorDocument.anchors;
var NamedAnchorCount = NamedAnchorNodeList.length;
- if (NamedAnchorCount > 0) {
- for (var i = 0; i < NamedAnchorCount; i++) {
- AppendStringToList(dialog.NamedAnchorList,NamedAnchorNodeList.item(i).name);
+ if (NamedAnchorCount > 0)
+ {
+ for (var i = 0; i < NamedAnchorCount; i++)
+ {
+ var item = AppendStringToTreelist(dialog.NamedAnchorList, NamedAnchorNodeList.item(i).name);
+
}
haveNamedAnchors = true;
} else {
// Message to tell user there are none
- AppendStringToList(dialog.NamedAnchorList,GetString("NoNamedAnchors"));
- dialog.NamedAnchorList.setAttribute("disabled", "true");
+ var item = AppendStringToTreelistById(dialog.NamedAnchorList, "NoNamedAnchors");
+ if (item) item.setAttribute("disabled", "true");
}
var firstHeading = true;
- for (var j = 1; j <= 6; j++) {
+ for (var j = 1; j <= 6; j++)
+ {
var headingList = editorShell.editorDocument.getElementsByTagName("h"+String(j));
- if (headingList.length > 0) {
+ if (headingList.length > 0)
+ {
var heading = headingList.item(0);
// Skip headings that already have a named anchor as their first child
@@ -266,23 +269,23 @@ function FillListboxes()
var child = heading.firstChild;
// if( child && child.name )
// dump(child.name+" = Child.name. Length="+child.name.length+"\n");
- if (child && child.nodeName == "A" && child.name && (child.name.length>0)) {
+ if (child && child.nodeName == "A" && child.name && (child.name.length>0))
continue;
- }
var range = editorShell.editorDocument.createRange();
range.setStart(heading,0);
var lastChildIndex = heading.childNodes.length;
range.setEnd(heading,lastChildIndex);
var text = range.toString();
- if (text) {
+ if (text)
+ {
// Use just first 40 characters, don't add "...",
// and replace whitespace with "_" and strip non-word characters
text = PrepareStringForURL(TruncateStringAtWordEnd(text, 40, false));
// Append "_" to any name already in the list
if (GetExistingHeadingIndex(text) > -1)
text += "_";
- AppendStringToList(dialog.HeadingsList, text);
+ AppendStringToTreelist(dialog.HeadingsList, text);
// Save nodes in an array so we can create anchor node under it later
if (!HNodeArray)
@@ -292,18 +295,21 @@ function FillListboxes()
}
}
}
- if (HNodeArray) {
+ if (HNodeArray)
+ {
haveHeadings = true;
} else {
// Message to tell user there are none
- AppendStringToList(dialog.HeadingsList,GetString("NoHeadings"));
- dialog.HeadingsList.setAttribute("disabled", "true");
+ var item = AppendStringToTreelistById(dialog.HeadingsList, "NoHeadings");
+ if (item) item.setAttribute("disabled", "true");
}
}
function GetExistingHeadingIndex(text)
{
- for (var i=0; i < dialog.HeadingsList.length; i++) {
+ var len = dialog.HeadingsList.getAttribute("length");
+ for (var i=0; i < len; i++)
+ {
if (dialog.HeadingsList.options[i].value == text)
return i;
}
@@ -312,16 +318,15 @@ function GetExistingHeadingIndex(text)
function SelectNamedAnchor()
{
- if (haveNamedAnchors) {
- dialog.hrefInput.value = "#"+dialog.NamedAnchorList.options[dialog.NamedAnchorList.selectedIndex].value;
- }
+dump("SelectNamedAnchor\n");
+ if (haveNamedAnchors)
+ dialog.hrefInput.value = "#"+dialog.NamedAnchorList.value;
}
function SelectHeading()
{
- if (haveHeadings) {
- dialog.hrefInput.value = "#"+dialog.HeadingsList.options[dialog.HeadingsList.selectedIndex].value;
- }
+ if (haveHeadings)
+ dialog.hrefInput.value = "#"+dialog.HeadingsList.value;
}
// Get and validate data from widgets.
@@ -329,21 +334,26 @@ function SelectHeading()
function ValidateData()
{
href = dialog.hrefInput.value.trimString();
- if (href.length > 0) {
+ if (href.length > 0)
+ {
// Set the HREF directly on the editor document's anchor node
// or on the newly-created node if insertNew is true
globalElement.setAttribute("href",href);
- } else if (insertNew) {
+ }
+ else if (insertNew)
+ {
// We must have a URL to insert a new link
//NOTE: We accept an empty HREF on existing link to indicate removing the link
ShowInputErrorMessage(GetString("EmptyHREFError"));
return false;
}
- if (dialog.linkTextInput) {
+ if (dialog.linkTextInput)
+ {
// The text we will insert isn't really an attribute,
// but it makes sense to validate it
newLinkText = TrimString(dialog.linkTextInput.value);
- if (newLinkText.length == 0) {
+ if (newLinkText.length == 0)
+ {
ShowInputErrorMessage(GetString("GetInputError"));
dialog.linkTextInput.focus();
return false;
@@ -357,7 +367,8 @@ function onOK()
{
if (ValidateData())
{
- if (href.length > 0) {
+ if (href.length > 0)
+ {
// Copy attributes to element we are changing or inserting
editorShell.CloneAttributes(anchorElement, globalElement);
@@ -365,20 +376,21 @@ function onOK()
editorShell.BeginBatchChanges();
// Get text to use for a new link
- if (insertLinkAtCaret) {
+ if (insertLinkAtCaret)
+ {
// Append the link text as the last child node
// of the anchor node
textNode = editorShell.editorDocument.createTextNode(newLinkText);
- if (textNode) {
+ if (textNode)
anchorElement.appendChild(textNode);
- }
try {
editorShell.InsertElementAtSelection(anchorElement, false);
} catch (e) {
dump("Exception occured in InsertElementAtSelection\n");
return true;
}
- } else if (insertNew) {
+ } else if (insertNew)
+ {
// Link source was supplied by the selection,
// so insert a link node as parent of this
// (may be text, image, or other inline content)
@@ -390,7 +402,8 @@ function onOK()
}
}
// Check if the link was to a heading
- if (href[0] == "#") {
+ if (href[0] == "#")
+ {
var name = href.substr(1);
var index = GetExistingHeadingIndex(name);
if (index >= 0) {
@@ -409,7 +422,9 @@ dump("Anchor node created and inserted under heading\n");
}
}
editorShell.EndBatchChanges();
- } else if (!insertNew) {
+ }
+ else if (!insertNew)
+ {
// We already had a link, but empty HREF means remove it
editorShell.RemoveTextProperty("a", "");
}
diff --git a/mozilla/editor/ui/dialogs/content/EdLinkProps.xul b/mozilla/editor/ui/dialogs/content/EdLinkProps.xul
index a61f01a0d74..07665c97ec7 100644
--- a/mozilla/editor/ui/dialogs/content/EdLinkProps.xul
+++ b/mozilla/editor/ui/dialogs/content/EdLinkProps.xul
@@ -45,16 +45,15 @@
-
-
-
-
+
+
+
+
-
-
-
+
+
-
+
@@ -68,13 +67,12 @@
-
-
+
+
-
-
-
- &HeadingMsg2.label;
+
+
+
diff --git a/mozilla/editor/ui/dialogs/content/EdListProps.js b/mozilla/editor/ui/dialogs/content/EdListProps.js
index 40cee62eb3b..feb34d3efc7 100644
--- a/mozilla/editor/ui/dialogs/content/EdListProps.js
+++ b/mozilla/editor/ui/dialogs/content/EdListProps.js
@@ -92,11 +92,11 @@ function InitDialog()
function BuildBulletStyleList()
{
- ClearList(BulletStyleList);
+ ClearMenulist(BulletStyleList);
var label = "";
var selectedIndex = -1;
- //dump("List Type: "+ListType+" globalElement: "+globalElement+"\n");
+dump("List Type: "+ListType+" globalElement: "+globalElement+"\n");
if (ListType == "ul")
{
@@ -106,9 +106,9 @@ function BuildBulletStyleList()
StartingNumberLabel.setAttribute("disabled", "true");
label = GetString("BulletStyle");
- AppendStringToListByID(BulletStyleList,"SolidCircle");
- AppendStringToListByID(BulletStyleList,"OpenCircle");
- AppendStringToListByID(BulletStyleList,"SolidSquare");
+ AppendStringToMenulistById(BulletStyleList,"SolidCircle");
+ AppendStringToMenulistById(BulletStyleList,"OpenCircle");
+ AppendStringToMenulistById(BulletStyleList,"SolidSquare");
BulletStyleList.selectedIndex = BulletStyleIndex;
ListTypeList.selectedIndex = 1;
@@ -121,11 +121,11 @@ function BuildBulletStyleList()
StartingNumberLabel.removeAttribute("disabled");
label = GetString("NumberStyle");
- AppendStringToListByID(BulletStyleList,"Style_1");
- AppendStringToListByID(BulletStyleList,"Style_I");
- AppendStringToListByID(BulletStyleList,"Style_i");
- AppendStringToListByID(BulletStyleList,"Style_A");
- AppendStringToListByID(BulletStyleList,"Style_a");
+ AppendStringToMenulistById(BulletStyleList,"Style_1");
+ AppendStringToMenulistById(BulletStyleList,"Style_I");
+ AppendStringToMenulistById(BulletStyleList,"Style_i");
+ AppendStringToMenulistById(BulletStyleList,"Style_A");
+ AppendStringToMenulistById(BulletStyleList,"Style_a");
BulletStyleList.selectedIndex = NumberStyleIndex;
ListTypeList.selectedIndex = 2;
@@ -155,6 +155,7 @@ function BuildBulletStyleList()
function SelectListType()
{
+dump(ListTypeList+"ListTypeList\n");
switch (ListTypeList.selectedIndex)
{
case 1:
diff --git a/mozilla/editor/ui/dialogs/content/EdListProps.xul b/mozilla/editor/ui/dialogs/content/EdListProps.xul
index a4529620851..f06471488e7 100644
--- a/mozilla/editor/ui/dialogs/content/EdListProps.xul
+++ b/mozilla/editor/ui/dialogs/content/EdListProps.xul
@@ -42,26 +42,27 @@
-
-
- &none.value;
- &bulletList.value;
- &numberList.value;
- &definitionList.value;
-
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
-
+
diff --git a/mozilla/editor/ui/dialogs/content/EdNamedAnchorProps.xul b/mozilla/editor/ui/dialogs/content/EdNamedAnchorProps.xul
index 0e64ad071cf..52cb29b8319 100644
--- a/mozilla/editor/ui/dialogs/content/EdNamedAnchorProps.xul
+++ b/mozilla/editor/ui/dialogs/content/EdNamedAnchorProps.xul
@@ -43,9 +43,9 @@
-
+
-
+
diff --git a/mozilla/editor/ui/dialogs/content/EdSpellCheck.js b/mozilla/editor/ui/dialogs/content/EdSpellCheck.js
index c5344941a75..ced2b12a9ae 100644
--- a/mozilla/editor/ui/dialogs/content/EdSpellCheck.js
+++ b/mozilla/editor/ui/dialogs/content/EdSpellCheck.js
@@ -51,12 +51,12 @@ function Startup()
dialog.MisspelledWord = document.getElementById("MisspelledWord");
dialog.ReplaceWordInput = document.getElementById("ReplaceWord");
dialog.SuggestedList = document.getElementById("SuggestedList");
- dialog.LanguageList = document.getElementById("LanguageList");
+ dialog.LanguageMenulist = document.getElementById("LanguageMenulist");
if (!dialog.MisspelledWord ||
!dialog.ReplaceWordInput ||
!dialog.SuggestedList ||
- !dialog.LanguageList )
+ !dialog.LanguageMenulist )
{
dump("Not all dialog controls were found!!!\n");
}
@@ -76,8 +76,8 @@ function Startup()
dialog.ReplaceWordInput.value = MisspelledWord;
//Use English for now TODO: Kin needs to finish this work so we can fill in list
- dialog.LanguageList.selectedIndex = 0;
- dump("Language Listed Index = "+dialog.LanguageList.selectedIndex+"\n");
+
+ dump("Language Listed Index = "+dialog.LanguageMenulist.selectedIndex+"\n");
DoEnabling();
@@ -90,31 +90,31 @@ function DoEnabling()
{
dialog.MisspelledWordLabel.setAttribute("value",GetString("CheckSpellingDone"));
- SetElementEnabledByID("MisspelledWord", false);
- SetElementEnabledByID("ReplaceWordLabel", false);
- SetElementEnabledByID("ReplaceWord", false);
- SetElementEnabledByID("CheckWord", false);
- SetElementEnabledByID("SuggestedListLabel", false);
- SetElementEnabledByID("SuggestedList", false);
- SetElementEnabledByID("Ignore", false);
- SetElementEnabledByID("IgnoreAll", false);
- SetElementEnabledByID("Replace", false);
- SetElementEnabledByID("ReplaceAll", false);
- SetElementEnabledByID("AddToDictionary", false);
+ SetElementEnabledById("MisspelledWord", false);
+ SetElementEnabledById("ReplaceWordLabel", false);
+ SetElementEnabledById("ReplaceWord", false);
+ SetElementEnabledById("CheckWord", false);
+ SetElementEnabledById("SuggestedListLabel", false);
+ SetElementEnabledById("SuggestedList", false);
+ SetElementEnabledById("Ignore", false);
+ SetElementEnabledById("IgnoreAll", false);
+ SetElementEnabledById("Replace", false);
+ SetElementEnabledById("ReplaceAll", false);
+ SetElementEnabledById("AddToDictionary", false);
} else {
dialog.MisspelledWordLabel.setAttribute("value",GetString("MisspelledWordLabel"));
- SetElementEnabledByID("MisspelledWord", true);
- SetElementEnabledByID("ReplaceWordLabel", true);
- SetElementEnabledByID("ReplaceWord", true);
- SetElementEnabledByID("CheckWord", true);
- SetElementEnabledByID("SuggestedListLabel", true);
- SetElementEnabledByID("SuggestedList", true);
- SetElementEnabledByID("Ignore", true);
- SetElementEnabledByID("IgnoreAll", true);
- SetElementEnabledByID("Replace", true);
- SetElementEnabledByID("ReplaceAll", true);
- SetElementEnabledByID("AddToDictionary", true);
+ SetElementEnabledById("MisspelledWord", true);
+ SetElementEnabledById("ReplaceWordLabel", true);
+ SetElementEnabledById("ReplaceWord", true);
+ SetElementEnabledById("CheckWord", true);
+ SetElementEnabledById("SuggestedListLabel", true);
+ SetElementEnabledById("SuggestedList", true);
+ SetElementEnabledById("Ignore", true);
+ SetElementEnabledById("IgnoreAll", true);
+ SetElementEnabledById("Replace", true);
+ SetElementEnabledById("ReplaceAll", true);
+ SetElementEnabledById("AddToDictionary", true);
}
}
@@ -152,8 +152,9 @@ function CheckWord()
MisspelledWord = word;
FillSuggestedList();
} else {
- ClearList(dialog.SuggestedList);
- AppendStringToList(dialog.SuggestedList, GetString("CorrectSpelling"));
+ ClearTreelist(dialog.SuggestedList);
+ var item = AppendStringToTreelistById(dialog.SuggestedList, "CorrectSpelling");
+ if (item) item.setAttribute("disabled", "true");
// Suppress being able to select the message text
allowSelectWord = false;
}
@@ -248,21 +249,24 @@ function FillSuggestedList()
list = dialog.SuggestedList;
// Clear the current contents of the list
- ClearList(list);
+ ClearTreelist(list);
+dump(MisspelledWord+"=misspelledword\n");
if (MisspelledWord.length > 0)
{
// Get suggested words until an empty string is returned
do {
word = spellChecker.GetSuggestedWord();
- dump("Suggested Word = "+word+"\n");
- if (word != "") {
- AppendStringToList(list, word);
+ dump("Suggested Word="+word+"|\n");
+ if (word.length > 0) {
+ AppendStringToTreelist(list, word);
}
- } while (word != "");
- if (list.length == 0) {
+ } while (word.length > 0);
+
+ if (list.getAttribute("length") == 0) {
// No suggestions - show a message but don't let user select it
- AppendStringToList(list, GetString("NoSuggestedWords"));
+ var item = AppendStringToTreelistById(list, "NoSuggestedWords");
+ if (item) item.setAttribute("disabled", "true");
allowSelectWord = false;
} else {
allowSelectWord = true;
diff --git a/mozilla/editor/ui/dialogs/content/EdSpellCheck.xul b/mozilla/editor/ui/dialogs/content/EdSpellCheck.xul
index 031bcd0635d..4aa99531b9d 100644
--- a/mozilla/editor/ui/dialogs/content/EdSpellCheck.xul
+++ b/mozilla/editor/ui/dialogs/content/EdSpellCheck.xul
@@ -41,58 +41,60 @@
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- &userDictionary.label;
-
-
-
-
-
-
-
+
+
+
+
+
- &languagePopup.label;
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mozilla/editor/ui/dialogs/content/EdTableProps.xul b/mozilla/editor/ui/dialogs/content/EdTableProps.xul
index 74aa47d5731..944c9b538e3 100644
--- a/mozilla/editor/ui/dialogs/content/EdTableProps.xul
+++ b/mozilla/editor/ui/dialogs/content/EdTableProps.xul
@@ -54,7 +54,7 @@
-
+
@@ -81,10 +81,10 @@
-
+
-
+
@@ -130,7 +130,7 @@
-
+