Mercurial > tinyurl_creator
view 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 source
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; }