1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 06:07:59 +01:00

Make last commit less sucky.

This commit is contained in:
Kris Maglione
2011-01-04 11:26:20 -05:00
parent e7ae04749c
commit c833f864d3
2 changed files with 12 additions and 15 deletions

View File

@@ -265,9 +265,16 @@ var Buffer = Module("buffer", {
// for notifying the user about secure web pages
onSecurityChange: function onSecurityChange(webProgress, request, state) {
onSecurityChange.superapply(this, arguments);
if (state & Ci.nsIWebProgressListener.STATE_IS_BROKEN)
statusline.security = "broken";
else if (state & Ci.nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL)
statusline.security = "extended";
else if (state & Ci.nsIWebProgressListener.STATE_SECURE_HIGH)
statusline.security = "secure";
else // if (state & Ci.nsIWebProgressListener.STATE_IS_INSECURE)
statusline.security = "insecure";
if (webProgress && webProgress.DOMWindow)
webProgress.DOMWindow.document.dactylSecurity = state;
statusline.security = state;
webProgress.DOMWindow.document.dactylSecurity = statusline.security;
},
onStatusChange: function onStatusChange(webProgress, request, status, message) {
onStatusChange.superapply(this, arguments);

View File

@@ -82,8 +82,8 @@ var StatusLine = Module("statusline", {
*
* @param {'extended'|'secure'|'broken'|'insecure'} type
*/
set class(type) {
this._class = type;
set security(type) {
this._security = type;
const highlightGroup = {
extended: "StatusLineExtended",
secure: "StatusLineSecure",
@@ -93,17 +93,7 @@ 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";
},
get security() this._security,
// update all fields of the statusline
update: function update() {