0
|
1
|
|
2 function tinyurl_initOptions(){
|
|
3 try{
|
|
4 var oPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("");
|
|
5
|
|
6 if(oPrefs.prefHasUserValue("tinyurl.update.notify"))
|
|
7 document.getElementById("tinyurl.update.notify").checked = oPrefs.getBoolPref("tinyurl.update.notify");
|
|
8 if(oPrefs.prefHasUserValue("tinyurl.confirmation.hide"))
|
|
9 document.getElementById("tinyurl.confirmation.hide").checked = oPrefs.getBoolPref("tinyurl.confirmation.hide");
|
|
10
|
|
11 }catch(err){ alert("An unknown error occurred\n"+ err); }
|
|
12 }
|
|
13
|
|
14 function tinyurl_saveOptions(){
|
|
15
|
|
16 try{
|
|
17
|
|
18 //Save
|
|
19 var oPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("");
|
|
20
|
|
21 oPrefs.setBoolPref("tinyurl.update.notify", document.getElementById("tinyurl.update.notify").checked);
|
|
22 oPrefs.setBoolPref("tinyurl.confirmation.hide", document.getElementById("tinyurl.confirmation.hide").checked);
|
|
23
|
|
24 }catch(err){ alert("An unknown error occurred\n"+ err); }
|
|
25
|
|
26 return true;
|
|
27 } |