new 'online' option, thanks zigdon!

This commit is contained in:
Martin Stubenschrott committed 2008-06-06 23:24:41 +00:00
1 parent f735f772e4
commit 62df5aa6fe
5 files changed
+32 -1

No files matched your search

+23
View File
@@ -327,6 +327,29 @@ liberator.config = { //{{{
{
completer: function (filter) { return liberator.completion.url(filter); }
});
/////////////////////////////////////////////////////////////////////////////}}}
////////////////////// OPTIONS /////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
liberator.options.add(["online"], "Set and reset the 'work offline' option", "boolean", true,
{
setter: function (value)
{
var ioService = Components.classes['@mozilla.org/network/io-service;1'].
getService(Components.interfaces.nsIIOService2);
ioService.offline = !value;
gPrefService.setBoolPref("browser.offline", ioService.offline);
},
getter: function ()
{
return Components.classes['@mozilla.org/network/io-service;1'].
getService(Components.interfaces.nsIIOService2).offline;
}
});
}
//}}}
}; //}}}