From 39d067f58ff889fc58d9ce5fcdbf7997cbf55545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Fri, 28 Jan 2011 09:20:37 +0100 Subject: [PATCH] Bug 628654 - Show connecting / waiting / loading status messages in small overlay on top of content at bottom of screen. r=gavin a=b --- browser/base/content/browser.css | 23 +++++++++++++ browser/base/content/browser.js | 27 +++++++++++---- browser/base/content/browser.xul | 1 + browser/base/content/tabbrowser.xml | 34 +++++++++++++++++++ .../themes/gnomestripe/browser/browser.css | 25 ++++++++++++++ browser/themes/pinstripe/browser/browser.css | 25 ++++++++++++++ browser/themes/winstripe/browser/browser.css | 25 ++++++++++++++ 7 files changed, 153 insertions(+), 7 deletions(-) diff --git a/browser/base/content/browser.css b/browser/base/content/browser.css index 25bd9dd8c14e..c23f4b7e2985 100644 --- a/browser/base/content/browser.css +++ b/browser/base/content/browser.css @@ -513,3 +513,26 @@ window[chromehidden~="toolbar"] toolbar:not(.toolbar-primary):not(.chromeclass-m browser[tabmodalPromptShowing] { -moz-user-focus: none !important; } + +/* Status panel */ + +statuspanel { + -moz-binding: url("chrome://browser/content/tabbrowser.xml#statuspanel"); + position: relative; + margin-top: -3em; + pointer-events: none; /* don't block the content across the whole browser width */ +} + +statuspanel[label=""] { + visibility: collapse; +} + +statuspanel[mirror] { + -moz-box-pack: end; +} + +.statuspanel-inner { + height: 3em; + -moz-box-align: end; + pointer-events: auto; +} diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 1b3830085f06..396b6df78622 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -4026,6 +4026,10 @@ var XULBrowserWindow = { delete this.reloadCommand; return this.reloadCommand = document.getElementById("Browser:Reload"); }, + get statusTextField () { + delete this.statusTextField; + return this.statusTextField = document.getElementById("statusbar-display"); + }, get isImage () { delete this.isImage; return this.isImage = document.getElementById("isImage"); @@ -4051,19 +4055,23 @@ var XULBrowserWindow = { delete this.throbberElement; delete this.stopCommand; delete this.reloadCommand; + delete this.statusTextField; delete this.statusText; }, setJSStatus: function (status) { this.jsStatus = status; + this.updateStatusField(); }, setJSDefaultStatus: function (status) { this.jsDefaultStatus = status; + this.updateStatusField(); }, setDefaultStatus: function (status) { this.defaultStatus = status; + this.updateStatusField(); }, setOverLink: function (url, anchorElt) { @@ -4074,6 +4082,17 @@ var XULBrowserWindow = { encodeURIComponent); gURLBar.setOverLink(url); } + }, + + updateStatusField: function () { + var text = this.status || this.jsStatus || this.jsDefaultStatus || this.defaultStatus; + + // check the current value so we don't trigger an attribute change + // and cause needless (slow!) UI updates + if (this.statusText != text) { + this.statusTextField.label = text; + this.statusText = text; + } }, // Called before links are navigated to to allow us to retarget them if needed. @@ -4177,19 +4196,12 @@ var XULBrowserWindow = { if (location.spec != "about:blank") { switch (aStatus) { - case Components.results.NS_BINDING_ABORTED: - msg = gNavigatorBundle.getString("nv_stopped"); - break; case Components.results.NS_ERROR_NET_TIMEOUT: msg = gNavigatorBundle.getString("nv_timeout"); break; } } } - // If msg is false then we did not have an error (channel may have - // been null, in the case of a stray image load). - if (!msg && (!location || location.spec != "about:blank")) - msg = gNavigatorBundle.getString("nv_done"); this.status = ""; this.setDefaultStatus(msg); @@ -4371,6 +4383,7 @@ var XULBrowserWindow = { onStatusChange: function (aWebProgress, aRequest, aStatus, aMessage) { this.status = aMessage; + this.updateStatusField(); }, // Properties used to cache security state used to update the UI diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index dee77ac37a55..17c7c0b3b4da 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -981,6 +981,7 @@ contentcontextmenu="contentAreaContextMenu" autocompletepopup="PopupAutoComplete" onclick="return contentAreaClick(event, false);"/> +