settings.js (1233B)
1 /** 2 * 3 * Settings are saved in a hidden spacer located in mab.xul, using the persist attribute 4 * 5 * @FileName: settings.js 6 * @$LastChangedDate: 2004-05-13 18:49:36 +0200 (Thu, 13 May 2004) $ 7 * @Author: Fabio Serra AKA Faser - faser@faser.net 8 * @Copyright: Fabio Serra 9 * @Licenze: MPL 1.1 10 * 11 */ 12 13 14 function getSettings() { 15 //Get settings from spacer 16 var op = window.opener; 17 var searchType = op.document.getElementById('settings-spacer').getAttribute("search"); 18 var nrResult = op.document.getElementById('settings-spacer').getAttribute("nrResult"); 19 20 //Display settings in the dialog windows 21 document.getElementById(searchType).setAttribute('selected','true'); 22 if(!nrResult) { 23 nrResult = 10; 24 } 25 var nrResultIndex = (nrResult/10) -1; 26 document.getElementById("max-results").selectedIndex = nrResultIndex; 27 } 28 29 function setSettings() { 30 var op = window.opener; 31 32 //Get settings 33 var searchType = document.getElementById('search').selectedItem.value; 34 var nrResult = document.getElementById('max-results').selectedItem.value; 35 36 //Save settings 37 op.document.getElementById('settings-spacer').setAttribute("search",searchType); 38 op.document.getElementById('settings-spacer').setAttribute("nrResult",nrResult); 39 40 window.close(); 41 }