Mercurial > tinyurl_creator
diff chrome/content/options.js @ 0:c14d52a3b2fe
initial import
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Mon, 11 Aug 2008 20:34:21 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/chrome/content/options.js Mon Aug 11 20:34:21 2008 +0900 @@ -0,0 +1,25 @@ + +function tinyurl_options_init(){ + try{ + + var oPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(""); + + // Prefill + if(oPrefs.prefHasUserValue("tinyurl.confirmation.hide")) + document.getElementById("confirm-hide").checked = oPrefs.getBoolPref("tinyurl.confirmation.hide"); + + }catch(e){ alert("Could not load preferences.\n"+ e); } +} + +function tinyurl_options_save(){ + try{ + + var oPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(""); + + // Save + oPrefs.setBoolPref("tinyurl.confirmation.hide", document.getElementById("confirm-hide").checked); + + }catch(e){ alert("Could not save preferences.\n"+ e); return false; } + + return true; +} \ No newline at end of file