From dfac1845e010f6a6a643792f077b0a2e08819e7f Mon Sep 17 00:00:00 2001 From: "cmanske%netscape.com" Date: Wed, 27 Mar 2002 03:52:37 +0000 Subject: [PATCH] Fixed publish dialog ui, b=130721, r=brade, sr=hewitt, a=asa git-svn-id: svn://10.0.0.236/trunk@117586 18797224-902f-48f8-a5cc-f745e15eee43 --- .../ui/composer/content/publishprefs.js | 6 +-- .../ui/dialogs/content/EditorPublish.js | 37 ++++++++------ .../ui/dialogs/content/EditorPublish.xul | 50 ++++++++++--------- .../dialogs/content/EditorPublishOverlay.xul | 2 +- .../dialogs/content/EditorPublishSettings.js | 6 +-- 5 files changed, 57 insertions(+), 44 deletions(-) diff --git a/mozilla/editor/ui/composer/content/publishprefs.js b/mozilla/editor/ui/composer/content/publishprefs.js index 40efa21cd71..f6991920720 100644 --- a/mozilla/editor/ui/composer/content/publishprefs.js +++ b/mozilla/editor/ui/composer/content/publishprefs.js @@ -521,14 +521,14 @@ function PublishSiteNameExists(name, publishSiteData, skipSiteIndex) // docUrl: Document URL with or without filename // (Must end in "/" if no filename) // dirObj.value = the directory of the document URL -// relative to the base publishing URL, using "/" if none +// relative to the base publishing URL, using "" if none // // XXX: Currently finds the site with the longest-matching url; // should we look for the shortest instead? Or match just the host portion? function FindSiteIndexAndDocDir(publishSiteData, docUrl, dirObj) { if (dirObj) - dirObj.value = "/"; + dirObj.value = ""; if (!publishSiteData || !docUrl || GetScheme(docUrl) == "file") return -1; @@ -559,7 +559,7 @@ function FindSiteIndexAndDocDir(publishSiteData, docUrl, dirObj) } } - // Get directory name from the end of url (may be just "/") + // Get directory name from the end of url if (dirObj && siteIndex >= 0 && urlLen > siteUrlLen) dirObj.value = FormatDirForPublishing(docUrl.slice(siteUrlLen)); diff --git a/mozilla/editor/ui/dialogs/content/EditorPublish.js b/mozilla/editor/ui/dialogs/content/EditorPublish.js index 412508a6b92..010b01fec48 100644 --- a/mozilla/editor/ui/dialogs/content/EditorPublish.js +++ b/mozilla/editor/ui/dialogs/content/EditorPublish.js @@ -184,18 +184,15 @@ function Startup() // No selected site -- assume same directory gDialog.OtherDirRadiogroup.selectedItem = gDialog.SameLocationRadio; } - else + else if (gPublishSiteData[gDialog.SiteList.selectedIndex].docDir == + gPublishSiteData[gDialog.SiteList.selectedIndex].otherDir) { // For now, check "same location" if dirs are already set to same directory - if (gPublishSiteData[gDialog.SiteList.selectedIndex].docDir == - gPublishSiteData[gDialog.SiteList.selectedIndex].otherDir) - { - gDialog.OtherDirRadiogroup.selectedItem = gDialog.SameLocationRadio; - } - else - { - gDialog.OtherDirRadiogroup.selectedItem = gDialog.OtherDirRadiogroup; - } + gDialog.OtherDirRadiogroup.selectedItem = gDialog.SameLocationRadio; + } + else + { + gDialog.OtherDirRadiogroup.selectedItem = gDialog.UseSubdirRadio; } doEnabling(); @@ -215,7 +212,13 @@ function FillSiteList() for (i = 0; i < count; i++) { var name = gPublishSiteData[i].siteName; - var menuitem = AppendStringToMenulist(gDialog.SiteList, name); + 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); + // Highlight the default site if (name == gDefaultSiteName) { @@ -346,6 +349,9 @@ 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(); } } @@ -440,7 +446,6 @@ function ValidateSettings() return false; } - //TODO: If publish scheme = "ftp" we should encourage user to supply the http BrowseUrl var browseUrl = GetBrowseUrlInput(); var username = TrimString(gDialog.UsernameInput.value); @@ -516,8 +521,13 @@ function ValidateSettings() { // Update selected item if sitename changed var selectedItem = gDialog.SiteList.selectedItem; - if (selectedItem && selectedItem.getAttribute("label") != siteName) + if (selectedItem && selectedItem.getAttribute("value") != siteName) { + // 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); } @@ -579,7 +589,6 @@ function ValidateData() ShowErrorInPanel(gPublishPanel, "MissingPublishFilename", gDialog.FilenameInput); return false; } - gReturnData.filename = filename; return true; diff --git a/mozilla/editor/ui/dialogs/content/EditorPublish.xul b/mozilla/editor/ui/dialogs/content/EditorPublish.xul index 455c8f71048..4c2a1a80e9e 100644 --- a/mozilla/editor/ui/dialogs/content/EditorPublish.xul +++ b/mozilla/editor/ui/dialogs/content/EditorPublish.xul @@ -64,17 +64,15 @@