mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-28 20:05:47 +01:00
Get the statusline color right after a :rehash.
This commit is contained in:
@@ -265,15 +265,9 @@ var Buffer = Module("buffer", {
|
||||
// for notifying the user about secure web pages
|
||||
onSecurityChange: function onSecurityChange(webProgress, request, state) {
|
||||
onSecurityChange.superapply(this, arguments);
|
||||
// TODO: do something useful with STATE_SECURE_MED and STATE_SECURE_LOW
|
||||
if (state & Ci.nsIWebProgressListener.STATE_IS_INSECURE)
|
||||
statusline.class = "insecure";
|
||||
else if (state & Ci.nsIWebProgressListener.STATE_IS_BROKEN)
|
||||
statusline.class = "broken";
|
||||
else if (state & Ci.nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL)
|
||||
statusline.class = "extended";
|
||||
else if (state & Ci.nsIWebProgressListener.STATE_SECURE_HIGH)
|
||||
statusline.class = "secure";
|
||||
if (webProgress && webProgress.DOMWindow)
|
||||
webProgress.DOMWindow.document.dactylSecurity = state;
|
||||
statusline.security = state;
|
||||
},
|
||||
onStatusChange: function onStatusChange(webProgress, request, status, message) {
|
||||
onStatusChange.superapply(this, arguments);
|
||||
|
||||
@@ -67,7 +67,7 @@ var StatusLine = Module("statusline", {
|
||||
objects: this.widgets = { get status() this.container },
|
||||
prepend: prepend.elements()
|
||||
});
|
||||
this.class = "insecure";
|
||||
this.security = content.document.dactylSecurity;
|
||||
},
|
||||
|
||||
get visible() !this.statusBar.collapsed && !this.statusBar.hidden,
|
||||
@@ -94,6 +94,16 @@ var StatusLine = Module("statusline", {
|
||||
highlight.highlightNode(this.statusBar, this.baseGroup + highlightGroup[type]);
|
||||
},
|
||||
get class() this._class,
|
||||
set security(state) {
|
||||
if (state & Ci.nsIWebProgressListener.STATE_IS_BROKEN)
|
||||
this.class = "broken";
|
||||
else if (state & Ci.nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL)
|
||||
this.class = "extended";
|
||||
else if (state & Ci.nsIWebProgressListener.STATE_SECURE_HIGH)
|
||||
this.class = "secure";
|
||||
else // if (state & Ci.nsIWebProgressListener.STATE_IS_INSECURE)
|
||||
this.class = "insecure";
|
||||
},
|
||||
|
||||
// update all fields of the statusline
|
||||
update: function update() {
|
||||
|
||||
Reference in New Issue
Block a user