diff --git a/suite/browser/tabbrowser.xml b/suite/browser/tabbrowser.xml index bc9595abd45..bb025957c77 100644 --- a/suite/browser/tabbrowser.xml +++ b/suite/browser/tabbrowser.xml @@ -69,7 +69,7 @@ onclick="if (event.button != 1 || event.target.localName != 'tab') return; this.parentNode.parentNode.parentNode.removeTab(event.target);" ondragover="nsDragAndDrop.dragOver(event, this.parentNode.parentNode.parentNode); event.stopPropagation();" ondragdrop="nsDragAndDrop.drop(event, this.parentNode.parentNode.parentNode); event.stopPropagation();"> - + @@ -124,6 +124,7 @@ mTabBrowser: aTabBrowser, mTab: aTab, mBlank: aStartsBlank, + mIcon: "", onProgressChange : function (aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, @@ -156,7 +157,9 @@ aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { this.mTab.setAttribute("busy", "true"); this.mTab.label = this.mTabBrowser.mStringBundle.getString("tabs.loading"); - + this.mTab.removeAttribute("image"); + this.mIcon = ""; + if (this.mTabBrowser.mCurrentTab == this.mTab) this.mTabBrowser.mIsBusy = true; } @@ -164,14 +167,22 @@ aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { if (this.mBlank) this.mBlank = false; - else { - this.mTab.removeAttribute("busy"); - if (this.mTab.label == this.mTabBrowser.mStringBundle.getString("tabs.loading")) - this.mTab.label = this.mTabBrowser.mStringBundle.getString("tabs.untitled") - if (this.mTabBrowser.mCurrentTab == this.mTab) - this.mTabBrowser.mIsBusy = false; + this.mTab.removeAttribute("busy"); + + var location = aRequest.QueryInterface(nsIChannel).URI; + if (this.mIcon) { + this.mTab.setAttribute("image", this.mIcon); + mIcon = ""; } + else if (pref.getBoolPref("browser.chrome.site_icons") && location && (location.schemeIs("http") || location.schemeIs("https"))) + this.mTab.setAttribute("image", this.mTabBrowser.buildFavIconString(location)); + + if (this.mTab.label == this.mTabBrowser.mStringBundle.getString("tabs.loading")) + this.mTab.label = this.mTabBrowser.mStringBundle.getString("tabs.untitled") + + if (this.mTabBrowser.mCurrentTab == this.mTab) + this.mTabBrowser.mIsBusy = false; } if (!oldBlank && this.mTabBrowser.mCurrentTab == this.mTab) { @@ -232,6 +243,16 @@ + + + + + + + + + + + + + + + + + + + + @@ -367,9 +461,18 @@ // Going from one tab to two for the first time. Get the first tab all hooked up with a title listener. this.mCurrentBrowser.addEventListener("DOMTitleChanged", this.onTitleChanged, false); + if (this.mCurrentBrowser.contentDocument.title != "") this.mCurrentTab.label = this.mCurrentBrowser.contentDocument.title; + // Create our close box. + this.createCloseBox(); + + // Hook up our favicon. + var uri = this.mCurrentBrowser.currentURI; + if (pref.getBoolPref("browser.chrome.site_icons") && uri && (uri.schemeIs('http') || uri.schemeIs('https'))) + this.mCurrentTab.setAttribute("image", this.buildFavIconString(uri)); + // Remove all our progress listeners from the active browser. if (this.mProgressListeners) { for (var i = 0; i < this.mProgressListeners.length; i++) { @@ -400,7 +503,8 @@ t.minWidth = 30; t.width = 0; t.setAttribute("flex", "100000"); - + t.setAttribute("validate", "never"); + t.setAttribute("onerror", "this.removeAttribute('image');"); this.mTabContainer.appendChild(t); b.setAttribute("type", "content"); @@ -470,7 +574,7 @@ if (l == 1) return; // Don't allow the last tab to close. - if (l == 2) { + if (l == 2) { var pref = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch(null); var autohide = pref.getBoolPref("browser.tabs.autoHide"); if (autohide) @@ -494,7 +598,7 @@ // Remove our title change listener oldBrowser.removeEventListener("DOMTitleChanged", this.onTitleChanged, false); - + // We are no longer the primary content area. oldBrowser.setAttribute("type", "content"); @@ -562,12 +666,18 @@ this.mTabbedMode = true; this.mCurrentBrowser.addEventListener("DOMTitleChanged", this.onTitleChanged, false); - + + // Create our close box. + this.createCloseBox(); + // Wire up a progress listener to our tab. var listener = (this.mTabProgressListener)(this, this.mCurrentTab); this.webProgress.addProgressListener(listener); this.mTabListeners[0] = listener; } + + // Hook up a listener for s. + this.mPanelContainer.addEventListener("DOMLinkAdded", this.onLinkAdded, false); } this.mProgressListeners.push(aListener); @@ -883,6 +993,7 @@ this.mPanelContainer.childNodes[i].removeEventListener("DOMTitleChanged", this.onTitleChanged, false); } } + this.mPanelContainer.removeEventListener("DOMLinkAdded", this.onLinkAdded, false); ]]> diff --git a/themes/classic/navigator/tabbrowser.css b/themes/classic/navigator/tabbrowser.css index 03efec5841b..fb0b0d58159 100644 --- a/themes/classic/navigator/tabbrowser.css +++ b/themes/classic/navigator/tabbrowser.css @@ -1,7 +1,15 @@ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); -tab[busy] { +.tab-image { + margin-top: 1px; + margin-right: 3px; + width: 16px; + height: 16px; + list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-item.gif"); +} + +tab[busy] > .tab-box > .tab-image { list-style-image: url("chrome://global/skin/loading.gif"); } @@ -9,4 +17,5 @@ tab[busy] { list-style-image: url("chrome://global/skin/closebox.gif"); margin-bottom: 3px; margin-right: 2px; + margin-left: 4px; } diff --git a/themes/modern/navigator/tabbrowser.css b/themes/modern/navigator/tabbrowser.css index eb9bc41a39c..56c481cdad9 100644 --- a/themes/modern/navigator/tabbrowser.css +++ b/themes/modern/navigator/tabbrowser.css @@ -1,7 +1,15 @@ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); -tab[busy] { +.tab-icon { + margin-top: 1px; + margin-right: 3px; + width: 16px; + height: 16px; + list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-item.gif"); +} + +tab[busy] > .tab-mid > .tab-mid-mid > .tab-icon { list-style-image: url("chrome://communicator/skin/icons/loading.gif"); } @@ -9,4 +17,5 @@ tab[busy] { list-style-image: url("chrome://global/skin/icons/closebox.gif"); margin-bottom: 3px; margin-right: 2px; + margin-left: 4px; } \ No newline at end of file