From d03f509ba3b1c50e47d75b3442b76e94e1451a56 Mon Sep 17 00:00:00 2001 From: "bugzilla%arlen.demon.co.uk" Date: Wed, 1 Dec 2004 11:12:21 +0000 Subject: [PATCH] Bug 261267 helper application dialog has title issues when opening an unknown filetype Relanding after aviary branch landing - already reviewed --- browser/components/bookmarks/content/addBookmark.js | 3 +-- browser/components/bookmarks/content/bookmarksManager.js | 2 +- browser/components/bookmarks/content/bookmarksProperties.js | 5 +---- toolkit/components/help/content/help.js | 5 +---- toolkit/content/fontpackage.js | 3 +-- toolkit/content/widgets/wizard.xml | 4 ++-- toolkit/mozapps/downloads/content/nsHelperAppDlg.js | 3 +-- toolkit/mozapps/downloads/src/nsHelperAppDlg.js.in | 3 +-- toolkit/mozapps/extensions/content/about.js | 2 +- toolkit/mozapps/extensions/content/extensions.js | 2 +- 10 files changed, 11 insertions(+), 21 deletions(-) diff --git a/browser/components/bookmarks/content/addBookmark.js b/browser/components/bookmarks/content/addBookmark.js index dc6aceac3afe..c3d976a2558c 100644 --- a/browser/components/bookmarks/content/addBookmark.js +++ b/browser/components/bookmarks/content/addBookmark.js @@ -116,7 +116,6 @@ function Startup() var bookmarkView = document.getElementById("bookmarks-view"); var shouldSetOKButton = true; - var dialogElement = document.documentElement; if ("arguments" in window) { var ind; var folderItem = null; @@ -132,7 +131,7 @@ function Startup() document.getElementById("createinseparator").setAttribute("hidden", "true"); document.getElementById("nameseparator").setAttribute("hidden", "true"); sizeToContent(); - dialogElement.setAttribute("title", dialogElement.getAttribute("title-selectFolder")); + document.title = document.documentElement.getAttribute("selectFolderTitle"); shouldSetOKButton = false; if (window.arguments[2]) folderItem = RDF.GetResource(window.arguments[2]); diff --git a/browser/components/bookmarks/content/bookmarksManager.js b/browser/components/bookmarks/content/bookmarksManager.js index 7e0fc73b1e0d..eabe3c9b7bb4 100644 --- a/browser/components/bookmarks/content/bookmarksManager.js +++ b/browser/components/bookmarks/content/bookmarksManager.js @@ -63,7 +63,7 @@ function Startup() bookmarksView.treeBoxObject.view.selection.select(0); - windowNode.setAttribute("title", titleString); + document.title = titleString; document.getElementById("CommandUpdate_Bookmarks").setAttribute("commandupdater","true"); bookmarksView.focus(); diff --git a/browser/components/bookmarks/content/bookmarksProperties.js b/browser/components/bookmarks/content/bookmarksProperties.js index 677d40f0a226..62b9115f1e16 100644 --- a/browser/components/bookmarks/content/bookmarksProperties.js +++ b/browser/components/bookmarks/content/bookmarksProperties.js @@ -94,11 +94,8 @@ function Init() field.value = value; } - var propsWindow = document.getElementById("bmPropsWindow"); var nameNode = document.getElementById("name"); - var title = propsWindow.getAttribute("title"); - title = title.replace(/\*\*bm_title\*\*/gi, nameNode.value); - propsWindow.setAttribute("title", title); + document.title = document.title.replace(/\*\*bm_title\*\*/gi, nameNode.value); // check bookmark schedule var scheduleArc = RDF.GetResource(WEB_NS+"Schedule"); diff --git a/toolkit/components/help/content/help.js b/toolkit/components/help/content/help.js index 97759aee69a4..34ea66cf8773 100644 --- a/toolkit/components/help/content/help.js +++ b/toolkit/components/help/content/help.js @@ -39,7 +39,6 @@ # Global Variables var helpBrowser; -var helpWindow; var helpSearchPanel; var emptySearch; var emptySearchText @@ -117,7 +116,6 @@ function displayTopic(topic) { # Initialize the Help window function init() { // Cache panel references. - helpWindow = document.getElementById("help"); helpSearchPanel = document.getElementById("help-search-panel"); helpTocPanel = document.getElementById("help-toc-panel"); helpIndexPanel = document.getElementById("help-index-panel"); @@ -186,8 +184,7 @@ function loadHelpRDF() { log("Help file: " + helpFileURI + " was not found."); } try { - helpWindow.setAttribute("title", - getAttribute(helpFileDS, RDF_ROOT, NC_TITLE, "")); + document.title = getAttribute(helpFileDS, RDF_ROOT, NC_TITLE, ""); helpBaseURI = getAttribute(helpFileDS, RDF_ROOT, NC_BASE, helpBaseURI); defaultTopic = getAttribute(helpFileDS, RDF_ROOT, NC_DEFAULTTOPIC, "welcome"); diff --git a/toolkit/content/fontpackage.js b/toolkit/content/fontpackage.js index a98396cdb18a..ff48800dc5cf 100644 --- a/toolkit/content/fontpackage.js +++ b/toolkit/content/fontpackage.js @@ -55,8 +55,7 @@ function onLoad() // if no download button // set title to "Install Font" // and set cancel button to "OK" - var downloadFontDialog = document.getElementById("downloadFontDialog"); - downloadFontDialog.setAttribute("title", fontPackageBundle.getString("windowTitleNoDownload")); + document.title = fontPackageBundle.getString("windowTitleNoDownload"); var cancelButton = document.getElementById("cancelButton"); cancelButton.setAttribute("label", fontPackageBundle.getString("cancelButtonNoDownload")); } diff --git a/toolkit/content/widgets/wizard.xml b/toolkit/content/widgets/wizard.xml index 58a70f46786d..3a234aaa9c91 100644 --- a/toolkit/content/widgets/wizard.xml +++ b/toolkit/content/widgets/wizard.xml @@ -24,8 +24,8 @@ - + diff --git a/toolkit/mozapps/downloads/content/nsHelperAppDlg.js b/toolkit/mozapps/downloads/content/nsHelperAppDlg.js index 0efa62edfb78..82e333f2224c 100755 --- a/toolkit/mozapps/downloads/content/nsHelperAppDlg.js +++ b/toolkit/mozapps/downloads/content/nsHelperAppDlg.js @@ -265,7 +265,6 @@ nsUnknownContentTypeDialog.prototype = { // initDialog: Fill various dialog fields with initial content. initDialog : function() { // Put file name in window title. - var win = this.dialogElement( "unknownContentType" ); var suggestedFileName = this.mLauncher.suggestedFileName; // Some URIs do not implement nsIURL, so we can't just QI. @@ -288,7 +287,7 @@ nsUnknownContentTypeDialog.prototype = { this.mTitle = this.dialogElement("strings").getFormattedString("title", [fname]); - win.setAttribute( "title", this.mTitle ); + this.mDialog.document.title = this.mTitle; // Put content type, filename and location into intro. this.initIntro(url, fname); diff --git a/toolkit/mozapps/downloads/src/nsHelperAppDlg.js.in b/toolkit/mozapps/downloads/src/nsHelperAppDlg.js.in index df4f13ffa805..07a58672bc8b 100644 --- a/toolkit/mozapps/downloads/src/nsHelperAppDlg.js.in +++ b/toolkit/mozapps/downloads/src/nsHelperAppDlg.js.in @@ -350,7 +350,6 @@ nsUnknownContentTypeDialog.prototype = { // initDialog: Fill various dialog fields with initial content. initDialog : function() { // Put file name in window title. - var win = this.dialogElement( "unknownContentType" ); var suggestedFileName = this.mLauncher.suggestedFileName; // Some URIs do not implement nsIURL, so we can't just QI. @@ -374,7 +373,7 @@ nsUnknownContentTypeDialog.prototype = { var displayName = fname.replace(/ +/g, " "); this.mTitle = this.dialogElement("strings").getFormattedString("title", [displayName]); - win.setAttribute( "title", this.mTitle ); + this.mDialog.document.title = this.mTitle; // Put content type, filename and location into intro. this.initIntro(url, fname, displayName); diff --git a/toolkit/mozapps/extensions/content/about.js b/toolkit/mozapps/extensions/content/about.js index 408c562ecb33..c8e68639464e 100644 --- a/toolkit/mozapps/extensions/content/about.js +++ b/toolkit/mozapps/extensions/content/about.js @@ -44,7 +44,7 @@ function init() if (creator) creator = creator.QueryInterface(Components.interfaces.nsIRDFLiteral).Value; - document.documentElement.setAttribute("title", extensionsStrings.getFormattedString("aboutWindowTitle", [name])); + document.title = extensionsStrings.getFormattedString("aboutWindowTitle", [name]); var extensionName = document.getElementById("extensionName"); extensionName.setAttribute("value", name); var extensionVersion = document.getElementById("extensionVersion"); diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js index 006fc5437841..35c3bad6a508 100644 --- a/toolkit/mozapps/extensions/content/extensions.js +++ b/toolkit/mozapps/extensions/content/extensions.js @@ -171,7 +171,7 @@ function Startup() gExtensionsView.selected = lastSelected; var extensionsStrings = document.getElementById("extensionsStrings"); - document.documentElement.setAttribute("title", extensionsStrings.getString(gWindowState + "Title")); + document.title = extensionsStrings.getString(gWindowState + "Title"); gExtensionsViewController.onCommandUpdate();