/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2009 Center for History and New Media
George Mason University, Fairfax, Virginia, USA
http://zotero.org
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Zotero. If not, see .
***** END LICENSE BLOCK *****
*/
//////////////////////////////////////////////////////////////////////////////
//
// Zotero_File_Interface_Bibliography
//
//////////////////////////////////////////////////////////////////////////////
// Class to provide options for bibliography
var Zotero_File_Interface_Bibliography = new function() {
var _io, _saveStyle;
this.init = init;
this.styleChanged = styleChanged;
this.acceptSelection = acceptSelection;
/*
* Initialize some variables and prepare event listeners for when chrome is done
* loading
*/
function init() {
// Set font size from pref
// Affects bibliography.xul and integrationDocPrefs.xul
Zotero.setFontSize(document.documentElement);
if(window.arguments && window.arguments.length) {
_io = window.arguments[0];
if(_io.wrappedJSObject) _io = _io.wrappedJSObject;
} else {
_io = {};
}
var listbox = document.getElementById("style-listbox");
var styles = Zotero.Styles.getVisible();
// if no style is set, get the last style used
if(!_io.style) {
_io.style = Zotero.Prefs.get("export.lastStyle");
_saveStyle = true;
}
// add styles to list
var index = 0;
var nStyles = styles.length;
var selectIndex = -1;
for(var i=0; i