@@ -72,6 +72,8 @@ const StatusLine = Module("statusline", {
7272 // our status bar fields
7373 this . _statusfields = { } ;
7474 this . _statuslineWidget = document . getElementById ( "liberator-status" ) ;
75+ // initialize setVisibility static variables
76+ this . setVisibility ( - 1 ) ;
7577 } ,
7678
7779 /**
@@ -123,6 +125,63 @@ const StatusLine = Module("statusline", {
123125 }
124126 } ,
125127
128+ // set the visibility of the statusline
129+ setVisibility : function ( request ) {
130+ if ( typeof this . setVisibility . currVisibility == 'undefined' ) {
131+ this . setVisibility . currVisibility = true ;
132+ this . setVisibility . prevVisibility = true ;
133+ this . setVisibility . contentSeparator
134+ = highlight . get ( 'ContentSeparator' ) . value ;
135+
136+ // kinds of requests
137+ this . setVisibility . MODE_ON = 0 ; // commandline active
138+ this . setVisibility . MODE_OFF = 1 ; // commandline inactive
139+ this . setVisibility . TOGGLE = 2 ; // toggle on or off
140+ this . setVisibility . FULLSCREEN = 3 ; // in or out of fullscreen
141+ }
142+
143+ const bb = document . getElementById ( "liberator-bottombar" ) ;
144+ const sv = this . setVisibility ;
145+
146+ if ( ! bb ) return ;
147+
148+ var toggle_off = function ( ) {
149+ bb . style . height = '0px' ;
150+ bb . style . overflow = 'hidden' ;
151+ highlight . set ( 'ContentSeparator' , 'display: none;' ) ;
152+ } ;
153+
154+ var toggle_on = function ( ) {
155+ bb . style . height = '' ;
156+ bb . style . overflow = '' ;
157+ highlight . set ( 'ContentSeparator' , sv . contentSeparatorValue ) ;
158+ } ;
159+
160+ switch ( request ) {
161+ case sv . TOGGLE :
162+ sv . currVisibility = ! sv . currVisibility ;
163+ if ( sv . currVisibility ) toggle_on ( ) ;
164+ else toggle_off ( ) ;
165+ break ;
166+ case sv . FULLSCREEN :
167+ if ( window . fullScreen ) {
168+ sv . prevVisibility = sv . currVisibility ;
169+ sv . currVisibility = false ;
170+ toggle_off ( ) ;
171+ } else {
172+ sv . currVisibility = sv . currVisibility || sv . prevVisibility ;
173+ if ( sv . currVisibility ) toggle_on ( ) ;
174+ }
175+ break ;
176+ case sv . MODE_ON :
177+ if ( ! sv . currVisibility ) toggle_on ( ) ;
178+ break ;
179+ case sv . MODE_OFF :
180+ if ( ! sv . currVisibility ) toggle_off ( ) ;
181+ break ;
182+ }
183+ } ,
184+
126185 /**
127186 * Set any field in the statusbar
128187 *
@@ -155,32 +214,48 @@ const StatusLine = Module("statusline", {
155214 } ) ;
156215 statusline . addField ( "ssl" , "The currently SSL status" , "liberator-status-ssl" ,
157216 function updateSSLState ( node , state ) {
158- var className = "" ;
217+ var className = "notSecure" ;
218+ var tooltip = gNavigatorBundle . getString ( "identity.unknown.tooltip" ) ;
159219 if ( ! state ) {
160220 let securityUI = config . tabbrowser . securityUI ;
161221 if ( securityUI )
162222 state = securityUI . state || 0 ;
163223 }
164224 const WPL = Components . interfaces . nsIWebProgressListener ;
165- if ( state & WPL . STATE_IDENTITY_EV_TOPLEVEL )
225+ if ( state & WPL . STATE_IDENTITY_EV_TOPLEVEL ) {
166226 className = "verifiedIdentity" ;
167- else if ( state & WPL . STATE_IS_SECURE )
227+ if ( state & WPL . STATE_BLOCKED_MIXED_ACTIVE_CONTENT )
228+ className = "mixedActiveBlocked" ;
229+ tooltip = gNavigatorBundle . getFormattedString (
230+ "identity.identified.verifier" ,
231+ [ gIdentityHandler . getIdentityData ( ) . caOrg ] ) ;
232+ } else if ( state & WPL . STATE_IS_SECURE ) {
168233 className = "verifiedDomain" ;
169- else if ( state & WPL . STATE_IS_BROKEN ) {
170- if ( ( state & WPL . STATE_LOADED_MIXED_ACTIVE_CONTENT ) &&
171- options . getPref ( "security.mixed_content.block_active_content" , false ) )
234+ if ( state & WPL . STATE_BLOCKED_MIXED_ACTIVE_CONTENT )
235+ className = "mixedActiveBlocked" ;
236+ tooltip = gNavigatorBundle . getFormattedString (
237+ "identity.identified.verifier" ,
238+ [ gIdentityHandler . getIdentityData ( ) . caOrg ] ) ;
239+ } else if ( state & WPL . STATE_IS_BROKEN ) {
240+ if ( state & WPL . STATE_LOADED_MIXED_ACTIVE_CONTENT )
172241 className = "mixedActiveContent" ;
242+ else
243+ className = "mixedDisplayContent" ;
244+ tooltip = gNavigatorBundle . getString ( "identity.unknown.tooltip" ) ;
173245 }
174-
175246 node . className = className ;
247+ node . setAttribute ( "tooltiptext" , tooltip ) ;
176248 } , {
177249 openPopup : function ( anchor ) {
178250 var handler = window . gIdentityHandler ;
179251 if ( typeof handler === "undefiend" ) // Thunderbird has none
180252 return ;
181253
254+ if ( handler . refreshIdentityPopup )
255+ handler . refreshIdentityPopup ( ) ;
256+ else
257+ handler . setPopupMessages ( handler . _identityBox . className ) ;
182258 handler . _identityPopup . hidden = false ;
183- handler . setPopupMessages ( handler . _identityBox . className ) ;
184259 handler . _identityPopup . openPopup ( anchor ) ;
185260 } ,
186261 } ) ;
0 commit comments