diff --git a/mozilla/editor/ui/dialogs/content/EdAEHTMLAttributes.js b/mozilla/editor/ui/dialogs/content/EdAEHTMLAttributes.js index 162f1e228a5..07cf39f3fc8 100644 --- a/mozilla/editor/ui/dialogs/content/EdAEHTMLAttributes.js +++ b/mozilla/editor/ui/dialogs/content/EdAEHTMLAttributes.js @@ -121,11 +121,12 @@ function BuildHTMLAttributeTable() TrimString( nodeMap[i].nodeName.toLowerCase() ) == "style" ) { continue; // repeated or non-HTML attribute, ignore this one and go to next } - var name = nodeMap[i].nodeName.toLowerCase(); - var value = gElement.getAttribute ( nodeMap[i].nodeName ); + var name = nodeMap[i].name.toLowerCase(); if ( name.indexOf("_moz") != 0 && - AddTreeItem(name, value, "HTMLAList", HTMLAttrs) ) + AddTreeItem(name, nodeMap[i].value, "HTMLAList", HTMLAttrs) ) + { added = true; + } } if (added) diff --git a/mozilla/editor/ui/dialogs/content/EdConvertToTable.xul b/mozilla/editor/ui/dialogs/content/EdConvertToTable.xul index e4e72c0c89d..a57d2c83b4d 100644 --- a/mozilla/editor/ui/dialogs/content/EdConvertToTable.xul +++ b/mozilla/editor/ui/dialogs/content/EdConvertToTable.xul @@ -51,12 +51,13 @@ &instructions2.label; - - + + + - + diff --git a/mozilla/editor/ui/dialogs/content/EdDialogOverlay.xul b/mozilla/editor/ui/dialogs/content/EdDialogOverlay.xul index ad499b061ae..fb0b4f43112 100644 --- a/mozilla/editor/ui/dialogs/content/EdDialogOverlay.xul +++ b/mozilla/editor/ui/dialogs/content/EdDialogOverlay.xul @@ -77,7 +77,7 @@ &LinkURLEditField.label; - + diff --git a/mozilla/editor/ui/dialogs/content/EditorPublish.js b/mozilla/editor/ui/dialogs/content/EditorPublish.js index 010b01fec48..03e1f971e4a 100644 --- a/mozilla/editor/ui/dialogs/content/EditorPublish.js +++ b/mozilla/editor/ui/dialogs/content/EditorPublish.js @@ -124,9 +124,6 @@ function Startup() gDialog.SiteList.selectedIndex = siteIndex; var docDir = dirObj.value; - // Be sure directory found is part of that site's dir list - AppendDirToSelectedSite(docDir); - // Use the directory within site in the editable menulist gPublishSiteData[siteIndex].docDir = docDir; @@ -175,10 +172,6 @@ function Startup() SetTextboxFocus(gDialog.PageTitleInput); } - //XXX TODO: How do we decide whether or not to save associated files? - // And whether to save in same location as page if yes? - gDialog.OtherDirCheckbox.checked = true; - if (gDialog.SiteList.selectedIndex == -1) { // No selected site -- assume same directory @@ -212,13 +205,11 @@ function FillSiteList() for (i = 0; i < count; i++) { var name = gPublishSiteData[i].siteName; - var menuitem = AppendLabelAndValueToMenulist(gDialog.SiteList, name); - // XXX Bug 131481: Using "max-width" style and "crop" attribute // don't constrain grid width properly, resulting in cut-off buttons - // One workaround is to truncate label strings to prevent this problem - // ...TruncateStringAtWordEnd(name, 20, true), name); - + // We'll truncate label strings to prevent this problem + var menuitem = AppendLabelAndValueToMenulist(gDialog.SiteList, + TruncateStringAtWordEnd(name, 30, true), name); // Highlight the default site if (name == gDefaultSiteName) { @@ -253,6 +244,7 @@ function SelectSiteList() var username = ""; var password = ""; var savePassword = false; + var publishOtherFiles = true; ClearMenulist(gDialog.DocDirList); ClearMenulist(gDialog.OtherDirList); @@ -281,6 +273,8 @@ function SelectSiteList() gDialog.DocDirList.value = FormatDirForPublishing(gPublishSiteData[selectedSiteIndex].docDir); gDialog.OtherDirList.value = FormatDirForPublishing(gPublishSiteData[selectedSiteIndex].otherDir); + publishOtherFiles = gPublishSiteData[selectedSiteIndex].publishOtherFiles; + } else { @@ -294,6 +288,9 @@ function SelectSiteList() gDialog.UsernameInput.value = username; gDialog.PasswordInput.value = password; gDialog.SavePassword.checked = savePassword; + gDialog.OtherDirCheckbox.checked = publishOtherFiles; + + doEnabling(); } function AddNewSite() @@ -349,9 +346,10 @@ function SwitchPanel(panel) gDialog.SettingsTab.selected = null; } gCurrentPanel = panel; - // This is done to show/compensate for bug 131481 - // Dialog is resized to incorrect size, but at least buttons aren't cut off! -// window.sizeToContent(); + + // XXX Another hack to workaround bug 131481 + // Resize dialog to be sure buttons are not cut off the right + window.sizeToContent(); } } @@ -392,29 +390,6 @@ function ChooseDir(menulist) // and build a tree to let user select dir } -function AppendDirToSelectedSite(dir) -{ - var selectedSiteIndex = gDialog.SiteList.selectedIndex; - if (selectedSiteIndex == -1) - return; - - var i; - var dirFound = false; - for (i = 0; i < gPublishSiteData[selectedSiteIndex].dirList.length; i++) - { - dirFound = (dir == gPublishSiteData[selectedSiteIndex].dirList[i]); - if (dirFound) - break; - } - if (!dirFound) - { - // Append dir to end and sort - gPublishSiteData[selectedSiteIndex].dirList[i] = dir; - if (gPublishSiteData[selectedSiteIndex].dirList.length > 1) - gPublishSiteData[selectedSiteIndex].dirList.sort(); - } -} - function ValidateSettings() { var siteName = TrimString(gDialog.SiteNameInput.value); @@ -451,6 +426,7 @@ function ValidateSettings() var username = TrimString(gDialog.UsernameInput.value); var savePassword = gDialog.SavePassword.checked; var password = gDialog.PasswordInput.value; + var publishOtherFiles = gDialog.OtherDirCheckbox.checked; //XXX If there was a username and/or password in the publishUrl // AND in the input field, which do we use? @@ -481,6 +457,7 @@ function ValidateSettings() } else { + // First time: start entire site array gPublishSiteData = new Array(1); siteIndex = 0; gDefaultSiteIndex = 0; @@ -490,6 +467,7 @@ function ValidateSettings() gPublishSiteData[siteIndex].docDir = ""; gPublishSiteData[siteIndex].otherDir = ""; gPublishSiteData[siteIndex].dirList = [""]; + gPublishSiteData[siteIndex].publishOtherFiles = true; newSite = true; } gPublishSiteData[siteIndex].siteName = siteName; @@ -500,6 +478,11 @@ function ValidateSettings() gPublishSiteData[siteIndex].password = savePassword ? password : ""; gPublishSiteData[siteIndex].savePassword = savePassword; + if (publishOtherFiles != gPublishSiteData[siteIndex].publishOtherFiles) + gSettingsChanged = true; + + gPublishSiteData[siteIndex].publishOtherFiles = publishOtherFiles; + gDialog.SiteList.selectedIndex = siteIndex; if (siteIndex == gDefaultSiteIndex) gDefaultSiteName = siteName; @@ -521,27 +504,22 @@ function ValidateSettings() { // Update selected item if sitename changed var selectedItem = gDialog.SiteList.selectedItem; - if (selectedItem && selectedItem.getAttribute("value") != siteName) + if (selectedItem && selectedItem.getAttribute("label") != siteName) { + // XXX More hacks to workaround bug 131481 // The real sitename selectedItem.setAttribute("value", siteName); // Truncate string to show in the menulist - //var truncatedName = TruncateStringAtWordEnd(siteName, 20, true); - selectedItem.setAttribute("label", siteName); - gDialog.SiteList.setAttribute("label", siteName); + var truncatedName = TruncateStringAtWordEnd(siteName, 30, true); + selectedItem.setAttribute("label", truncatedName); + gDialog.SiteList.setAttribute("label", truncatedName); } } // Get the directory name in site to publish to var docDir = GetDocDirInput(); - // Because of the autoselect behavior in editable menulists, - // selectedIndex = -1 means value in input field is not already in the list, - // so add it to the list of site directories - if (gDialog.DocDirList.selectedIndex == -1) - AppendDirToSelectedSite(docDir); - gPublishSiteData[siteIndex].docDir = docDir; // And directory for images and other files @@ -550,9 +528,6 @@ function ValidateSettings() otherDir = docDir; else otherDir = GetOtherDirInput(); - - if (gDialog.OtherDirList.selectedIndex == -1) - AppendDirToSelectedSite(otherDir); gPublishSiteData[siteIndex].otherDir = otherDir; @@ -566,10 +541,8 @@ function ValidateSettings() gReturnData.password = password; gReturnData.savePassword = savePassword; gReturnData.docDir = gPublishSiteData[siteIndex].docDir; - - // If "Other dir" is not checked, return empty string to indicate "don't save associated files" - gReturnData.otherDir = gDialog.OtherDirCheckbox.checked ? gPublishSiteData[siteIndex].otherDir : ""; - + gReturnData.otherDir = gPublishSiteData[siteIndex].otherDir; + gReturnData.publishOtherFiles = publishOtherFiles; gReturnData.dirList = gPublishSiteData[siteIndex].dirList; return true; } @@ -605,18 +578,25 @@ function ShowErrorInPanel(panelId, errorMsgId, widgetWithError) function doHelpButton() { if (gCurrentPanel == gPublishPanel) - openHelp("publish_tab"); + openHelp("comp-doc-publish-publishtab"); else - openHelp("settings_tab"); + openHelp("comp-doc-publish-settingstab"); } function onAccept() { if (ValidateData()) { + // DON'T save the docDir and otherDir before trying to publish + gReturnData.saveDirs = false; + // We save new site data to prefs only if we are attempting to publish if (gSettingsChanged) - SavePublishSiteDataToPrefs(gPublishSiteData, gDefaultSiteName); + SavePublishDataToPrefs(gReturnData); + + // Set flag to resave data after publishing + // so we save docDir and otherDir if we published successfully + gReturnData.savePublishData = true; var title = TrimString(gDialog.PageTitleInput.value); if (title != gPreviousTitle) diff --git a/mozilla/editor/ui/dialogs/content/EditorPublish.xul b/mozilla/editor/ui/dialogs/content/EditorPublish.xul index 4c2a1a80e9e..1e7addeaf86 100644 --- a/mozilla/editor/ui/dialogs/content/EditorPublish.xul +++ b/mozilla/editor/ui/dialogs/content/EditorPublish.xul @@ -64,8 +64,9 @@