From 5b42cf3b3eea28e75b75b15f040408ef971e94c8 Mon Sep 17 00:00:00 2001 From: "cmanske%netscape.com" Date: Thu, 22 Jun 2000 03:13:08 +0000 Subject: [PATCH] Changes to usage for lists to conform to new XUL requiring . b=30511, r=bryner. Table editing xul/js work for bug 20973, r=jfrancis git-svn-id: svn://10.0.0.236/trunk@72872 18797224-902f-48f8-a5cc-f745e15eee43 --- .../ui/dialogs/content/EdAdvancedEdit.xul | 24 +- .../ui/dialogs/content/EdDialogCommon.js | 35 +- .../ui/dialogs/content/EdDictionary.xul | 4 +- .../editor/ui/dialogs/content/EdLinkProps.xul | 8 +- .../editor/ui/dialogs/content/EdSpellCheck.js | 1 + .../ui/dialogs/content/EdSpellCheck.xul | 4 +- .../editor/ui/dialogs/content/EdTableProps.js | 530 +++++++++++++----- .../ui/dialogs/content/EdTableProps.xul | 70 ++- .../dialogs/content/EditorSaveAsCharset.xul | 4 +- .../locale/en-US/EditorTableProperties.dtd | 17 +- 10 files changed, 502 insertions(+), 195 deletions(-) diff --git a/mozilla/editor/ui/dialogs/content/EdAdvancedEdit.xul b/mozilla/editor/ui/dialogs/content/EdAdvancedEdit.xul index 21339f6b806..c8a79874521 100644 --- a/mozilla/editor/ui/dialogs/content/EdAdvancedEdit.xul +++ b/mozilla/editor/ui/dialogs/content/EdAdvancedEdit.xul @@ -87,15 +87,17 @@ class="AttributesTree inset" flex="1" context="attlistPopup"> - - + + + + - + @@ -116,15 +118,17 @@ - - + + + + - + @@ -145,15 +149,17 @@ - - + + + + - + diff --git a/mozilla/editor/ui/dialogs/content/EdDialogCommon.js b/mozilla/editor/ui/dialogs/content/EdDialogCommon.js index 1a39d24bc64..e7d73fbc99a 100644 --- a/mozilla/editor/ui/dialogs/content/EdDialogCommon.js +++ b/mozilla/editor/ui/dialogs/content/EdDialogCommon.js @@ -318,7 +318,7 @@ function InitPixelOrPercentMenulist(elementForAtt, elementInDoc, attribute, menu ClearMenulist(menulist); pixelItem = AppendStringToMenulist(menulist, GetString("Pixels")); percentItem = AppendStringToMenulist(menulist, GetAppropriatePercentString(elementForAtt, elementInDoc)); - +//dump("**** InitPixelOrPercentMenulist: pixelItem="+pixelItem+", percentItem="+percentItem+", menulistID="+menulistID+"\n"); // Search for a "%" character percentIndex = size.search(/%/); if (percentIndex > 0) @@ -411,6 +411,7 @@ function ClearMenulist(menulist) /* These help using a for simple lists Assumes this simple structure: + @@ -424,14 +425,23 @@ function AppendStringToTreelistById(tree, stringID) function AppendStringToTreelist(tree, string) { +dump("AppendStringToTreelist: string="+string+"\n"); if (tree) { - var treechildren = tree.firstChild; + var treecols = tree.firstChild; + if (!treecols) + { + dump("Bad XUL: Must have as first child\n"); + } + var treechildren = treecols.nextSibling; if (!treechildren) { treechildren = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "treechildren"); if (treechildren) + { + treechildren.setAttribute("flex","1"); tree.appendChild(treechildren); + } else { dump("Failed to create \n"); @@ -461,9 +471,17 @@ function ClearTreelist(tree) if (tree) { tree.clearItemSelection(); - while (tree.firstChild) - tree.removeChild(tree.firstChild); - + // Skip over the first child + if (tree.firstChild) + { + nextChild = tree.firstChild.nextSibling; + while (nextChild) + { + var nextTmp = nextChild.nextSibling; + tree.removeChild(nextChild); + nextChild = nextTmp; + } + } // Count list items tree.setAttribute("length", 0); } @@ -471,8 +489,13 @@ function ClearTreelist(tree) function GetSelectedTreelistAttribute(tree, attr) { - if (tree) + if (tree && tree.selectedItems && + tree.selectedItems[0] && + tree.selectedItems[0].firstChild && + tree.selectedItems[0].firstChild.firstChild) + { return tree.selectedItems[0].firstChild.firstChild.getAttribute(attr); + } return ""; } diff --git a/mozilla/editor/ui/dialogs/content/EdDictionary.xul b/mozilla/editor/ui/dialogs/content/EdDictionary.xul index 25a1da24fdd..efd181c04cc 100644 --- a/mozilla/editor/ui/dialogs/content/EdDictionary.xul +++ b/mozilla/editor/ui/dialogs/content/EdDictionary.xul @@ -52,7 +52,9 @@ - + + +