diff --git a/mozilla/xpfe/browser/src/navigator.xul b/mozilla/xpfe/browser/src/navigator.xul index 5c625b6589f..a03d4646fe5 100644 --- a/mozilla/xpfe/browser/src/navigator.xul +++ b/mozilla/xpfe/browser/src/navigator.xul @@ -63,7 +63,7 @@ } else { dump("BrowserAppCore has already been created! Why?\n"); } - } + } function DoDisableButtons() { @@ -271,9 +271,153 @@ - + + var bindCount = 0; + function onStatus() { + var status = document.getElementById("Browser:Status"); + if ( status ) { + var text = status.getAttribute("text"); + var statusText = document.getElementById("statusText"); + if ( statusText ) { + statusText.childNodes[0].nodeValue = text; + } + if ( bindCount == 0 ) { + // This presumably precedes the first onStartBinding, spin + // the progress meter. + var meter = document.getElementById("Browser:LoadingProgress"); + if ( meter ) { + meter.setAttribute( "mode", "undetermined" ); + } + } + } else { + dump("Can't find status broadcaster!\n"); + } + } + function onSecurity() { + var security = document.getElementById("Browser:Security"); + var indicator = document.getElementById("statusbar-indicator"); + var style = indicator.getAttribute("style"); + // Strip off current display/width setting. + style = style.replace( /display[^;]*;/, "" ); + style = style.replace( /width[^;]*;/, "" ); + if ( security.getAttribute("secure") == "true" ) { + // Set indicator to display:normal; + style = style + "display:normal;width:120px;"; + color = "border-top-color:yellow;" + } else { + // Set indicator to display:none; + style = style + "display:none;width:0%;"; + color = "border-top-color:rgb(192,192,192);" + } + indicator.setAttribute("style",style); + + var meter = document.getElementById("statusbar-meter"); + var text = document.getElementById("statusbar-text"); + style = meter.getAttribute("style"); + style = style.replace( /border-top-color[^;];/, "" ); + style = style + color; + meter.setAttribute("style",style); + style = text.getAttribute("style"); + style = style.replace( /border-top-color[^;];/, "" ); + style = style + color; + text.setAttribute("style",style); + } + function securityOn() { + var security = document.getElementById("Browser:Security"); + if ( security.getAttribute("secure") == "false" ) { + security.setAttribute("secure","true"); + // Temporary till onchange handlers work. + onSecurity(); + } + } + function securityOff() { + var security = document.getElementById("Browser:Security"); + if ( security.getAttribute("secure") == "true" ) { + security.setAttribute("secure","false"); + // Temporary till onchange handlers work. + onSecurity(); + } + } + function doTests() { + // Turn security on. + securityOn(); + } + function onStartBinding() { + bindCount++; + if ( bindCount == 1 ) { + // Something is going on, turn on progress meter. + var meter = document.getElementById("Browser:LoadingProgress"); + if ( meter ) { + meter.setAttribute( "mode", "undetermined" ); + } + } + } + function onStopBinding() { + bindCount--; + if ( bindCount < 0 ) { + // Something unusual occurred (stop/back?). + bindCount = 0; + } + var stop = document.getElementById("Browser:OnStopBinding"); + if ( bindCount == 0 ) { + // Turn off progress meter. + var meter = document.getElementById("Browser:LoadingProgress"); + var status = document.getElementById("Browser:Status"); + status.setAttribute("text","Document: Done"); + meter.setAttribute("value","0"); + meter.setAttribute("mode","normal"); + } + } + function dumpProgress() { + var broadcaster = document.getElementById("Browser:LoadingProgress"); + var meter = document.getElementById("meter"); + dump( "bindCount=" + bindCount + "\n" ); + dump( "broadcaster mode=" + broadcaster.getAttribute("mode") + "\n" ); + dump( "broadcaster value=" + broadcaster.getAttribute("value") + "\n" ); + dump( "meter mode=" + meter.getAttribute("mode") + "\n" ); + dump( "meter value=" + meter.getAttribute("value") + "\n" ); + } + + + + + + + + + + + + + + [Notification Component] Click to test... + + + + + + + + + + + + + + + + + + Document: Done + + + + + - -