searchDialog.js (1773B)
1 /* 2 ***** BEGIN LICENSE BLOCK ***** 3 4 Copyright © 2009 Center for History and New Media 5 George Mason University, Fairfax, Virginia, USA 6 http://zotero.org 7 8 This file is part of Zotero. 9 10 Zotero is free software: you can redistribute it and/or modify 11 it under the terms of the GNU Affero General Public License as published by 12 the Free Software Foundation, either version 3 of the License, or 13 (at your option) any later version. 14 15 Zotero is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 GNU Affero General Public License for more details. 19 20 You should have received a copy of the GNU Affero General Public License 21 along with Zotero. If not, see <http://www.gnu.org/licenses/>. 22 23 ***** END LICENSE BLOCK ***** 24 */ 25 26 "use strict"; 27 28 var itemsView; 29 var collectionsView; 30 var io; 31 32 function doLoad() 33 { 34 // Set font size from pref 35 var sbc = document.getElementById('zotero-search-box-container'); 36 Zotero.setFontSize(sbc); 37 38 io = window.arguments[0]; 39 40 var searchBox = document.getElementById('search-box'); 41 searchBox.groups = io.dataIn.groups; 42 searchBox.search = io.dataIn.search; 43 document.getElementById('search-name').value = io.dataIn.name; 44 } 45 46 function doUnload() 47 { 48 49 } 50 51 function doAccept() 52 { 53 document.getElementById('search-box').search.name = document.getElementById('search-name').value; 54 try { 55 let searchBox = document.getElementById('search-box'); 56 searchBox.updateSearch(); 57 io.dataOut = { 58 json: searchBox.search.toJSON() 59 }; 60 } 61 catch (e) { 62 Zotero.debug(e, 1); 63 Components.utils.reportError(e); 64 throw (e); 65 } 66 }