2006-06-21 22:31:52 +00:00
|
|
|
var autoUpdateBox;
|
2006-07-19 16:14:27 +00:00
|
|
|
var positionMenu;
|
2006-05-18 18:39:55 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
To add a new preference:
|
2006-06-21 22:31:52 +00:00
|
|
|
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
|
2006-06-25 07:31:01 +00:00
|
|
|
4) (Optional) To add an observer for a preference change,
|
|
|
|
add an appropriate case in the switch statement
|
|
|
|
in Scholar.Prefs.observe()
|
2006-05-18 18:39:55 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
function init()
|
|
|
|
{
|
2006-06-21 22:31:52 +00:00
|
|
|
autoUpdateBox = document.getElementById('autoUpdateBox');
|
2006-06-25 07:31:01 +00:00
|
|
|
autoUpdateBox.checked = Scholar.Prefs.get('automaticScraperUpdates');
|
2006-07-19 16:14:27 +00:00
|
|
|
|
|
|
|
positionMenu = document.getElementById('positionMenu');
|
|
|
|
positionMenu.selectedIndex = Scholar.Prefs.get('scholarPaneOnTop') ? 0 : 1;
|
2006-05-18 18:39:55 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function accept()
|
|
|
|
{
|
2006-06-25 07:31:01 +00:00
|
|
|
Scholar.Prefs.set('automaticScraperUpdates', autoUpdateBox.checked)
|
2006-07-19 16:14:27 +00:00
|
|
|
Scholar.Prefs.set('scholarPaneOnTop', positionMenu.selectedIndex == 0)
|
2006-05-18 18:39:55 +00:00
|
|
|
}
|