zotero/chrome/chromeFiles/content/scholar/preferences.js
Dan Stillman 691993a6c3 Added Scholar.Prefs, a front-end to the preferences service with simple get(pref) and set(pref, value) methods that will retrieve and set based on the type of the default value, which I believe should generally should fine -- for more fine-grained control, use Scholar.Prefs.prefBranch to access the branch directly
Scholar.Prefs also registers itself as a preferences observer and can be used to trigger actions when certain prefs are changed by editing the switch statement in the observe() method

Updated preferences.js to use Scholar.Prefs
2006-06-25 07:31:01 +00:00

26 lines
No EOL
627 B
JavaScript

var autoUpdateBox;
/*
To add a new preference:
1) modify defaults/preferences/scholar.js
2) in this document:
a) add var above
b) add lines to init() function
c) add line to accept() function
3) add a control to prefs.xul
4) (Optional) To add an observer for a preference change,
add an appropriate case in the switch statement
in Scholar.Prefs.observe()
*/
function init()
{
autoUpdateBox = document.getElementById('autoUpdateBox');
autoUpdateBox.checked = Scholar.Prefs.get('automaticScraperUpdates');
}
function accept()
{
Scholar.Prefs.set('automaticScraperUpdates', autoUpdateBox.checked)
}