zotero/chrome/chromeFiles/content/scholar/bibliography.js
Simon Kornblith 73b5634f62 addresses #215, allow user to select citation style and change citation styles on the fly
addresses #214, add footnote support to word integration

- the third icon on the Zotero Word toolbar is now reserved for "Document Options," which, for now, means on the selection of styles
- the Document Options window will, for now, appear the first time you create a citation. the default style probably belongs in the Scholar preferences window.
- you can now generate citations in both footnote and in-text citation formats. you can't yet switch between them on the fly, but that should be coming soon...
- Ibid is not yet implemented. again, coming soon.
2006-08-29 23:15:13 +00:00

51 lines
No EOL
1.3 KiB
JavaScript

//////////////////////////////////////////////////////////////////////////////
//
// Scholar_File_Interface_Bibliography
//
//////////////////////////////////////////////////////////////////////////////
// Class to provide options for bibliography
var Scholar_File_Interface_Bibliography = new function() {
var _io;
this.init = init;
this.acceptSelection = acceptSelection;
/*
* Initialize some variables and prepare event listeners for when chrome is done
* loading
*/
function init() {
_io = window.arguments[0];
var listbox = document.getElementById("style-popup");
var styleMenu = document.getElementById("style-menu");
var styles = Scholar.Cite.getStyles();
// add styles to list
for(i in styles) {
var itemNode = document.createElement("menuitem");
itemNode.setAttribute("value", i);
itemNode.setAttribute("label", styles[i]);
listbox.appendChild(itemNode);
if(i == _io.style) {
styleMenu.selectedItem = itemNode;
}
}
// select first item by default
if(styleMenu.selectedIndex == -1) {
styleMenu.selectedIndex = 0;
}
}
function acceptSelection() {
// collect code
_io.style = document.getElementById("style-menu").selectedItem.value;
if(document.getElementById("output-radio")) {
_io.output = document.getElementById("output-radio").selectedItem.id;
}
}
}