zotero/chrome/chromeFiles/content/scholar/preferences.js
David Norton 8427ebdf2a Fixes #114, Preference for Scholar location (top, bottom).
(I had to go a little roundabout way of doing it, as you can't use the overlay-related positioning attributes on-the-fly)
2006-07-19 16:14:27 +00:00

31 lines
No EOL
853 B
JavaScript

var autoUpdateBox;
var positionMenu;
/*
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');
positionMenu = document.getElementById('positionMenu');
positionMenu.selectedIndex = Scholar.Prefs.get('scholarPaneOnTop') ? 0 : 1;
}
function accept()
{
Scholar.Prefs.set('automaticScraperUpdates', autoUpdateBox.checked)
Scholar.Prefs.set('scholarPaneOnTop', positionMenu.selectedIndex == 0)
}