Skip to content

Commit

Permalink
Copy trunk to 2.1.3 release tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
slaarti committed Jul 4, 2009
1 parent 514b410 commit 5afcec8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 16 deletions.
17 changes: 16 additions & 1 deletion content/LJcode-sites.js
Expand Up @@ -138,11 +138,22 @@ var LJlogin_sites = {
}
};

function LJlogin_notify_statusbar() {
// Get statusbar updated. FIXME by getting rid of this when Firefox
// hopefully fixes their shit.
Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService)
.notifyObservers(null, "ljlogin-update-statusbar", null);
}

function LJlogin_enabled_sites() {
var key = "ljcode.enabledsites";

if (arguments.length > 0) { // Set
var sites = LJlogin_preference(key, '', arguments[0].join(','));
// Get statusbar updated. FIXME by getting rid of this when Firefox
// hopefully fixes their shit.
LJlogin_notify_statusbar();
} else {
var sites = LJlogin_preference(key, '');
}
Expand Down Expand Up @@ -186,7 +197,11 @@ function LJlogin_sites_sitescheme(siteid) {
function LJlogin_sites_stealthwidget(siteid) {
var key = "site." + siteid + ".stealthwidget";
if (arguments.length > 1) { // Set
return LJlogin_preference(key, false, arguments[1]);
var value = LJlogin_preference(key, false, arguments[1]);
// Get statusbar updated. FIXME by getting rid of this when Firefox
// hopefully fixes their shit.
LJlogin_notify_statusbar();
return value;
} else {
return LJlogin_preference(key, false);
}
Expand Down
2 changes: 1 addition & 1 deletion content/contents.rdf
Expand Up @@ -6,7 +6,7 @@
chrome:name="ljlogin"
chrome:author="Chris Pinard"
chrome:authorURL="http://ljlogin.e-space.gweep.net/"
chrome:displayName="LJlogin 2.1.2"
chrome:displayName="LJlogin 2.1.3"
chrome:extension="true"
chrome:description="Tells you which LiveJournal account you're logged in with, and lets you switch between them.">
</RDF:Description>
Expand Down
21 changes: 9 additions & 12 deletions content/ljlogin.js
Expand Up @@ -56,25 +56,22 @@ function LJlogin_init() {
.getService(Components.interfaces.nsIObserverService);
observerService.addObserver(cookiemonster,"cookie-changed",false);

// Set up a preferences observer to keep the statusbar widgets
// in tune with the list of enabled sites.
// Because Firefox broke their shit, this is a regular observer that
// has to be signaled by hand elsewhere. Laaaame. FIXME by reverting
// when they fix their shit. Anyway, this is to keep the statusbar
// widgets in tune with the list of enabled sites.
var prerogative = {
observe: function(subject, topic, data) {
// Only care if we're talking a changed preference.
if (topic != "nsPref:changed") return;
// There're only a few preferences we truly care about.
if ((data != "ljcode.enabledsites") &&
(data.indexOf('stealthwidget') == -1)) return;
// Only care if we're talking a change in the statusbar.
if (topic != "ljlogin-update-statusbar") return;
// And here we are. Go for it...
LJlogin_statusbar_refresh();
return; // And done.
}
};
var prefsObserver = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService)
.getBranch("extensions.ljlogin.");
prefsObserver.QueryInterface(Components.interfaces.nsIPrefBranch2);
prefsObserver.addObserver("", prerogative, false);
// Fortunately, if we have to do this the dumb way, we've already got
// a regular observer service call set up for the cookie stuff, above.
observerService.addObserver(prerogative, "ljlogin-update-statusbar", false);

// And set the statusbar by hand once, to get things started.
LJlogin_statusbar_refresh();
Expand Down
4 changes: 2 additions & 2 deletions install.rdf
Expand Up @@ -5,11 +5,11 @@
<RDF:Description RDF:about="rdf:#$ZouwY"
em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
em:minVersion="2.0"
em:maxVersion="3.0.*" />
em:maxVersion="3.5.*" />
<RDF:Description RDF:about="urn:mozilla:install-manifest"
em:id="{ad4ee9e5-49c7-4589-acf3-db9fa76a95c9}"
em:name="LJlogin"
em:version="2.1.2"
em:version="2.1.3"
em:description="Tells you which LiveJournal account you're logged in with, and lets you switch between them."
em:iconURL="chrome://ljlogin/content/icons/lj/userinfo.gif"
em:creator="Chris Pinard"
Expand Down

0 comments on commit 5afcec8

Please sign in to comment.