1
0
mirror of https://github.com/MailHops/mailhops-plugin.git synced 2025-05-17 06:40:08 -07:00
mailhops-plugin/chrome/content/preferences.js
2011-03-04 10:53:50 -07:00

29 lines
973 B
JavaScript

if (!pref)
{
var pref = Components.classes["@mozilla.org/preferences-service;1"].getService ( Components.interfaces.nsIPrefBranch ) ;
}
var mailHopPreferences =
{
loadPreferences: function()
{
if(mailHops.getCharPref("mail.mailHops.map",'goog')=='goog')
document.getElementById("mailhop.map").selectedIndex = 0;
else
document.getElementById("mailhop.map").selectedIndex = 1;
if(mailHops.getCharPref("mail.mailHops.unit",'mi')=='mi')
document.getElementById("mailhop.unit").selectedIndex = 0;
else
document.getElementById("mailhop.unit").selectedIndex = 1;
} ,
savePreferences: function()
{
mailHopPreferences.setCharPref("mail.mailHops.map", document.getElementById("mailhop.map").selectedItem.value) ;
mailHopPreferences.setCharPref("mail.mailHops.unit", document.getElementById("mailhop.unit").selectedItem.value) ;
} ,
setCharPref: function( strName , strValue )
{
pref.setCharPref ( strName , strValue ) ;
}
}