Merged 1.0 branch back to trunk
This commit is contained in:
parent
8a932b7dc5
commit
35ff52f2e8
387 changed files with 73511 additions and 9454 deletions
|
@ -1,8 +1,42 @@
|
|||
content zotero chrome/content/zotero/
|
||||
|
||||
locale zotero en-US chrome/locale/en-US/zotero/
|
||||
skin zotero default chrome/skin/default/zotero/
|
||||
locale zotero af-ZA chrome/locale/af-ZA/zotero/
|
||||
locale zotero ar chrome/locale/ar/zotero/
|
||||
locale zotero bg-BG chrome/locale/bg-BG/zotero/
|
||||
locale zotero ca-AD chrome/locale/ca-AD/zotero/
|
||||
locale zotero da-DK chrome/locale/da-DK/zotero/
|
||||
locale zotero de-AT chrome/locale/de-AT/zotero/
|
||||
locale zotero de-CH chrome/locale/de-CH/zotero/
|
||||
locale zotero de-DE chrome/locale/de-DE/zotero/
|
||||
locale zotero el-GR chrome/locale/el-GR/zotero/
|
||||
locale zotero es-ES chrome/locale/es-ES/zotero/
|
||||
locale zotero et-EE chrome/locale/et-EE/zotero/
|
||||
locale zotero fr-FR chrome/locale/fr-FR/zotero/
|
||||
locale zotero he-IL chrome/locale/he-IL/zotero/
|
||||
locale zotero hu-HU chrome/locale/hu-HU/zotero/
|
||||
locale zotero is-IS chrome/locale/is-IS/zotero/
|
||||
locale zotero it-IT chrome/locale/it-IT/zotero/
|
||||
locale zotero ja-JP chrome/locale/ja-JP/zotero/
|
||||
locale zotero ko-KR chrome/locale/ko-KR/zotero/
|
||||
locale zotero mn-MN chrome/locale/mn-MN/zotero/
|
||||
locale zotero nb-NO chrome/locale/nb-NO/zotero/
|
||||
locale zotero nl-NL chrome/locale/nl-NL/zotero/
|
||||
locale zotero pl-PL chrome/locale/pl-PL/zotero/
|
||||
locale zotero pt-BR chrome/locale/pt-BR/zotero/
|
||||
locale zotero pt-PT chrome/locale/pt-PT/zotero/
|
||||
locale zotero ro-RO chrome/locale/ro-RO/zotero/
|
||||
locale zotero ru-RU chrome/locale/ru-RU/zotero/
|
||||
locale zotero sr-YU chrome/locale/sr-YU/zotero/
|
||||
locale zotero sv-SE chrome/locale/sv-SE/zotero/
|
||||
locale zotero tr-TR chrome/locale/tr-TR/zotero/
|
||||
locale zotero zh-CN chrome/locale/zh-CN/zotero/
|
||||
locale zotero zh-TW chrome/locale/zh-TW/zotero/
|
||||
|
||||
skin zotero default chrome/skin/default/zotero/
|
||||
|
||||
overlay chrome://browser/content/browser.xul chrome://zotero/content/overlay.xul
|
||||
overlay chrome://browser/content/browser.xul chrome://zotero/content/ingester/browser.xul
|
||||
style chrome://browser/content/browser.xul chrome://zotero/skin/zotero.css
|
||||
style chrome://global/content/customizeToolbar.xul chrome://zotero/skin/zotero.css
|
||||
style chrome://global/content/customizeToolbar.xul chrome://zotero/skin/zotero.css
|
||||
|
||||
content zotero-platform chrome/content/zotero-platform/ platform
|
||||
|
|
1
chrome/content/zotero-platform/mac/itemPane.css
Normal file
1
chrome/content/zotero-platform/mac/itemPane.css
Normal file
|
@ -0,0 +1 @@
|
|||
|
0
chrome/content/zotero-platform/unix/itemPane.css
Normal file
0
chrome/content/zotero-platform/unix/itemPane.css
Normal file
30
chrome/content/zotero-platform/win/itemPane.css
Normal file
30
chrome/content/zotero-platform/win/itemPane.css
Normal file
|
@ -0,0 +1,30 @@
|
|||
#zotero-editpane-dynamic-fields row > hbox,
|
||||
#zotero-editpane-dynamic-fields row > vbox
|
||||
{
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
padding-top: 0 !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
#zotero-editpane-dynamic-fields row > hbox > hbox
|
||||
{
|
||||
-moz-box-align: center;
|
||||
}
|
||||
|
||||
#zotero-editpane-dynamic-fields row hbox hbox label
|
||||
{
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#zotero-editpane-dynamic-fields row > toolbarbutton
|
||||
{
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#zotero-editpane-dynamic-fields row vbox[fieldname=abstractNote],
|
||||
#zotero-editpane-dynamic-fields row vbox[fieldname=extra]
|
||||
{
|
||||
margin-left: 1px;
|
||||
}
|
|
@ -5,22 +5,174 @@
|
|||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/about.dtd">
|
||||
|
||||
<dialog
|
||||
id="zotero-about"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
orient="vertical"
|
||||
id="zotero-about"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
orient="vertical"
|
||||
buttons="accept"
|
||||
buttonlabelaccept="&zotero.about.close;"
|
||||
onload="onLoad();"
|
||||
onload="onLoad(); moveToAlertPosition(); sizeToContent();"
|
||||
ondialogaccept="return true;">
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
function onLoad()
|
||||
{
|
||||
var labels = document.getElementsByTagName('label');
|
||||
var translators = {
|
||||
afAZ: [
|
||||
"leuce"
|
||||
],
|
||||
|
||||
ar: [
|
||||
"fadhil"
|
||||
],
|
||||
|
||||
bgBG: [
|
||||
"Peter Stoilov"
|
||||
],
|
||||
|
||||
caAD: [
|
||||
"Joan Junyent"
|
||||
],
|
||||
|
||||
daDK: [
|
||||
"Banta"
|
||||
],
|
||||
|
||||
deAT: [
|
||||
"stw"
|
||||
],
|
||||
|
||||
deCH: [
|
||||
"stw"
|
||||
],
|
||||
|
||||
deDE: [
|
||||
"Harald Kliems",
|
||||
"jverber",
|
||||
"stw"
|
||||
],
|
||||
|
||||
elGR: [
|
||||
"geraki"
|
||||
],
|
||||
|
||||
esES: [
|
||||
"Alberto González Palomo"
|
||||
],
|
||||
|
||||
etEE: [
|
||||
"brainbulb"
|
||||
],
|
||||
|
||||
frFR: [
|
||||
"Pascal Pichon",
|
||||
"Jojaba",
|
||||
"La Luciole"
|
||||
],
|
||||
|
||||
heIL: [
|
||||
"d_leaper",
|
||||
"Doron Tilleman"
|
||||
],
|
||||
|
||||
huHU: [
|
||||
"tdombos"
|
||||
],
|
||||
|
||||
itIT: [
|
||||
"Andrea",
|
||||
"Elisabetta Manuele",
|
||||
"Giuliano Masseroni",
|
||||
"Luca Pedrazzi"
|
||||
],
|
||||
|
||||
jaJP: [
|
||||
"Andreas Bovens",
|
||||
"Michael Schiltz"
|
||||
],
|
||||
|
||||
koKR: [
|
||||
"wtspout"
|
||||
],
|
||||
|
||||
mnMN: [
|
||||
"cybermon"
|
||||
],
|
||||
|
||||
nbNO: [
|
||||
"Finn Arne Jørgensen"
|
||||
],
|
||||
|
||||
nlNL: [
|
||||
"Andreas Bovens",
|
||||
"Michael Schiltz",
|
||||
"Rintze Zelle"
|
||||
],
|
||||
|
||||
plPL: [
|
||||
"krzywy",
|
||||
"Trevor Owens"
|
||||
],
|
||||
|
||||
ptBR: [
|
||||
"Humberto Sartini"
|
||||
],
|
||||
|
||||
ptPT: [
|
||||
"gandrenf",
|
||||
"XRex"
|
||||
],
|
||||
|
||||
roRO: [
|
||||
"Turcan"
|
||||
],
|
||||
|
||||
ruRU: [
|
||||
"Yar"
|
||||
],
|
||||
|
||||
srYU: [
|
||||
"Igor_M"
|
||||
],
|
||||
|
||||
svSE: [
|
||||
"mymarkup"
|
||||
],
|
||||
|
||||
trTR: [
|
||||
"Zeki Celikbas"
|
||||
],
|
||||
|
||||
zhCN: [
|
||||
"liyan",
|
||||
"Wenping Guo"
|
||||
],
|
||||
|
||||
zhTW: [
|
||||
"Chun-Chung Chen",
|
||||
"coolcd"
|
||||
]
|
||||
};
|
||||
|
||||
for(var i = 0; i<labels.length; i++)
|
||||
labels[i].setAttribute('crop','end');
|
||||
var box = document.getElementById('zotero-translators-list');
|
||||
|
||||
for (var locale in translators) {
|
||||
var heading = document.createElement('label');
|
||||
var str = locale.substr(0, 2);
|
||||
if (locale.substr(2)) {
|
||||
str += '-' + locale.substr(2);
|
||||
}
|
||||
str += ':';
|
||||
heading.className = 'locale';
|
||||
heading.setAttribute('value', str);
|
||||
box.appendChild(heading);
|
||||
|
||||
for each(var person in translators[locale]) {
|
||||
var label = document.createElement('label');
|
||||
label.setAttribute('value', person);
|
||||
box.appendChild(label);
|
||||
}
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
|
@ -28,7 +180,7 @@
|
|||
<script src="include.js"/>
|
||||
|
||||
<vbox id="aboutcontent">
|
||||
<label id="name" value="&zotero.name;"/>
|
||||
<label id="name" value="Zotero"/>
|
||||
<label class="text-link" href="http://www.zotero.org" value="http://www.zotero.org"/>
|
||||
<label id="version" value="&zotero.version; "/>
|
||||
<script>
|
||||
|
@ -38,24 +190,46 @@
|
|||
<vbox class="subcontent">
|
||||
<label class="text-link" href="http://chnm.gmu.edu" value="Center for History and New Media"/>
|
||||
<label value="George Mason University"/>
|
||||
<label value="Fairfax, VA"/>
|
||||
<label value="Fairfax, VA, USA"/>
|
||||
</vbox>
|
||||
<label class="subhead" value="&zotero.directors;"/>
|
||||
<vbox class="subcontent">
|
||||
<label value="Dan Cohen"/>
|
||||
<label value="Josh Greenberg"/>
|
||||
<label value="Sean Takats"/>
|
||||
</vbox>
|
||||
<label class="subhead" value="&zotero.developers;"/>
|
||||
<vbox class="subcontent">
|
||||
<label value="Dan Stillman"/>
|
||||
<label value="Simon Kornblith"/>
|
||||
<label value="David Norton"/>
|
||||
|
||||
</vbox>
|
||||
<label class="subhead" value="&zotero.alumni;"/>
|
||||
<vbox class="subcontent">
|
||||
<label value="Josh Greenberg (co-director)"/>
|
||||
<label value="David Norton (developer)"/>
|
||||
</vbox>
|
||||
<label class="subhead" value="&zotero.about.localizations;"/>
|
||||
<vbox class="subcontent">
|
||||
<vbox id="zotero-translators-list"/>
|
||||
</vbox>
|
||||
<label class="subhead" value="&zotero.about.additionalSoftware;"/>
|
||||
<vbox class="subcontent">
|
||||
<label class="text-link" href="http://www.famfamfam.com/lab/icons/silk/" value="famfamfam (small icons)"/>
|
||||
<label class="text-link" href="http://simile.mit.edu/timeline/" value="SIMILE Project (Timeline)"/>
|
||||
<label class="text-link" href="http://tango.freedesktop.org/Tango_Desktop_Project" value="Tango Desktop Project (pref icons)"/>
|
||||
<label class="text-link" href="http://www.dbai.tuwien.ac.at/user/pollak/webpagedump/" value="WebPageDump (snapshot code)"/>
|
||||
<label class="text-link" href="http://xbiblio.sourceforge.net/" value="XBiblio (Citation Style Language)"/>
|
||||
<label class="text-link" href="http://www.foolabs.com/xpdf/" value="Xpdf (pdftotext)"/>
|
||||
</vbox>
|
||||
<label class="subhead" value="&zotero.executiveProducer;"/>
|
||||
<vbox class="subcontent">
|
||||
<label value="Roy Rosenzweig"/>
|
||||
</vbox>
|
||||
<label class="subhead" value="&zotero.thanks;"/>
|
||||
<vbox class="subcontent">
|
||||
<label class="text-link" href="http://www.mellon.org/" value="Andrew W. Mellon Foundation"/>
|
||||
<label class="text-link" href="http://www.imls.gov/" value="Institute of Museum and Library Services"/>
|
||||
<label class="text-link" href="http://www.mozilla.org/" value="Mozilla Foundation"/>
|
||||
<label class="text-link" href="http://www.famfamfam.com/lab/icons/silk/" value="famfamfam (icons)"/>
|
||||
<label class="text-link" href="http://www.sloan.org/" value="Alfred P. Sloan Foundation"/>
|
||||
</vbox>
|
||||
</vbox>
|
||||
</dialog>
|
|
@ -21,139 +21,467 @@
|
|||
*/
|
||||
|
||||
var Zotero_Citation_Dialog = new function () {
|
||||
var _itemLocators = new Object();
|
||||
var _itemLocatorTypes = new Object();
|
||||
var _preserveData = {
|
||||
"prefix":"value",
|
||||
"suffix":"value",
|
||||
"locatorType":"selectedIndex",
|
||||
"locator":"value",
|
||||
"suppressAuthor":"checked"
|
||||
};
|
||||
|
||||
var _itemData = new Object();
|
||||
var _multipleSourcesOn = false;
|
||||
var _lastSelected = null;
|
||||
var _previewShown = false;
|
||||
var _suppressNextTreeSelect = false;
|
||||
var _locatorIndexArray = {};
|
||||
var _autoRegeneratePref;
|
||||
var _acceptButton;
|
||||
var _sortCheckbox;
|
||||
var _originalHTML;
|
||||
var io;
|
||||
|
||||
this.load = load;
|
||||
this.toggleMultipleSources = toggleMultipleSources;
|
||||
this.toggleEditor = toggleEditor;
|
||||
this.treeItemSelected = treeItemSelected;
|
||||
this.listItemSelected = listItemSelected;
|
||||
this.addCitation = addCitation;
|
||||
this.deleteCitation = deleteCitation;
|
||||
this.add = add;
|
||||
this.remove = remove;
|
||||
this.sortCitation = sortCitation;
|
||||
this.confirmRegenerate = confirmRegenerate;
|
||||
this.accept = accept;
|
||||
this.cancel = cancel;
|
||||
|
||||
/*
|
||||
* initialize add citation dialog
|
||||
*/
|
||||
function load() {
|
||||
document.getElementById("multiple-sources-button").label = Zotero.getString("citation.multipleSources");
|
||||
document.getElementById("show-editor-button").label = Zotero.getString("citation.showEditor");
|
||||
|
||||
if(Zotero.isWin) {
|
||||
document.getElementById("zotero-select-items-container").style.border = "1px solid black";
|
||||
}
|
||||
io = window.arguments[0].wrappedJSObject;
|
||||
|
||||
// find accept button
|
||||
_acceptButton = document.getElementById("add-citation-dialog").getButton("accept");
|
||||
_autoRegeneratePref = Zotero.Prefs.get("integration.autoRegenerate");
|
||||
|
||||
// if a style with sortable citations, present checkbox
|
||||
if(io.citation.sortable) {
|
||||
_sortCheckbox = document.getElementById("keepSorted");
|
||||
_sortCheckbox.hidden = false;
|
||||
_sortCheckbox.checked = true;
|
||||
io.citation.properties.sort = true;
|
||||
}
|
||||
|
||||
// load locators
|
||||
var locators = Zotero.CSL.Global.getLocatorStrings();
|
||||
var menu = document.getElementById("locatorType");
|
||||
var popup = document.getElementById("locator-type-popup");
|
||||
var i = 0;
|
||||
for(var value in locators) {
|
||||
var locator = locators[value];
|
||||
locator = locator[0].toUpperCase()+locator.substr(1);
|
||||
// add to popup
|
||||
var child = document.createElement("menuitem");
|
||||
child.setAttribute("value", value);
|
||||
child.setAttribute("label", locator);
|
||||
popup.appendChild(child);
|
||||
// add to array
|
||||
_locatorIndexArray[value] = i;
|
||||
i++;
|
||||
}
|
||||
menu.selectedIndex = 0;
|
||||
|
||||
// load (from selectItemsDialog.js)
|
||||
doLoad();
|
||||
|
||||
// if we already have a citation, load data from it
|
||||
document.getElementById('editor').format = "Integration";
|
||||
if(io.citation.citationItems.length) {
|
||||
if(io.citation.citationItems.length == 1) {
|
||||
// single citation
|
||||
_suppressNextTreeSelect = true;
|
||||
itemsView.selectItem(io.citation.citationItems[0].itemID); // treeview from selectItemsDialog.js
|
||||
for(var property in _preserveData) {
|
||||
if(io.citation.citationItems[0][property]) {
|
||||
if(property == "locatorType") {
|
||||
document.getElementById(property)[_preserveData[property]] = _locatorIndexArray[io.citation.citationItems[0][property]];
|
||||
} else {
|
||||
document.getElementById(property)[_preserveData[property]] = io.citation.citationItems[0][property];
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// multiple citations
|
||||
toggleMultipleSources();
|
||||
for(var i=0; i<io.citation.citationItems.length; i++) {
|
||||
var item = Zotero.Items.get(io.citation.citationItems[i].itemID);
|
||||
if(item) {
|
||||
_addItem(item);
|
||||
_itemData[io.citation.citationItems[i].itemID] = io.citation.citationItems[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// show user-editable edited citation
|
||||
if(io.citation.properties.custom) {
|
||||
toggleEditor(io.citation.properties.custom);
|
||||
io.citation.properties.custom = undefined;
|
||||
}
|
||||
|
||||
_updateAccept();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* turn on/off multiple sources item list
|
||||
*/
|
||||
function toggleMultipleSources() {
|
||||
_multipleSourcesOn = !_multipleSourcesOn;
|
||||
if(_multipleSourcesOn) {
|
||||
document.getElementById("multiple-sources").hidden = true;
|
||||
document.getElementById("add-citation-dialog").width = "600";
|
||||
document.getElementById("multiple-sources-button").label = Zotero.getString("citation.multipleSources");
|
||||
window.sizeToContent();
|
||||
window.moveTo((window.screenX+75), window.screenY);
|
||||
} else {
|
||||
document.getElementById("multiple-sources").hidden = undefined;
|
||||
document.getElementById("add-citation-dialog").width = "750";
|
||||
document.getElementById("multiple-sources-button").label = Zotero.getString("citation.singleSource");
|
||||
window.sizeToContent();
|
||||
window.moveTo((window.screenX-75), window.screenY);
|
||||
}
|
||||
|
||||
_multipleSourcesOn = !_multipleSourcesOn;
|
||||
}
|
||||
|
||||
function treeItemSelected() {
|
||||
if(_multipleSourcesOn) {
|
||||
// get selected item (from selectItemsDialog.js)
|
||||
var item = getSelectedItems(true);
|
||||
|
||||
// if item has already been added, disable add button
|
||||
document.getElementById("citation-add").disabled = (!item.length || _itemLocators[item[0]] != undefined ? true : false);
|
||||
}
|
||||
}
|
||||
|
||||
function listItemSelected() {
|
||||
var pagesBox = document.getElementById("item-locator");
|
||||
var locatorTypeBox = document.getElementById("item-locator-type");
|
||||
if(_lastSelected) {
|
||||
_itemLocators[_lastSelected.value] = pagesBox.value;
|
||||
_itemLocatorTypes[_lastSelected.value] = locatorTypeBox.selectedIndex;
|
||||
}
|
||||
|
||||
var selectedListItem = document.getElementById("citation-list").getSelectedItem(0);
|
||||
|
||||
if(selectedListItem) {
|
||||
document.getElementById("citation-delete").disabled = pagesBox.disabled = locatorTypeBox.disabled = false;
|
||||
pagesBox.value = _itemLocators[selectedListItem.value];
|
||||
locatorTypeBox.selectedIndex = _itemLocatorTypes[selectedListItem.value];
|
||||
treeItemSelected();
|
||||
// disable adding info until citation added
|
||||
_itemSelected(false);
|
||||
} else {
|
||||
document.getElementById("citation-delete").disabled = pagesBox.disabled = locatorTypeBox.disabled = true;
|
||||
pagesBox.value = "";
|
||||
locatorTypeBox.selectedIndex = -1;
|
||||
document.getElementById("multiple-sources").hidden = true;
|
||||
document.getElementById("add-citation-dialog").width = "600";
|
||||
document.getElementById("multiple-sources-button").label = Zotero.getString("citation.multipleSources");
|
||||
window.sizeToContent();
|
||||
window.moveTo((window.screenX+75), window.screenY);
|
||||
|
||||
// enable all fields
|
||||
for(var i in _preserveData) {
|
||||
document.getElementById(i).disabled = false;
|
||||
}
|
||||
|
||||
// delete item list
|
||||
_itemData = new Object();
|
||||
|
||||
// delete all items
|
||||
_clearCitationList();
|
||||
}
|
||||
|
||||
_lastSelected = selectedListItem;
|
||||
_updateAccept();
|
||||
_updatePreview();
|
||||
}
|
||||
|
||||
function addCitation() {
|
||||
// get selected item (from selectItemsDialog.js)
|
||||
var item = getSelectedItems();
|
||||
item = item[0];
|
||||
var itemID = item.getID();
|
||||
/*
|
||||
* called when an item in the item selection tree is clicked
|
||||
*/
|
||||
function treeItemSelected() {
|
||||
if(_suppressNextTreeSelect) {
|
||||
_suppressNextTreeSelect = false;
|
||||
_updateAccept();
|
||||
return;
|
||||
}
|
||||
var items = itemsView.getSelectedItems(true); // treeview from selectItemsDialog.js
|
||||
var itemID = (items.length ? items[0] : false);
|
||||
|
||||
// add to list
|
||||
var itemNode = document.createElement("listitem");
|
||||
itemNode.setAttribute("value", itemID);
|
||||
itemNode.setAttribute("label", item.getField("title"));
|
||||
itemNode.setAttribute("class", "listitem-iconic");
|
||||
itemNode.setAttribute("image", "chrome://zotero/skin/treeitem-"+Zotero.ItemTypes.getName(item.getType())+".png");
|
||||
document.getElementById("citation-list").appendChild(itemNode);
|
||||
if(_multipleSourcesOn) {
|
||||
// if item is also on right side, show info
|
||||
var hasBeenAdded = itemID && _itemData[itemID] !== undefined;
|
||||
// disable boxes if item not added; otherwise, enable
|
||||
_itemSelected(hasBeenAdded ? itemID : false);
|
||||
// disable adding nothing, or things already added
|
||||
document.getElementById("add").disabled = !itemID || hasBeenAdded;
|
||||
} else {
|
||||
_updateAccept();
|
||||
_updatePreview();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* called when an item in the selected items list is clicked
|
||||
*/
|
||||
function listItemSelected() {
|
||||
var selectedListItem = document.getElementById("citation-list").getSelectedItem(0);
|
||||
var itemID = (selectedListItem ? selectedListItem.value : false);
|
||||
_itemSelected(itemID);
|
||||
|
||||
document.getElementById("remove").disabled = !itemID;
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a citation to the multipleSources list
|
||||
*/
|
||||
function add() {
|
||||
var item = itemsView.getSelectedItems()[0]; // treeview from selectItemsDialog.js
|
||||
_itemSelected(item.getID());
|
||||
_addItem(item);
|
||||
|
||||
// don't let someone select it again
|
||||
document.getElementById("citation-add").disabled = true;
|
||||
document.getElementById("add").disabled = true;
|
||||
|
||||
// flag
|
||||
_itemLocators[itemID] = document.getElementById("tree-locator").value;
|
||||
_itemLocatorTypes[itemID] = document.getElementById("tree-locator-type").selectedIndex;
|
||||
document.getElementById("tree-locator").value = "";
|
||||
// allow user to press OK
|
||||
_updateAccept();
|
||||
_updatePreview();
|
||||
sortCitation();
|
||||
}
|
||||
|
||||
function deleteCitation() {
|
||||
/*
|
||||
* Deletes a citation from the multipleSources list
|
||||
*/
|
||||
function remove() {
|
||||
var citationList = document.getElementById("citation-list");
|
||||
var selectedListItem = citationList.getSelectedItem(0);
|
||||
var itemID = selectedListItem.value;
|
||||
|
||||
// remove from _itemLocators
|
||||
_itemLocators[selectedListItem.value] = _itemLocatorType[selectedListItem.value] = undefined;
|
||||
// remove from _itemData
|
||||
delete _itemData[itemID];
|
||||
_itemData[itemID] = undefined;
|
||||
_lastSelected = null;
|
||||
|
||||
// re-select currently selected in left pane
|
||||
var itemIDs = itemsView.getSelectedItems(true); // treeview from selectItemsDialog.js
|
||||
if(itemIDs.length) {
|
||||
document.getElementById("zotero-items-tree").focus();
|
||||
treeItemSelected();
|
||||
}
|
||||
|
||||
// remove from list
|
||||
citationList.removeChild(selectedListItem);
|
||||
|
||||
_updateAccept();
|
||||
_updatePreview();
|
||||
treeItemSelected();
|
||||
}
|
||||
|
||||
/*
|
||||
* Sorts the list of citations
|
||||
*/
|
||||
function sortCitation() {
|
||||
io.citation.properties.sort = _sortCheckbox.checked;
|
||||
if(_sortCheckbox.checked) {
|
||||
_getCitation();
|
||||
|
||||
// delete all existing items from list
|
||||
_clearCitationList();
|
||||
|
||||
// run preview function to re-sort, if it hasn't already been
|
||||
// run
|
||||
io.previewFunction();
|
||||
|
||||
// add items back to list
|
||||
for(var i=0; i<io.citation.citationItems.length; i++) {
|
||||
var item = Zotero.Items.get(io.citation.citationItems[i].itemID);
|
||||
_addItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Ask whether to modfiy the preview
|
||||
*/
|
||||
function confirmRegenerate(focusShifted) {
|
||||
if(document.getElementById('editor').value == _originalHTML) {
|
||||
// no changes; just update without asking
|
||||
_updatePreview();
|
||||
return;
|
||||
}
|
||||
|
||||
if(_autoRegeneratePref == -1) {
|
||||
if(focusShifted) { // only ask after onchange event; oninput is too
|
||||
// frequent for this to be worthwhile
|
||||
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService);
|
||||
|
||||
var saveBehavior = { value: false };
|
||||
var regenerate = promptService.confirmEx(
|
||||
this.window,
|
||||
Zotero.getString('integration.regenerate.title'),
|
||||
Zotero.getString('integration.regenerate.body'),
|
||||
promptService.STD_YES_NO_BUTTONS,
|
||||
null, null, null,
|
||||
Zotero.getString('integration.regenerate.saveBehavior'),
|
||||
saveBehavior
|
||||
);
|
||||
|
||||
if(saveBehavior.value) {
|
||||
_autoRegeneratePref = (regenerate == 0 ? 1 : 0);
|
||||
Zotero.Prefs.set("integration.autoRegenerate", _autoRegeneratePref);
|
||||
}
|
||||
|
||||
if(regenerate == 0) {
|
||||
_updatePreview();
|
||||
}
|
||||
}
|
||||
} else if(_autoRegeneratePref == 1) {
|
||||
_updatePreview();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Shows the edit pane
|
||||
*/
|
||||
function toggleEditor(text) {
|
||||
var editor = document.getElementById('editor');
|
||||
editor.hidden = _previewShown;
|
||||
_previewShown = !_previewShown;
|
||||
|
||||
if(_previewShown) {
|
||||
document.getElementById("show-editor-button").label = Zotero.getString("citation.hideEditor");
|
||||
window.sizeToContent();
|
||||
if(text) {
|
||||
editor.value = text;
|
||||
} else {
|
||||
_updatePreview();
|
||||
}
|
||||
} else {
|
||||
document.getElementById("show-editor-button").label = Zotero.getString("citation.showEditor");
|
||||
window.sizeToContent();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* called when accept button is clicked
|
||||
*/
|
||||
function accept() {
|
||||
var io = window.arguments[0];
|
||||
_getCitation();
|
||||
if(_previewShown && io.citation.citationItems.length // if a citation is selected
|
||||
&& document.getElementById('editor').value != _originalHTML) { // and citation has been edited
|
||||
io.citation.properties.custom = document.getElementById('editor').value;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* called when cancel button is clicked
|
||||
*/
|
||||
function cancel() {
|
||||
io.citation.citationItems = new Array();
|
||||
}
|
||||
|
||||
/*
|
||||
* Updates the contents of the preview pane
|
||||
*/
|
||||
function _updatePreview() {
|
||||
if(_previewShown) {
|
||||
var editor = document.getElementById('editor');
|
||||
_getCitation();
|
||||
|
||||
editor.readonly = !io.citation.citationItems.length;
|
||||
editor.value = _originalHTML = (io.citation.citationItems.length ? io.previewFunction() : "");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Controls whether the accept (OK) button should be enabled
|
||||
*/
|
||||
function _updateAccept(status) {
|
||||
if(_multipleSourcesOn) {
|
||||
treeItemSelected(); // store locator info
|
||||
_acceptButton.disabled = !document.getElementById("citation-list").childNodes.length;
|
||||
} else {
|
||||
_acceptButton.disabled = !itemsView.getSelectedItems().length; // treeview from selectItemsDialog.js
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* called when an item is selected; if itemID is false, disables fields; if
|
||||
* itemID is undefined, only updates _itemData array
|
||||
*/
|
||||
function _itemSelected(itemID) {
|
||||
if(_lastSelected && !_itemData[_lastSelected]) {
|
||||
_itemData[_lastSelected] = new Object();
|
||||
}
|
||||
|
||||
for(var box in _preserveData) {
|
||||
var domBox = document.getElementById(box);
|
||||
var property = _preserveData[box];
|
||||
|
||||
// save property
|
||||
if(_lastSelected) {
|
||||
if(property == "locatorType") {
|
||||
_itemData[_lastSelected][box] = domBox.selectedItem.value;
|
||||
} else {
|
||||
_itemData[_lastSelected][box] = domBox[property];
|
||||
}
|
||||
}
|
||||
// restore previous property
|
||||
if(itemID) {
|
||||
domBox.disabled = false;
|
||||
if(_itemData[itemID] && _itemData[itemID][box] !== undefined) {
|
||||
if(property == "locatorType") {
|
||||
domBox[property] = _locatorIndexArray[_itemData[itemID][box]];
|
||||
} else {
|
||||
domBox[property] = _itemData[itemID][box];
|
||||
}
|
||||
}
|
||||
} else if(itemID !== undefined) {
|
||||
domBox.disabled = true;
|
||||
domBox[property] = "";
|
||||
}
|
||||
}
|
||||
|
||||
if(itemID !== undefined) _lastSelected = itemID;
|
||||
}
|
||||
|
||||
/*
|
||||
* updates io.citation to reflect selected items
|
||||
*/
|
||||
function _getCitation() {
|
||||
io.citation.citationItems = new Array();
|
||||
|
||||
// use to map selectedIndexes back to page/paragraph/line
|
||||
var locatorTypeElements = document.getElementById("locatorType").getElementsByTagName("menuitem");
|
||||
if(_multipleSourcesOn) {
|
||||
_itemSelected(); // store locator info
|
||||
|
||||
var citationList = document.getElementById("citation-list");
|
||||
var listLength = citationList.childNodes.length;
|
||||
|
||||
var citationItems = new Array();
|
||||
if(listLength) {
|
||||
io.items = new Array();
|
||||
io.locatorTypes = new Array();
|
||||
io.locators = new Array();
|
||||
|
||||
// generate citationItems
|
||||
for(var i=0; i<listLength; i++) {
|
||||
var itemID = citationList.childNodes[i].value;
|
||||
io.items.push(itemID);
|
||||
io.locatorTypes.push(_itemLocatorTypes[itemID]);
|
||||
io.locators.push(_itemLocators[itemID]);
|
||||
|
||||
var citationItem = _itemData[itemID];
|
||||
citationItem.itemID = itemID;
|
||||
io.citation.citationItems.push(citationItem);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// get selected item (from selectItemsDialog.js)
|
||||
io.items = getSelectedItems(true);
|
||||
var items = itemsView.getSelectedItems(true); // treeview from selectItemsDialog.js
|
||||
|
||||
if(io.items.length) {
|
||||
io.locatorTypes = new Array(document.getElementById("tree-locator-type").selectedItem.value);
|
||||
io.locators = new Array(document.getElementById("tree-locator").value);
|
||||
var citationItem = new Zotero.CSL.CitationItem();
|
||||
citationItem.itemID = items[0];
|
||||
for(var property in _preserveData) {
|
||||
if(property == "locatorType") {
|
||||
citationItem[property] = document.getElementById(property).selectedItem.value;
|
||||
} else {
|
||||
citationItem[property] = document.getElementById(property)[_preserveData[property]];
|
||||
}
|
||||
}
|
||||
io.citation.citationItems = [citationItem];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Add an item to the item list (multiple sources only)
|
||||
*/
|
||||
function _addItem(item) {
|
||||
var itemNode = document.createElement("listitem");
|
||||
itemNode.setAttribute("value", item.getID());
|
||||
itemNode.setAttribute("label", item.getField("title"));
|
||||
itemNode.setAttribute("class", "listitem-iconic");
|
||||
itemNode.setAttribute("image", item.getImageSrc());
|
||||
document.getElementById("citation-list").appendChild(itemNode);
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes all items from the multiple sources list
|
||||
*/
|
||||
function _clearCitationList() {
|
||||
var citationList = document.getElementById("citation-list");
|
||||
while(citationList.firstChild) {
|
||||
citationList.removeChild(citationList.firstChild);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -23,118 +23,131 @@
|
|||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/overlay.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/addCitationDialog.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/integration.css" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
|
||||
<dialog
|
||||
id="add-citation-dialog"
|
||||
orient="vertical"
|
||||
title="Add Citation"
|
||||
title="&zotero.integration.addEditCitation.title;"
|
||||
width="600" height="450"
|
||||
onload="Zotero_Citation_Dialog.load();"
|
||||
onunload="doUnload();"
|
||||
ondialogaccept="Zotero_Citation_Dialog.accept();"
|
||||
ondialogcancel="Zotero_Citation_Dialog.cancel();"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
style="padding:2em">
|
||||
style="padding: 0">
|
||||
|
||||
<script src="include.js"/>
|
||||
<script src="selectItemsDialog.js"/>
|
||||
<script src="addCitationDialog.js"/>
|
||||
|
||||
<hbox flex="1">
|
||||
<vbox id="zotero-select-items-container" flex="1" style="padding: 1em">
|
||||
<vbox flex="1">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&toolbar.search.label;" control="tb-search"/>
|
||||
<textbox id="tb-search" type="timed" timeout="250" oncommand="onSearch()" dir="reverse" onkeypress="if(event.keyCode == event.DOM_VK_ESCAPE) { this.value = ''; this.doCommand('cmd_zotero_search'); return false; }">
|
||||
<toolbarbutton id="tb-search-cancel" oncommand="this.parentNode.value='';" hidden="true"/>
|
||||
</textbox>
|
||||
</hbox>
|
||||
|
||||
<hbox flex="1">
|
||||
<tree id="collections-tree"
|
||||
style="width: 200px;" hidecolumnpicker="true" seltype="single"
|
||||
onselect="onCollectionSelected();">
|
||||
<treecols>
|
||||
<treecol
|
||||
id="name_column"
|
||||
label="&collections.name_column;"
|
||||
flex="1"
|
||||
primary="true"/>
|
||||
</treecols>
|
||||
<treechildren/>
|
||||
</tree>
|
||||
|
||||
<tree id="items-tree"
|
||||
flex="1" hidecolumnpicker="true" seltype="single"
|
||||
onselect="Zotero_Citation_Dialog.treeItemSelected();">
|
||||
<treecols>
|
||||
<treecol
|
||||
id="title" primary="true"
|
||||
label="&items.title_column;"
|
||||
flex="4" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="firstCreator"
|
||||
label="&items.creator_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="dateAdded" hidden="true"
|
||||
label="&items.dateAdded_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="dateModified" hidden="true"
|
||||
label="&items.dateModified_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
</treecols>
|
||||
<treechildren/>
|
||||
</tree>
|
||||
<vbox align="stretch" flex="1">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&zotero.toolbar.search.label;" control="zotero-tb-search"/>
|
||||
<textbox id="zotero-tb-search" type="timed" timeout="250" oncommand="onSearch()" dir="reverse" onkeypress="if(event.keyCode == event.DOM_VK_ESCAPE) { this.value = ''; this.doCommand('cmd_zotero_search'); return false; } return true;">
|
||||
<toolbarbutton id="zotero-tb-search-cancel" oncommand="this.parentNode.value='';" hidden="true"/>
|
||||
</textbox>
|
||||
</hbox>
|
||||
<hbox flex="1" style="margin-top: 5px">
|
||||
<tree id="zotero-collections-tree"
|
||||
style="width: 200px;" hidecolumnpicker="true" seltype="single"
|
||||
onselect="onCollectionSelected();">
|
||||
<treecols>
|
||||
<treecol
|
||||
id="zotero-collections-name-column"
|
||||
label="&zotero.collections.name_column;"
|
||||
flex="1"
|
||||
primary="true"/>
|
||||
</treecols>
|
||||
<treechildren/>
|
||||
</tree>
|
||||
|
||||
<tree id="zotero-items-tree"
|
||||
flex="1" hidecolumnpicker="true" seltype="single"
|
||||
onselect="Zotero_Citation_Dialog.treeItemSelected();">
|
||||
<treecols>
|
||||
<treecol
|
||||
id="zotero-items-column-title" primary="true"
|
||||
label="&zotero.items.title_column;"
|
||||
flex="4" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-firstCreator"
|
||||
label="&zotero.items.creator_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-dateAdded" hidden="true"
|
||||
label="&zotero.items.dateAdded_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-dateModified" hidden="true"
|
||||
label="&zotero.items.dateModified_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
</treecols>
|
||||
<treechildren/>
|
||||
</tree>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<hbox hidden="true" id="multiple-sources">
|
||||
<vbox align="center" pack="center">
|
||||
<toolbarbutton id="add" oncommand="Zotero_Citation_Dialog.add()" disabled="true"/>
|
||||
<toolbarbutton id="remove" oncommand="Zotero_Citation_Dialog.remove()" disabled="true"/>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<checkbox id="keepSorted" hidden="true" checked="false" oncommand="Zotero_Citation_Dialog.sortCitation()" label="&zotero.citation.keepSorted.label;"/>
|
||||
<listbox id="citation-list" flex="1" align="stretch" seltype="single"
|
||||
onselect="Zotero_Citation_Dialog.listItemSelected();"></listbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<menulist id="tree-locator-type">
|
||||
<menupopup id="tree-locator-type-popup">
|
||||
<menuitem value="p" label="&citation.page;" selected="1"/>
|
||||
<menuitem value="g" label="&citation.paragraph;"/>
|
||||
<menuitem value="l" label="&citation.line;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<textbox id="tree-locator" flex="1"/>
|
||||
<hbox align="stretch" style="margin-top: 8px">
|
||||
<vbox flex="1">
|
||||
<hbox align="center">
|
||||
<label value="&zotero.citation.prefix.label;"/>
|
||||
<textbox oninput="Zotero_Citation_Dialog.confirmRegenerate(false)" onchange="Zotero_Citation_Dialog.confirmRegenerate(true)" class="fix" id="prefix" align="stretch" flex="1"/>
|
||||
</hbox>
|
||||
<hbox align="center">
|
||||
<label value="&zotero.citation.suffix.label;"/>
|
||||
<textbox oninput="Zotero_Citation_Dialog.confirmRegenerate(false)" onchange="Zotero_Citation_Dialog.confirmRegenerate(true)" class="fix" id="suffix" align="stretch" flex="1"/>
|
||||
</hbox>
|
||||
<spacer flex="1"/>
|
||||
</vbox>
|
||||
<separator flex="4"/>
|
||||
<vbox flex="1">
|
||||
<hbox align="stretch">
|
||||
<menulist onchange="Zotero_Citation_Dialog.confirmRegenerate(true)" id="locatorType">
|
||||
<menupopup id="locator-type-popup"/>
|
||||
</menulist>
|
||||
<textbox oninput="Zotero_Citation_Dialog.confirmRegenerate(false)" onchange="Zotero_Citation_Dialog.confirmRegenerate(true)" id="locator" flex="1"/>
|
||||
</hbox>
|
||||
<separator style="height: 2px" flex="1"/>
|
||||
<checkbox oncommand="Zotero_Citation_Dialog.confirmRegenerate(true)" id="suppressAuthor" label="&zotero.citation.suppressAuthor.label;"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<hbox hidden="true" id="multiple-sources">
|
||||
<vbox pack="center">
|
||||
<toolbarbutton id="citation-add" oncommand="Zotero_Citation_Dialog.addCitation()" disabled="true"/>
|
||||
<toolbarbutton id="citation-delete" oncommand="Zotero_Citation_Dialog.deleteCitation()" disabled="true"/>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<listbox id="citation-list" flex="1" seltype="single"
|
||||
onselect="Zotero_Citation_Dialog.listItemSelected();"></listbox>
|
||||
<hbox>
|
||||
<menulist id="item-locator-type" disabled="true">
|
||||
<menupopup id="item-locator-type-popup">
|
||||
<menuitem value="p" label="&citation.page;"/>
|
||||
<menuitem value="g" label="&citation.paragraph;"/>
|
||||
<menuitem value="l" label="&citation.line;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<textbox id="item-locator"/>
|
||||
<textbox id="editor" type="styled" hidden="true" flex="1"/>
|
||||
|
||||
<hbox style="margin-top: 15px">
|
||||
<hbox>
|
||||
<button id="show-editor-button" oncommand="Zotero_Citation_Dialog.toggleEditor()"/>
|
||||
<button id="multiple-sources-button" oncommand="Zotero_Citation_Dialog.toggleMultipleSources()"/>
|
||||
</hbox>
|
||||
<vbox flex="1" align="end">
|
||||
<hbox>
|
||||
<button dlgtype="cancel"/>
|
||||
<button dlgtype="accept" disabled="true"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<vbox>
|
||||
<button id="multiple-sources-button" oncommand="Zotero_Citation_Dialog.toggleMultipleSources()"/>
|
||||
</vbox>
|
||||
<vbox flex="1" align="end">
|
||||
<hbox>
|
||||
<button dlgtype="cancel"/>
|
||||
<button dlgtype="accept"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</dialog>
|
||||
|
|
133
chrome/content/zotero/advancedSearch.js
Normal file
133
chrome/content/zotero/advancedSearch.js
Normal file
|
@ -0,0 +1,133 @@
|
|||
var ZoteroAdvancedSearch = new function() {
|
||||
this.onLoad = onLoad;
|
||||
this.search = search;
|
||||
this.clear = clear;
|
||||
this.save = save;
|
||||
this.onDblClick = onDblClick;
|
||||
this.onUnload = onUnload;
|
||||
|
||||
this.itemsView = false;
|
||||
|
||||
var _searchBox;
|
||||
|
||||
function onLoad() {
|
||||
_searchBox = document.getElementById('zotero-search-box');
|
||||
|
||||
// Set font size from pref
|
||||
var sbc = document.getElementById('zotero-search-box-container');
|
||||
Zotero.setFontSize(sbc);
|
||||
|
||||
var io = window.arguments[0];
|
||||
_searchBox.search = io.dataIn.search;
|
||||
}
|
||||
|
||||
|
||||
function search() {
|
||||
_searchBox.updateSearch();
|
||||
|
||||
// A minimal implementation of Zotero.CollectionTreeView
|
||||
var itemGroup = {
|
||||
isSearchMode: function() { return true; },
|
||||
getChildItems: function () {
|
||||
var ids = _searchBox.search.search();
|
||||
return Zotero.Items.get(ids);
|
||||
},
|
||||
isLibrary: function () { return false; },
|
||||
isCollection: function () { return false; },
|
||||
isSearch: function () { return true; }
|
||||
}
|
||||
|
||||
if (this.itemsView) {
|
||||
this.itemsView.unregister();
|
||||
}
|
||||
|
||||
this.itemsView = new Zotero.ItemTreeView(itemGroup, false);
|
||||
document.getElementById('zotero-items-tree').view = this.itemsView;
|
||||
}
|
||||
|
||||
|
||||
function clear() {
|
||||
if (this.itemsView) {
|
||||
this.itemsView.unregister();
|
||||
}
|
||||
document.getElementById('zotero-items-tree').view = null;
|
||||
|
||||
var s = new Zotero.Search();
|
||||
s.addCondition('title', 'contains', '');
|
||||
_searchBox.search = s;
|
||||
}
|
||||
|
||||
|
||||
function save() {
|
||||
_searchBox.updateSearch();
|
||||
|
||||
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService);
|
||||
|
||||
var untitled = Zotero.DB.getNextName('collections', 'collectionName',
|
||||
Zotero.getString('pane.collections.untitled'));
|
||||
|
||||
var name = { value: untitled };
|
||||
var result = promptService.prompt(window,
|
||||
Zotero.getString('pane.collections.newSavedSeach'),
|
||||
Zotero.getString('pane.collections.savedSearchName'), name, "", {});
|
||||
|
||||
if (!result)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!name.value)
|
||||
{
|
||||
newName.value = untitled;
|
||||
}
|
||||
|
||||
var s = _searchBox.search.clone();
|
||||
s.setName(name.value);
|
||||
s.save();
|
||||
}
|
||||
|
||||
|
||||
// Adapted from: http://www.xulplanet.com/references/elemref/ref_tree.html#cmnote-9
|
||||
function onDblClick(event, tree)
|
||||
{
|
||||
if (event && tree && event.type == "dblclick")
|
||||
{
|
||||
var row = {}, col = {}, obj = {};
|
||||
tree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, col, obj);
|
||||
// obj.value == cell/text/image
|
||||
// TODO: handle collection double-click
|
||||
if (obj.value && this.itemsView && this.itemsView.selection.currentIndex > -1)
|
||||
{
|
||||
var item = this.itemsView.getSelectedItems()[0];
|
||||
|
||||
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Components.interfaces.nsIWindowMediator);
|
||||
|
||||
var lastWin = wm.getMostRecentWindow("navigator:browser");
|
||||
|
||||
if (!lastWin) {
|
||||
window.open();
|
||||
var newWindow = wm.getMostRecentWindow("navigator:browser");
|
||||
var b = newWindow.getBrowser();
|
||||
return;
|
||||
}
|
||||
|
||||
if (lastWin.document.getElementById('zotero-pane').getAttribute('hidden') == 'true') {
|
||||
lastWin.ZoteroPane.toggleDisplay();
|
||||
}
|
||||
|
||||
lastWin.ZoteroPane.selectItem(item.getID(), false, true);
|
||||
lastWin.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function onUnload() {
|
||||
// Unregister search from Notifier
|
||||
if (this.itemsView) {
|
||||
this.itemsView.unregister();
|
||||
}
|
||||
}
|
||||
}
|
63
chrome/content/zotero/advancedSearch.xul
Normal file
63
chrome/content/zotero/advancedSearch.xul
Normal file
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/overlay.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window [
|
||||
<!ENTITY % zoteroDTD SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
%zoteroDTD;
|
||||
<!ENTITY % searchboxDTD SYSTEM "chrome://zotero/locale/searchbox.dtd">
|
||||
%searchboxDTD;
|
||||
]>
|
||||
|
||||
<window
|
||||
id="zotero-advanced-search-dialog"
|
||||
title="&zotero.toolbar.advancedSearch;"
|
||||
orient="vertical"
|
||||
persist="screenX screenY width height"
|
||||
onload="ZoteroAdvancedSearch.onLoad()"
|
||||
onunload="ZoteroAdvancedSearch.onUnload()"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
windowtype="zotero:search">
|
||||
|
||||
<script src="include.js"/>
|
||||
<script src="advancedSearch.js"/>
|
||||
<script src="chrome://global/content/nsDragAndDrop.js"/>
|
||||
<script src="chrome://global/content/nsTransferable.js"/>
|
||||
|
||||
<vbox id="zotero-search-box-container" flex="1">
|
||||
|
||||
<hbox>
|
||||
<zoterosearch id="zotero-search-box" oncommand="ZoteroAdvancedSearch.search()" flex="1"/>
|
||||
</hbox>
|
||||
|
||||
<hbox id="zotero-search-buttons">
|
||||
<button label="&zotero.search.search;" default="true" oncommand="ZoteroAdvancedSearch.search()"/>
|
||||
<button label="&zotero.search.clear;" oncommand="ZoteroAdvancedSearch.clear()"/>
|
||||
<button label="&zotero.search.saveSearch;" oncommand="ZoteroAdvancedSearch.save()"/>
|
||||
</hbox>
|
||||
|
||||
<tree id="zotero-items-tree" flex="1" hidecolumnpicker="true" seltype="multiple"
|
||||
ondblclick="ZoteroAdvancedSearch.onDblClick(event, this)"
|
||||
ondraggesture="if (event.target.localName == 'treechildren') { nsDragAndDrop.startDrag(event, ZoteroAdvancedSearch.itemsView); }">
|
||||
<treecols>
|
||||
<treecol
|
||||
id="zotero-items-column-title" primary="true"
|
||||
label="&zotero.items.title_column;"
|
||||
flex="4" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-firstCreator"
|
||||
label="&zotero.items.creator_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
</treecols>
|
||||
<treechildren alternatingbackground="true"/>
|
||||
</tree>
|
||||
|
||||
</vbox>
|
||||
|
||||
<keyset>
|
||||
<key id="key_close" key="W" modifiers="accel" oncommand="window.close()"/>
|
||||
</keyset>
|
||||
</window>
|
|
@ -29,9 +29,10 @@
|
|||
// Class to provide options for bibliography
|
||||
|
||||
var Zotero_File_Interface_Bibliography = new function() {
|
||||
var _io;
|
||||
var _io, _saveStyle;
|
||||
|
||||
this.init = init;
|
||||
this.styleChanged = styleChanged;
|
||||
this.acceptSelection = acceptSelection;
|
||||
|
||||
/*
|
||||
|
@ -39,46 +40,108 @@ var Zotero_File_Interface_Bibliography = new function() {
|
|||
* loading
|
||||
*/
|
||||
function init() {
|
||||
_io = window.arguments[0];
|
||||
// Set font size from pref
|
||||
// Affects bibliography.xul and integrationDocPrefs.xul
|
||||
var sbc = document.getElementById('zotero-bibliography-container');
|
||||
Zotero.setFontSize(sbc);
|
||||
|
||||
var listbox = document.getElementById("style-popup");
|
||||
var styleMenu = document.getElementById("style-menu");
|
||||
_io = window.arguments[0];
|
||||
if(_io.wrappedJSObject){
|
||||
_io = _io.wrappedJSObject;
|
||||
}
|
||||
|
||||
var listbox = document.getElementById("style-listbox");
|
||||
var styles = Zotero.Cite.getStyles();
|
||||
|
||||
// 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
|
||||
for(i in styles) {
|
||||
var itemNode = document.createElement("menuitem");
|
||||
for(var i in styles) {
|
||||
var itemNode = document.createElement("listitem");
|
||||
itemNode.setAttribute("value", i);
|
||||
itemNode.setAttribute("label", styles[i]);
|
||||
listbox.appendChild(itemNode);
|
||||
|
||||
if(i == _io.style) {
|
||||
styleMenu.selectedItem = itemNode;
|
||||
listbox.selectedItem = itemNode;
|
||||
}
|
||||
}
|
||||
|
||||
// select first item by default
|
||||
if(styleMenu.selectedIndex == -1) {
|
||||
styleMenu.selectedIndex = 0;
|
||||
if(listbox.selectedIndex == -1) {
|
||||
listbox.selectedIndex = 0;
|
||||
}
|
||||
|
||||
if(Zotero.isMac && document.getElementById("copy-to-clipboard")) {
|
||||
document.getElementById("copy-to-clipboard").hidden = "true";
|
||||
// ONLY FOR bibliography.xul: export options
|
||||
if(document.getElementById("save-as-rtf")) {
|
||||
// restore saved bibliographic settings
|
||||
document.getElementById(Zotero.Prefs.get("export.bibliographySettings")).setAttribute("selected", "true");
|
||||
|
||||
// disable clipboard on the Mac, because it can't support formatted
|
||||
// output
|
||||
if(Zotero.isMac) {
|
||||
document.getElementById("mac-clipboard-warning").hidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
// move to center of screen
|
||||
// ONLY FOR integrationDocPrefs.xul: update status of displayAs, set
|
||||
// bookmarks text
|
||||
if(document.getElementById("displayAs")) {
|
||||
if(_io.useEndnotes && _io.useEndnotes == 1) document.getElementById("displayAs").selectedIndex = 1;
|
||||
styleChanged();
|
||||
|
||||
if(_io.useBookmarks && _io.useBookmarks == 1) document.getElementById("formatUsing").selectedIndex = 1;
|
||||
if(_io.openOffice) {
|
||||
var formatOption = "referenceMarks";
|
||||
} else {
|
||||
var formatOption = "fields";
|
||||
}
|
||||
document.getElementById("fields").label = Zotero.getString("integration."+formatOption+".label");
|
||||
document.getElementById("fields-caption").textContent = Zotero.getString("integration."+formatOption+".caption");
|
||||
|
||||
// add border on Windows
|
||||
if(Zotero.isWin) {
|
||||
document.getElementById("zotero-bibliography-container").style.border = "1px solid black";
|
||||
}
|
||||
}
|
||||
window.sizeToContent();
|
||||
window.moveTo(
|
||||
(self.screen.width-window.innerWidth)/2,
|
||||
(self.screen.height-window.innerHeight)/2
|
||||
);
|
||||
window.centerWindowOnScreen();
|
||||
}
|
||||
|
||||
/*
|
||||
* ONLY FOR integrationDocPrefs.xul: called when style is changed
|
||||
*/
|
||||
function styleChanged() {
|
||||
// update status of displayAs box based
|
||||
var selectedStyle = document.getElementById("style-listbox").selectedItem.getAttribute('value');
|
||||
var styleClass = Zotero.Cite.getStyleClass(selectedStyle);
|
||||
document.getElementById("displayAs").disabled = styleClass != "note";
|
||||
}
|
||||
|
||||
function acceptSelection() {
|
||||
// collect code
|
||||
_io.style = document.getElementById("style-menu").selectedItem.value;
|
||||
_io.style = document.getElementById("style-listbox").selectedItem.value;
|
||||
if(document.getElementById("output-radio")) {
|
||||
// collect settings
|
||||
_io.output = document.getElementById("output-radio").selectedItem.id;
|
||||
// save settings
|
||||
Zotero.Prefs.set("export.bibliographySettings", _io.output);
|
||||
}
|
||||
|
||||
// ONLY FOR integrationDocPrefs.xul: collect displayAs
|
||||
if(document.getElementById("displayAs")) {
|
||||
_io.useEndnotes = document.getElementById("displayAs").selectedIndex;
|
||||
_io.useBookmarks = document.getElementById("formatUsing").selectedIndex;
|
||||
}
|
||||
|
||||
// save style (this happens only for "Export Bibliography," or Word
|
||||
// integration when no bibliography style was previously selected)
|
||||
if(_saveStyle) {
|
||||
Zotero.Prefs.set("export.lastStyle", _io.style);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,30 +1,33 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/bibliography.css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="&bibliography.title;" buttons="cancel,accept"
|
||||
title="&zotero.bibliography.title;" buttons="cancel,accept"
|
||||
ondialogaccept="Zotero_File_Interface_Bibliography.acceptSelection()"
|
||||
id="zotero-bibliography"
|
||||
onload="Zotero_File_Interface_Bibliography.init()">
|
||||
|
||||
<script src="include.js"/>
|
||||
<script src="bibliography.js"/>
|
||||
|
||||
<hbox>
|
||||
<label value="&bibliography.style.label;" control="style-menu"/>
|
||||
<menulist id="style-menu">
|
||||
<menupopup id="style-popup">
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
<groupbox>
|
||||
<caption label="&bibliography.output.label;"/>
|
||||
<radiogroup id="output-radio">
|
||||
<radio id="save-as-rtf" selected="true" label="&bibliography.saveAsRTF.label;"/>
|
||||
<radio id="save-as-html" label="&bibliography.saveAsHTML.label;"/>
|
||||
<radio id="copy-to-clipboard" label="&bibliography.copyToClipboard.label;"/>
|
||||
<radio id="print" label="&bibliography.print.label;"/>
|
||||
</radiogroup>
|
||||
</groupbox>
|
||||
|
||||
<script src="include.js"/>
|
||||
<script src="bibliography.js"/>
|
||||
|
||||
<vbox id="zotero-bibliography-container">
|
||||
<groupbox>
|
||||
<caption label="&zotero.bibliography.style.label;"/>
|
||||
<listbox id="style-listbox" oncommand="Zotero_File_Interface_Bibliography.styleChanged()"/>
|
||||
</groupbox>
|
||||
<groupbox>
|
||||
<caption label="&zotero.bibliography.output.label;"/>
|
||||
<radiogroup id="output-radio">
|
||||
<radio id="save-as-rtf" label="&zotero.bibliography.saveAsRTF.label;"/>
|
||||
<radio id="save-as-html" label="&zotero.bibliography.saveAsHTML.label;"/>
|
||||
<hbox align="center">
|
||||
<radio id="copy-to-clipboard" label="&zotero.bibliography.copyToClipboard.label;"/>
|
||||
<label id="mac-clipboard-warning" value="&zotero.bibliography.macClipboardWarning;"
|
||||
hidden="true" style="margin-left:1em; font-size:0.95em"/>
|
||||
</hbox>
|
||||
<radio id="print" label="&zotero.bibliography.print.label;"/>
|
||||
</radiogroup>
|
||||
</groupbox>
|
||||
</vbox>
|
||||
</dialog>
|
69
chrome/content/zotero/bindings/conditional-timed-textbox.xml
Normal file
69
chrome/content/zotero/bindings/conditional-timed-textbox.xml
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (c) 2006 Center for History and New Media
|
||||
George Mason University, Fairfax, Virginia, USA
|
||||
http://chnm.gmu.edu
|
||||
|
||||
Licensed under the Educational Community License, Version 1.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.opensource.org/licenses/ecl1.php
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
-->
|
||||
|
||||
<bindings xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="conditional-timed-textbox" extends="chrome://global/content/bindings/textbox.xml#timed-textbox">
|
||||
<implementation>
|
||||
<field name="skipTimeout"/>
|
||||
<field name="testcode"/>
|
||||
<field name="onbeforefire"/>
|
||||
<field name="onafterfire"/>
|
||||
<field name="ontestfail"/>
|
||||
|
||||
<method name="_fireCommand">
|
||||
<parameter name="me"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (me.skipTimeout) {
|
||||
me.skipTimeout = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var code = me.getAttribute('testcode');
|
||||
if (!code.length) {
|
||||
code = true;
|
||||
}
|
||||
|
||||
if (eval(code)) {
|
||||
if (me.getAttribute('onbeforefire')) {
|
||||
eval(me.getAttribute('onbeforefire'));
|
||||
}
|
||||
me._timer = null;
|
||||
me.doCommand();
|
||||
if (me.getAttribute('onafterfire')) {
|
||||
eval(me.getAttribute('onafterfire'));
|
||||
}
|
||||
}
|
||||
else {
|
||||
eval(me.getAttribute('ontestfail'));
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
</binding>
|
||||
</bindings>
|
|
@ -23,9 +23,14 @@
|
|||
<bindings xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="note-editor">
|
||||
<resources>
|
||||
<stylesheet src="chrome://zotero/skin/bindings/noteeditor.css"/>
|
||||
</resources>
|
||||
|
||||
<implementation>
|
||||
<field name="itemRef"/>
|
||||
<field name="itemRef">null</field>
|
||||
<property name="item" onget="return this.itemRef;">
|
||||
<setter>
|
||||
<![CDATA[
|
||||
|
@ -37,12 +42,12 @@
|
|||
|
||||
if(this.item && !this.getAttribute('notitle')=='1')
|
||||
{
|
||||
citeLabel.appendChild(document.createTextNode(this.item.getField('title')));
|
||||
citeLabel.appendChild(document.createTextNode(this.item.getDisplayTitle(true)));
|
||||
}
|
||||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
<field name="noteRef"/>
|
||||
<field name="noteRef">null</field>
|
||||
<property name="note" onget="return this.noteRef;">
|
||||
<setter>
|
||||
<![CDATA[
|
||||
|
@ -60,7 +65,7 @@
|
|||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
<field name="collectionRef"/>
|
||||
<field name="collectionRef">null</field>
|
||||
<property name="collection" onget="return this.collectionRef;" onset="this.collectionRef = val;"/>
|
||||
<property name="value" onget="return this.id('noteField').value;" onset="this.id('noteField').value = val;"/>
|
||||
<method name="save">
|
||||
|
@ -87,6 +92,44 @@
|
|||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="handleKeyDown">
|
||||
<parameter name="event"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
switch (event.keyCode) {
|
||||
// Insert tab manually
|
||||
case 9:
|
||||
if (event.shiftKey || event.ctrlKey || event.altKey) {
|
||||
return;
|
||||
}
|
||||
// From http://kb.mozillazine.org/Inserting_text_at_cursor
|
||||
try {
|
||||
var command = "cmd_insertText";
|
||||
var controller = document.commandDispatcher.getControllerForCommand(command);
|
||||
if (controller && controller.isCommandEnabled(command)) {
|
||||
controller = controller.QueryInterface(Components.interfaces.nsICommandController);
|
||||
var params = Components.classes["@mozilla.org/embedcomp/command-params;1"]
|
||||
.createInstance(Components.interfaces.nsICommandParams);
|
||||
params.setStringValue("state_data", "\t");
|
||||
controller.doCommandWithParams(command, params);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.debug("Can't do cmd_insertText!\n" + e, 1);
|
||||
}
|
||||
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
// DEBUG: is there a better way to prevent blur()?
|
||||
setTimeout(function() { event.target.focus(); }, 1);
|
||||
break;
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="focus">
|
||||
<body>
|
||||
<![CDATA[
|
||||
|
@ -94,6 +137,47 @@
|
|||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="selectParent">
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (!this.item.getID()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (document.getElementById('zotero-pane')) {
|
||||
var zp = ZoteroPane;
|
||||
}
|
||||
else {
|
||||
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Components.interfaces.nsIWindowMediator);
|
||||
|
||||
var lastWin = wm.getMostRecentWindow("navigator:browser");
|
||||
|
||||
if (!lastWin) {
|
||||
window.open();
|
||||
var newWindow = wm.getMostRecentWindow("navigator:browser");
|
||||
var b = newWindow.getBrowser();
|
||||
return;
|
||||
}
|
||||
|
||||
if (lastWin.document.getElementById('zotero-pane').getAttribute('hidden') == 'true') {
|
||||
lastWin.ZoteroPane.toggleDisplay();
|
||||
|
||||
// DEBUG: The actions below seem to crash Firefox 2.0.0.1 on OS X if
|
||||
// the Z pane isn't already open, so we don't try
|
||||
return;
|
||||
}
|
||||
|
||||
var zp = lastWin.ZoteroPane;
|
||||
}
|
||||
|
||||
zp.clearQuicksearch();
|
||||
zp.selectItem(this.item.getID());
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="id">
|
||||
<parameter name="id"/>
|
||||
<body>
|
||||
|
@ -103,12 +187,11 @@
|
|||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
<handlers>
|
||||
</handlers>
|
||||
|
||||
<content>
|
||||
<xul:vbox xbl:inherits="flex">
|
||||
<xul:label id="citeLabel"/>
|
||||
<xul:textbox id="noteField" multiline="true" type="timed" timeout="1000" flex="1" oncommand="this.parentNode.parentNode.save();"/>
|
||||
<xul:label id="citeLabel" onclick="document.getBindingParent(this).selectParent()"/>
|
||||
<xul:textbox id="noteField" multiline="true" type="timed" timeout="1000" flex="1" onkeydown="document.getBindingParent(this).handleKeyDown(event)" oncommand="document.getBindingParent(this).save();"/>
|
||||
<xul:hbox>
|
||||
<xul:linksbox id="links" flex="1"/>
|
||||
</xul:hbox>
|
||||
|
@ -145,10 +228,11 @@
|
|||
// TODO: localize
|
||||
var v = this.id('tags').summary;
|
||||
|
||||
if(!v || v == "")
|
||||
v = "[click here]";
|
||||
if (!v || v == "") {
|
||||
v = "[" + Zotero.getString('pane.item.noteEditor.clickHere') + "]";
|
||||
}
|
||||
|
||||
this.id('tagsLabel').value = "Tags: " + v;
|
||||
this.id('tagsLabel').value = Zotero.getString('pane.item.tags') + " " + v;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -168,10 +252,11 @@
|
|||
<![CDATA[
|
||||
var v = this.id('seeAlso').summary;
|
||||
|
||||
if(!v || v == "")
|
||||
v = "[click here]";
|
||||
if (!v || v == "") {
|
||||
v = "[" + Zotero.getString('pane.item.noteEditor.clickHere') + "]";
|
||||
}
|
||||
|
||||
this.id('seeAlsoLabel').value = "Related: " + v;
|
||||
this.id('seeAlsoLabel').value = Zotero.getString('pane.item.related') + " " + v;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -186,8 +271,8 @@
|
|||
</implementation>
|
||||
<content>
|
||||
<xul:vbox xbl:inherits="flex">
|
||||
<xul:label id="seeAlsoLabel" class="clicky" crop="end" onclick="this.parentNode.parentNode.seeAlsoClick();"/>
|
||||
<xul:label id="tagsLabel" class="clicky" crop="end" onclick="this.parentNode.parentNode.tagsClick();"/>
|
||||
<xul:label id="seeAlsoLabel" class="zotero-clicky" crop="end" onclick="this.parentNode.parentNode.seeAlsoClick();"/>
|
||||
<xul:label id="tagsLabel" class="zotero-clicky" crop="end" onclick="this.parentNode.parentNode.tagsClick();"/>
|
||||
<xul:popupset>
|
||||
<xul:popup id="seeAlsoPopup" width="300" onpopupshowing="this.firstChild.reload();">
|
||||
<xul:seealsobox id="seeAlso" flex="1"/>
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
***** END LICENSE BLOCK *****
|
||||
-->
|
||||
|
||||
<!DOCTYPE bindings SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
|
||||
<bindings xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
@ -106,7 +108,7 @@
|
|||
|
||||
var box = document.createElement('box');
|
||||
box.setAttribute('onclick',"this.parentNode.parentNode.parentNode.parentNode.parentNode.showItem('"+seealso[i].getID()+"')");
|
||||
box.setAttribute('class','clicky');
|
||||
box.setAttribute('class','zotero-clicky');
|
||||
box.setAttribute('flex','1');
|
||||
box.appendChild(icon);
|
||||
box.appendChild(label);
|
||||
|
@ -114,7 +116,7 @@
|
|||
var remove = document.createElement("label");
|
||||
remove.setAttribute('value','-');
|
||||
remove.setAttribute('onclick',"this.parentNode.parentNode.parentNode.parentNode.parentNode.remove('"+seealso[i].getID()+"');");
|
||||
remove.setAttribute('class','clicky');
|
||||
remove.setAttribute('class','zotero-clicky');
|
||||
|
||||
var row = document.createElement("row");
|
||||
row.appendChild(box);
|
||||
|
@ -211,7 +213,19 @@
|
|||
count = 0;
|
||||
}
|
||||
|
||||
this.id('seeAlsoNum').value = count + ' related:';
|
||||
var str = 'pane.item.related.count.';
|
||||
switch (count){
|
||||
case 0:
|
||||
str += 'zero';
|
||||
break;
|
||||
case 1:
|
||||
str += 'singular';
|
||||
break;
|
||||
default:
|
||||
str += 'plural';
|
||||
break;
|
||||
}
|
||||
this.id('seeAlsoNum').value = Zotero.getString(str, [count]);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -228,7 +242,7 @@
|
|||
<xul:vbox xbl:inherits="flex">
|
||||
<xul:hbox align="center">
|
||||
<xul:label id="seeAlsoNum"/>
|
||||
<xul:button label="Add" oncommand="this.parentNode.parentNode.parentNode.add();"/>
|
||||
<xul:button label="&zotero.item.add;" oncommand="this.parentNode.parentNode.parentNode.add();"/>
|
||||
</xul:hbox>
|
||||
<xul:grid flex="1">
|
||||
<xul:columns>
|
||||
|
|
|
@ -1,176 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (c) 2006 Center for History and New Media
|
||||
George Mason University, Fairfax, Virginia, USA
|
||||
http://chnm.gmu.edu
|
||||
|
||||
Licensed under the Educational Community License, Version 1.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.opensource.org/licenses/ecl1.php
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
-->
|
||||
|
||||
<!DOCTYPE bindings SYSTEM "chrome://zotero/locale/searchbox.dtd">
|
||||
|
||||
<bindings xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<binding id="zotero-search-textbox">
|
||||
<implementation>
|
||||
<property name="value"
|
||||
onget="return document.getAnonymousNodes(this)[0].value"
|
||||
onset="document.getAnonymousNodes(this)[0].setAttribute('value', val); return val"/>
|
||||
<property name="mode">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
if (this.getAttribute('hasOptions')!='true'){
|
||||
return false;
|
||||
}
|
||||
|
||||
var button = this.id('textbox-button');
|
||||
var menu = this.id(button.popup);
|
||||
|
||||
var selectedIndex = -1;
|
||||
for (var i=0; i<menu.childNodes.length; i++){
|
||||
if (menu.childNodes[i].getAttribute('checked')=='true'){
|
||||
selectedIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (button.popup){
|
||||
case 'textbox-fulltext-menu':
|
||||
switch (selectedIndex){
|
||||
case 0:
|
||||
return false;
|
||||
|
||||
case 1:
|
||||
return 'phraseBinary';
|
||||
|
||||
case 2:
|
||||
return 'regexp';
|
||||
|
||||
case 3:
|
||||
return 'regexpCS';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
throw('Invalid search textbox popup');
|
||||
]]>
|
||||
</getter>
|
||||
</property>
|
||||
<method name="update">
|
||||
<parameter name="condition"/>
|
||||
<parameter name="mode"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var button = this.id('textbox-button');
|
||||
|
||||
switch (condition){
|
||||
case 'fulltextContent':
|
||||
button.popup = 'textbox-fulltext-menu';
|
||||
button.setAttribute('popup', 'textbox-fulltext-menu');
|
||||
var menu = this.id(button.popup);
|
||||
this.setAttribute('hasOptions', true);
|
||||
|
||||
var selectedIndex = 0;
|
||||
if (mode){
|
||||
switch (mode){
|
||||
case 'phrase':
|
||||
selectedIndex = 0;
|
||||
break;
|
||||
|
||||
case 'phraseBinary':
|
||||
selectedIndex = 1;
|
||||
break;
|
||||
|
||||
case 'regexp':
|
||||
selectedIndex = 2;
|
||||
break;
|
||||
|
||||
case 'regexpCS':
|
||||
selectedIndex = 3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
menu.childNodes[selectedIndex].setAttribute('checked', true);
|
||||
break;
|
||||
|
||||
default:
|
||||
this.setAttribute('hasOptions', false);
|
||||
|
||||
// Set textbox to autocomplete mode
|
||||
switch (condition)
|
||||
{
|
||||
// Skip autocomplete for these fields
|
||||
case 'note':
|
||||
case 'extra':
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
var textbox = document.getAnonymousNodes(this)[0];
|
||||
textbox.setAttribute('type', 'autocomplete');
|
||||
textbox.setAttribute('autocompletesearch', 'zotero');
|
||||
|
||||
if (condition=='creator')
|
||||
{
|
||||
// 2 searches both single- and double-field creators
|
||||
var autocompleteCondition = condition + '/2'
|
||||
}
|
||||
else
|
||||
{
|
||||
var autocompleteCondition = condition;
|
||||
}
|
||||
|
||||
textbox.setAttribute('autocompletesearchparam', autocompleteCondition);
|
||||
}
|
||||
}
|
||||
|
||||
if (!autocompleteCondition)
|
||||
{
|
||||
var textbox = document.getAnonymousNodes(this)[0];
|
||||
textbox.removeAttribute('type');
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="id">
|
||||
<parameter name="id"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
return document.getAnonymousNodes(this)[0].getElementsByAttribute('id',id)[0];
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
|
||||
<content>
|
||||
<xul:textbox xbl:inherits="flex">
|
||||
<xul:popupset>
|
||||
<xul:menupopup id="textbox-fulltext-menu">
|
||||
<xul:menuitem type="radio" checked="true" label="&zotero.search.textModes.phrase;"/>
|
||||
<xul:menuitem type="radio" label="&zotero.search.textModes.phraseBinary;"/>
|
||||
<xul:menuitem type="radio" label="&zotero.search.textModes.regexp;"/>
|
||||
<xul:menuitem type="radio" label="&zotero.search.textModes.regexpCS;"/>
|
||||
</xul:menupopup>
|
||||
</xul:popupset>
|
||||
|
||||
<xul:toolbarbutton id="textbox-button" type="menu"/>
|
||||
</xul:textbox>
|
||||
</content>
|
||||
</binding>
|
||||
</bindings>
|
295
chrome/content/zotero/bindings/styled-textbox.xml
Normal file
295
chrome/content/zotero/bindings/styled-textbox.xml
Normal file
|
@ -0,0 +1,295 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (c) 2006 Center for History and New Media
|
||||
George Mason University, Fairfax, Virginia, USA
|
||||
http://chnm.gmu.edu
|
||||
|
||||
Licensed under the Educational Community License, Version 1.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.opensource.org/licenses/ecl1.php
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
-->
|
||||
|
||||
<!DOCTYPE bindings SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
<bindings xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<binding id="styled-textbox">
|
||||
<resources>
|
||||
<stylesheet src="chrome://zotero/skin/bindings/styled-textbox.css"/>
|
||||
</resources>
|
||||
|
||||
<implementation>
|
||||
<constructor><![CDATA[
|
||||
this._box = document.getAnonymousElementByAttribute(this, "anonid", "rt-box");
|
||||
this._browser = document.getAnonymousElementByAttribute(this, "anonid", "rt-view");
|
||||
this._buttons = {
|
||||
'italic':document.getAnonymousElementByAttribute(this, "anonid", "rt-italic"),
|
||||
'bold':document.getAnonymousElementByAttribute(this, "anonid", "rt-bold"),
|
||||
'underline':document.getAnonymousElementByAttribute(this, "anonid", "rt-underline"),
|
||||
'superscript':document.getAnonymousElementByAttribute(this, "anonid", "rt-superscript"),
|
||||
'subscript':document.getAnonymousElementByAttribute(this, "anonid", "rt-subscript")
|
||||
};
|
||||
|
||||
// globals
|
||||
this._formatMap = {
|
||||
"Integration":{
|
||||
"\\":"\\\\",
|
||||
"&":"&",
|
||||
"<":"<",
|
||||
">":">",
|
||||
"<i>":"\\i ",
|
||||
"</i>":"\\i0 ",
|
||||
"<b>":"\\b ",
|
||||
"</b>":"\\b0 ",
|
||||
"<u>":"\\ul ",
|
||||
"</u>":"\\ul0 ",
|
||||
"<br>":"\x0B",
|
||||
"<sup>":"\\super ",
|
||||
"</sup>":"\\super0 ",
|
||||
"<sub>":"\\sub ",
|
||||
"</sub>":"\\sub0 ",
|
||||
// there's no way to mimic a tab stop in CSS without
|
||||
// tables, which wouldn't work here.
|
||||
'<span class="tab"> </span>':"\t"
|
||||
}
|
||||
};
|
||||
|
||||
// defaults
|
||||
this._format = "HTML";
|
||||
this._readonly = false;
|
||||
this._styleWithCSS = false;
|
||||
// storage variables before loaded
|
||||
this._value = false;
|
||||
this._toggle = [];
|
||||
|
||||
// why is this necessary? because the browser takes time to
|
||||
// load, but doesn't appear to fire an event when loaded,
|
||||
// when recovering from being hidden. why does this work?
|
||||
// no idea.
|
||||
this._isLoaded = false;
|
||||
var me = this;
|
||||
if(this.hasAttribute("hidden")) {
|
||||
window.setTimeout(function() {me._loaded()}, 1);
|
||||
} else {
|
||||
this._browser.contentWindow.addEventListener("load", function() {me._loaded()}, false);
|
||||
}
|
||||
]]></constructor>
|
||||
|
||||
<!-- Called when loaded. Until the browser is loaded, we can't do
|
||||
anything with it, so we just keep track of what's supposed to
|
||||
happen. -->
|
||||
<method name="_loaded">
|
||||
<body><![CDATA[
|
||||
this._isLoaded = true;
|
||||
this.readonly = this._readonly;
|
||||
this.format = this._format;
|
||||
if(this._value !== false) this.value = this._value;
|
||||
if(this._toggle.length) {
|
||||
for(var i=0; i<this._toggle.length; i++) {
|
||||
this.toggle(this._toggle[i]);
|
||||
}
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<!-- Toggle underlining/italics/boldface -->
|
||||
<method name="toggle">
|
||||
<parameter name="command"/>
|
||||
<body><![CDATA[
|
||||
if(this._isLoaded) {
|
||||
if(!this._buttons[command]) {
|
||||
throw "Invalid command to toggle";
|
||||
}
|
||||
|
||||
this._browser.contentWindow.document.execCommand(command, false, !this._buttons[command].hasAttribute("selected"));
|
||||
this._updateButtons();
|
||||
} else {
|
||||
this._toggle.push(command);
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<!-- Updates the status of text toggle buttons -->
|
||||
<method name="_updateButtons">
|
||||
<body><![CDATA[
|
||||
for each(var command in ["bold", "italic", "underline", "superscript", "subscript"]) {
|
||||
try {
|
||||
var enabled = this._browser.contentDocument.queryCommandState(command);
|
||||
|
||||
var buttonEnabled = this._buttons[command].hasAttribute("selected");
|
||||
if(buttonEnabled != enabled) {
|
||||
if(enabled) {
|
||||
this._buttons[command].setAttribute("selected", "true");
|
||||
} else {
|
||||
this._buttons[command].removeAttribute("selected");
|
||||
}
|
||||
}
|
||||
} catch(e) {}
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<!-- Returns contained browser object -->
|
||||
<property name="browser" readonly="true" onget="return this._browser;"/>
|
||||
|
||||
<!-- Toggle read-only status -->
|
||||
<property name="readonly">
|
||||
<getter><![CDATA[
|
||||
return this._readonly;
|
||||
]]></getter>
|
||||
<setter><![CDATA[
|
||||
this._readonly = val;
|
||||
if(this._isLoaded) {
|
||||
if(val) {
|
||||
this._browser.contentDocument.designMode = "off";
|
||||
} else {
|
||||
this._browser.contentDocument.designMode = "on";
|
||||
}
|
||||
}
|
||||
return this._readonly;
|
||||
]]></setter>
|
||||
</property>
|
||||
|
||||
<!-- Sets or returns formatting (currently, HTML or Integration) of rich text box -->
|
||||
<property name="format">
|
||||
<getter><![CDATA[
|
||||
return this._format;
|
||||
]]></getter>
|
||||
<setter><![CDATA[
|
||||
this._format = val;
|
||||
if(this._isLoaded) {
|
||||
if(val != "HTML") {
|
||||
if(!this._formatMap[val]) {
|
||||
throw "Invalid format for rich text area";
|
||||
return false;
|
||||
}
|
||||
this._styleWithCSS = false;
|
||||
} else {
|
||||
this._styleWithCSS = true;
|
||||
}
|
||||
|
||||
this._browser.contentDocument.execCommand("styleWithCSS", false, this._styleWithCSS);
|
||||
}
|
||||
return val;
|
||||
]]></setter>
|
||||
</property>
|
||||
|
||||
<!-- Sets or returns contents of rich text box -->
|
||||
<property name="value">
|
||||
<getter><![CDATA[
|
||||
var output = this._browser.contentDocument.body.innerHTML;
|
||||
if(this._format != "HTML") {
|
||||
// do appropriate replacement operations for non-HTML
|
||||
// formats
|
||||
var replacements = this._formatMap[this._format];
|
||||
for(var needle in replacements) {
|
||||
output = output.replace(needle, replacements[needle], "g");
|
||||
}
|
||||
}
|
||||
return output;
|
||||
]]></getter>
|
||||
<setter><![CDATA[
|
||||
if(this._isLoaded) {
|
||||
var html = val;
|
||||
bodyStyle = "";
|
||||
if(this._format != "HTML") {
|
||||
if(this._format == "Integration") {
|
||||
if(html.substr(0, 3) == "\\li") {
|
||||
// try to show paragraph formatting
|
||||
var returnIndex = html.indexOf("\r\n");
|
||||
|
||||
var tags = html.substr(1, returnIndex).split("\\");
|
||||
html = html.substr(returnIndex+2);
|
||||
|
||||
for(var i=0; i<tags.length; i++) {
|
||||
var tagName = tags[i].substr(0, 2);
|
||||
var tagValue = tags[i].substring(2, tags[i].length-1);
|
||||
if(tagName == "li") {
|
||||
var li = parseInt(tagValue, 10);
|
||||
} else if(tagName == "fi") {
|
||||
var fi = parseInt(tagValue, 10);
|
||||
}
|
||||
}
|
||||
|
||||
// don't negatively indent
|
||||
Zotero.debug(li);
|
||||
Zotero.debug(fi);
|
||||
if(fi < 0 && li == 0) {
|
||||
li = -fi;
|
||||
}
|
||||
|
||||
bodyStyle = "margin-left:"+(li/20+6)+"pt;text-indent:"+(fi/20)+"pt;";
|
||||
Zotero.debug(bodyStyle);
|
||||
}
|
||||
}
|
||||
|
||||
// do appropriate replacement operations for non-HTML
|
||||
// formats
|
||||
var replacements = this._formatMap[this._format];
|
||||
for(var needle in replacements) {
|
||||
html = html.replace(replacements[needle], needle, "g");
|
||||
}
|
||||
}
|
||||
|
||||
// write
|
||||
this._browser.contentDocument.write('<body style="'+bodyStyle+'">'+html+"</body>");
|
||||
this._browser.contentDocument.close();
|
||||
this._browser.contentDocument.designMode = (this._readonly ? "off" : "on");
|
||||
try {
|
||||
this._browser.contentDocument.execCommand("styleWithCSS", false, this._styleWithCSS);
|
||||
} catch(e) {}
|
||||
|
||||
this._updateButtons();
|
||||
} else {
|
||||
this._value = val;
|
||||
}
|
||||
return val;
|
||||
]]></setter>
|
||||
</property>
|
||||
|
||||
<!-- Sets or returns contents of hidden attribute -->
|
||||
<property name="hidden" getter="return this._box.hidden;"
|
||||
setter="return this._box.hidden = val;"/>
|
||||
</implementation>
|
||||
|
||||
<content>
|
||||
<xul:vbox anonid="rt-box" class="rt-box" xbl:inherits="onfocus,onblur,flex">
|
||||
<xul:toolbar class="rt-toolbar" mode="icons">
|
||||
<xul:toolbarbutton anonid="rt-bold" class="rt-bold rt-text-control"
|
||||
tooltiptext="&zotero.richText.bold.label;"
|
||||
oncommand="parentNode.parentNode.parentNode.toggle('bold');"/>
|
||||
<xul:toolbarbutton anonid="rt-italic" class="rt-italic rt-text-control"
|
||||
tooltiptext="&zotero.richText.italic.label;"
|
||||
oncommand="parentNode.parentNode.parentNode.toggle('italic');"/>
|
||||
<xul:toolbarbutton anonid="rt-underline" class="rt-underline rt-text-control"
|
||||
tooltiptext="&zotero.richText.underline.label;"
|
||||
oncommand="parentNode.parentNode.parentNode.toggle('underline');"/>
|
||||
<xul:toolbarbutton anonid="rt-superscript" class="rt-superscript rt-text-control"
|
||||
tooltiptext="&zotero.richText.superscript.label;"
|
||||
oncommand="parentNode.parentNode.parentNode.toggle('superscript');"/>
|
||||
<xul:toolbarbutton anonid="rt-subscript" class="rt-subscript rt-text-control"
|
||||
tooltiptext="&zotero.richText.subscript.label;"
|
||||
oncommand="parentNode.parentNode.parentNode.toggle('subscript');"/>
|
||||
</xul:toolbar>
|
||||
|
||||
<xul:browser flex="1" anonid="rt-view" class="rt-view"
|
||||
onclick="parentNode.parentNode._loaded()"
|
||||
onmouseup="parentNode.parentNode._updateButtons();"
|
||||
onkeyup="parentNode.parentNode._updateButtons();"/>
|
||||
</xul:vbox>
|
||||
</content>
|
||||
</binding>
|
||||
</bindings>
|
|
@ -21,6 +21,8 @@
|
|||
***** END LICENSE BLOCK *****
|
||||
-->
|
||||
|
||||
<!DOCTYPE bindings SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
|
||||
<bindings xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
@ -48,7 +50,7 @@
|
|||
{
|
||||
for(var i = 0; i < tags.length; i++)
|
||||
{
|
||||
r = r + tags[i] + ", ";
|
||||
r = r + tags[i].tag + ", ";
|
||||
}
|
||||
r = r.substr(0,r.length-2);
|
||||
}
|
||||
|
@ -71,8 +73,7 @@
|
|||
|
||||
if(tags)
|
||||
{
|
||||
for(var i = 0; i < tags.length; i++)
|
||||
{
|
||||
for (var i=0; i<tags.length; i++) {
|
||||
this.addDynamicRow(tags[i], i+1);
|
||||
}
|
||||
this.updateCount(tags.length);
|
||||
|
@ -88,27 +89,42 @@
|
|||
</body>
|
||||
</method>
|
||||
<method name="addDynamicRow">
|
||||
<parameter name="tag"/>
|
||||
<parameter name="tagObj"/>
|
||||
<parameter name="tabindex"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var id = tag ? Zotero.Tags.getID(tag) : null;
|
||||
tag = tag ? tag : '';
|
||||
if (tagObj) {
|
||||
var tagID = tagObj.id;
|
||||
var tag = tagObj.tag;
|
||||
var type = tagObj.type;
|
||||
}
|
||||
if (!tag) {
|
||||
tag = '';
|
||||
}
|
||||
|
||||
if (!tabindex)
|
||||
{
|
||||
if (this.id('tagRows').lastChild)
|
||||
{
|
||||
tabindex = parseInt(this.id('tagRows').lastChild.
|
||||
firstChild.nextSibling.getAttribute('tabindex')) + 1;
|
||||
firstChild.nextSibling.getAttribute('ztabindex')) + 1;
|
||||
}
|
||||
else {
|
||||
tabindex = 1;
|
||||
}
|
||||
}
|
||||
|
||||
var icon= document.createElement("image");
|
||||
icon.setAttribute('src','chrome://zotero/skin/tag.png');
|
||||
var icon = document.createElement("image");
|
||||
var iconFile = 'tag';
|
||||
if (type == 0) {
|
||||
icon.setAttribute('tooltiptext', Zotero.getString('pane.item.tags.icon.user'));
|
||||
}
|
||||
else if (type == 1) {
|
||||
iconFile += '-automatic';
|
||||
icon.setAttribute('tooltiptext', Zotero.getString('pane.item.tags.icon.automatic'));
|
||||
}
|
||||
icon.setAttribute('src', 'chrome://zotero/skin/' + iconFile + '.png');
|
||||
|
||||
// DEBUG: Why won't just this.nextSibling.blur() work?
|
||||
icon.setAttribute('onclick','if (this.nextSibling.inputField){ this.nextSibling.inputField.blur() }');
|
||||
|
||||
|
@ -116,25 +132,26 @@
|
|||
|
||||
var remove = document.createElement("label");
|
||||
remove.setAttribute('value','-');
|
||||
if (id)
|
||||
remove.setAttribute('class','zotero-clicky');
|
||||
if (tagID)
|
||||
{
|
||||
remove.setAttribute('tabindex', -1);
|
||||
remove.setAttribute('onclick',"this.parentNode.parentNode.parentNode.parentNode.parentNode.remove('"+id+"');");
|
||||
remove.setAttribute('class','clicky');
|
||||
remove.setAttribute('ztabindex', -1);
|
||||
remove.setAttribute('onclick',"this.parentNode.parentNode.parentNode.parentNode.parentNode.remove('"+ tagID +"');");
|
||||
}
|
||||
else
|
||||
{
|
||||
remove.setAttribute('disabled', true);
|
||||
remove.setAttribute('class', 'unclicky');
|
||||
}
|
||||
|
||||
var row = document.createElement("row");
|
||||
row.appendChild(icon);
|
||||
row.appendChild(label);
|
||||
row.appendChild(remove);
|
||||
if (id)
|
||||
|
||||
if (tagID)
|
||||
{
|
||||
row.setAttribute('id','tag-'+id);
|
||||
row.setAttribute('id', 'tag-' + tagID);
|
||||
row.setAttribute('tagType', type);
|
||||
}
|
||||
|
||||
this.id('tagRows').appendChild(row);
|
||||
|
@ -200,7 +217,20 @@
|
|||
count = 0;
|
||||
}
|
||||
|
||||
this.id('tagsNum').value = count + ' tags:';
|
||||
var str = 'pane.item.tags.count.';
|
||||
switch (count){
|
||||
case 0:
|
||||
str += 'zero';
|
||||
break;
|
||||
case 1:
|
||||
str += 'singular';
|
||||
break;
|
||||
default:
|
||||
str += 'plural';
|
||||
break;
|
||||
}
|
||||
|
||||
this.id('tagsNum').value = Zotero.getString(str, [count]);
|
||||
this.count = count;
|
||||
]]>
|
||||
</body>
|
||||
|
@ -232,12 +262,28 @@
|
|||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="closePopup">
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (this.parentNode.getAttribute('showing')=='true') {
|
||||
this.parentNode.setAttribute('showing', false);
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="getScrollBox">
|
||||
<body>
|
||||
<![CDATA[
|
||||
return document.getAnonymousNodes(this)[0];
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
<content>
|
||||
<xul:vbox xbl:inherits="flex">
|
||||
<xul:scrollbox xbl:inherits="flex" orient="vertical" style="overflow:auto">
|
||||
<xul:hbox align="center">
|
||||
<xul:label id="tagsNum"/>
|
||||
<xul:button label="Add" oncommand="this.parentNode.parentNode.parentNode.new();"/>
|
||||
<xul:button label="&zotero.item.add;" oncommand="this.parentNode.parentNode.parentNode.new();"/>
|
||||
</xul:hbox>
|
||||
<xul:grid>
|
||||
<xul:columns>
|
||||
|
@ -247,7 +293,7 @@
|
|||
</xul:columns>
|
||||
<xul:rows id="tagRows"/>
|
||||
</xul:grid>
|
||||
</xul:vbox>
|
||||
</xul:scrollbox>
|
||||
</content>
|
||||
</binding>
|
||||
</bindings>
|
697
chrome/content/zotero/bindings/tagselector.xml
Normal file
697
chrome/content/zotero/bindings/tagselector.xml
Normal file
|
@ -0,0 +1,697 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (c) 2006 Center for History and New Media
|
||||
George Mason University, Fairfax, Virginia, USA
|
||||
http://chnm.gmu.edu
|
||||
|
||||
Licensed under the Educational Community License, Version 1.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.opensource.org/licenses/ecl1.php
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
-->
|
||||
<?xml-stylesheet href="chrome://zotero/skin/overlay.css" type="text/css"?>
|
||||
<!DOCTYPE bindings SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
|
||||
<bindings xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="tag-selector">
|
||||
<resources>
|
||||
<stylesheet src="chrome://zotero/skin/bindings/tagselector.css"/>
|
||||
</resources>
|
||||
|
||||
<implementation>
|
||||
<field name="_initialized">false</field>
|
||||
<field name="_notifierID">false</field>
|
||||
<field name="_tags">null</field>
|
||||
<field name="_dirty">null</field>
|
||||
<field name="_empty">null</field>
|
||||
<field name="selection"/>
|
||||
<property name="showAutomatic" onget="return this.getAttribute('showAutomatic')"/>
|
||||
<property name="_types">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
var types = [0];
|
||||
if (this.showAutomatic == 'true') {
|
||||
types.push(1);
|
||||
}
|
||||
return types;
|
||||
]]>
|
||||
</getter>
|
||||
</property>
|
||||
|
||||
<field name="_hasFilter">false</field>
|
||||
<field name="_filter">null</field>
|
||||
<method name="setFilterTags">
|
||||
<parameter name="val"/>
|
||||
<parameter name="skipRefresh"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (Zotero.hasValues(val)) {
|
||||
this._hasFilter = true;
|
||||
this._filter = val;
|
||||
}
|
||||
else {
|
||||
this._hasFilter = !!val;
|
||||
this._filter = {};
|
||||
}
|
||||
|
||||
if (!skipRefresh) {
|
||||
this.refresh();
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<field name="_hasScope">false</field>
|
||||
<field name="_scope">null</field>
|
||||
<property name="scope" onget="return this._scope">
|
||||
<setter>
|
||||
<![CDATA[
|
||||
if (Zotero.hasValues(val)) {
|
||||
this._hasScope = true;
|
||||
this._scope = val;
|
||||
}
|
||||
else {
|
||||
this._hasScope = !!val;
|
||||
this._scope = {};
|
||||
}
|
||||
|
||||
this.refresh();
|
||||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<property name="filterToScope">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
return this.getAttribute('filterToScope') == 'true';
|
||||
]]>
|
||||
</getter>
|
||||
<setter>
|
||||
<![CDATA[
|
||||
this.setAttribute('filterToScope', val);
|
||||
this.refresh();
|
||||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<constructor>
|
||||
<![CDATA[
|
||||
this.setAttribute('filterToScope', true);
|
||||
this.id('show-automatic').setAttribute('checked', this.getAttribute('showAutomatic'));
|
||||
this.dragObserver = new this._dragObserverConstructor;
|
||||
]]>
|
||||
</constructor>
|
||||
|
||||
|
||||
<method name="init">
|
||||
<body>
|
||||
<![CDATA[
|
||||
this._initialized = true;
|
||||
this.selection = {};
|
||||
this._notifierID = Zotero.Notifier.registerObserver(this, ['collection-item', 'item-tag', 'tag']);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="uninit">
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (!this._initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._initialized = false;
|
||||
this.unregister();
|
||||
this.selection = {};
|
||||
this.doCommand();
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="unregister">
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (this._notifierID) {
|
||||
Zotero.Notifier.unregisterObserver(this._notifierID);
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="refresh">
|
||||
<parameter name="fetch"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (!this._initialized) {
|
||||
this.init();
|
||||
fetch = true;
|
||||
}
|
||||
|
||||
Zotero.debug('Refreshing tags selector');
|
||||
var empty = true;
|
||||
var tagsToggleBox = this.id('tags-toggle');
|
||||
|
||||
if (fetch || this._dirty) {
|
||||
this._tags = Zotero.Tags.getAll(this._types);
|
||||
|
||||
// Remove children
|
||||
while (tagsToggleBox.hasChildNodes()){
|
||||
tagsToggleBox.removeChild(tagsToggleBox.firstChild);
|
||||
}
|
||||
|
||||
// Regenerate list
|
||||
for (var tagID in this._tags) {
|
||||
// If the last tag was the same, add this tagID and tagType to it
|
||||
if (tagsToggleBox.lastChild &&
|
||||
tagsToggleBox.lastChild.getAttribute('value') == this._tags[tagID].tag) {
|
||||
tagsToggleBox.lastChild.setAttribute('tagID', tagsToggleBox.lastChild.getAttribute('tagID') + '-' + tagID);
|
||||
tagsToggleBox.lastChild.setAttribute('tagType', tagsToggleBox.lastChild.getAttribute('tagType') + '-' + this._tags[tagID].type);
|
||||
continue;
|
||||
}
|
||||
|
||||
var label = document.createElement('label');
|
||||
label.setAttribute('onclick', "this.parentNode.parentNode.parentNode.handleTagClick(event, this)");
|
||||
label.className = 'zotero-clicky';
|
||||
label.setAttribute('value', this._tags[tagID].tag);
|
||||
label.setAttribute('tagID', tagID);
|
||||
label.setAttribute('tagType', this._tags[tagID].type);
|
||||
label.setAttribute('context', 'tag-menu');
|
||||
label.setAttribute('ondragover', 'nsDragAndDrop.dragOver(event, this.parentNode.parentNode.parentNode.dragObserver)');
|
||||
label.setAttribute('ondragexit', 'nsDragAndDrop.dragExit(event, this.parentNode.parentNode.parentNode.dragObserver)');
|
||||
label.setAttribute('ondragdrop', 'nsDragAndDrop.drop(event, this.parentNode.parentNode.parentNode.dragObserver)');
|
||||
tagsToggleBox.appendChild(label);
|
||||
}
|
||||
|
||||
this._dirty = false;
|
||||
}
|
||||
|
||||
// Set attributes
|
||||
var labels = tagsToggleBox.getElementsByTagName('label');
|
||||
for (var i=0; i<labels.length; i++){
|
||||
var tagIDs = labels[i].getAttribute('tagID').split('-');
|
||||
|
||||
// Restore selection
|
||||
if (this.selection[labels[i].value]){
|
||||
labels[i].setAttribute('selected', 'true');
|
||||
}
|
||||
else {
|
||||
labels[i].setAttribute('selected', 'false');
|
||||
}
|
||||
|
||||
// Check tags against filter
|
||||
if (this._hasFilter) {
|
||||
var inFilter = false;
|
||||
for each(var tagID in tagIDs) {
|
||||
if (this._filter[tagID]) {
|
||||
inFilter = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check tags against scope
|
||||
if (this._hasScope) {
|
||||
var inScope = false;
|
||||
for each(var tagID in tagIDs) {
|
||||
if (this._scope[tagID]) {
|
||||
inScope = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If not in filter, hide
|
||||
if (this._hasFilter && !inFilter) {
|
||||
//Zotero.debug(1);
|
||||
labels[i].setAttribute('hidden', true);
|
||||
}
|
||||
else if (this.filterToScope) {
|
||||
if (this._hasScope && inScope) {
|
||||
//Zotero.debug(2);
|
||||
labels[i].setAttribute('inScope', true);
|
||||
labels[i].setAttribute('hidden', false);
|
||||
empty = false;
|
||||
}
|
||||
else {
|
||||
//Zotero.debug(3);
|
||||
labels[i].setAttribute('hidden', true);
|
||||
labels[i].setAttribute('inScope', false);
|
||||
}
|
||||
}
|
||||
// Display all
|
||||
else {
|
||||
if (this._hasScope && inScope) {
|
||||
//Zotero.debug(4);
|
||||
labels[i].setAttribute('inScope', true);
|
||||
}
|
||||
else {
|
||||
//Zotero.debug(5);
|
||||
labels[i].setAttribute('inScope', false);
|
||||
|
||||
// If out of scope, make sure it's not selected (otherwise a tag
|
||||
// stays selected after removing an item with that tag from the
|
||||
// current collection)
|
||||
if (this.selection[labels[i].value]) {
|
||||
labels[i].setAttribute('selected', false);
|
||||
delete this.selection[labels[i].value];
|
||||
var doCommand = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
labels[i].setAttribute('hidden', false);
|
||||
empty = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.updateNumSelected();
|
||||
this._empty = empty;
|
||||
this.id('tags-toggle').setAttribute('collapsed', empty);
|
||||
this.id('no-tags-box').setAttribute('collapsed', !empty);
|
||||
|
||||
if (doCommand) {
|
||||
Zotero.debug('A selected tag went out of scope -- deselecting');
|
||||
this.doCommand();
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="getNumSelected">
|
||||
<body>
|
||||
<![CDATA[
|
||||
var count = 0;
|
||||
for (var i in this.selection) {
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="updateNumSelected">
|
||||
<body>
|
||||
<![CDATA[
|
||||
var count = this.getNumSelected();
|
||||
|
||||
switch (count) {
|
||||
case 0:
|
||||
var mod = 'none';
|
||||
break;
|
||||
case 1:
|
||||
var mod = 'singular';
|
||||
break;
|
||||
default:
|
||||
var mod = 'plural';
|
||||
}
|
||||
|
||||
this.id('num-selected').value = Zotero.getString('pane.tagSelector.numSelected.' + mod, [count]);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="notify">
|
||||
<parameter name="event"/>
|
||||
<parameter name="type"/>
|
||||
<parameter name="ids"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
// If a selected tag no longer exists, deselect it
|
||||
if (event == 'delete') {
|
||||
this._tags = Zotero.Tags.getAll(this._types);
|
||||
|
||||
for (var tag in this.selection) {
|
||||
for each(var tag2 in this._tags) {
|
||||
if (tag == tag2) {
|
||||
var found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
delete this.selection[tag];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This could be more optimized to insert new/changed tags at the appropriate
|
||||
// spot if we cared, but we probably don't
|
||||
var t = this.id('tags-search').inputField;
|
||||
this.setFilterTags(Zotero.Tags.search(t.value), true);
|
||||
this._dirty = true;
|
||||
this.doCommand();
|
||||
|
||||
// If no tags visible after a delete, deselect all
|
||||
if ((event == 'remove' || event == 'delete') &&
|
||||
this._empty && this.getNumSelected()) {
|
||||
Zotero.debug('No tags visible after delete -- deselecting all');
|
||||
this.clearAll();
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<!-- Not currently used -->
|
||||
<method name="selectVisible">
|
||||
<body>
|
||||
<![CDATA[
|
||||
var tagsToggleBox = this.id('tags-toggle');
|
||||
|
||||
var labels = tagsToggleBox.getElementsByTagName('label');
|
||||
for (var i=0; i<labels.length; i++){
|
||||
if (labels[i].getAttribute('hidden') != 'true'
|
||||
&& labels[i].getAttribute('inScope') == 'true') {
|
||||
labels[i].setAttribute('selected', 'true');
|
||||
this.selection[labels[i].value] = true;
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<!-- Not currently used -->
|
||||
<method name="clearVisible">
|
||||
<body>
|
||||
<![CDATA[
|
||||
var tagsToggleBox = this.id('tags-toggle');
|
||||
|
||||
var labels = tagsToggleBox.getElementsByTagName('label');
|
||||
for (var i=0; i<labels.length; i++){
|
||||
labels[i].setAttribute('selected', 'false');
|
||||
delete this.selection[labels[i].value];
|
||||
}
|
||||
|
||||
this.doCommand();
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="clearAll">
|
||||
<body>
|
||||
<![CDATA[
|
||||
this.selection = {};
|
||||
this.clearVisible();
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="handleKeyPress">
|
||||
<parameter name="clear"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var textbox = this.id('tags-search');
|
||||
var t = textbox.inputField;
|
||||
|
||||
textbox.firstChild.hidden = (t.value == "");
|
||||
|
||||
if (clear != undefined){
|
||||
if (clear){
|
||||
t.value = '';
|
||||
this.setFilterTags(false);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
this.setFilterTags(Zotero.Tags.search(t.value));
|
||||
return true;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="handleTagClick">
|
||||
<parameter name="event"/>
|
||||
<parameter name="label"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (event.button != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Ignore clicks on tags not in scope
|
||||
if (label.getAttribute('inScope') == 'false') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Deselect
|
||||
if (label.getAttribute('selected')=='true'){
|
||||
delete this.selection[label.value];
|
||||
label.setAttribute('selected', 'false');
|
||||
}
|
||||
// Select
|
||||
else {
|
||||
this.selection[label.value] = true;
|
||||
label.setAttribute('selected', 'true');
|
||||
}
|
||||
|
||||
this.doCommand();
|
||||
|
||||
this.updateNumSelected();
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="rename">
|
||||
<parameter name="tagIDs"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
tagIDs = tagIDs.split('-');
|
||||
// Convert to ints
|
||||
for (var i=0; i<tagIDs.length; i++) {
|
||||
tagIDs[i] = parseInt(tagIDs[i]);
|
||||
}
|
||||
var oldName = Zotero.Tags.getName(tagIDs[0]);
|
||||
|
||||
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService);
|
||||
|
||||
var newName = { value: oldName };
|
||||
var result = promptService.prompt(window,
|
||||
Zotero.getString('pane.tagSelector.rename.title'),
|
||||
Zotero.getString('pane.tagSelector.rename.message'),
|
||||
newName, '', {});
|
||||
|
||||
if (result && newName.value) {
|
||||
// Add other ids with same tag
|
||||
var ids = Zotero.Tags.getIDs(oldName);
|
||||
|
||||
for (var i=0; i<ids.length; i++) {
|
||||
if (tagIDs.indexOf(ids[i]) == -1) {
|
||||
tagIDs.push(ids[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.selection[oldName]) {
|
||||
var wasSelected = true;
|
||||
delete this.selection[oldName];
|
||||
}
|
||||
|
||||
Zotero.DB.beginTransaction();
|
||||
|
||||
for (var i=0; i<tagIDs.length; i++) {
|
||||
Zotero.Tags.rename(tagIDs[i], newName.value);
|
||||
}
|
||||
|
||||
if (wasSelected) {
|
||||
this.selection[newName.value] = true;
|
||||
}
|
||||
Zotero.DB.commitTransaction();
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="delete">
|
||||
<parameter name="tagIDs"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
tagIDs = tagIDs.split('-');
|
||||
var oldName = Zotero.Tags.getName(tagIDs[0]);
|
||||
|
||||
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService);
|
||||
|
||||
var confirmed = promptService.confirm(window,
|
||||
Zotero.getString('pane.tagSelector.delete.title'),
|
||||
Zotero.getString('pane.tagSelector.delete.message'));
|
||||
|
||||
if (confirmed) {
|
||||
Zotero.DB.beginTransaction();
|
||||
|
||||
// Add other ids with same tag
|
||||
var ids = Zotero.Tags.getIDs(oldName);
|
||||
for each(var id in ids) {
|
||||
if (tagIDs.indexOf(id) == -1) {
|
||||
tagIDs.push(id);
|
||||
}
|
||||
}
|
||||
|
||||
for each(var tagID in tagIDs) {
|
||||
Zotero.Tags.remove(tagID);
|
||||
}
|
||||
|
||||
Zotero.DB.commitTransaction()
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="focusTextbox">
|
||||
<body>
|
||||
<![CDATA[
|
||||
this.id('tags-search').focus();
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<property name="dragObserver"/>
|
||||
<method name="_dragObserverConstructor">
|
||||
<body>
|
||||
<![CDATA[
|
||||
this.onDragOver = onDragOver;
|
||||
this.onDragExit = onDragExit;
|
||||
this.onDrop = onDrop;
|
||||
this.getSupportedFlavours = getSupportedFlavours;
|
||||
|
||||
|
||||
function onDragOver(event, flavour, session) {
|
||||
event.target.setAttribute('draggedOver', true);
|
||||
return true;
|
||||
}
|
||||
|
||||
function onDragExit(event, session) {
|
||||
event.target.setAttribute('draggedOver', false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function onDrop(event, dropData, session) {
|
||||
event.target.setAttribute('draggedOver', false);
|
||||
|
||||
var ids = dropData.data.split(',');
|
||||
var items = Zotero.Items.get(ids);
|
||||
var unlock = Zotero.Notifier.begin(true);
|
||||
for each(var item in items) {
|
||||
item.addTagByID(event.target.getAttribute('tagID'));
|
||||
}
|
||||
Zotero.Notifier.commit(unlock);
|
||||
}
|
||||
|
||||
|
||||
function getSupportedFlavours() {
|
||||
var flavours = new FlavourSet();
|
||||
flavours.appendFlavour("zotero/item");
|
||||
return flavours;
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="id">
|
||||
<parameter name="id"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
return document.getAnonymousNodes(this)[0].getElementsByAttribute('id',id)[0];
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
|
||||
<content>
|
||||
<xul:groupbox flex="1">
|
||||
<xul:menupopup id="tag-menu">
|
||||
<xul:menuitem label="&zotero.tagSelector.renameTag;" class="menuitem-non-iconic" oncommand="this.parentNode.parentNode.parentNode.rename(document.popupNode.getAttribute('tagID')); event.stopPropagation()"/>
|
||||
<xul:menuitem label="&zotero.tagSelector.deleteTag;" class="menuitem-non-iconic" oncommand="this.parentNode.parentNode.parentNode.delete(document.popupNode.getAttribute('tagID')); event.stopPropagation()"/>
|
||||
</xul:menupopup>
|
||||
|
||||
<xul:vbox id="no-tags-box" align="center" pack="center" flex="1">
|
||||
<xul:label value="&zotero.tagSelector.noTagsToDisplay;"/>
|
||||
</xul:vbox>
|
||||
|
||||
<xul:vbox id="tags-toggle" flex="1"/>
|
||||
|
||||
<xul:hbox>
|
||||
<xul:hbox pack="start">
|
||||
<xul:checkbox label="&zotero.tagSelector.displayAll;"
|
||||
oncommand="this.parentNode.parentNode.parentNode.parentNode.filterToScope = !this.checked; event.stopPropagation();">
|
||||
</xul:checkbox>
|
||||
</xul:hbox>
|
||||
|
||||
<!--
|
||||
<xul:hbox>
|
||||
<xul:radiogroup orient="horizontal">
|
||||
<xul:radio label="any"/>
|
||||
<xul:radio label="all"/>
|
||||
</xul:radiogroup>
|
||||
</xul:hbox>
|
||||
-->
|
||||
</xul:hbox>
|
||||
|
||||
<xul:hbox>
|
||||
<xul:label value="&zotero.tagSelector.filter;"/>
|
||||
<xul:textbox id="tags-search" flex="1" type="timed" timeout="250" dir="reverse"
|
||||
oncommand="this.parentNode.parentNode.parentNode.handleKeyPress(); event.stopPropagation()"
|
||||
onkeypress="if (event.keyCode == event.DOM_VK_ESCAPE) { this.parentNode.parentNode.parentNode.handleKeyPress(true); }">
|
||||
<xul:toolbarbutton id="search-cancel"
|
||||
oncommand="this.parentNode.focus(); this.parentNode.parentNode.parentNode.parentNode.handleKeyPress(true)" hidden="true"/>
|
||||
</xul:textbox>
|
||||
<xul:toolbarbutton id="view-settings-menu" tooltiptext="&zotero.toolbar.actions.label;"
|
||||
image="chrome://zotero/skin/tag-selector-menu.png" type="menu">
|
||||
<xul:menupopup id="view-settings-popup">
|
||||
<xul:menuitem id="show-automatic" label="&zotero.tagSelector.showAutomatic;" autocheck="true" type="checkbox"
|
||||
oncommand="var ts = this.parentNode.parentNode.parentNode.parentNode.parentNode; ts._dirty = true; ts.setAttribute('showAutomatic', this.getAttribute('checked') == 'true')"/>
|
||||
</xul:menupopup>
|
||||
</xul:toolbarbutton>
|
||||
</xul:hbox>
|
||||
|
||||
<xul:hbox>
|
||||
<xul:hbox pack="center">
|
||||
<xul:label id="num-selected"/>
|
||||
</xul:hbox>
|
||||
|
||||
<!--
|
||||
Disabled (at least) until there's an ANY search mode
|
||||
<xul:toolbarbutton label="&zotero.tagSelector.selectVisible;"
|
||||
oncommand="this.parentNode.parentNode.parentNode.parentNode.selectVisible()"/>
|
||||
<xul:button label="&zotero.tagSelector.clearVisible;"
|
||||
oncommand="this.parentNode.parentNode.parentNode.parentNode.clearVisible()"/> -->
|
||||
<xul:toolbarseparator/>
|
||||
<xul:hbox pack="center">
|
||||
<xul:button label="&zotero.tagSelector.clearAll;"
|
||||
oncommand="this.parentNode.parentNode.parentNode.parentNode.clearAll(); event.stopPropagation();"/>
|
||||
</xul:hbox>
|
||||
</xul:hbox>
|
||||
</xul:groupbox>
|
||||
</content>
|
||||
</binding>
|
||||
</bindings>
|
|
@ -1,17 +1,53 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Mozilla timed-textbox binding applied to the XBL #textarea rather than
|
||||
#textbox, with the Return key event handler removed
|
||||
A combination of Mozilla's textarea, timed-textbox, input-box, and
|
||||
input-box-spell bindings, with the timed-textbox's Return key
|
||||
event handler removed
|
||||
|
||||
Note: It would be much nicer if a) Mozilla offered this natively or b) we
|
||||
just extended the timed-textbox binding directly, but since it's based on
|
||||
html:input rather than html:textarea, doing so breaks things in various ways
|
||||
Note: It would be much nicer if a) Mozilla offered this natively or
|
||||
b) we just extended the timed-textbox binding directly, but since it's based
|
||||
on html:input rather than html:textarea, doing so breaks things in various
|
||||
ways (though it may be possible with some tweaking)
|
||||
|
||||
Also note: spellcheck code here is a slightly adjusted version
|
||||
of a patch by Neil Deakin on Bugzilla that wasn't approved in time for
|
||||
Firefox 2.0 (https://bugzilla.mozilla.org/show_bug.cgi?id=346787).
|
||||
When there's native support for spellcheck="true" in XUL, we'll hopefully be
|
||||
able to use that, though it'll still need to work as a timed textarea...
|
||||
-->
|
||||
|
||||
<!DOCTYPE bindings [
|
||||
<!ENTITY % textcontextDTD SYSTEM "chrome://global/locale/textcontext.dtd" >
|
||||
%textcontextDTD;
|
||||
|
||||
<!-- These aren't yet included in textcontext.dtd in Minefield, so we reproduce them here
|
||||
(rather than including the massive browser.dtd) -->
|
||||
<!ENTITY spellAddToDictionary.label "Add to dictionary">
|
||||
<!ENTITY spellAddToDictionary.accesskey "o">
|
||||
<!ENTITY spellEnable.label "Spell check this field">
|
||||
<!ENTITY spellEnable.accesskey "S">
|
||||
<!ENTITY spellNoSuggestions.label "(No spelling suggestions)">
|
||||
<!ENTITY spellDictionaries.label "Languages">
|
||||
<!ENTITY spellDictionaries.accesskey "l">
|
||||
<!ENTITY spellAddDictionaries.label "Add dictionaries...">
|
||||
<!ENTITY spellAddDictionaries.accesskey "A">
|
||||
]>
|
||||
|
||||
<bindings xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<binding id="timed-textarea" extends="chrome://global/content/bindings/textbox.xml#textarea">
|
||||
<binding id="timed-textarea" extends="chrome://global/content/bindings/textbox.xml#textbox">
|
||||
<implementation>
|
||||
<field name="mInputField">null</field>
|
||||
<property name="inputField" readonly="true">
|
||||
<getter><![CDATA[
|
||||
if (!this.mInputField)
|
||||
this.mInputField = document.getAnonymousElementByAttribute(this, "anonid", "input");
|
||||
return this.mInputField;
|
||||
]]></getter>
|
||||
</property>
|
||||
|
||||
<field name="_timer">null</field>
|
||||
<property name="timeout"
|
||||
onset="this.setAttribute('timeout', val); return val;"
|
||||
|
@ -38,15 +74,218 @@
|
|||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<!-- Spellcheck code -->
|
||||
<field name="_spellCheckInitialized">false</field>
|
||||
<property name="spellCheckerUI" readonly="true">
|
||||
<getter><![CDATA[
|
||||
if (!this._spellCheckInitialized) {
|
||||
this._spellCheckInitialized = true;
|
||||
|
||||
const CI = Components.interfaces;
|
||||
if (!document instanceof CI.nsIDOMXULDocument)
|
||||
return null;
|
||||
|
||||
var textbox = this;
|
||||
|
||||
if (!textbox || !textbox instanceof CI.nsIDOMXULTextBoxElement)
|
||||
return null;
|
||||
|
||||
try {
|
||||
var loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"].
|
||||
getService(CI.mozIJSSubScriptLoader);
|
||||
loader.loadSubScript("chrome://global/content/inlineSpellCheckUI.js", this);
|
||||
|
||||
if ("InlineSpellCheckerUI" in this)
|
||||
this.InlineSpellCheckerUI.init(
|
||||
textbox.inputField.QueryInterface(CI.nsIDOMNSEditableElement).editor
|
||||
);
|
||||
} catch(ex) {
|
||||
// this throws an error on window open...
|
||||
}
|
||||
}
|
||||
|
||||
return this.InlineSpellCheckerUI;
|
||||
]]></getter>
|
||||
</property>
|
||||
|
||||
<constructor>
|
||||
<![CDATA[
|
||||
// can't initialize the spell checker in the constructor as not
|
||||
// everything is initialized and the editor will fail to create the
|
||||
// inline spell checker object
|
||||
setTimeout(this._delayedInitSpellCheck, 0, this)
|
||||
|
||||
// oninput doesn't seem to fire on text drag
|
||||
this.inputField.addEventListener('dragdrop', function(event) {
|
||||
document.getBindingParent(event.target).doInput();
|
||||
}, false);
|
||||
]]>
|
||||
</constructor>
|
||||
|
||||
<method name="_delayedInitSpellCheck">
|
||||
<parameter name="me"/>
|
||||
<body><![CDATA[
|
||||
var spellui = me.spellCheckerUI;
|
||||
if (spellui)
|
||||
spellui.enabled = true;
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="_doPopupItemEnabling">
|
||||
<parameter name="popupNode"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var controller = document.commandDispatcher.getControllerForCommand(command);
|
||||
var children = popupNode.childNodes;
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
var command = children[i].getAttribute("cmd");
|
||||
if (command) {
|
||||
var enabled = controller.isCommandEnabled(command);
|
||||
if (enabled)
|
||||
children[i].removeAttribute("disabled");
|
||||
else
|
||||
children[i].setAttribute("disabled", "true");
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="_doPopupItemEnablingSpell">
|
||||
<parameter name="popupNode"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var spellui = this.spellCheckerUI;
|
||||
if (!spellui || !spellui.canSpellCheck) {
|
||||
this._setMenuItemVisibility("spell-no-suggestions", false);
|
||||
this._setMenuItemVisibility("spell-check-enabled", false);
|
||||
this._setMenuItemVisibility("spell-check-separator", false);
|
||||
this._setMenuItemVisibility("spell-add-to-dictionary", false);
|
||||
this._setMenuItemVisibility("spell-suggestions-separator", false);
|
||||
this._setMenuItemVisibility("spell-dictionaries", false);
|
||||
return;
|
||||
}
|
||||
|
||||
spellui.initFromEvent(document.popupRangeParent,
|
||||
document.popupRangeOffset);
|
||||
|
||||
var enabled = spellui.enabled;
|
||||
document.getAnonymousElementByAttribute(this, "anonid",
|
||||
"spell-check-enabled").setAttribute("checked", enabled);
|
||||
|
||||
var overMisspelling = spellui.overMisspelling;
|
||||
this._setMenuItemVisibility("spell-add-to-dictionary", overMisspelling);
|
||||
this._setMenuItemVisibility("spell-suggestions-separator", overMisspelling);
|
||||
|
||||
// suggestion list
|
||||
var suggestionsSeparator = document.getAnonymousElementByAttribute(this,
|
||||
"anonid", "spell-add-to-dictionary");
|
||||
var numsug = spellui.addSuggestionsToMenu(popupNode, suggestionsSeparator, 5);
|
||||
this._setMenuItemVisibility("spell-no-suggestions", overMisspelling && numsug == 0);
|
||||
|
||||
// dictionary list
|
||||
var dictmenu = document.getAnonymousElementByAttribute(this, "anonid",
|
||||
"spell-dictionaries-menu");
|
||||
var addsep = document.getAnonymousElementByAttribute(this, "anonid",
|
||||
"spell-language-separator");
|
||||
|
||||
var numdicts = spellui.addDictionaryListToMenu(dictmenu, addsep);
|
||||
this._setMenuItemVisibility("spell-dictionaries", enabled);
|
||||
|
||||
this._doPopupItemEnabling(popupNode);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="_doPopupItemDisabling">
|
||||
<body><![CDATA[
|
||||
if (this.spellCheckerUI) {
|
||||
this.spellCheckerUI.clearSuggestionsFromMenu();
|
||||
this.spellCheckerUI.clearDictionaryListFromMenu();
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="_setMenuItemVisibility">
|
||||
<parameter name="anonid"/>
|
||||
<parameter name="visible"/>
|
||||
<body><![CDATA[
|
||||
document.getAnonymousElementByAttribute(this, "anonid", anonid).
|
||||
hidden = ! visible;
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="doTextCommand">
|
||||
<parameter name="command"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var controller = document.commandDispatcher.getControllerForCommand(command);
|
||||
controller.doCommand(command);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="doInput">
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (this._timer) {
|
||||
clearTimeout(this._timer);
|
||||
}
|
||||
this._timer = this.timeout && setTimeout(this._fireCommand, this.timeout, this);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
|
||||
|
||||
<handlers>
|
||||
<handler event="input">
|
||||
<![CDATA[
|
||||
if (this._timer)
|
||||
clearTimeout(this._timer);
|
||||
this._timer = this.timeout && setTimeout(this._fireCommand, this.timeout, this);
|
||||
]]>
|
||||
<![CDATA[
|
||||
this.doInput();
|
||||
]]>
|
||||
</handler>
|
||||
</handlers>
|
||||
|
||||
|
||||
<content context="_child">
|
||||
<xul:hbox class="textbox-input-box" flex="1">
|
||||
<html:textarea class="textbox-textarea" flex="1" anonid="input"
|
||||
xbl:inherits="onfocus,onblur,xbl:text=value,disabled,tabindex,rows,cols,readonly,wrap"><children/></html:textarea>
|
||||
<xul:menupopup anonid="input-box-contextmenu"
|
||||
onpopupshowing="if (document.commandDispatcher.focusedElement != this.parentNode.firstChild) { this.parentNode.firstChild.focus(); } this.parentNode.parentNode._doPopupItemEnablingSpell(this);"
|
||||
onpopuphiding="this.parentNode.parentNode._doPopupItemDisabling(this);"
|
||||
oncommand="var cmd = event.originalTarget.getAttribute('cmd'); if(cmd) { this.parentNode.parentNode.doTextCommand(cmd); event.stopPropagation(); }">
|
||||
<xul:menuitem label="&spellNoSuggestions.label;" anonid="spell-no-suggestions" disabled="true"/>
|
||||
<xul:menuitem label="&spellAddToDictionary.label;" accesskey="&spellAddToDictionary.accesskey;" anonid="spell-add-to-dictionary"
|
||||
oncommand="this.parentNode.parentNode.parentNode.spellCheckerUI.addToDictionary();"/>
|
||||
<xul:menuseparator anonid="spell-suggestions-separator"/>
|
||||
<xul:menuitem label="&undoCmd.label;" accesskey="&undoCmd.accesskey;" cmd="cmd_undo"/>
|
||||
<xul:menuseparator/>
|
||||
<xul:menuitem label="&cutCmd.label;" accesskey="&cutCmd.accesskey;" cmd="cmd_cut"/>
|
||||
<xul:menuitem label="©Cmd.label;" accesskey="©Cmd.accesskey;" cmd="cmd_copy"/>
|
||||
<xul:menuitem label="&pasteCmd.label;" accesskey="&pasteCmd.accesskey;" cmd="cmd_paste"/>
|
||||
<xul:menuitem label="&deleteCmd.label;" accesskey="&deleteCmd.accesskey;" cmd="cmd_delete"/>
|
||||
<xul:menuseparator/>
|
||||
<xul:menuitem label="&selectAllCmd.label;" accesskey="&selectAllCmd.accesskey;" cmd="cmd_selectAll"/>
|
||||
<xul:menuseparator anonid="spell-check-separator"/>
|
||||
<xul:menuitem label="&spellEnable.label;" type="checkbox" accesskey="&spellEnable.accesskey;" anonid="spell-check-enabled"
|
||||
oncommand="this.parentNode.parentNode.parentNode.spellCheckerUI.toggleEnabled();"/>
|
||||
<xul:menu label="&spellDictionaries.label;" accesskey="&spellDictionaries.accesskey;" anonid="spell-dictionaries">
|
||||
<xul:menupopup anonid="spell-dictionaries-menu"
|
||||
onpopupshowing="event.stopPropagation();"
|
||||
onpopuphiding="event.stopPropagation();">
|
||||
<xul:menuseparator anonid="spell-language-separator"/>
|
||||
<xul:menuitem anonid="spell-add-dictionaries-main" label="&spellAddDictionaries.label;"
|
||||
accesskey="&spellAddDictionaries.accesskey;"
|
||||
oncommand="nsContextMenu.prototype.addDictionaries();"/>
|
||||
</xul:menupopup>
|
||||
</xul:menu>
|
||||
</xul:menupopup>
|
||||
</xul:hbox>
|
||||
|
||||
</content>
|
||||
</binding>
|
||||
</bindings>
|
|
@ -23,10 +23,15 @@
|
|||
|
||||
<!DOCTYPE bindings SYSTEM "chrome://zotero/locale/searchbox.dtd">
|
||||
|
||||
<bindings xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<bindings xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="search-box">
|
||||
<resources>
|
||||
<stylesheet src="chrome://zotero/skin/bindings/search.css"/>
|
||||
</resources>
|
||||
|
||||
<implementation>
|
||||
<field name="searchRef"/>
|
||||
<property name="search" onget="return this.searchRef;">
|
||||
|
@ -41,32 +46,30 @@
|
|||
var conditions = this.search.getSearchConditions();
|
||||
for(var id in conditions)
|
||||
{
|
||||
// Checkboxes
|
||||
switch (conditions[id]['condition']) {
|
||||
case 'recursive':
|
||||
case 'noChildren':
|
||||
case 'includeParentsAndChildren':
|
||||
var checkbox = conditions[id]['condition'] + 'Checkbox';
|
||||
this.id(checkbox).setAttribute('condition',id);
|
||||
this.id(checkbox).checked = (conditions[id]['operator']=='true');
|
||||
continue;
|
||||
}
|
||||
|
||||
if(conditions[id]['condition'] == 'joinMode')
|
||||
{
|
||||
this.id('joinModeMenu').setAttribute('condition',id);
|
||||
this.id('joinModeMenu').value = conditions[id]['operator'];
|
||||
}
|
||||
else if(conditions[id]['condition'] == 'recursive')
|
||||
{
|
||||
this.id('recursiveCheckbox').setAttribute('condition',id);
|
||||
this.id('recursiveCheckbox').checked = (conditions[id]['operator']=='true');
|
||||
}
|
||||
else
|
||||
{
|
||||
this.addCondition(conditions[id]);
|
||||
}
|
||||
}
|
||||
|
||||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
<method name="onAddClicked">
|
||||
<body>
|
||||
<![CDATA[
|
||||
this.addCondition(this.search.getSearchCondition(this.search.addCondition("title","contains","")));
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="addCondition">
|
||||
<parameter name="ref"/>
|
||||
<body>
|
||||
|
@ -77,9 +80,19 @@
|
|||
|
||||
conditionsBox.appendChild(condition);
|
||||
|
||||
// Default to an empty 'title' condition
|
||||
if (!ref) {
|
||||
ref = this.search.getSearchCondition(this.search.addCondition("title","contains",""))
|
||||
}
|
||||
|
||||
condition.initWithParentAndCondition(this, ref);
|
||||
|
||||
conditionsBox.childNodes[0].id('remove').hidden = (conditionsBox.childNodes.length == 1);
|
||||
if (conditionsBox.childNodes.length == 2){
|
||||
conditionsBox.childNodes[0].enableRemoveButton();
|
||||
}
|
||||
else if (conditionsBox.childNodes.length == 1){
|
||||
conditionsBox.childNodes[0].disableRemoveButton();
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -90,15 +103,16 @@
|
|||
var conditionsBox = this.id('conditions');
|
||||
this.search.removeCondition(id);
|
||||
|
||||
for(var i = 0, len=conditionsBox.childNodes.length; i < len; i++)
|
||||
if(conditionsBox.childNodes[i].conditionID == id)
|
||||
{
|
||||
for (var i = 0, len=conditionsBox.childNodes.length; i < len; i++){
|
||||
if (conditionsBox.childNodes[i].conditionID == id){
|
||||
conditionsBox.removeChild(conditionsBox.childNodes[i]);
|
||||
|
||||
i = len;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
conditionsBox.childNodes[0].id('remove').hidden = (conditionsBox.childNodes.length == 1);
|
||||
if (conditionsBox.childNodes.length == 1){
|
||||
conditionsBox.childNodes[0].disableRemoveButton();
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -113,20 +127,35 @@
|
|||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="updateRecursive">
|
||||
<method name="updateCheckbox">
|
||||
<parameter name="condition"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var checkbox = this.id('recursiveCheckbox');
|
||||
var checkbox = this.id(condition + 'Checkbox');
|
||||
var value = checkbox.checked ? 'true' : 'false';
|
||||
if(checkbox.hasAttribute('condition'))
|
||||
{
|
||||
this.search.updateCondition(checkbox.getAttribute('condition'),
|
||||
'recursive', value, null);
|
||||
condition, value, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
checkbox.setAttribute('condition',
|
||||
this.search.addCondition('recursive', value, null));
|
||||
this.search.addCondition(condition, value, null));
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<!-- Calls updateSearch() on all search conditions -->
|
||||
<method name="updateSearch">
|
||||
<body>
|
||||
<![CDATA[
|
||||
var conditionsBox = this.id('conditions');
|
||||
|
||||
if (conditionsBox.hasChildNodes()) {
|
||||
for(var i = 0, len=conditionsBox.childNodes.length; i < len; i++) {
|
||||
conditionsBox.childNodes[i].updateSearch();
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
|
@ -134,18 +163,32 @@
|
|||
<method name="save">
|
||||
<body>
|
||||
<![CDATA[
|
||||
var conditionsBox = this.id('conditions');
|
||||
|
||||
if(conditionsBox.hasChildNodes())
|
||||
for(var i = 0, len=conditionsBox.childNodes.length; i < len; i++)
|
||||
{
|
||||
conditionsBox.childNodes[i].updateSearch();
|
||||
}
|
||||
|
||||
this.updateSearch();
|
||||
return this.search.save();
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="handleKeyPress">
|
||||
<parameter name="event"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
switch (event.keyCode) {
|
||||
case event.DOM_VK_RETURN:
|
||||
case event.DOM_VK_ENTER:
|
||||
if (event.shiftKey) {
|
||||
this.addCondition();
|
||||
}
|
||||
else {
|
||||
this.doCommand();
|
||||
}
|
||||
break;
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="id">
|
||||
<parameter name="id"/>
|
||||
<body>
|
||||
|
@ -155,29 +198,38 @@
|
|||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
<handlers>
|
||||
</handlers>
|
||||
|
||||
<content>
|
||||
<xul:vbox flex="1">
|
||||
<xul:vbox id="search-box" flex="1" onkeypress="this.parentNode.handleKeyPress(event)">
|
||||
<xul:groupbox xbl:inherits="flex">
|
||||
<xul:caption align="center">
|
||||
<xul:label value="&zotero.search.joinMode.match;"/>
|
||||
<xul:menulist id="joinModeMenu" oncommand="this.parentNode.parentNode.parentNode.parentNode.updateJoinMode()">
|
||||
<xul:label value="&zotero.search.joinMode.prefix;"/>
|
||||
<xul:menulist id="joinModeMenu" oncommand="this.parentNode.parentNode.parentNode.parentNode.updateJoinMode(); event.stopPropagation()">
|
||||
<xul:menupopup>
|
||||
<xul:menuitem label="&zotero.search.joinMode.any;" value="any"/>
|
||||
<xul:menuitem label="&zotero.search.joinMode.all;" value="all" selected="true"/>
|
||||
</xul:menupopup>
|
||||
</xul:menulist>
|
||||
<xul:label value="&zotero.search.joinMode.ofTheFollowing;:"/>
|
||||
<xul:label value="&zotero.search.joinMode.suffix;"/>
|
||||
</xul:caption>
|
||||
<xul:vbox id="conditions"/>
|
||||
</xul:groupbox>
|
||||
<xul:checkbox id="recursiveCheckbox" label="&zotero.search.recursive.label;" oncommand="this.parentNode.parentNode.updateRecursive()"/>
|
||||
<xul:hbox>
|
||||
<xul:checkbox id="recursiveCheckbox" label="&zotero.search.recursive.label;" oncommand="this.parentNode.parentNode.parentNode.updateCheckbox('recursive'); event.stopPropagation()"/>
|
||||
<xul:checkbox id="noChildrenCheckbox" label="&zotero.search.noChildren;" oncommand="this.parentNode.parentNode.parentNode.updateCheckbox('noChildren'); event.stopPropagation()"/>
|
||||
</xul:hbox>
|
||||
<xul:checkbox id="includeParentsAndChildrenCheckbox" label="&zotero.search.includeParentsAndChildren;" oncommand="document.getBindingParent(this).updateCheckbox('includeParentsAndChildren'); event.stopPropagation()"/>
|
||||
</xul:vbox>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
|
||||
|
||||
<binding id="search-condition">
|
||||
<resources>
|
||||
<stylesheet src="chrome://zotero/skin/bindings/search.css"/>
|
||||
</resources>
|
||||
|
||||
<implementation>
|
||||
<field name="conditionID"/>
|
||||
<field name="selectedCondition"/>
|
||||
|
@ -188,20 +240,90 @@
|
|||
<field name="dontupdate"/>
|
||||
<constructor>
|
||||
<![CDATA[
|
||||
var operators = new Array('is', 'isNot', 'contains', 'doesNotContain', 'isLessThan', 'isGreaterThan', 'isBefore', 'isAfter');
|
||||
var operators = new Array('is', 'isNot', 'beginsWith', 'contains', 'doesNotContain', 'isLessThan', 'isGreaterThan', 'isBefore', 'isAfter', 'isInTheLast');
|
||||
var operatorsList = this.id('operatorsmenu');
|
||||
|
||||
// Build operator menu
|
||||
for(var i in operators)
|
||||
{
|
||||
operatorsList.appendItem(Zotero.getString('searchOperator.'+operators[i]),operators[i]);
|
||||
}
|
||||
|
||||
|
||||
// Build conditions menu
|
||||
var conditionsList = this.id('conditionsmenu');
|
||||
var conditions = Zotero.SearchConditions.getStandardConditions();
|
||||
|
||||
for(var i=0, len=conditions.length; i<len; i++)
|
||||
{
|
||||
conditionsList.appendItem(conditions[i]['localized'], conditions[i]['name']);
|
||||
for (var i=0, len=conditions.length; i<len; i++) {
|
||||
var menuitem = conditionsList.appendItem(conditions[i]['localized'], conditions[i]['name']);
|
||||
|
||||
var baseFields = null;
|
||||
try {
|
||||
baseFields = Zotero.ItemFields.getTypeFieldsFromBase(conditions[i]['name']);
|
||||
}
|
||||
catch (e) {}
|
||||
|
||||
// Add tooltip, building it if it doesn't exist
|
||||
if (baseFields) {
|
||||
if (!this.id(conditions[i]['name'] + '-tooltip')) {
|
||||
var fieldName = null;
|
||||
try {
|
||||
fieldName = Zotero.getString('itemFields.' + conditions[i]['name']);
|
||||
}
|
||||
catch (e) {}
|
||||
|
||||
if (fieldName) {
|
||||
var localized = [fieldName];
|
||||
}
|
||||
else {
|
||||
var localized = [];
|
||||
}
|
||||
|
||||
for (var j in baseFields) {
|
||||
var str = Zotero.SearchConditions.getLocalizedName(Zotero.ItemFields.getName(baseFields[j]));
|
||||
|
||||
if (localized.indexOf(str) == -1) {
|
||||
localized.push(str);
|
||||
}
|
||||
}
|
||||
localized.sort();
|
||||
|
||||
var tt = document.createElement('tooltip');
|
||||
tt.setAttribute('id', conditions[i]['name'] + '-tooltip');
|
||||
tt.setAttribute('orient', 'vertical');
|
||||
tt.setAttribute('noautohide', true);
|
||||
|
||||
var grid = document.createElement('grid');
|
||||
|
||||
var columns = document.createElement('columns');
|
||||
var col1 = document.createElement('column');
|
||||
var col2 = document.createElement('column');
|
||||
columns.appendChild(col1);
|
||||
columns.appendChild(col2);
|
||||
|
||||
var rows = document.createElement('rows');
|
||||
|
||||
var fieldRow = document.createElement('row');
|
||||
var label = document.createElement('label');
|
||||
label.setAttribute('value', Zotero.getString('searchConditions.tooltip.fields'));
|
||||
fieldRow.appendChild(label);
|
||||
var vbox = document.createElement('vbox');
|
||||
for each(var str in localized) {
|
||||
var label = document.createElement('label')
|
||||
label.setAttribute('value', str);
|
||||
vbox.appendChild(label);
|
||||
}
|
||||
fieldRow.appendChild(vbox);
|
||||
|
||||
rows.appendChild(fieldRow);
|
||||
|
||||
grid.appendChild(rows);
|
||||
tt.appendChild(grid);
|
||||
|
||||
this.id('condition-tooltips').appendChild(tt);
|
||||
}
|
||||
|
||||
menuitem.setAttribute('tooltip', conditions[i]['name'] + '-tooltip');
|
||||
}
|
||||
}
|
||||
conditionsList.selectedIndex = 0;
|
||||
]]>
|
||||
|
@ -209,7 +331,7 @@
|
|||
<method name="onConditionSelected">
|
||||
<body>
|
||||
<![CDATA[
|
||||
// Skip if already selected
|
||||
// Skip if correct condition already selected
|
||||
if (this.id('conditionsmenu').value==this.selectedCondition){
|
||||
return;
|
||||
}
|
||||
|
@ -236,7 +358,7 @@
|
|||
}
|
||||
operatorsList.selectedIndex = selectThis;
|
||||
|
||||
// Generate drop-down menus for certain conditions
|
||||
// Generate drop-down menu instead of textbox for certain conditions
|
||||
switch (conditionsMenu.value){
|
||||
case 'collectionID':
|
||||
var merged = [];
|
||||
|
@ -244,7 +366,15 @@
|
|||
var cols = Zotero.getCollections(false, true);
|
||||
for (var i in cols)
|
||||
{
|
||||
merged.push([cols[i].getName(), 'C' + cols[i].getID()]);
|
||||
// Indent subcollections
|
||||
var indent = '';
|
||||
if (cols[i].level) {
|
||||
for (var j=1; j<cols[i].level; j++) {
|
||||
indent += ' ';
|
||||
}
|
||||
indent += '- ';
|
||||
}
|
||||
merged.push([indent + cols[i].getName(), 'C' + cols[i].getID()]);
|
||||
}
|
||||
|
||||
var searches = Zotero.Searches.getAll();
|
||||
|
@ -257,7 +387,7 @@
|
|||
}
|
||||
|
||||
this.createValueMenu(merged);
|
||||
return;
|
||||
break;
|
||||
|
||||
case 'itemTypeID':
|
||||
var types = Zotero.ItemTypes.getTypes();
|
||||
|
@ -269,25 +399,82 @@
|
|||
delete types[i]['id'];
|
||||
}
|
||||
this.createValueMenu(types);
|
||||
return;
|
||||
break;
|
||||
|
||||
case 'fileTypeID':
|
||||
var types = Zotero.FileTypes.getTypes();
|
||||
for (var i in types) {
|
||||
types[i][0] = Zotero.getString('fileTypes.' + types[i]['name']);
|
||||
types[i][1] = types[i]['id'];
|
||||
delete types[i]['name'];
|
||||
delete types[i]['id'];
|
||||
}
|
||||
this.createValueMenu(types);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (operatorsList.value=='isInTheLast')
|
||||
{
|
||||
this.id('value-date-age').value = this.value;
|
||||
}
|
||||
|
||||
// Textbox
|
||||
else {
|
||||
// If switching from menu to textbox, clear value
|
||||
if (this.id('valuefield').hidden){
|
||||
this.id('valuefield').value = '';
|
||||
}
|
||||
// If switching between textbox conditions, get loaded value for new one
|
||||
else {
|
||||
this.id('valuefield').value = this.value;
|
||||
}
|
||||
|
||||
// Update field drop-down if applicable
|
||||
this.id('valuefield').update(conditionsMenu.value, this.mode);
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise use a text field
|
||||
this.onOperatorSelected();
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="onOperatorSelected">
|
||||
<body>
|
||||
<![CDATA[
|
||||
var conditionsMenu = this.id('conditionsmenu');
|
||||
var operatorsList = this.id('operatorsmenu');
|
||||
|
||||
// If switching between menu and textbox, clear value
|
||||
if (this.id('valuefield').hidden){
|
||||
this.value = '';
|
||||
this.id('valuefield').value = '';
|
||||
}
|
||||
else {
|
||||
this.id('valuefield').value = this.value;
|
||||
// Drop-down menu
|
||||
if (conditionsMenu.value == 'collectionID' || conditionsMenu.value == 'itemTypeID'
|
||||
|| conditionsMenu.value == 'fileTypeID') {
|
||||
this.id('valuefield').hidden = true;
|
||||
this.id('valuemenu').hidden = false;
|
||||
this.id('value-date-age').hidden = true;
|
||||
}
|
||||
|
||||
// Update field drop-down if applicable
|
||||
this.id('valuefield').update(conditionsMenu.value, this.mode);
|
||||
// Textbox + units dropdown for isInTheLast operator
|
||||
else if (operatorsList.value=='isInTheLast')
|
||||
{
|
||||
// If switching from text field, clear value
|
||||
if (this.id('value-date-age').hidden){
|
||||
this.value = '';
|
||||
}
|
||||
this.id('valuefield').hidden = true;
|
||||
this.id('valuemenu').hidden = true;
|
||||
this.id('value-date-age').hidden = false;
|
||||
}
|
||||
|
||||
this.id('valuefield').hidden = false;
|
||||
this.id('valuemenu').hidden = true;
|
||||
// Textbox
|
||||
else
|
||||
{
|
||||
// If switching from date age, clear value
|
||||
if (this.id('valuefield').hidden){
|
||||
this.value = '';
|
||||
}
|
||||
this.id('valuefield').hidden = false;
|
||||
this.id('valuemenu').hidden = true;
|
||||
this.id('value-date-age').hidden = true;
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -310,8 +497,6 @@
|
|||
{
|
||||
this.id('valuemenu').value = this.value;
|
||||
}
|
||||
this.id('valuefield').hidden = true;
|
||||
this.id('valuemenu').hidden = false;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -344,6 +529,16 @@
|
|||
this.id('conditionsmenu').value = condition['condition'];
|
||||
}
|
||||
|
||||
// Convert datetimes from UTC to localtime
|
||||
if ((condition['condition']=='accessDate' ||
|
||||
condition['condition']=='dateAdded' ||
|
||||
condition['condition']=='dateModified') &&
|
||||
Zotero.Date.isSQLDateTime(condition['value'])){
|
||||
|
||||
condition['value'] =
|
||||
Zotero.Date.dateToSQL(Zotero.Date.sqlToDate(condition['value'], true));
|
||||
}
|
||||
|
||||
this.mode = condition['mode'];
|
||||
this.id('operatorsmenu').value = condition['operator'];
|
||||
this.value = prefix + condition['value'];
|
||||
|
@ -351,9 +546,12 @@
|
|||
}
|
||||
|
||||
this.onConditionSelected();
|
||||
|
||||
this.id('conditionsmenu').focus();
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<!-- Gets the value from the field and updates the associated search condition -->
|
||||
<method name="updateSearch">
|
||||
<body>
|
||||
<![CDATA[
|
||||
|
@ -366,12 +564,28 @@
|
|||
if (!this.id('valuefield').hidden)
|
||||
{
|
||||
var value = this.id('valuefield').value;
|
||||
|
||||
// Convert datetimes to UTC before saving
|
||||
if ((this.id('conditionsmenu').value=='accessDate' ||
|
||||
this.id('conditionsmenu').value=='dateAdded' ||
|
||||
this.id('conditionsmenu').value=='dateModified') &&
|
||||
Zotero.Date.isSQLDateTime(value)){
|
||||
|
||||
var value = Zotero.Date.dateToSQL(Zotero.Date.sqlToDate(value), true);
|
||||
}
|
||||
|
||||
// Append mode to condition
|
||||
if (this.id('valuefield').mode){
|
||||
condition += '/' + this.id('valuefield').mode;
|
||||
}
|
||||
}
|
||||
|
||||
// isInTheLast operator
|
||||
else if (!this.id('value-date-age').hidden)
|
||||
{
|
||||
var value = this.id('value-date-age').value;
|
||||
}
|
||||
|
||||
// Handle special C1234 and S5678 form for
|
||||
// collections and searches
|
||||
else if (this.id('conditionsmenu').value=='collectionID')
|
||||
|
@ -393,7 +607,6 @@
|
|||
{
|
||||
var value = this.id('valuemenu').value;
|
||||
}
|
||||
|
||||
this.parent.search.updateCondition(this.conditionID, condition, operator, value);
|
||||
}
|
||||
]]>
|
||||
|
@ -402,16 +615,194 @@
|
|||
<method name="onRemoveClicked">
|
||||
<body>
|
||||
<![CDATA[
|
||||
if(this.parent)
|
||||
if (this.parent){
|
||||
this.parent.removeCondition(this.conditionID);
|
||||
window.sizeToContent()
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="onAddClicked">
|
||||
<body>
|
||||
<![CDATA[
|
||||
if(this.parent)
|
||||
this.parent.onAddClicked();
|
||||
if (this.parent){
|
||||
this.parent.addCondition();
|
||||
window.sizeToContent();
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="disableRemoveButton">
|
||||
<body>
|
||||
<![CDATA[
|
||||
document.getAnonymousNodes(this)[0].lastChild.previousSibling.disabled = true;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="enableRemoveButton">
|
||||
<body>
|
||||
<![CDATA[
|
||||
document.getAnonymousNodes(this)[0].lastChild.previousSibling.disabled = false;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
<method name="id">
|
||||
<parameter name="id"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var elems = document.getAnonymousNodes(this)[0].getElementsByAttribute('id',id);
|
||||
return elems[0] ? elems[0] : false;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
|
||||
<content>
|
||||
<xul:hbox id="search-condition" xbl:inherits="flex">
|
||||
<xul:popupset id="condition-tooltips"/>
|
||||
|
||||
<xul:menulist id="conditionsmenu" oncommand="this.parentNode.parentNode.onConditionSelected(); event.stopPropagation()">
|
||||
<xul:menupopup/>
|
||||
</xul:menulist>
|
||||
<xul:menulist id="operatorsmenu" oncommand="this.parentNode.parentNode.onOperatorSelected(); event.stopPropagation()">
|
||||
<xul:menupopup/>
|
||||
</xul:menulist>
|
||||
<xul:zoterosearchtextbox id="valuefield" flex="1"/>
|
||||
<xul:menulist id="valuemenu" flex="1" hidden="true">
|
||||
<xul:menupopup/>
|
||||
</xul:menulist>
|
||||
<xul:zoterosearchagefield id="value-date-age" hidden="true" flex="1"/>
|
||||
<!-- Adding elements below will break disable/enableRemoveButton() -->
|
||||
<xul:toolbarbutton id="remove" class="zotero-clicky" label="-" oncommand="this.parentNode.parentNode.onRemoveClicked(event); event.stopPropagation()"/>
|
||||
<xul:toolbarbutton id="add" class="zotero-clicky" label="+" oncommand="this.parentNode.parentNode.onAddClicked(event); event.stopPropagation()"/>
|
||||
</xul:hbox>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
|
||||
|
||||
<binding id="search-textbox">
|
||||
<resources>
|
||||
<stylesheet src="chrome://zotero/skin/bindings/search.css"/>
|
||||
</resources>
|
||||
|
||||
<implementation>
|
||||
<property name="value"
|
||||
onget="return document.getAnonymousNodes(this)[0].value"
|
||||
onset="document.getAnonymousNodes(this)[0].setAttribute('value', val); return val"/>
|
||||
<property name="mode">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
if (this.getAttribute('hasOptions')!='true'){
|
||||
return false;
|
||||
}
|
||||
|
||||
var button = this.id('textbox-button');
|
||||
var menu = this.id(button.popup);
|
||||
|
||||
var selectedIndex = -1;
|
||||
for (var i=0; i<menu.childNodes.length; i++){
|
||||
if (menu.childNodes[i].getAttribute('checked')=='true'){
|
||||
selectedIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch (button.popup){
|
||||
case 'textbox-fulltext-menu':
|
||||
switch (selectedIndex){
|
||||
case 0:
|
||||
return false;
|
||||
|
||||
case 1:
|
||||
return 'phraseBinary';
|
||||
|
||||
case 2:
|
||||
return 'regexp';
|
||||
|
||||
case 3:
|
||||
return 'regexpCS';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
throw('Invalid search textbox popup');
|
||||
]]>
|
||||
</getter>
|
||||
</property>
|
||||
<method name="update">
|
||||
<parameter name="condition"/>
|
||||
<parameter name="mode"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var button = this.id('textbox-button');
|
||||
|
||||
switch (condition){
|
||||
case 'fulltextContent':
|
||||
button.popup = 'textbox-fulltext-menu';
|
||||
button.setAttribute('popup', 'textbox-fulltext-menu');
|
||||
var menu = this.id(button.popup);
|
||||
this.setAttribute('hasOptions', true);
|
||||
|
||||
var selectedIndex = 0;
|
||||
if (mode){
|
||||
switch (mode){
|
||||
case 'phrase':
|
||||
selectedIndex = 0;
|
||||
break;
|
||||
|
||||
case 'phraseBinary':
|
||||
selectedIndex = 1;
|
||||
break;
|
||||
|
||||
case 'regexp':
|
||||
selectedIndex = 2;
|
||||
break;
|
||||
|
||||
case 'regexpCS':
|
||||
selectedIndex = 3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
menu.childNodes[selectedIndex].setAttribute('checked', true);
|
||||
break;
|
||||
|
||||
default:
|
||||
this.setAttribute('hasOptions', false);
|
||||
|
||||
// Set textbox to autocomplete mode
|
||||
switch (condition)
|
||||
{
|
||||
// Skip autocomplete for these fields
|
||||
case 'date':
|
||||
case 'note':
|
||||
case 'extra':
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
var textbox = document.getAnonymousNodes(this)[0];
|
||||
textbox.setAttribute('type', 'autocomplete');
|
||||
textbox.setAttribute('autocompletesearch', 'zotero');
|
||||
|
||||
if (condition=='creator')
|
||||
{
|
||||
// 2 searches both single- and double-field creators
|
||||
var autocompleteCondition = condition + '/2'
|
||||
}
|
||||
else
|
||||
{
|
||||
var autocompleteCondition = condition;
|
||||
}
|
||||
|
||||
textbox.setAttribute('autocompletesearchparam', autocompleteCondition);
|
||||
}
|
||||
}
|
||||
|
||||
if (!autocompleteCondition)
|
||||
{
|
||||
var textbox = document.getAnonymousNodes(this)[0];
|
||||
textbox.removeAttribute('type');
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -424,20 +815,82 @@
|
|||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
|
||||
<content>
|
||||
<xul:hbox xbl:inherits="flex">
|
||||
<xul:menulist id="conditionsmenu" oncommand="this.parentNode.parentNode.onConditionSelected();">
|
||||
<xul:menupopup/>
|
||||
<xul:textbox id="search-textbox" xbl:inherits="hasOptions,flex">
|
||||
<xul:popupset>
|
||||
<xul:menupopup id="textbox-fulltext-menu">
|
||||
<xul:menuitem type="radio" label="&zotero.search.textModes.phrase;"/>
|
||||
<xul:menuitem type="radio" label="&zotero.search.textModes.phraseBinary;"/>
|
||||
<xul:menuitem type="radio" label="&zotero.search.textModes.regexp;"/>
|
||||
<xul:menuitem type="radio" label="&zotero.search.textModes.regexpCS;"/>
|
||||
</xul:menupopup>
|
||||
</xul:popupset>
|
||||
|
||||
<xul:toolbarbutton id="textbox-button" type="menu"/>
|
||||
</xul:textbox>
|
||||
</content>
|
||||
</binding>
|
||||
|
||||
|
||||
|
||||
<binding id="search-in-the-last">
|
||||
<resources>
|
||||
<stylesheet src="chrome://zotero/skin/bindings/search.css"/>
|
||||
</resources>
|
||||
|
||||
<implementation>
|
||||
<property name="value">
|
||||
<getter>
|
||||
<![CDATA[
|
||||
var menulist = document.getAnonymousNodes(this)[0].firstChild.nextSibling;
|
||||
|
||||
return document.getAnonymousNodes(this)[0].firstChild.value + ' ' +
|
||||
menulist.firstChild.childNodes[menulist.selectedIndex].getAttribute('value')
|
||||
]]>
|
||||
</getter>
|
||||
<setter>
|
||||
<![CDATA[
|
||||
var [num, units] = val.split(' ');
|
||||
document.getAnonymousNodes(this)[0].firstChild.setAttribute('value', num);
|
||||
|
||||
var menulist = document.getAnonymousNodes(this)[0].firstChild.nextSibling;
|
||||
var menupopup = menulist.firstChild;
|
||||
|
||||
var selectThis = 0;
|
||||
for (var i=0; i<menupopup.childNodes.length; i++){
|
||||
if (menupopup.childNodes[i].value == units)
|
||||
{
|
||||
selectThis = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
menulist.selectedIndex = selectThis;
|
||||
|
||||
return val;
|
||||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
<method name="id">
|
||||
<parameter name="id"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
return document.getAnonymousNodes(this)[0].getElementsByAttribute('id',id)[0];
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
|
||||
<content>
|
||||
<xul:hbox id="search-in-the-last" flex="1">
|
||||
<xul:textbox flex="1"/>
|
||||
<xul:menulist>
|
||||
<xul:menupopup flex="1">
|
||||
<xul:menuitem label="&zotero.search.date.units.days;" value="days" selected="true"/>
|
||||
<xul:menuitem label="&zotero.search.date.units.months;" value="months"/>
|
||||
<xul:menuitem label="&zotero.search.date.units.years;" value="years"/>
|
||||
</xul:menupopup>
|
||||
</xul:menulist>
|
||||
<xul:menulist id="operatorsmenu">
|
||||
<xul:menupopup/>
|
||||
</xul:menulist>
|
||||
<xul:zoterosearchtextbox id="valuefield" flex="1"/>
|
||||
<xul:menulist id="valuemenu" flex="1" hidden="true">
|
||||
<xul:menupopup/>
|
||||
</xul:menulist>
|
||||
<xul:toolbarbutton id="remove" class="clicky" label="-" oncommand="this.parentNode.parentNode.onRemoveClicked();"/>
|
||||
<xul:toolbarbutton id="add" class="clicky" label="+" oncommand="this.parentNode.parentNode.onAddClicked();"/>
|
||||
</xul:hbox>
|
||||
</content>
|
||||
</binding>
|
||||
|
|
735
chrome/content/zotero/browser.js
Normal file
735
chrome/content/zotero/browser.js
Normal file
|
@ -0,0 +1,735 @@
|
|||
/*
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (c) 2006 Center for History and New Media
|
||||
George Mason University, Fairfax, Virginia, USA
|
||||
http://chnm.gmu.edu
|
||||
|
||||
Licensed under the Educational Community License, Version 1.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.opensource.org/licenses/ecl1.php
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
Based on code from Greasemonkey and PiggyBank
|
||||
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
//
|
||||
// Zotero Ingester Browser Functions
|
||||
//
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Zotero_Browser
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Class to interface with the browser when ingesting data
|
||||
|
||||
var Zotero_Browser = new function() {
|
||||
this.init = init;
|
||||
this.scrapeThisPage = scrapeThisPage;
|
||||
this.annotatePage = annotatePage;
|
||||
this.toggleMode = toggleMode;
|
||||
this.setCollapsed = setCollapsed;
|
||||
this.chromeLoad = chromeLoad;
|
||||
this.chromeUnload = chromeUnload;
|
||||
this.contentLoad = contentLoad;
|
||||
this.contentHide = contentHide;
|
||||
this.tabClose = tabClose;
|
||||
this.resize = resize;
|
||||
this.updateStatus = updateStatus;
|
||||
this.finishScraping = finishScraping;
|
||||
this.itemDone = itemDone;
|
||||
|
||||
this.tabbrowser = null;
|
||||
this.appcontent = null;
|
||||
this.statusImage = null;
|
||||
|
||||
var _scrapePopupShowing = false;
|
||||
var _browserData = new Object();
|
||||
|
||||
var _blacklist = [
|
||||
"googlesyndication.com",
|
||||
"doubleclick.net",
|
||||
"questionmarket.com",
|
||||
"atdmt.com",
|
||||
"aggregateknowledge.com"
|
||||
];
|
||||
|
||||
var tools = {
|
||||
'zotero-annotate-tb-add':{
|
||||
cursor:"pointer",
|
||||
event:"click",
|
||||
callback:function(e) { _add("annotation", e) }
|
||||
},
|
||||
'zotero-annotate-tb-highlight':{
|
||||
cursor:"text",
|
||||
event:"mouseup",
|
||||
callback:function(e) { _add("highlight", e) }
|
||||
},
|
||||
'zotero-annotate-tb-unhighlight':{
|
||||
cursor:"text",
|
||||
event:"mouseup",
|
||||
callback:function(e) { _add("unhighlight", e) }
|
||||
}
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Public Zotero_Browser methods
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/*
|
||||
* Initialize some variables and prepare event listeners for when chrome is done
|
||||
* loading
|
||||
*/
|
||||
function init() {
|
||||
if (!Zotero || !Zotero.initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
Zotero_Browser.browserData = new Object();
|
||||
Zotero_Browser._scrapePopupShowing = false;
|
||||
Zotero.Ingester.ProxyMonitor.init();
|
||||
Zotero.Ingester.MIMEHandler.init();
|
||||
Zotero.Translate.init();
|
||||
|
||||
window.addEventListener("load",
|
||||
function(e) { Zotero_Browser.chromeLoad(e) }, false);
|
||||
window.addEventListener("unload",
|
||||
function(e) { Zotero_Browser.chromeUnload(e) }, false);
|
||||
}
|
||||
|
||||
/*
|
||||
* Scrapes a page (called when the capture icon is clicked); takes a collection
|
||||
* ID as the argument
|
||||
*/
|
||||
function scrapeThisPage(saveLocation) {
|
||||
if (!Zotero.stateCheck()) {
|
||||
Zotero_Browser.progress.changeHeadline(Zotero.getString("ingester.scrapeError"));
|
||||
var desc = Zotero.getString("ingester.scrapeError.transactionInProgress.previousError")
|
||||
+ ' ' + Zotero.getString("general.restartFirefoxAndTryAgain");
|
||||
Zotero_Browser.progress.addDescription(desc);
|
||||
Zotero_Browser.progress.show();
|
||||
Zotero_Browser.progress.startCloseTimer(8000);
|
||||
return;
|
||||
}
|
||||
_getTabObject(this.tabbrowser.selectedBrowser).translate(saveLocation);
|
||||
}
|
||||
|
||||
/*
|
||||
* flags a page for annotation
|
||||
*/
|
||||
function annotatePage(id, browser) {
|
||||
if (browser) {
|
||||
var tab = _getTabObject(browser);
|
||||
}
|
||||
else {
|
||||
var tab = _getTabObject(this.tabbrowser.selectedBrowser);
|
||||
}
|
||||
tab.annotateNextLoad = true;
|
||||
tab.annotateID = id;
|
||||
}
|
||||
|
||||
/*
|
||||
* toggles a tool on/off
|
||||
*/
|
||||
function toggleMode(toggleTool, ignoreOtherTools) {
|
||||
// make sure other tools are turned off
|
||||
if(!ignoreOtherTools) {
|
||||
for(var tool in tools) {
|
||||
if(tool != toggleTool && document.getElementById(tool).getAttribute("tool-active")) {
|
||||
toggleMode(tool, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// make sure annotation action is toggled
|
||||
var tab = _getTabObject(Zotero_Browser.tabbrowser.selectedBrowser);
|
||||
if(tab.page && tab.page.annotations && tab.page.annotations.clearAction) tab.page.annotations.clearAction();
|
||||
|
||||
if(!toggleTool) return;
|
||||
|
||||
var body = Zotero_Browser.tabbrowser.selectedBrowser.contentDocument.getElementsByTagName("body")[0];
|
||||
var addElement = document.getElementById(toggleTool);
|
||||
|
||||
if(addElement.getAttribute("tool-active")) {
|
||||
// turn off
|
||||
body.style.cursor = "auto";
|
||||
addElement.removeAttribute("tool-active");
|
||||
Zotero_Browser.tabbrowser.selectedBrowser.removeEventListener(tools[toggleTool].event, tools[toggleTool].callback, true);
|
||||
} else {
|
||||
body.style.cursor = tools[toggleTool].cursor;
|
||||
addElement.setAttribute("tool-active", "true");
|
||||
Zotero_Browser.tabbrowser.selectedBrowser.addEventListener(tools[toggleTool].event, tools[toggleTool].callback, true);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* expands all annotations
|
||||
*/
|
||||
function setCollapsed(status) {
|
||||
var tab = _getTabObject(Zotero_Browser.tabbrowser.selectedBrowser);
|
||||
tab.page.annotations.setCollapsed(status);
|
||||
}
|
||||
|
||||
/*
|
||||
* called to hide the collection selection popup
|
||||
*/
|
||||
function hidePopup(collectionID) {
|
||||
_scrapePopupShowing = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* called to show the collection selection popup
|
||||
*/
|
||||
function showPopup(collectionID, parentElement) {
|
||||
if(_scrapePopupShowing && parentElement.hasChildNodes()) {
|
||||
return false; // Don't dynamically reload popups that are already showing
|
||||
}
|
||||
_scrapePopupShowing = true;
|
||||
parentElement.removeAllItems();
|
||||
|
||||
if(collectionID == null) { // show library
|
||||
var newItem = document.createElement("menuitem");
|
||||
newItem.setAttribute("label", Zotero.getString("pane.collections.library"));
|
||||
newItem.setAttribute("class", "menuitem-iconic zotero-scrape-popup-library");
|
||||
newItem.setAttribute("oncommand", 'Zotero_Browser.scrapeThisPage()');
|
||||
parentElement.appendChild(newItem);
|
||||
}
|
||||
|
||||
var childrenList = Zotero.getCollections(collectionID);
|
||||
for(var i = 0; i < childrenList.length; i++) {
|
||||
if(childrenList[i].hasChildCollections()) {
|
||||
var newItem = document.createElement("menu");
|
||||
var subMenu = document.createElement("menupopup");
|
||||
subMenu.setAttribute("onpopupshowing", 'Zotero_Browser.showPopup("'+childrenList[i].getID()+'", this)');
|
||||
newItem.setAttribute("class", "menu-iconic zotero-scrape-popup-collection");
|
||||
newItem.appendChild(subMenu);
|
||||
} else {
|
||||
var newItem = document.createElement("menuitem");
|
||||
newItem.setAttribute("class", "menuitem-iconic zotero-scrape-popup-collection");
|
||||
}
|
||||
newItem.setAttribute("label", childrenList[i].getName());
|
||||
newItem.setAttribute("oncommand", 'Zotero_Browser.scrapeThisPage("'+childrenList[i].getID()+'")');
|
||||
|
||||
parentElement.appendChild(newItem);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* When chrome loads, register our event handlers with the appropriate interfaces
|
||||
*/
|
||||
function chromeLoad() {
|
||||
this.tabbrowser = document.getElementById("content");
|
||||
this.appcontent = document.getElementById("appcontent");
|
||||
this.statusImage = document.getElementById("zotero-status-image");
|
||||
|
||||
// this gives us onLocationChange, for updating when tabs are switched/created
|
||||
this.tabbrowser.addEventListener("TabClose",
|
||||
function(e) {
|
||||
//Zotero.debug("TabClose");
|
||||
Zotero_Browser.tabClose(e);
|
||||
}, false);
|
||||
this.tabbrowser.addEventListener("TabSelect",
|
||||
function(e) {
|
||||
//Zotero.debug("TabSelect");
|
||||
Zotero_Browser.updateStatus();
|
||||
}, false);
|
||||
// this is for pageshow, for updating the status of the book icon
|
||||
this.appcontent.addEventListener("pageshow",
|
||||
function(e) {
|
||||
//Zotero.debug("pageshow");
|
||||
Zotero_Browser.contentLoad(e);
|
||||
}, true);
|
||||
// this is for turning off the book icon when a user navigates away from a page
|
||||
this.appcontent.addEventListener("pagehide",
|
||||
function(e) {
|
||||
//Zotero.debug("pagehide");
|
||||
Zotero_Browser.contentHide(e);
|
||||
}, true);
|
||||
|
||||
this.tabbrowser.addEventListener("resize",
|
||||
function(e) { Zotero_Browser.resize(e) }, false);
|
||||
// Resize on text zoom changes
|
||||
document.getElementById('cmd_textZoomReduce').addEventListener("command",
|
||||
function(e) { Zotero_Browser.resize(e) }, false);
|
||||
document.getElementById('cmd_textZoomEnlarge').addEventListener("command",
|
||||
function(e) { Zotero_Browser.resize(e) }, false);
|
||||
document.getElementById('cmd_textZoomReset').addEventListener("command",
|
||||
function(e) { Zotero_Browser.resize(e) }, false);
|
||||
}
|
||||
|
||||
/*
|
||||
* When chrome unloads, delete our document objects
|
||||
*/
|
||||
function chromeUnload() {
|
||||
delete Zotero_Browser.browserData;
|
||||
}
|
||||
|
||||
/*
|
||||
* An event handler called when a new document is loaded. Creates a new document
|
||||
* object, and updates the status of the capture icon
|
||||
*/
|
||||
function contentLoad(event) {
|
||||
var isHTML = event.originalTarget instanceof HTMLDocument;
|
||||
var doc = event.originalTarget;
|
||||
var rootDoc = doc;
|
||||
|
||||
if(isHTML) {
|
||||
// get the appropriate root document to check which browser we're on
|
||||
while(rootDoc.defaultView.frameElement) {
|
||||
rootDoc = rootDoc.defaultView.frameElement.ownerDocument;
|
||||
}
|
||||
|
||||
// ignore blacklisted domains
|
||||
try {
|
||||
if(doc.domain) {
|
||||
for each(var blacklistedURL in _blacklist) {
|
||||
if(doc.domain.substr(doc.domain.length-blacklistedURL.length) == blacklistedURL) {
|
||||
Zotero.debug("Ignoring blacklisted URL "+doc.location);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {}
|
||||
}
|
||||
|
||||
// Figure out what browser this contentDocument is associated with
|
||||
var browser;
|
||||
for(var i=0; i<this.tabbrowser.browsers.length; i++) {
|
||||
if(rootDoc == this.tabbrowser.browsers[i].contentDocument) {
|
||||
browser = this.tabbrowser.browsers[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!browser) return;
|
||||
|
||||
// get data object
|
||||
var tab = _getTabObject(browser);
|
||||
|
||||
if(isHTML) {
|
||||
if(tab.annotateNextLoad) {
|
||||
if(Zotero.Annotate.isAnnotated(tab.annotateID)) {
|
||||
window.alert(Zotero.getString("annotations.oneWindowWarning"));
|
||||
} else {
|
||||
// enable annotation
|
||||
tab.page.annotations = new Zotero.Annotations(this, browser, tab.annotateID);
|
||||
Zotero.Annotate.setAnnotated(tab.annotateID, true);
|
||||
browser.contentWindow.addEventListener('beforeunload', function() {
|
||||
// save annotations
|
||||
try {
|
||||
tab.page.annotations.save();
|
||||
} catch(e) {
|
||||
throw(e);
|
||||
} finally {
|
||||
Zotero.Annotate.setAnnotated(tab.page.annotations.itemID, false);
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// detect translators
|
||||
tab.detectTranslators(rootDoc, doc);
|
||||
|
||||
// clear annotateNextLoad
|
||||
if(tab.annotateNextLoad) {
|
||||
tab.annotateNextLoad = tab.annotateID = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* called to unregister Zotero icon, etc.
|
||||
*/
|
||||
function contentHide(event) {
|
||||
if(event.originalTarget instanceof HTMLDocument && !event.originalTarget.defaultView.frameElement) {
|
||||
var doc = event.originalTarget;
|
||||
|
||||
// Figure out what browser this contentDocument is associated with
|
||||
var browser;
|
||||
for(var i=0; i<this.tabbrowser.browsers.length; i++) {
|
||||
if(doc == this.tabbrowser.browsers[i].contentDocument) {
|
||||
browser = this.tabbrowser.browsers[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// clear data object
|
||||
var tab = _getTabObject(browser);
|
||||
if(!tab) return;
|
||||
tab.clear();
|
||||
|
||||
// update status
|
||||
if(this.tabbrowser.selectedBrowser == browser) {
|
||||
updateStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* called when a tab is closed
|
||||
*/
|
||||
function tabClose(event) {
|
||||
// Save annotations when closing a tab, since the browser is already
|
||||
// gone from tabbrowser by the time contentHide() gets called
|
||||
var tab = _getTabObject(event.target);
|
||||
if(tab.page && tab.page.annotations) tab.page.annotations.save();
|
||||
tab.clear();
|
||||
|
||||
// To execute if document object does not exist
|
||||
_deleteTabObject(event.target.linkedBrowser);
|
||||
toggleMode(null);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* called when the window is resized
|
||||
*/
|
||||
function resize(event) {
|
||||
var tab = _getTabObject(this.tabbrowser.selectedBrowser);
|
||||
if(!tab.page.annotations) return;
|
||||
|
||||
tab.page.annotations.refresh();
|
||||
}
|
||||
|
||||
/*
|
||||
* Updates the status of the capture icon to reflect the scrapability or lack
|
||||
* thereof of the current page
|
||||
*/
|
||||
function updateStatus() {
|
||||
var tab = _getTabObject(Zotero_Browser.tabbrowser.selectedBrowser);
|
||||
|
||||
var captureIcon = tab.getCaptureIcon();
|
||||
if(captureIcon) {
|
||||
Zotero_Browser.statusImage.src = captureIcon;
|
||||
Zotero_Browser.statusImage.tooltipText = tab.getCaptureTooltip();
|
||||
Zotero_Browser.statusImage.hidden = false;
|
||||
} else {
|
||||
Zotero_Browser.statusImage.hidden = true;
|
||||
}
|
||||
|
||||
// set annotation bar status
|
||||
if(tab.page.annotations) {
|
||||
document.getElementById('zotero-annotate-tb').hidden = false;
|
||||
toggleMode();
|
||||
} else {
|
||||
document.getElementById('zotero-annotate-tb').hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback to be executed when scraping is complete
|
||||
*/
|
||||
function finishScraping(obj, returnValue) {
|
||||
if(!returnValue) {
|
||||
Zotero_Browser.progress.changeHeadline(Zotero.getString("ingester.scrapeError"));
|
||||
// Include link to Known Translator Issues page
|
||||
var url = "http://www.zotero.org/documentation/known_translator_issues";
|
||||
var linkText = '<a href="' + url + '" tooltiptext="' + url + '">'
|
||||
+ Zotero.getString('ingester.scrapeErrorDescription.linkText') + '</a>';
|
||||
Zotero_Browser.progress.addDescription(Zotero.getString("ingester.scrapeErrorDescription", linkText));
|
||||
}
|
||||
Zotero_Browser.progress.startCloseTimer();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Callback to be executed when an item has been finished
|
||||
*/
|
||||
function itemDone(obj, item, collection) {
|
||||
var title = item.getField("title");
|
||||
var icon = item.getImageSrc();
|
||||
Zotero_Browser.progress.changeHeadline(Zotero.getString("ingester.scraping"));
|
||||
Zotero_Browser.progress.addLines([title], [icon]);
|
||||
|
||||
// add item to collection, if one was specified
|
||||
if(collection) {
|
||||
collection.addItem(item.getID());
|
||||
}
|
||||
|
||||
Zotero_Browser.progress.startCloseTimer();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Private Zotero_Browser methods
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
* Gets a data object given a browser window object
|
||||
*
|
||||
* NOTE: Browser objects are associated with document objects via keys generated
|
||||
* from the time the browser object is opened. I'm not sure if this is the
|
||||
* appropriate mechanism for handling this, but it's what PiggyBank used and it
|
||||
* appears to work.
|
||||
*
|
||||
* Currently, the data object contains only one property: "translators," which
|
||||
* is an array of translators that should work with the given page as returned
|
||||
* from Zotero.Translate.getTranslator()
|
||||
*/
|
||||
function _getTabObject(browser) {
|
||||
if(!browser) return false;
|
||||
try {
|
||||
var key = browser.getAttribute("zotero-key");
|
||||
if(_browserData[key]) {
|
||||
return _browserData[key];
|
||||
}
|
||||
} finally {
|
||||
if(!key) {
|
||||
var key = (new Date()).getTime();
|
||||
browser.setAttribute("zotero-key", key);
|
||||
return (_browserData[key] = new Zotero_Browser.Tab(browser));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Deletes the document object associated with a given browser window object
|
||||
*/
|
||||
function _deleteTabObject(browser) {
|
||||
if(!browser) return false;
|
||||
try {
|
||||
var key = browser.getAttribute("zotero-key");
|
||||
if(_browserData[key]) {
|
||||
delete _browserData[key];
|
||||
return true;
|
||||
}
|
||||
} finally {}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* adds an annotation
|
||||
*/
|
||||
function _add(type, e) {
|
||||
var tab = _getTabObject(Zotero_Browser.tabbrowser.selectedBrowser);
|
||||
|
||||
if(type == "annotation") {
|
||||
// ignore click if it's on an existing annotation
|
||||
if(e.target.getAttribute("zotero-annotation")) return;
|
||||
|
||||
var annotation = tab.page.annotations.createAnnotation();
|
||||
annotation.initWithEvent(e);
|
||||
|
||||
// disable add mode, now that we've used it
|
||||
toggleMode();
|
||||
} else {
|
||||
try {
|
||||
var selection = Zotero_Browser.tabbrowser.selectedBrowser.contentWindow.getSelection();
|
||||
} catch(err) {
|
||||
return;
|
||||
}
|
||||
if(selection.isCollapsed) return;
|
||||
|
||||
if(type == "highlight") {
|
||||
tab.page.annotations.createHighlight(selection.getRangeAt(0));
|
||||
} else if(type == "unhighlight") {
|
||||
tab.page.annotations.unhighlight(selection.getRangeAt(0));
|
||||
}
|
||||
|
||||
selection.removeAllRanges();
|
||||
}
|
||||
|
||||
// stop propagation
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Zotero_Browser.Tab
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Zotero_Browser.Tab = function(browser) {
|
||||
this.browser = browser;
|
||||
this.page = new Object();
|
||||
}
|
||||
|
||||
/*
|
||||
* clears page-specific information
|
||||
*/
|
||||
Zotero_Browser.Tab.prototype.clear = function() {
|
||||
delete this.page;
|
||||
this.page = new Object();
|
||||
}
|
||||
|
||||
/*
|
||||
* detects translators for this browser object
|
||||
*/
|
||||
Zotero_Browser.Tab.prototype.detectTranslators = function(rootDoc, doc) {
|
||||
// if there's already a scrapable page in the browser window, and it's
|
||||
// still there, ensure it is actually part of the page, then return
|
||||
if(this.page.translators && this.page.translators.length && this.page.document.location) {
|
||||
if(this._searchFrames(rootDoc, this.page.document)) {
|
||||
return;
|
||||
} else {
|
||||
this.page.document = null;
|
||||
}
|
||||
}
|
||||
|
||||
if(doc instanceof HTMLDocument) {
|
||||
// get translators
|
||||
var me = this;
|
||||
|
||||
var translate = new Zotero.Translate("web");
|
||||
translate.setDocument(doc);
|
||||
translate.setHandler("translators", function(obj, item) { me._translatorsAvailable(obj, item) });
|
||||
translate.getTranslators();
|
||||
} else if(doc.documentURI.length > 7 && doc.documentURI.substr(0, 7) == "file://") {
|
||||
this._attemptLocalFileImport(doc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* searches for a document in all of the frames of a given document
|
||||
*/
|
||||
Zotero_Browser.Tab.prototype._searchFrames = function(rootDoc, searchDoc) {
|
||||
var frames = rootDoc.getElementsByTagName("frame");
|
||||
for each(var frame in frames) {
|
||||
if(frame.contentDocument &&
|
||||
(frame.contentDocument == searchDoc ||
|
||||
this._searchFrames(frame.contentDocument, searchDoc))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Attempts import of a file; to be run on local files only
|
||||
*/
|
||||
Zotero_Browser.Tab.prototype._attemptLocalFileImport = function(doc) {
|
||||
var file = Components.classes["@mozilla.org/network/protocol;1?name=file"]
|
||||
.getService(Components.interfaces.nsIFileProtocolHandler)
|
||||
.getFileFromURLSpec(doc.documentURI);
|
||||
|
||||
var me = this;
|
||||
var translate = new Zotero.Translate("import");
|
||||
translate.setLocation(file);
|
||||
translate.setHandler("translators", function(obj, item) { me._translatorsAvailable(obj, item) });
|
||||
translate.getTranslators();
|
||||
}
|
||||
|
||||
/*
|
||||
* translate a page, saving in saveLocation
|
||||
*/
|
||||
Zotero_Browser.Tab.prototype.translate = function(saveLocation) {
|
||||
if(this.page.translators && this.page.translators.length) {
|
||||
Zotero_Browser.progress.show();
|
||||
|
||||
if(saveLocation) {
|
||||
saveLocation = Zotero.Collections.get(saveLocation);
|
||||
} else { // save to currently selected collection, if a collection is selected
|
||||
try {
|
||||
saveLocation = ZoteroPane.getSelectedCollection();
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
var me = this;
|
||||
|
||||
if(!this.page.hasBeenTranslated) {
|
||||
// use first translator available
|
||||
this.page.translate.setTranslator(this.page.translators[0]);
|
||||
this.page.translate.setHandler("select", me._selectItems);
|
||||
this.page.translate.setHandler("done", function(obj, item) { Zotero_Browser.finishScraping(obj, item) });
|
||||
this.page.hasBeenTranslated = true;
|
||||
}
|
||||
this.page.translate.clearHandlers("itemDone");
|
||||
this.page.translate.setHandler("itemDone", function(obj, item) { Zotero_Browser.itemDone(obj, item, saveLocation) });
|
||||
|
||||
this.page.translate.translate();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* returns the URL of the image representing the translator to be called on the
|
||||
* current page, or false if the page cannot be scraped
|
||||
*/
|
||||
Zotero_Browser.Tab.prototype.getCaptureIcon = function() {
|
||||
if(this.page.translators && this.page.translators.length) {
|
||||
var itemType = this.page.translators[0].itemType;
|
||||
if(itemType == "multiple") {
|
||||
// Use folder icon for multiple types, for now
|
||||
return "chrome://zotero/skin/treesource-collection.png";
|
||||
} else {
|
||||
return Zotero.ItemTypes.getImageSrc(itemType);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Zotero_Browser.Tab.prototype.getCaptureTooltip = function() {
|
||||
if (this.page.translators && this.page.translators.length) {
|
||||
var arr = [Zotero.getString('ingester.saveToZotero')];
|
||||
if (this.page.translators[0].itemType == 'multiple') {
|
||||
arr.push('...');
|
||||
}
|
||||
arr.push (' ' , '(' + this.page.translators[0].label + ')');
|
||||
return Zotero.localeJoin(arr, '');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
/**********CALLBACKS**********/
|
||||
|
||||
/*
|
||||
* called when a user is supposed to select items
|
||||
*/
|
||||
Zotero_Browser.Tab.prototype._selectItems = function(obj, itemList) {
|
||||
// this is kinda ugly, mozillazine made me do it! honest!
|
||||
var io = { dataIn:itemList, dataOut:null }
|
||||
var newDialog = window.openDialog("chrome://zotero/content/ingester/selectitems.xul",
|
||||
"_blank","chrome,modal,centerscreen,resizable=yes", io);
|
||||
|
||||
if(!io.dataOut) { // user selected no items, so close the progress indicatior
|
||||
Zotero_Browser.progress.close();
|
||||
}
|
||||
|
||||
return io.dataOut;
|
||||
}
|
||||
|
||||
/*
|
||||
* called when translators are available
|
||||
*/
|
||||
Zotero_Browser.Tab.prototype._translatorsAvailable = function(translate, translators) {
|
||||
if(translators && translators.length) {
|
||||
this.page.translate = translate;
|
||||
this.page.translators = translators;
|
||||
this.page.document = translate.document;
|
||||
} else if(translate.type != "import" && translate.document.documentURI.length > 7
|
||||
&& translate.document.documentURI.substr(0, 7) == "file://") {
|
||||
this._attemptLocalFileImport(translate.document);
|
||||
}
|
||||
Zotero_Browser.updateStatus();
|
||||
}
|
||||
|
||||
// Handles the display of a div showing progress in scraping
|
||||
Zotero_Browser.progress = new Zotero.ProgressWindow();
|
||||
|
||||
Zotero_Browser.init();
|
167
chrome/content/zotero/editBibliographyDialog.js
Normal file
167
chrome/content/zotero/editBibliographyDialog.js
Normal file
|
@ -0,0 +1,167 @@
|
|||
/*
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (c) 2006 Center for History and New Media
|
||||
George Mason University, Fairfax, Virginia, USA
|
||||
http://chnm.gmu.edu
|
||||
|
||||
Licensed under the Educational Community License, Version 1.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.opensource.org/licenses/ecl1.php
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
var Zotero_Bibliography_Dialog = new function () {
|
||||
var bibEditInterface;
|
||||
var itemSet;
|
||||
var _originalBibEntry;
|
||||
var _lastSelectedItem;
|
||||
|
||||
this.load = load;
|
||||
this.treeItemSelected = treeItemSelected;
|
||||
this.listItemSelected = listItemSelected;
|
||||
this.add = add;
|
||||
this.remove = remove;
|
||||
this.accept = accept;
|
||||
|
||||
/*
|
||||
* initialize add citation dialog
|
||||
*/
|
||||
function load() {
|
||||
document.getElementById('editor').format = "Integration";
|
||||
|
||||
if(Zotero.isWin) {
|
||||
document.getElementById("zotero-select-items-container").style.border = "1px solid black";
|
||||
}
|
||||
bibEditInterface = window.arguments[0].wrappedJSObject;
|
||||
itemSet = bibEditInterface.getItemSet();
|
||||
|
||||
// load (from selectItemsDialog.js)
|
||||
doLoad();
|
||||
|
||||
// load bibliography entires
|
||||
_loadItems();
|
||||
}
|
||||
|
||||
/*
|
||||
* called when an item in the item selection tree is clicked
|
||||
*/
|
||||
function treeItemSelected() {
|
||||
var items = itemsView.getSelectedItems(true); // treeview from selectItemsDialog.js
|
||||
|
||||
// disable add if item already in itemSet
|
||||
document.getElementById("add").disabled = !items.length || itemSet.getItemsByIds([items[0]])[0];
|
||||
}
|
||||
|
||||
/*
|
||||
* called when an item in the reference list is clicked
|
||||
*/
|
||||
function listItemSelected() {
|
||||
var selectedListItem = document.getElementById("item-list").getSelectedItem(0);
|
||||
|
||||
// enable remove if item is selected
|
||||
document.getElementById("remove").disabled = !selectedListItem;
|
||||
|
||||
if(selectedListItem) {
|
||||
_updatePreview(itemSet.getItemsByIds([selectedListItem.value])[0]);
|
||||
} else {
|
||||
_updatePreview(false);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a citation to the reference list
|
||||
*/
|
||||
function add() {
|
||||
var item = itemsView.getSelectedItems()[0]; // treeview from selectItemsDialog.js
|
||||
|
||||
bibEditInterface.add(item);
|
||||
document.getElementById("add").disabled = true;
|
||||
_loadItems();
|
||||
}
|
||||
|
||||
/*
|
||||
* Deletes a citation from the reference list
|
||||
*/
|
||||
function remove() {
|
||||
var selectedListItem = document.getElementById("item-list").getSelectedItem(0);
|
||||
var itemID = selectedListItem.value;
|
||||
var item = itemSet.getItemsByIds([itemID])[0];
|
||||
|
||||
if(bibEditInterface.isCited(item)) {
|
||||
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService);
|
||||
|
||||
var out = {};
|
||||
var regenerate = promptService.confirmEx(
|
||||
window,
|
||||
Zotero.getString('integration.deleteCitedItem.title'),
|
||||
Zotero.getString('integration.deleteCitedItem.body'),
|
||||
promptService.STD_OK_CANCEL_BUTTONS+promptService.BUTTON_POS_1_DEFAULT,
|
||||
null, null, null, null, out
|
||||
);
|
||||
|
||||
if(regenerate != 0) return;
|
||||
}
|
||||
|
||||
bibEditInterface.remove(item);
|
||||
_loadItems();
|
||||
}
|
||||
|
||||
/*
|
||||
* Called on "Accept" button
|
||||
*/
|
||||
function accept() {
|
||||
_updatePreview();
|
||||
}
|
||||
|
||||
/*
|
||||
* Updates the contents of the preview pane
|
||||
*/
|
||||
function _updatePreview(item) {
|
||||
var editor = document.getElementById('editor');
|
||||
|
||||
if(_lastSelectedItem && editor.value != _originalBibEntry) {
|
||||
Zotero.debug("setting bibliography for "+_lastSelectedItem.getID()+" to "+editor.value);
|
||||
_lastSelectedItem.setProperty("bibliography-Integration", editor.value);
|
||||
}
|
||||
|
||||
editor.readonly = !item;
|
||||
editor.value = _originalBibEntry = (item ? bibEditInterface.preview(item) : "");
|
||||
_lastSelectedItem = item;
|
||||
}
|
||||
|
||||
/*
|
||||
* loads items from itemSet
|
||||
*/
|
||||
function _loadItems() {
|
||||
// delete all existing items from list
|
||||
var itemList = document.getElementById("item-list");
|
||||
while(itemList.firstChild) {
|
||||
itemList.removeChild(itemList.firstChild);
|
||||
}
|
||||
|
||||
// add new items
|
||||
for(var i=0; i<itemSet.items.length; i++) {
|
||||
var item = itemSet.items[i].zoteroItem;
|
||||
|
||||
var itemNode = document.createElement("listitem");
|
||||
itemNode.setAttribute("value", item.getID());
|
||||
itemNode.setAttribute("label", item.getField("title"));
|
||||
itemNode.setAttribute("class", "listitem-iconic");
|
||||
itemNode.setAttribute("image", item.getImageSrc());
|
||||
itemList.appendChild(itemNode);
|
||||
}
|
||||
|
||||
_updatePreview();
|
||||
}
|
||||
}
|
115
chrome/content/zotero/editBibliographyDialog.xul
Normal file
115
chrome/content/zotero/editBibliographyDialog.xul
Normal file
|
@ -0,0 +1,115 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (c) 2006 Center for History and New Media
|
||||
George Mason University, Fairfax, Virginia, USA
|
||||
http://chnm.gmu.edu
|
||||
|
||||
Licensed under the Educational Community License, Version 1.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.opensource.org/licenses/ecl1.php
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
-->
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/overlay.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/integration.css" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
|
||||
<dialog
|
||||
id="edit-bibliography-dialog"
|
||||
orient="vertical"
|
||||
title="&zotero.integration.editBibliography.title;"
|
||||
width="750" height="450"
|
||||
onload="Zotero_Bibliography_Dialog.load();"
|
||||
onunload="doUnload();"
|
||||
ondialogaccept="Zotero_Bibliography_Dialog.accept();"
|
||||
buttons="accept"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
style="padding: 0">
|
||||
|
||||
<script src="include.js"/>
|
||||
<script src="selectItemsDialog.js"/>
|
||||
<script src="editBibliographyDialog.js"/>
|
||||
|
||||
<vbox id="zotero-select-items-container" flex="1" style="padding: 1em">
|
||||
<vbox flex="1">
|
||||
<hbox flex="1">
|
||||
<vbox align="stretch" flex="1">
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&zotero.toolbar.search.label;" control="zotero-tb-search"/>
|
||||
<textbox id="zotero-tb-search" type="timed" timeout="250" oncommand="onSearch()" dir="reverse" onkeypress="if(event.keyCode == event.DOM_VK_ESCAPE) { this.value = ''; this.doCommand('cmd_zotero_search'); return false; } return true;">
|
||||
<toolbarbutton id="zotero-tb-search-cancel" oncommand="this.parentNode.value='';" hidden="true"/>
|
||||
</textbox>
|
||||
</hbox>
|
||||
<hbox flex="1" style="margin-top: 5px">
|
||||
<tree id="zotero-collections-tree"
|
||||
style="width: 150px;" hidecolumnpicker="true" seltype="single"
|
||||
onselect="onCollectionSelected();">
|
||||
<treecols>
|
||||
<treecol
|
||||
id="zotero-collections-name-column"
|
||||
label="&zotero.collections.name_column;"
|
||||
flex="1"
|
||||
primary="true"/>
|
||||
</treecols>
|
||||
<treechildren/>
|
||||
</tree>
|
||||
|
||||
<tree id="zotero-items-tree"
|
||||
flex="1" hidecolumnpicker="true" seltype="single"
|
||||
onselect="Zotero_Bibliography_Dialog.treeItemSelected();">
|
||||
<treecols>
|
||||
<treecol
|
||||
id="zotero-items-column-title" primary="true"
|
||||
label="&zotero.items.title_column;"
|
||||
flex="4" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-firstCreator"
|
||||
label="&zotero.items.creator_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-dateAdded" hidden="true"
|
||||
label="&zotero.items.dateAdded_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-dateModified" hidden="true"
|
||||
label="&zotero.items.dateModified_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
</treecols>
|
||||
<treechildren/>
|
||||
</tree>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<hbox id="source-list">
|
||||
<vbox align="center" pack="center">
|
||||
<toolbarbutton id="add" oncommand="Zotero_Bibliography_Dialog.add()" disabled="true"/>
|
||||
<toolbarbutton id="remove" oncommand="Zotero_Bibliography_Dialog.remove()" disabled="true"/>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<label value="&zotero.integration.references.label;"/>
|
||||
<listbox id="item-list" flex="1" align="stretch" seltype="single"
|
||||
style="width: 250px;" onselect="Zotero_Bibliography_Dialog.listItemSelected();"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<textbox id="editor" type="styled" flex="1"/>
|
||||
</vbox>
|
||||
</dialog>
|
139
chrome/content/zotero/errorReport.xul
Normal file
139
chrome/content/zotero/errorReport.xul
Normal file
|
@ -0,0 +1,139 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/errorReport.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
|
||||
<wizard xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
id="zotero-error-report" title="Zotero">
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
var Zotero_Error_Report = new function() {
|
||||
this.init = init;
|
||||
this.sendErrorReport = sendErrorReport;
|
||||
|
||||
var obj = window.arguments[0].wrappedJSObject;
|
||||
var Zotero = obj.Zotero;
|
||||
var data = obj.data;
|
||||
var msg = data.msg;
|
||||
var e = data.e;
|
||||
var askForSteps = data.askForSteps;
|
||||
var extraData = data.extraData ? data.extraData : '';
|
||||
|
||||
function init() {
|
||||
var wizard = document.getElementById('zotero-error-report');
|
||||
|
||||
document.getElementById('zotero-failure-message').appendChild(document.createTextNode(msg));
|
||||
document.getElementById('zotero-error-message').value = e;
|
||||
|
||||
var continueButtonName = wizard.getButton('next').getAttribute('label');
|
||||
var str = Zotero.getString('errorReport.advanceMessage', continueButtonName);
|
||||
document.getElementById('zotero-advance-message').setAttribute('value', str);
|
||||
|
||||
if (askForSteps) {
|
||||
var str = Zotero.getString('errorReport.stepsToReproduce') + "\n\n1.\n2.\n3.\n\n"
|
||||
+ Zotero.getString('errorReport.expectedResult') + "\n\n"
|
||||
+ Zotero.getString('errorReport.actualResult') + "\n";
|
||||
document.getElementById('zotero-error-steps').value = str;
|
||||
document.getElementById('zotero-error-steps-box').setAttribute('hidden', false)
|
||||
}
|
||||
}
|
||||
|
||||
function sendErrorReport() {
|
||||
var parts = {
|
||||
error: "true",
|
||||
email: document.getElementById('zotero-email-address').value,
|
||||
errorSteps: document.getElementById('zotero-error-steps').value,
|
||||
errorData: Zotero.getErrors(true).join('\n'),
|
||||
extraData: extraData,
|
||||
diagnostic: Zotero.getSystemInfo()
|
||||
};
|
||||
|
||||
var body = '';
|
||||
for (var key in parts) {
|
||||
body += key + '=' + encodeURIComponent(parts[key]) + '&';
|
||||
}
|
||||
body = body.substr(0, body.length - 1);
|
||||
Zotero.Utilities.HTTP.doPost("http://www.zotero.org/repo/report", body,
|
||||
_sendErrorReportCallback);
|
||||
}
|
||||
|
||||
|
||||
function _sendErrorReportCallback(xmlhttp) {
|
||||
var wizard = document.getElementById('zotero-error-report');
|
||||
if (!wizard) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!xmlhttp.responseXML){
|
||||
try {
|
||||
if (xmlhttp.status>1000){
|
||||
alert('No network connection');
|
||||
}
|
||||
else {
|
||||
alert('Invalid response from repository');
|
||||
}
|
||||
}
|
||||
catch (e){
|
||||
alert('Repository cannot be contacted');
|
||||
}
|
||||
|
||||
wizard.rewind();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var reported = xmlhttp.responseXML.getElementsByTagName('reported');
|
||||
if (reported.length != 1) {
|
||||
alert('Invalid response from repository');
|
||||
wizard.rewind();
|
||||
return;
|
||||
}
|
||||
|
||||
wizard.advance();
|
||||
wizard.getButton('cancel').setAttribute('disabled', true);
|
||||
wizard.canRewind = false;
|
||||
var reportID = reported[0].getAttribute('reportID');
|
||||
document.getElementById('zotero-report-id').setAttribute('value', reportID);
|
||||
document.getElementById('zotero-report-result').setAttribute('hidden', false);
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<wizardpage onpageshow="Zotero_Error_Report.init()">
|
||||
<description id="zotero-failure-message"/>
|
||||
<textbox id="zotero-error-message" class="plain" readonly="true" multiline="true" rows="6"/>
|
||||
<!-- TODO: RTL language support -->
|
||||
<description id="zotero-unrelated-message">&zotero.general.note; &zotero.errorReport.unrelatedMessages;</description>
|
||||
<description id="zotero-advance-message"/>
|
||||
</wizardpage>
|
||||
|
||||
<wizardpage label="&zotero.errorReport.additionalInfo; &zotero.general.optional;">
|
||||
<hbox id="zotero-email-address-box">
|
||||
<label value="&zotero.errorReport.emailAddress;" control="zotero-email-address"/>
|
||||
<textbox id="zotero-email-address" flex="1"/>
|
||||
</hbox>
|
||||
|
||||
<vbox id="zotero-error-steps-box" hidden="true">
|
||||
<description control="zotero-error-steps">&zotero.errorReport.errorSteps;</description>
|
||||
<textbox id="zotero-error-steps" multiline="true" rows="6"/>
|
||||
</vbox>
|
||||
</wizardpage>
|
||||
|
||||
<wizardpage onpageshow="Zotero_Error_Report.sendErrorReport()">
|
||||
<description>&zotero.errorReport.submissionInProgress;</description>
|
||||
</wizardpage>
|
||||
|
||||
<wizardpage>
|
||||
<description>&zotero.errorReport.submitted;</description>
|
||||
<description id="zotero-report-result" hidden="true">
|
||||
&zotero.errorReport.reportID;
|
||||
<textbox id="zotero-report-id" class="plain" readonly="true"/>
|
||||
</description>
|
||||
<description>&zotero.errorReport.includeReportID;</description>
|
||||
<description>&zotero.errorReport.furtherAssistance;</description>
|
||||
</wizardpage>
|
||||
</wizard>
|
|
@ -38,6 +38,10 @@ var Zotero_File_Interface_Export = new function() {
|
|||
* add options to export
|
||||
*/
|
||||
function init() {
|
||||
// Set font size from pref
|
||||
var sbc = document.getElementById('zotero-export-options-container');
|
||||
Zotero.setFontSize(sbc);
|
||||
|
||||
var addedOptions = new Object();
|
||||
|
||||
var translators = window.arguments[0].translators;
|
||||
|
@ -46,8 +50,10 @@ var Zotero_File_Interface_Export = new function() {
|
|||
var formatMenu = document.getElementById("format-menu");
|
||||
var optionsBox = document.getElementById("translator-options");
|
||||
|
||||
var selectedTranslator = Zotero.Prefs.get("export.lastTranslator");
|
||||
|
||||
// add styles to list
|
||||
for(i in translators) {
|
||||
for(var i in translators) {
|
||||
var itemNode = document.createElement("menuitem");
|
||||
itemNode.setAttribute("label", translators[i].label);
|
||||
listbox.appendChild(itemNode);
|
||||
|
@ -75,6 +81,11 @@ var Zotero_File_Interface_Export = new function() {
|
|||
addedOptions[option] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// select last selected translator
|
||||
if(translators[i].translatorID == selectedTranslator) {
|
||||
formatMenu.selectedIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
// select first item by default
|
||||
|
@ -82,17 +93,21 @@ var Zotero_File_Interface_Export = new function() {
|
|||
formatMenu.selectedIndex = 0;
|
||||
}
|
||||
|
||||
updateOptions();
|
||||
updateOptions(Zotero.Prefs.get("export.translatorSettings"));
|
||||
}
|
||||
|
||||
/*
|
||||
* update translator-specific options
|
||||
*/
|
||||
function updateOptions() {
|
||||
function updateOptions(optionString) {
|
||||
// get selected translator
|
||||
var index = document.getElementById("format-menu").selectedIndex;
|
||||
var translatorOptions = window.arguments[0].translators[index].displayOptions;
|
||||
|
||||
if(optionString) {
|
||||
var options = optionString.split(",");
|
||||
}
|
||||
|
||||
var optionsBox = document.getElementById("translator-options");
|
||||
for(var i=0; i<optionsBox.childNodes.length; i++) {
|
||||
// loop through options to see which should be enabled
|
||||
|
@ -105,8 +120,14 @@ var Zotero_File_Interface_Export = new function() {
|
|||
|
||||
var defValue = translatorOptions[optionName];
|
||||
if(typeof(defValue) == "boolean") {
|
||||
// if option exists, enable it and set to default value
|
||||
node.setAttribute("checked", (defValue ? "true" : "false"));
|
||||
if(optionString) {
|
||||
// if there's a saved prefs string, use it
|
||||
var isChecked = options.shift();
|
||||
} else {
|
||||
// use defaults
|
||||
var isChecked = (defValue ? "true" : "false");
|
||||
}
|
||||
node.setAttribute("checked", isChecked);
|
||||
}
|
||||
} else {
|
||||
// option should be disabled and unchecked to prevent confusion
|
||||
|
@ -124,7 +145,11 @@ var Zotero_File_Interface_Export = new function() {
|
|||
var index = document.getElementById("format-menu").selectedIndex;
|
||||
window.arguments[0].selectedTranslator = window.arguments[0].translators[index];
|
||||
|
||||
// set options on selected translator
|
||||
// save selected translator
|
||||
Zotero.Prefs.set("export.lastTranslator", window.arguments[0].translators[index].translatorID);
|
||||
|
||||
// set options on selected translator and generate optionString
|
||||
var optionString = "";
|
||||
var optionsAvailable = window.arguments[0].selectedTranslator.displayOptions;
|
||||
for(var option in optionsAvailable) {
|
||||
var defValue = optionsAvailable[option];
|
||||
|
@ -132,12 +157,18 @@ var Zotero_File_Interface_Export = new function() {
|
|||
|
||||
if(typeof(defValue) == "boolean") {
|
||||
if(element.checked == true) {
|
||||
optionString += ",true";
|
||||
optionsAvailable[option] = true;
|
||||
} else {
|
||||
optionString += ",false";
|
||||
optionsAvailable[option] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// save options
|
||||
if(optionString) optionString = optionString.substr(1);
|
||||
Zotero.Prefs.set("export.translatorSettings", optionString);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -2,22 +2,24 @@
|
|||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="&exportOptions.title;" buttons="cancel,accept"
|
||||
title="&zotero.exportOptions.title;" buttons="cancel,accept"
|
||||
ondialogaccept="Zotero_File_Interface_Export.accept()"
|
||||
ondialogcancel="Zotero_File_Interface_Export.cancel()"
|
||||
id="zotero-export-options"
|
||||
onload="Zotero_File_Interface_Export.init()">
|
||||
|
||||
<script src="include.js"/>
|
||||
<script src="exportOptions.js"/>
|
||||
<hbox>
|
||||
<label value="&exportOptions.format.label;" control="format-menu"/>
|
||||
<menulist id="format-menu" oncommand="Zotero_File_Interface_Export.updateOptions()">
|
||||
<menupopup id="format-popup">
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
<groupbox id="translator-options">
|
||||
<caption label="&exportOptions.translatorOptions.label;"/>
|
||||
</groupbox>
|
||||
|
||||
<script src="include.js"/>
|
||||
<script src="exportOptions.js"/>
|
||||
|
||||
<vbox id="zotero-export-options-container" flex="1">
|
||||
<hbox>
|
||||
<label value="&zotero.exportOptions.format.label;" control="format-menu"/>
|
||||
<menulist id="format-menu" oncommand="Zotero_File_Interface_Export.updateOptions()">
|
||||
<menupopup id="format-popup"/>
|
||||
</menulist>
|
||||
</hbox>
|
||||
<groupbox id="translator-options">
|
||||
<caption label="&zotero.exportOptions.translatorOptions.label;"/>
|
||||
</groupbox>
|
||||
</vbox>
|
||||
</dialog>
|
|
@ -20,80 +20,137 @@
|
|||
***** END LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/****Zotero_File_Exporter****
|
||||
**
|
||||
* A class to handle exporting of items, collections, or the entire library
|
||||
**/
|
||||
|
||||
/**
|
||||
* Constructs a new Zotero_File_Exporter with defaults
|
||||
**/
|
||||
var Zotero_File_Exporter = function() {
|
||||
this.name = Zotero.getString("fileInterface.exportedItems");
|
||||
this.collection = false;
|
||||
this.items = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs the actual export operation
|
||||
**/
|
||||
Zotero_File_Exporter.prototype.save = function() {
|
||||
var translation = new Zotero.Translate("export");
|
||||
var translators = translation.getTranslators();
|
||||
|
||||
// present options dialog
|
||||
var io = {translators:translators}
|
||||
window.openDialog("chrome://zotero/content/exportOptions.xul",
|
||||
"_blank", "chrome,modal,centerscreen", io);
|
||||
if(!io.selectedTranslator) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
var fp = Components.classes["@mozilla.org/filepicker;1"]
|
||||
.createInstance(nsIFilePicker);
|
||||
fp.init(window, Zotero.getString("fileInterface.export"), nsIFilePicker.modeSave);
|
||||
|
||||
// set file name and extension
|
||||
if(io.selectedTranslator.displayOptions.exportFileData) {
|
||||
// if the result will be a folder, don't append any extension or use
|
||||
// filters
|
||||
fp.defaultString = this.name;
|
||||
fp.appendFilters(Components.interfaces.nsIFilePicker.filterAll);
|
||||
} else {
|
||||
// if the result will be a file, append an extension and use filters
|
||||
fp.defaultString = this.name+"."+io.selectedTranslator.target;
|
||||
fp.defaultExtension = io.selectedTranslator.target;
|
||||
fp.appendFilter(io.selectedTranslator.label, "*."+io.selectedTranslator.target);
|
||||
}
|
||||
|
||||
var rv = fp.show();
|
||||
if (rv == nsIFilePicker.returnOK || rv == nsIFilePicker.returnReplace) {
|
||||
if(this.collection) {
|
||||
translation.setCollection(this.collection);
|
||||
} else if(this.items) {
|
||||
translation.setItems(this.items);
|
||||
}
|
||||
|
||||
translation.setLocation(fp.file);
|
||||
translation.setTranslator(io.selectedTranslator);
|
||||
translation.setHandler("done", this._exportDone);
|
||||
Zotero.UnresponsiveScriptIndicator.disable();
|
||||
Zotero_File_Interface.Progress.show(
|
||||
Zotero.getString("fileInterface.itemsExported"),
|
||||
function() {
|
||||
translation.translate();
|
||||
});
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Closes the items exported indicator
|
||||
*/
|
||||
Zotero_File_Exporter.prototype._exportDone = function(obj, worked) {
|
||||
Zotero_File_Interface.Progress.close();
|
||||
Zotero.UnresponsiveScriptIndicator.enable();
|
||||
|
||||
if(!worked) {
|
||||
window.alert(Zotero.getString("fileInterface.exportError"));
|
||||
}
|
||||
}
|
||||
|
||||
/****Zotero_File_Interface****
|
||||
**
|
||||
* A singleton to interface with ZoteroPane to provide export/bibliography
|
||||
* capabilities
|
||||
**/
|
||||
var Zotero_File_Interface = new function() {
|
||||
var _unresponsiveScriptPreference, _importCollection, _notifyItem, _notifyCollection;
|
||||
var _importCollection, _unlock;
|
||||
|
||||
this.exportFile = exportFile;
|
||||
this.exportCollection = exportCollection;
|
||||
this.exportItemsToClipboard = exportItemsToClipboard;
|
||||
this.exportItems = exportItems;
|
||||
this.importFile = importFile;
|
||||
this.bibliographyFromCollection = bibliographyFromCollection;
|
||||
this.bibliographyFromItems = bibliographyFromItems;
|
||||
this.copyItemsToClipboard = copyItemsToClipboard;
|
||||
this.copyCitationToClipboard = copyCitationToClipboard;
|
||||
|
||||
/*
|
||||
* Creates Zotero.Translate instance and shows file picker for file export
|
||||
*/
|
||||
function exportFile(name, items) {
|
||||
var translation = new Zotero.Translate("export");
|
||||
var translators = translation.getTranslators();
|
||||
|
||||
// present options dialog
|
||||
var io = {translators:translators}
|
||||
window.openDialog("chrome://zotero/content/exportOptions.xul",
|
||||
"_blank", "chrome,modal,centerscreen", io);
|
||||
if(!io.selectedTranslator) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
var fp = Components.classes["@mozilla.org/filepicker;1"]
|
||||
.createInstance(nsIFilePicker);
|
||||
|
||||
fp.init(window, Zotero.getString("fileInterface.export"), nsIFilePicker.modeSave);
|
||||
|
||||
// set file name and extension
|
||||
name = (name ? name : Zotero.getString("pane.collections.library"));
|
||||
fp.defaultString = name+"."+io.selectedTranslator.target;
|
||||
fp.appendFilter(io.selectedTranslator.label, "*."+io.selectedTranslator.target);
|
||||
|
||||
var rv = fp.show();
|
||||
if (rv == nsIFilePicker.returnOK || rv == nsIFilePicker.returnReplace) {
|
||||
if(items) {
|
||||
translation.setItems(items);
|
||||
}
|
||||
translation.setLocation(fp.file);
|
||||
translation.setTranslator(io.selectedTranslator);
|
||||
translation.setHandler("done", _exportDone);
|
||||
_disableUnresponsive();
|
||||
Zotero_File_Interface.Progress.show(
|
||||
Zotero.getString("fileInterface.itemsExported"),
|
||||
function() {
|
||||
translation.translate();
|
||||
});
|
||||
}
|
||||
function exportFile() {
|
||||
var exporter = new Zotero_File_Exporter();
|
||||
exporter.name = Zotero.getString("pane.collections.library");
|
||||
exporter.save();
|
||||
}
|
||||
|
||||
/*
|
||||
* exports a collection or saved search
|
||||
*/
|
||||
function exportCollection() {
|
||||
var exporter = new Zotero_File_Exporter();
|
||||
|
||||
var collection = ZoteroPane.getSelectedCollection();
|
||||
if (collection)
|
||||
{
|
||||
exportFile(collection.getName(), Zotero.getItems(collection.getID()));
|
||||
return;
|
||||
if(collection) {
|
||||
exporter.name = collection.getName();
|
||||
exporter.collection = collection;
|
||||
} else {
|
||||
// find sorted items
|
||||
exporter.items = ZoteroPane.getSortedItems();
|
||||
if(!exporter.items) throw ("No items to save");
|
||||
|
||||
// find name
|
||||
var searchRef = ZoteroPane.getSelectedSavedSearch();
|
||||
if(searchRef) {
|
||||
var search = new Zotero.Search();
|
||||
search.load(searchRef['id']);
|
||||
exporter.name = search.getName();
|
||||
}
|
||||
}
|
||||
|
||||
var searchRef = ZoteroPane.getSelectedSavedSearch();
|
||||
if (searchRef)
|
||||
{
|
||||
var search = new Zotero.Search();
|
||||
search.load(searchRef['id']);
|
||||
exportFile(search.getName(), Zotero.Items.get(search.search()));
|
||||
return;
|
||||
}
|
||||
|
||||
throw ("No collection or saved search currently selected");
|
||||
exporter.save();
|
||||
}
|
||||
|
||||
|
||||
|
@ -101,21 +158,35 @@ var Zotero_File_Interface = new function() {
|
|||
* exports items
|
||||
*/
|
||||
function exportItems() {
|
||||
var items = ZoteroPane.getSelectedItems();
|
||||
if(!items || !items.length) throw("no items currently selected");
|
||||
var exporter = new Zotero_File_Exporter();
|
||||
|
||||
exportFile(Zotero.getString("fileInterface.exportedItems"), items);
|
||||
exporter.items = ZoteroPane.getSelectedItems();
|
||||
if(!exporter.items || !exporter.items.length) throw("no items currently selected");
|
||||
|
||||
exporter.save();
|
||||
}
|
||||
|
||||
/*
|
||||
* closes items exported indicator
|
||||
* exports items to clipboard
|
||||
*/
|
||||
function _exportDone(obj, worked) {
|
||||
Zotero_File_Interface.Progress.close();
|
||||
_restoreUnresponsive();
|
||||
|
||||
function exportItemsToClipboard(items, translatorID) {
|
||||
var translation = new Zotero.Translate("export");
|
||||
translation.setItems(items);
|
||||
translation.setTranslator(translatorID);
|
||||
translation.setHandler("done", _copyToClipboard);
|
||||
translation.translate();
|
||||
}
|
||||
|
||||
/*
|
||||
* handler when done exporting items to clipboard
|
||||
*/
|
||||
function _copyToClipboard(obj, worked) {
|
||||
if(!worked) {
|
||||
window.alert(Zotero.getString("fileInterface.exportError"));
|
||||
} else {
|
||||
Components.classes["@mozilla.org/widget/clipboardhelper;1"]
|
||||
.getService(Components.interfaces.nsIClipboardHelper)
|
||||
.copyString(obj.output.replace(/\r\n/g, "\n"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,15 +221,15 @@ var Zotero_File_Interface = new function() {
|
|||
translation.setTranslator(translators[0]);
|
||||
translation.setHandler("collectionDone", _importCollectionDone);
|
||||
translation.setHandler("done", _importDone);
|
||||
_disableUnresponsive();
|
||||
|
||||
// disable notifier
|
||||
Zotero.Notifier.disable();
|
||||
Zotero.UnresponsiveScriptIndicator.disable();
|
||||
|
||||
// show progress indicator
|
||||
Zotero_File_Interface.Progress.show(
|
||||
Zotero.getString("fileInterface.itemsImported"),
|
||||
function() {
|
||||
Zotero.DB.beginTransaction();
|
||||
|
||||
// translate
|
||||
translation.translate();
|
||||
});
|
||||
} else {
|
||||
|
@ -173,10 +244,7 @@ var Zotero_File_Interface = new function() {
|
|||
* collections
|
||||
*/
|
||||
function _importCollectionDone(obj, collection) {
|
||||
Zotero.Notifier.enable();
|
||||
Zotero.Notifier.trigger("add", "collection", collection.getID());
|
||||
collection.changeParent(_importCollection.getID());
|
||||
Zotero.Notifier.disable();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -188,60 +256,42 @@ var Zotero_File_Interface = new function() {
|
|||
_importCollection.addItem(itemID);
|
||||
}
|
||||
|
||||
// run notify
|
||||
Zotero.Notifier.enable();
|
||||
if(obj.newItems.length) {
|
||||
Zotero.Notifier.trigger("add", "item", obj.newItems);
|
||||
Zotero.Notifier.trigger("modify", "collection", _importCollection.getID());
|
||||
}
|
||||
Zotero.DB.commitTransaction();
|
||||
|
||||
Zotero_File_Interface.Progress.close();
|
||||
_restoreUnresponsive();
|
||||
Zotero.UnresponsiveScriptIndicator.enable();
|
||||
|
||||
if(!worked) {
|
||||
_importCollection.erase();
|
||||
window.alert(Zotero.getString("fileInterface.importError"));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* disables the "unresponsive script" warning; necessary for import and
|
||||
* export, which can take quite a while to execute
|
||||
*/
|
||||
function _disableUnresponsive() {
|
||||
var prefService = Components.classes["@mozilla.org/preferences-service;1"].
|
||||
getService(Components.interfaces.nsIPrefBranch);
|
||||
_unresponsiveScriptPreference = prefService.getIntPref("dom.max_chrome_script_run_time");
|
||||
prefService.setIntPref("dom.max_chrome_script_run_time", 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* restores the "unresponsive script" warning
|
||||
*/
|
||||
function _restoreUnresponsive() {
|
||||
var prefService = Components.classes["@mozilla.org/preferences-service;1"].
|
||||
getService(Components.interfaces.nsIPrefBranch);
|
||||
prefService.setIntPref("dom.max_chrome_script_run_time", _unresponsiveScriptPreference);
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a bibliography from a collection or saved search
|
||||
*/
|
||||
function bibliographyFromCollection() {
|
||||
// find sorted items
|
||||
var items = Zotero.Items.get(ZoteroPane.getSortedItems());
|
||||
if(!items) return;
|
||||
|
||||
// find name
|
||||
var name = false;
|
||||
|
||||
var collection = ZoteroPane.getSelectedCollection();
|
||||
if (collection)
|
||||
{
|
||||
_doBibliographyOptions(collection.getName(), Zotero.getItems(collection.getID()));
|
||||
return;
|
||||
if(collection) {
|
||||
name = collection.getName();
|
||||
} else {
|
||||
var searchRef = ZoteroPane.getSelectedSavedSearch();
|
||||
if(searchRef) {
|
||||
var search = new Zotero.Search();
|
||||
search.load(searchRef['id']);
|
||||
name = search.getName();
|
||||
}
|
||||
}
|
||||
|
||||
var searchRef = ZoteroPane.getSelectedSavedSearch();
|
||||
if (searchRef)
|
||||
{
|
||||
var search = new Zotero.Search();
|
||||
search.load(searchRef['id']);
|
||||
_doBibliographyOptions(search.getName(), Zotero.Items.get(search.search()));
|
||||
return;
|
||||
}
|
||||
_doBibliographyOptions(name, items);
|
||||
return;
|
||||
|
||||
throw ("No collection or saved search currently selected");
|
||||
}
|
||||
|
@ -256,20 +306,93 @@ var Zotero_File_Interface = new function() {
|
|||
_doBibliographyOptions(Zotero.getString("fileInterface.untitledBibliography"), items);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Copies HTML and text bibliography entries for passed items in given style
|
||||
*
|
||||
* Does not check that items are actual references (and not notes or attachments)
|
||||
*/
|
||||
function copyItemsToClipboard(items, style) {
|
||||
// copy to clipboard
|
||||
var transferable = Components.classes["@mozilla.org/widget/transferable;1"].
|
||||
createInstance(Components.interfaces.nsITransferable);
|
||||
var clipboardService = Components.classes["@mozilla.org/widget/clipboard;1"].
|
||||
getService(Components.interfaces.nsIClipboard);
|
||||
var csl = Zotero.Cite.getStyle(style);
|
||||
var itemSet = csl.createItemSet(items);
|
||||
|
||||
// add HTML
|
||||
var bibliography = csl.formatBibliography(itemSet, "HTML");
|
||||
var str = Components.classes["@mozilla.org/supports-string;1"].
|
||||
createInstance(Components.interfaces.nsISupportsString);
|
||||
str.data = bibliography;
|
||||
transferable.addDataFlavor("text/html");
|
||||
transferable.setTransferData("text/html", str, bibliography.length*2);
|
||||
|
||||
// add text
|
||||
var bibliography = csl.formatBibliography(itemSet, "Text");
|
||||
var str = Components.classes["@mozilla.org/supports-string;1"].
|
||||
createInstance(Components.interfaces.nsISupportsString);
|
||||
str.data = bibliography;
|
||||
transferable.addDataFlavor("text/unicode");
|
||||
transferable.setTransferData("text/unicode", str, bibliography.length*2);
|
||||
|
||||
clipboardService.setData(transferable, null, Components.interfaces.nsIClipboard.kGlobalClipboard);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Copies HTML and text citations for passed items in given style
|
||||
*
|
||||
* Does not check that items are actual references (and not notes or attachments)
|
||||
*/
|
||||
function copyCitationToClipboard(items, style) {
|
||||
// copy to clipboard
|
||||
var transferable = Components.classes["@mozilla.org/widget/transferable;1"].
|
||||
createInstance(Components.interfaces.nsITransferable);
|
||||
var clipboardService = Components.classes["@mozilla.org/widget/clipboard;1"].
|
||||
getService(Components.interfaces.nsIClipboard);
|
||||
|
||||
var csl = Zotero.Cite.getStyle(style);
|
||||
var itemSet = csl.createItemSet(items);
|
||||
var itemIDs = [];
|
||||
for (var i=0; i<items.length; i++) {
|
||||
itemIDs.push(items[i].getID());
|
||||
}
|
||||
var citation = csl.createCitation(itemSet.getItemsByIds(itemIDs));
|
||||
|
||||
// add HTML
|
||||
var bibliography = csl.formatCitation(citation, "HTML");
|
||||
var str = Components.classes["@mozilla.org/supports-string;1"].
|
||||
createInstance(Components.interfaces.nsISupportsString);
|
||||
str.data = bibliography;
|
||||
transferable.addDataFlavor("text/html");
|
||||
transferable.setTransferData("text/html", str, bibliography.length*2);
|
||||
|
||||
// add text
|
||||
var bibliography = csl.formatCitation(citation, "Text");
|
||||
var str = Components.classes["@mozilla.org/supports-string;1"].
|
||||
createInstance(Components.interfaces.nsISupportsString);
|
||||
str.data = bibliography;
|
||||
transferable.addDataFlavor("text/unicode");
|
||||
transferable.setTransferData("text/unicode", str, bibliography.length*2);
|
||||
|
||||
clipboardService.setData(transferable, null, Components.interfaces.nsIClipboard.kGlobalClipboard);
|
||||
}
|
||||
|
||||
/*
|
||||
* Shows bibliography options and creates a bibliography
|
||||
*/
|
||||
function _doBibliographyOptions(name, items) {
|
||||
// make sure at least one item is not a standalone note or attachment
|
||||
var haveNonNote = false;
|
||||
for(var i in items) {
|
||||
var type = Zotero.ItemTypes.getName(items[i].getType());
|
||||
if(type != "note" && type != "attachment") {
|
||||
haveNonNote = true;
|
||||
var haveRegularItem = false;
|
||||
for each(var item in items) {
|
||||
if (item.isRegularItem()) {
|
||||
haveRegularItem = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!haveNonNote) {
|
||||
if (!haveRegularItem) {
|
||||
window.alert(Zotero.getString("fileInterface.noReferencesError"));
|
||||
return;
|
||||
}
|
||||
|
@ -288,19 +411,25 @@ var Zotero_File_Interface = new function() {
|
|||
|
||||
// generate bibliography
|
||||
try {
|
||||
var csl = Zotero.Cite.getStyle(io.style);
|
||||
csl.preprocessItems(items);
|
||||
var bibliography = csl.createBibliography(items, format);
|
||||
if(io.output == 'copy-to-clipboard') {
|
||||
copyItemsToClipboard(items, io.style);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
var csl = Zotero.Cite.getStyle(io.style);
|
||||
var itemSet = csl.createItemSet(items);
|
||||
var bibliography = csl.formatBibliography(itemSet, format);
|
||||
}
|
||||
} catch(e) {
|
||||
window.alert(Zotero.getString("fileInterface.bibliographyGenerationError"));
|
||||
throw(e);
|
||||
return;
|
||||
}
|
||||
|
||||
if(io.output == "print") {
|
||||
// printable bibliography, using a hidden browser
|
||||
var browser = Zotero.Browser.createHiddenBrowser(window);
|
||||
browser.contentDocument.write(bibliography);
|
||||
browser.contentDocument.close();
|
||||
|
||||
// this is kinda nasty, but we have to temporarily modify the user's
|
||||
// settings to eliminate the header and footer. the other way to do
|
||||
|
@ -358,31 +487,10 @@ var Zotero_File_Interface = new function() {
|
|||
fStream.write(bibliography, bibliography.length);
|
||||
fStream.close();
|
||||
}
|
||||
} else if(io.output == "copy-to-clipboard") {
|
||||
// copy to clipboard
|
||||
var transferable = Components.classes["@mozilla.org/widget/transferable;1"].
|
||||
createInstance(Components.interfaces.nsITransferable);
|
||||
var clipboardService = Components.classes["@mozilla.org/widget/clipboard;1"].
|
||||
getService(Components.interfaces.nsIClipboard);
|
||||
|
||||
// add HTML
|
||||
var str = Components.classes["@mozilla.org/supports-string;1"].
|
||||
createInstance(Components.interfaces.nsISupportsString);
|
||||
str.data = bibliography;
|
||||
transferable.addDataFlavor("text/html");
|
||||
transferable.setTransferData("text/html", str, bibliography.length*2);
|
||||
// add text
|
||||
var bibliography = csl.createBibliography(items, "Text");
|
||||
var str = Components.classes["@mozilla.org/supports-string;1"].
|
||||
createInstance(Components.interfaces.nsISupportsString);
|
||||
str.data = bibliography;
|
||||
transferable.addDataFlavor("text/unicode");
|
||||
transferable.setTransferData("text/unicode", str, bibliography.length*2);
|
||||
|
||||
clipboardService.setData(transferable, null, Components.interfaces.nsIClipboard.kGlobalClipboard);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function _saveBibliography(name, format) {
|
||||
// savable bibliography, using a file stream
|
||||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
|
@ -461,4 +569,4 @@ Zotero_File_Interface.Progress = new function() {
|
|||
window.setTimeout(_callback, 1500);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="&progress.title;" width="300" height="30"
|
||||
title="&zotero.progress.title;" width="300" height="30"
|
||||
id="zotero-progress">
|
||||
<vbox style="padding:10px">
|
||||
<hbox align="stretch">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Zotero = Components.classes["@chnm.gmu.edu/Zotero;1"]
|
||||
var Zotero = Components.classes["@zotero.org/Zotero;1"]
|
||||
// Currently uses only nsISupports
|
||||
//.getService(Components.interfaces.chnmIZoteroService).
|
||||
.getService(Components.interfaces.nsISupports)
|
||||
|
|
|
@ -1,504 +0,0 @@
|
|||
/*
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (c) 2006 Center for History and New Media
|
||||
George Mason University, Fairfax, Virginia, USA
|
||||
http://chnm.gmu.edu
|
||||
|
||||
Licensed under the Educational Community License, Version 1.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.opensource.org/licenses/ecl1.php
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
Based on code from Greasemonkey and PiggyBank
|
||||
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
//
|
||||
// Zotero Ingester Browser Functions
|
||||
//
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Zotero_Ingester_Interface
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Class to interface with the browser when ingesting data
|
||||
|
||||
var Zotero_Ingester_Interface = function() {}
|
||||
|
||||
Zotero_Ingester_Interface.blacklist = [
|
||||
"googlesyndication.com",
|
||||
"doubleclick.net",
|
||||
"questionmarket.com",
|
||||
"atdmt.com"
|
||||
];
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Public Zotero_Ingester_Interface methods
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
* Initialize some variables and prepare event listeners for when chrome is done
|
||||
* loading
|
||||
*/
|
||||
Zotero_Ingester_Interface.init = function() {
|
||||
Zotero_Ingester_Interface.browserData = new Object();
|
||||
Zotero_Ingester_Interface._scrapePopupShowing = false;
|
||||
Zotero.Ingester.ProxyMonitor.init();
|
||||
Zotero.Ingester.MIMEHandler.init();
|
||||
Zotero.Translate.init();
|
||||
|
||||
window.addEventListener("load", Zotero_Ingester_Interface.chromeLoad, false);
|
||||
window.addEventListener("unload", Zotero_Ingester_Interface.chromeUnload, false);
|
||||
}
|
||||
|
||||
/*
|
||||
* When chrome loads, register our event handlers with the appropriate interfaces
|
||||
*/
|
||||
Zotero_Ingester_Interface.chromeLoad = function() {
|
||||
Zotero_Ingester_Interface.tabBrowser = document.getElementById("content");
|
||||
Zotero_Ingester_Interface.appContent = document.getElementById("appcontent");
|
||||
Zotero_Ingester_Interface.statusImage = document.getElementById("zotero-status-image");
|
||||
|
||||
// this gives us onLocationChange, for updating when tabs are switched/created
|
||||
Zotero_Ingester_Interface.tabBrowser.addEventListener("TabClose",
|
||||
Zotero_Ingester_Interface.tabClose, false);
|
||||
Zotero_Ingester_Interface.tabBrowser.addEventListener("TabSelect",
|
||||
Zotero_Ingester_Interface.tabSelect, false);
|
||||
// this is for pageshow, for updating the status of the book icon
|
||||
Zotero_Ingester_Interface.appContent.addEventListener("pageshow",
|
||||
Zotero_Ingester_Interface.contentLoad, true);
|
||||
}
|
||||
|
||||
/*
|
||||
* When chrome unloads, delete our document objects and remove our listeners
|
||||
*/
|
||||
Zotero_Ingester_Interface.chromeUnload = function() {
|
||||
delete Zotero_Ingester_Interface.browserData;
|
||||
}
|
||||
|
||||
/*
|
||||
* Scrapes a page (called when the capture icon is clicked); takes a collection
|
||||
* ID as the argument
|
||||
*/
|
||||
Zotero_Ingester_Interface.scrapeThisPage = function(saveLocation) {
|
||||
var browser = Zotero_Ingester_Interface.tabBrowser.selectedBrowser;
|
||||
var data = Zotero_Ingester_Interface._getData(browser);
|
||||
|
||||
if(data.translators && data.translators.length) {
|
||||
Zotero_Ingester_Interface.Progress.show();
|
||||
|
||||
if(saveLocation) {
|
||||
saveLocation = Zotero.Collections.get(saveLocation);
|
||||
} else { // save to currently selected collection, if a collection is selected
|
||||
try {
|
||||
saveLocation = ZoteroPane.getSelectedCollection();
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
var translate = new Zotero.Translate("web");
|
||||
translate.setDocument(data.document);
|
||||
// use first translator available
|
||||
translate.setTranslator(data.translators[0]);
|
||||
translate.setHandler("select", Zotero_Ingester_Interface._selectItems);
|
||||
translate.setHandler("itemDone", function(obj, item) { Zotero_Ingester_Interface._itemDone(obj, item, saveLocation) });
|
||||
translate.setHandler("done", function(obj, item) { Zotero_Ingester_Interface._finishScraping(obj, item, saveLocation) });
|
||||
translate.translate();
|
||||
}
|
||||
}
|
||||
|
||||
Zotero_Ingester_Interface.searchFrames = function(rootDoc, searchDoc) {
|
||||
for each(var frame in rootDoc.frames) {
|
||||
if(frame.document == searchDoc ||
|
||||
(frame.document.frames && searchFrames(frame, searchDoc))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* An event handler called when a new document is loaded. Creates a new document
|
||||
* object, and updates the status of the capture icon
|
||||
*/
|
||||
Zotero_Ingester_Interface.contentLoad = function(event) {
|
||||
if(event.originalTarget instanceof HTMLDocument) {
|
||||
var doc = event.originalTarget;
|
||||
var rootDoc = doc;
|
||||
|
||||
// get the appropriate root document to check which browser we're on
|
||||
while(rootDoc.defaultView.frameElement) {
|
||||
rootDoc = rootDoc.defaultView.frameElement.ownerDocument;
|
||||
}
|
||||
|
||||
// Figure out what browser this contentDocument is associated with
|
||||
var browser;
|
||||
for(var i=0; i<Zotero_Ingester_Interface.tabBrowser.browsers.length; i++) {
|
||||
if(rootDoc == Zotero_Ingester_Interface.tabBrowser.browsers[i].contentDocument) {
|
||||
browser = Zotero_Ingester_Interface.tabBrowser.browsers[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!browser) {
|
||||
return;
|
||||
}
|
||||
|
||||
// get data object
|
||||
var data = Zotero_Ingester_Interface._getData(browser);
|
||||
|
||||
// if there's already a scrapable page in the browser window, and it's
|
||||
// still there, ensure it is actually part of the page, then return
|
||||
if(data.translators && data.translators.length && data.document.location) {
|
||||
if(Zotero_Ingester_Interface.searchFrames(rootDoc, data.document)) {
|
||||
return;
|
||||
} else {
|
||||
data.document = null;
|
||||
}
|
||||
}
|
||||
|
||||
for each(var blacklistedURL in Zotero_Ingester_Interface.blacklist) {
|
||||
if(doc.domain.substr(doc.domain.length-blacklistedURL.length) == blacklistedURL) {
|
||||
Zotero.debug("Ignoring blacklisted URL "+doc.location);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// get translators
|
||||
var translate = new Zotero.Translate("web");
|
||||
translate.setDocument(doc);
|
||||
data.translators = translate.getTranslators();
|
||||
// update status
|
||||
if(Zotero_Ingester_Interface.tabBrowser.selectedBrowser == browser) {
|
||||
Zotero_Ingester_Interface._updateStatus(data);
|
||||
}
|
||||
// add document
|
||||
if(data.translators && data.translators.length) {
|
||||
data.document = doc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* called when a tab is closed
|
||||
*/
|
||||
Zotero_Ingester_Interface.tabClose = function(event) {
|
||||
// To execute if document object does not exist
|
||||
Zotero_Ingester_Interface._deleteData(event.target.linkedBrowser);
|
||||
}
|
||||
|
||||
/*
|
||||
* called when a tab is switched
|
||||
*/
|
||||
Zotero_Ingester_Interface.tabSelect = function(event) {
|
||||
var data = Zotero_Ingester_Interface._getData(Zotero_Ingester_Interface.tabBrowser.selectedBrowser);
|
||||
Zotero_Ingester_Interface._updateStatus(data);
|
||||
}
|
||||
|
||||
Zotero_Ingester_Interface.hidePopup = function(collectionID) {
|
||||
Zotero_Ingester_Interface._scrapePopupShowing = false;
|
||||
}
|
||||
|
||||
Zotero_Ingester_Interface.showPopup = function(collectionID, parentElement) {
|
||||
if(Zotero_Ingester_Interface._scrapePopupShowing && parentElement.hasChildNodes()) {
|
||||
return false; // Don't dynamically reload popups that are already showing
|
||||
}
|
||||
Zotero_Ingester_Interface._scrapePopupShowing = true;
|
||||
parentElement.removeAllItems();
|
||||
|
||||
if(collectionID == null) { // show library
|
||||
var newItem = document.createElement("menuitem");
|
||||
newItem.setAttribute("label", Zotero.getString("pane.collections.library"));
|
||||
newItem.setAttribute("class", "menuitem-iconic zotero-scrape-popup-library");
|
||||
newItem.setAttribute("oncommand", 'Zotero_Ingester_Interface.scrapeThisPage()');
|
||||
parentElement.appendChild(newItem);
|
||||
}
|
||||
|
||||
var childrenList = Zotero.getCollections(collectionID);
|
||||
for(var i = 0; i < childrenList.length; i++) {
|
||||
if(childrenList[i].hasChildCollections()) {
|
||||
var newItem = document.createElement("menu");
|
||||
var subMenu = document.createElement("menupopup");
|
||||
subMenu.setAttribute("onpopupshowing", 'Zotero_Ingester_Interface.showPopup("'+childrenList[i].getID()+'", this)');
|
||||
newItem.setAttribute("class", "menu-iconic zotero-scrape-popup-collection");
|
||||
newItem.appendChild(subMenu);
|
||||
} else {
|
||||
var newItem = document.createElement("menuitem");
|
||||
newItem.setAttribute("class", "menuitem-iconic zotero-scrape-popup-collection");
|
||||
}
|
||||
newItem.setAttribute("label", childrenList[i].getName());
|
||||
newItem.setAttribute("oncommand", 'Zotero_Ingester_Interface.scrapeThisPage("'+childrenList[i].getID()+'")');
|
||||
|
||||
parentElement.appendChild(newItem);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Private Zotero_Ingester_Interface methods
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
* Gets a data object given a browser window object
|
||||
*
|
||||
* NOTE: Browser objects are associated with document objects via keys generated
|
||||
* from the time the browser object is opened. I'm not sure if this is the
|
||||
* appropriate mechanism for handling this, but it's what PiggyBank used and it
|
||||
* appears to work.
|
||||
*
|
||||
* Currently, the data object contains only one property: "translators," which
|
||||
* is an array of translators that should work with the given page as returned
|
||||
* from Zotero.Translate.getTranslator()
|
||||
*/
|
||||
Zotero_Ingester_Interface._getData = function(browser) {
|
||||
try {
|
||||
var key = browser.getAttribute("zotero-key");
|
||||
if(Zotero_Ingester_Interface.browserData[key]) {
|
||||
return Zotero_Ingester_Interface.browserData[key];
|
||||
}
|
||||
} finally {
|
||||
if(!key) {
|
||||
var key = (new Date()).getTime();
|
||||
browser.setAttribute("zotero-key", key);
|
||||
Zotero_Ingester_Interface.browserData[key] = new Array();
|
||||
return Zotero_Ingester_Interface.browserData[key];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Deletes the document object associated with a given browser window object
|
||||
*/
|
||||
Zotero_Ingester_Interface._deleteData = function(browser) {
|
||||
try {
|
||||
var key = browser.getAttribute("zotero-key");
|
||||
if(Zotero_Ingester_Interface.browserData[key]) {
|
||||
delete Zotero_Ingester_Interface.browserData[key];
|
||||
return true;
|
||||
}
|
||||
} finally {}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Updates the status of the capture icon to reflect the scrapability or lack
|
||||
* thereof of the current page
|
||||
*/
|
||||
Zotero_Ingester_Interface._updateStatus = function(data) {
|
||||
if(data.translators && data.translators.length) {
|
||||
var itemType = data.translators[0].itemType;
|
||||
if(itemType == "multiple") {
|
||||
// Use folder icon for multiple types, for now
|
||||
Zotero_Ingester_Interface.statusImage.src = "chrome://zotero/skin/treesource-collection.png";
|
||||
} else {
|
||||
Zotero_Ingester_Interface.statusImage.src = "chrome://zotero/skin/treeitem-"+itemType+".png";
|
||||
}
|
||||
Zotero_Ingester_Interface.statusImage.hidden = false;
|
||||
} else {
|
||||
Zotero_Ingester_Interface.statusImage.hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback to be executed when an item has been finished
|
||||
*/
|
||||
Zotero_Ingester_Interface._itemDone = function(obj, item, collection) {
|
||||
var title = item.getField("title");
|
||||
var icon = "chrome://zotero/skin/treeitem-"+Zotero.ItemTypes.getName(item.getField("itemTypeID"))+".png"
|
||||
Zotero_Ingester_Interface.Progress.addLines([title], [icon]);
|
||||
|
||||
// add item to collection, if one was specified
|
||||
if(collection) {
|
||||
Zotero.Notifier.disable();
|
||||
collection.addItem(item.getID());
|
||||
Zotero.Notifier.enable();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* called when a user is supposed to select items
|
||||
*/
|
||||
Zotero_Ingester_Interface._selectItems = function(obj, itemList) {
|
||||
// this is kinda ugly, mozillazine made me do it! honest!
|
||||
var io = { dataIn:itemList, dataOut:null }
|
||||
var newDialog = window.openDialog("chrome://zotero/content/ingester/selectitems.xul",
|
||||
"_blank","chrome,modal,centerscreen,resizable=yes", io);
|
||||
|
||||
if(!io.dataOut) { // user selected no items, so kill the progress indicatior
|
||||
Zotero_Ingester_Interface.Progress.kill();
|
||||
}
|
||||
|
||||
return io.dataOut;
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback to be executed when scraping is complete
|
||||
*/
|
||||
Zotero_Ingester_Interface._finishScraping = function(obj, returnValue, collection) {
|
||||
if(!returnValue) {
|
||||
Zotero_Ingester_Interface.Progress.changeHeadline(Zotero.getString("ingester.scrapeError"));
|
||||
Zotero_Ingester_Interface.Progress.addDescription(Zotero.getString("ingester.scrapeErrorDescription"));
|
||||
}
|
||||
|
||||
if(collection) {
|
||||
// notify about modified items
|
||||
Zotero.Notifier.trigger("modify", "collection", collection.getID());
|
||||
}
|
||||
|
||||
Zotero_Ingester_Interface.Progress.fade();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Zotero.Ingester.Progress
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Handles the display of a div showing progress in scraping
|
||||
Zotero_Ingester_Interface.Progress = new function() {
|
||||
var _windowLoaded = false;
|
||||
var _windowLoading = false;
|
||||
// keep track of all of these things in case they're called before we're
|
||||
// done loading the progress window
|
||||
var _loadDescription = null;
|
||||
var _loadLines = new Array();
|
||||
var _loadIcons = new Array();
|
||||
var _loadHeadline = Zotero.getString("ingester.scraping");
|
||||
|
||||
this.show = show;
|
||||
this.changeHeadline = changeHeadline;
|
||||
this.addLines = addLines;
|
||||
this.addDescription = addDescription;
|
||||
this.fade = fade;
|
||||
this.kill = kill;
|
||||
|
||||
function show() {
|
||||
if(_windowLoading || _windowLoaded) { // already loading or loaded
|
||||
return false;
|
||||
}
|
||||
_progressWindow = window.openDialog("chrome://zotero/chrome/ingester/progress.xul",
|
||||
"", "chrome,dialog=no,titlebar=no,popup=yes");
|
||||
_progressWindow.addEventListener("load", _onWindowLoaded, false);
|
||||
_windowLoading = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function changeHeadline(headline) {
|
||||
if(_windowLoaded) {
|
||||
_progressWindow.document.getElementById("zotero-progress-text-headline").value = headline;
|
||||
} else {
|
||||
_loadHeadline = headline;
|
||||
}
|
||||
}
|
||||
|
||||
function addLines(label, icon) {
|
||||
if(_windowLoaded) {
|
||||
for(i in label) {
|
||||
var newLabel = _progressWindow.document.createElement("label");
|
||||
newLabel.setAttribute("class", "zotero-progress-item-label");
|
||||
newLabel.setAttribute("crop", "end");
|
||||
newLabel.setAttribute("value", label[i]);
|
||||
|
||||
var newImage = _progressWindow.document.createElement("image");
|
||||
newImage.setAttribute("class", "zotero-progress-item-icon");
|
||||
newImage.setAttribute("src", icon[i]);
|
||||
|
||||
var newHB = _progressWindow.document.createElement("hbox");
|
||||
newHB.setAttribute("class", "zotero-progress-item-hbox");
|
||||
newHB.setAttribute("valign", "center");
|
||||
newHB.appendChild(newImage);
|
||||
newHB.appendChild(newLabel);
|
||||
|
||||
_progressWindow.document.getElementById("zotero-progress-text-box").appendChild(newHB);
|
||||
}
|
||||
|
||||
_move();
|
||||
} else {
|
||||
_loadLines = _loadLines.concat(label);
|
||||
_loadIcons = _loadIcons.concat(icon);
|
||||
}
|
||||
}
|
||||
|
||||
function addDescription(text) {
|
||||
if(_windowLoaded) {
|
||||
var newHB = _progressWindow.document.createElement("hbox");
|
||||
newHB.setAttribute("class", "zotero-progress-item-hbox");
|
||||
var newDescription = _progressWindow.document.createElement("description");
|
||||
newDescription.setAttribute("class", "zotero-progress-description");
|
||||
var newText = _progressWindow.document.createTextNode(text);
|
||||
|
||||
newDescription.appendChild(newText);
|
||||
newHB.appendChild(newDescription);
|
||||
_progressWindow.document.getElementById("zotero-progress-text-box").appendChild(newHB);
|
||||
|
||||
_move();
|
||||
} else {
|
||||
_loadDescription = text;
|
||||
}
|
||||
}
|
||||
|
||||
function fade() {
|
||||
if(_windowLoaded || _windowLoading) {
|
||||
setTimeout(_timeout, 2500);
|
||||
}
|
||||
}
|
||||
|
||||
function kill() {
|
||||
_windowLoaded = false;
|
||||
_windowLoading = false;
|
||||
try {
|
||||
_progressWindow.close();
|
||||
} catch(ex) {}
|
||||
}
|
||||
|
||||
function _onWindowLoaded() {
|
||||
_windowLoading = false;
|
||||
_windowLoaded = true;
|
||||
|
||||
_move();
|
||||
// do things we delayed because the window was loading
|
||||
changeHeadline(_loadHeadline);
|
||||
addLines(_loadLines, _loadIcons);
|
||||
if(_loadDescription) {
|
||||
addDescription(_loadDescription);
|
||||
}
|
||||
|
||||
// reset parameters
|
||||
_loadDescription = null;
|
||||
_loadLines = new Array();
|
||||
_loadIcons = new Array();
|
||||
_loadHeadline = Zotero.getString("ingester.scraping")
|
||||
}
|
||||
|
||||
function _move() {
|
||||
_progressWindow.sizeToContent();
|
||||
_progressWindow.moveTo(
|
||||
window.screenX + window.innerWidth - _progressWindow.outerWidth - 30,
|
||||
window.screenY + window.innerHeight - _progressWindow.outerHeight - 10
|
||||
);
|
||||
}
|
||||
|
||||
function _timeout() {
|
||||
kill(); // could check to see if we're really supposed to fade yet
|
||||
// (in case multiple scrapers are operating at once)
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<overlay id="zotero-ingester-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script src="../include.js"/>
|
||||
<script src="browser.js"/>
|
||||
|
||||
<script type="application/x-javascript">
|
||||
Zotero_Ingester_Interface.init();
|
||||
</script>
|
||||
|
||||
<hbox id="urlbar-icons">
|
||||
<popupset>
|
||||
<popup id="zotero-scrape-popup" onpopupshowing="Zotero_Ingester_Interface.showPopup(null, this)" onpopuphidden="Zotero_Ingester_Interface.hidePopup(null, this)">
|
||||
</popup>
|
||||
</popupset>
|
||||
|
||||
<image src="chrome://zotero/skin/treeitem-book.png" id="zotero-status-image" onclick="Zotero_Ingester_Interface.scrapeThisPage()" position="1" hidden="true" context="zotero-scrape-popup" />
|
||||
</hbox>
|
||||
</overlay>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
|
||||
<window id="zotero-progress-window"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
windowtype="alert:alert"
|
||||
align="start">
|
||||
|
||||
<hbox id="zotero-progress-box">
|
||||
<vbox id="zotero-progress-text-box">
|
||||
<label id="zotero-progress-text-headline" style="font-weight: bold;" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
</window>
|
|
@ -41,8 +41,11 @@ var Zotero_Ingester_Interface_SelectItems = function() {}
|
|||
* loading
|
||||
*/
|
||||
Zotero_Ingester_Interface_SelectItems.init = function() {
|
||||
// Set font size from pref
|
||||
var sbc = document.getElementById('zotero-select-items-container');
|
||||
Zotero.setFontSize(sbc);
|
||||
|
||||
this.io = window.arguments[0];
|
||||
this.Zotero_Ingester_Interface = window.arguments[1];
|
||||
var listbox = document.getElementById("zotero-selectitems-links");
|
||||
|
||||
for(i in this.io.dataIn) { // we could use a tree for this if we wanted to
|
||||
|
@ -55,6 +58,13 @@ Zotero_Ingester_Interface_SelectItems.init = function() {
|
|||
}
|
||||
}
|
||||
|
||||
Zotero_Ingester_Interface_SelectItems.selectAll = function(deselect) {
|
||||
var listbox = document.getElementById("zotero-selectitems-links");
|
||||
for (var i=0; i<listbox.childNodes.length; i++){
|
||||
listbox.childNodes[i].setAttribute('checked', !deselect);
|
||||
}
|
||||
}
|
||||
|
||||
Zotero_Ingester_Interface_SelectItems.acceptSelection = function() {
|
||||
var listbox = document.getElementById("zotero-selectitems-links");
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
<dialog xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="&selectitems.title;" width="400" height="330"
|
||||
title="&zotero.selectitems.title;" width="400" height="330"
|
||||
persist="width height screenX screenY"
|
||||
buttons="cancel,accept"
|
||||
ondialogaccept="Zotero_Ingester_Interface_SelectItems.acceptSelection()"
|
||||
|
@ -12,8 +12,16 @@
|
|||
|
||||
<script src="../include.js"/>
|
||||
<script src="selectitems.js"/>
|
||||
<caption label="&selectitems.intro.label;" id="zotero-selectitems-intro"/>
|
||||
<box flex="1">
|
||||
<listbox id="zotero-selectitems-links" flex="1" context="zoteroSelectContext"></listbox>
|
||||
</box>
|
||||
|
||||
<vbox id="zotero-select-items-container" flex="1">
|
||||
<caption label="&zotero.selectitems.intro.label;" id="zotero-selectitems-intro"/>
|
||||
<box flex="1">
|
||||
<listbox id="zotero-selectitems-links" flex="1" context="zoteroSelectContext"></listbox>
|
||||
</box>
|
||||
<hbox>
|
||||
<button label="Select All" oncommand="Zotero_Ingester_Interface_SelectItems.selectAll()"/>
|
||||
<button label="Deselect All" oncommand="Zotero_Ingester_Interface_SelectItems.selectAll(true)"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
</dialog>
|
|
@ -1,20 +1,45 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/bibliography.css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="&integration.docPrefs.title;" buttons="accept"
|
||||
ondialogaccept="Zotero_File_Interface_Bibliography.acceptSelection()"
|
||||
id="zotero-bibliography"
|
||||
onload="Zotero_File_Interface_Bibliography.init()">
|
||||
|
||||
<script src="include.js"/>
|
||||
<script src="bibliography.js"/>
|
||||
<dialog
|
||||
id="add-citation-dialog"
|
||||
orient="vertical"
|
||||
buttons="accept"
|
||||
title="&zotero.integration.docPrefs.title;"
|
||||
onload="Zotero_File_Interface_Bibliography.init();"
|
||||
ondialogaccept="Zotero_File_Interface_Bibliography.acceptSelection();"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
style="padding: 0">
|
||||
|
||||
<script src="include.js"/>
|
||||
<script src="bibliography.js"/>
|
||||
|
||||
<hbox>
|
||||
<label value="&bibliography.style.label;" control="style-menu"/>
|
||||
<menulist id="style-menu">
|
||||
<menupopup id="style-popup">
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
<vbox id="zotero-bibliography-container" style="padding: 0.5em">
|
||||
<groupbox>
|
||||
<caption label="&zotero.bibliography.style.label;"/>
|
||||
<listbox id="style-listbox" onselect="Zotero_File_Interface_Bibliography.styleChanged()"/>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&zotero.integration.prefs.displayAs.label;"/>
|
||||
<radiogroup id="displayAs" orient="horizontal">
|
||||
<radio id="footnotes" label="&zotero.integration.prefs.footnotes.label;" selected="true"/>
|
||||
<radio id="endnotes" label="&zotero.integration.prefs.endnotes.label;"/>
|
||||
</radiogroup>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&zotero.integration.prefs.formatUsing.label;"/>
|
||||
|
||||
<radiogroup id="formatUsing" orient="vertical">
|
||||
<radio id="fields" selected="true"/>
|
||||
<label class="radioDescription" id="fields-caption"/>
|
||||
<radio id="bookmarks" label="&zotero.integration.prefs.bookmarks.label;"/>
|
||||
<label class="radioDescription" id="bookmarks-caption">&zotero.integration.prefs.bookmarks.caption;</label>
|
||||
</radiogroup>
|
||||
</groupbox>
|
||||
</vbox>
|
||||
</dialog>
|
File diff suppressed because it is too large
Load diff
|
@ -20,6 +20,8 @@
|
|||
|
||||
***** END LICENSE BLOCK *****
|
||||
-->
|
||||
<?xml-stylesheet href="chrome://zotero/skin/itemPane.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero-platform/content/itemPane.css" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
|
||||
<overlay
|
||||
|
@ -27,22 +29,40 @@
|
|||
|
||||
<script src="itemPane.js"/>
|
||||
<deck id="zotero-view-item" flex="1" onselect="if (this.selectedIndex!==''){ ZoteroItemPane.loadPane(this.selectedIndex) }">
|
||||
<vbox id="zotero-info" flex="1">
|
||||
<scrollbox id="zotero-info" flex="1" orient="vertical" style="overflow:auto">
|
||||
<popupset>
|
||||
<popup id="creatorTypeMenu" position="after_start"
|
||||
<popup id="zotero-creator-type-menu" position="after_start"
|
||||
oncommand="var otherFields = ZoteroItemPane.getCreatorFields(document.popupNode.parentNode);
|
||||
var typeID = event.explicitOriginalTarget.getAttribute('typeid');
|
||||
document.popupNode.setAttribute('label',
|
||||
Zotero.getString('creatorTypes.' + Zotero.CreatorTypes.getName(typeID)) + ':');
|
||||
document.popupNode.setAttribute('typeid', typeID);
|
||||
ZoteroItemPane.modifyCreator(document.popupNode.getAttribute('fieldname').split('-')[1],
|
||||
'typeID', typeID, otherFields)"/>
|
||||
<popup id="zotero-field-menu">
|
||||
<menu label="&zotero.item.textTransform;">
|
||||
<menupopup>
|
||||
<menuitem label="&zotero.item.textTransform.lowercase;" class="menuitem-non-iconic"
|
||||
oncommand="ZoteroItemPane.textTransform(document.popupNode, 'lower')"/>
|
||||
<menuitem label="&zotero.item.textTransform.titlecase;" class="menuitem-non-iconic"
|
||||
oncommand="ZoteroItemPane.textTransform(document.popupNode, 'title')"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</popup>
|
||||
</popupset>
|
||||
<hbox align="center">
|
||||
<button id="tb-go-to-url" label="&toolbar.goToURL.label;" tooltiptext="&toolbar.goToURL.tooltip;" flex="1" oncommand="window.loadURI(this.getAttribute('viewURL'))" disabled="false"/>
|
||||
<button id="tb-openurl" label="&toolbar.openURL.label;" tooltiptext="&toolbar.openURL.tooltip;" flex="1" oncommand="ZoteroItemPane.onOpenURLClick();"/>
|
||||
<hbox id="zotero-editpane-go-buttons" align="center">
|
||||
<button id="zotero-go-to-url"
|
||||
onfocus="ZoteroItemPane.ensureElementIsVisible(this)"
|
||||
oncommand="ZoteroItemPane.onViewClick(this, event)" disabled="false"/>
|
||||
<button id="zotero-openurl" label="&zotero.toolbar.openURL.label;"
|
||||
tooltiptext="&zotero.toolbar.openURL.tooltip;"
|
||||
onfocus="ZoteroItemPane.ensureElementIsVisible(this)"
|
||||
oncommand="ZoteroItemPane.onOpenURLClick(event);"/>
|
||||
</hbox>
|
||||
<hbox align="center">
|
||||
<menulist id="editpane-type-menu" oncommand="ZoteroItemPane.changeTypeTo(this.value)" flex="1">
|
||||
<menulist id="zotero-editpane-type-menu" oncommand="ZoteroItemPane.changeTypeTo(this.value, this)" flex="1"
|
||||
onfocus="ZoteroItemPane.ensureElementIsVisible(this)"
|
||||
onkeypress="if (event.keyCode == event.DOM_VK_TAB){ if (!event.shiftKey) { ZoteroItemPane.focusFirstField('info'); event.preventDefault(); } }">
|
||||
<menupopup/>
|
||||
</menulist>
|
||||
</hbox>
|
||||
|
@ -51,31 +71,31 @@
|
|||
<column/>
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
<rows id="editpane-dynamic-fields" flex="1"/>
|
||||
<rows id="zotero-editpane-dynamic-fields" flex="1"/>
|
||||
</grid>
|
||||
</vbox>
|
||||
</scrollbox>
|
||||
<vbox flex="1">
|
||||
<hbox align="center">
|
||||
<label id="editpane-notes-label"/>
|
||||
<button label="&item.add;" oncommand="ZoteroItemPane.addNote();"/>
|
||||
<label id="zotero-editpane-notes-label"/>
|
||||
<button label="&zotero.item.add;" oncommand="ZoteroItemPane.addNote();"/>
|
||||
</hbox>
|
||||
<grid flex="1">
|
||||
<columns>
|
||||
<column flex="1"/>
|
||||
<column/>
|
||||
</columns>
|
||||
<rows id="editpane-dynamic-notes" flex="1"/>
|
||||
<rows id="zotero-editpane-dynamic-notes" flex="1"/>
|
||||
</grid>
|
||||
</vbox>
|
||||
<vbox flex="1">
|
||||
<hbox align="center">
|
||||
<label id="editpane-attachments-label"/>
|
||||
<button id="tb-item-attachments-add" type="menu" label="&item.add;">
|
||||
<label id="zotero-editpane-attachments-label"/>
|
||||
<button id="zotero-tb-item-attachments-add" type="menu" label="&zotero.item.add;">
|
||||
<menupopup>
|
||||
<menuitem class="menuitem-iconic" id="tb-item-attachments-link" label="&toolbar.attachment.linked;" oncommand="ZoteroItemPane.addAttachmentFromDialog(true);"/>
|
||||
<menuitem class="menuitem-iconic" id="tb-item-attachments-file" label="&toolbar.attachment.add;" oncommand="ZoteroItemPane.addAttachmentFromDialog();"/>
|
||||
<menuitem class="menuitem-iconic" id="tb-item-attachments-web-link" label="&toolbar.attachment.weblink;" oncommand="ZoteroItemPane.addAttachmentFromPage(true);"/>
|
||||
<menuitem class="menuitem-iconic" id="tb-item-attachments-snapshot" label="&toolbar.attachment.snapshot;" oncommand="ZoteroItemPane.addAttachmentFromPage();"/>
|
||||
<menuitem class="menuitem-iconic" id="zotero-tb-item-attachments-link" label="&zotero.toolbar.attachment.linked;" oncommand="ZoteroItemPane.addAttachmentFromDialog(true);"/>
|
||||
<menuitem class="menuitem-iconic" id="zotero-tb-item-attachments-file" label="&zotero.toolbar.attachment.add;" oncommand="ZoteroItemPane.addAttachmentFromDialog();"/>
|
||||
<menuitem class="menuitem-iconic" id="zotero-tb-item-attachments-web-link" label="&zotero.toolbar.attachment.weblink;" oncommand="ZoteroItemPane.addAttachmentFromPage(true);"/>
|
||||
<menuitem class="menuitem-iconic" id="zotero-tb-item-attachments-snapshot" label="&zotero.toolbar.attachment.snapshot;" oncommand="ZoteroItemPane.addAttachmentFromPage();"/>
|
||||
</menupopup>
|
||||
</button>
|
||||
</hbox>
|
||||
|
@ -84,10 +104,10 @@
|
|||
<column flex="1"/>
|
||||
<column/>
|
||||
</columns>
|
||||
<rows id="editpane-dynamic-attachments" flex="1"/>
|
||||
<rows id="zotero-editpane-dynamic-attachments" flex="1"/>
|
||||
</grid>
|
||||
</vbox>
|
||||
<tagsbox id="editpane-tags" flex="1"/>
|
||||
<seealsobox id="editpane-related" flex="1"/>
|
||||
<tagsbox id="zotero-editpane-tags" flex="1"/>
|
||||
<seealsobox id="zotero-editpane-related" flex="1"/>
|
||||
</deck>
|
||||
</overlay>
|
147
chrome/content/zotero/locale/csl/locales-af-AZ.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-af-AZ.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="af">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">toegang verkry</term>
|
||||
<term name="retrieved">opgehaal</term>
|
||||
<term name="from">van</term>
|
||||
<term name="forthcoming">voorhande</term>
|
||||
<term name="references">Verwysings</term>
|
||||
<term name="no date">n.d.</term>
|
||||
<term name="and">en</term>
|
||||
<term name="et-al">et al.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>reël</single>
|
||||
<multiple>reëls</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>bladsy</single>
|
||||
<multiple>bladsye</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>paragraaf</single>
|
||||
<multiple>paragrawe</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">no</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>bl</single>
|
||||
<multiple>bll</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>redakteur</single>
|
||||
<multiple>redakteurs</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>vertaler</single>
|
||||
<multiple>vertalers</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>red</single>
|
||||
<multiple>reds</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>vert</single>
|
||||
<multiple>verts</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">onder redaksie van</term>
|
||||
<term name="translator" form="verb">vertaal deur</term>
|
||||
<term name="editor" form="verb-short">red</term>
|
||||
<term name="translator" form="verb-short">verts</term>
|
||||
<term name="month-01">Januarie</term>
|
||||
<term name="month-02">Februarie</term>
|
||||
<term name="month-03">Maart</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">Mei</term>
|
||||
<term name="month-06">Junie</term>
|
||||
<term name="month-07">Julie</term>
|
||||
<term name="month-08">Augustus</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">Oktober</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">Desember</term>
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mrt</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">Mei</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Okt</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Des</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-ar.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-ar.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="ar">
|
||||
<term name="at">at</term>
|
||||
<term name="in">في</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">زير</term>
|
||||
<term name="retrieved">جلب</term>
|
||||
<term name="from">من</term>
|
||||
<term name="forthcoming">القادم</term>
|
||||
<term name="references">مراجع</term>
|
||||
<term name="no date"/>
|
||||
<term name="and">و</term>
|
||||
<term name="et-al"/>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>سطر</single>
|
||||
<multiple>أسطر</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>صفحة</single>
|
||||
<multiple>صفحات</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>فقرة</single>
|
||||
<multiple>فقرات</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">ع</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>ص</single>
|
||||
<multiple>ص.ص</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">م</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>تحرير</single>
|
||||
<multiple>تحرير</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>ترجمة</single>
|
||||
<multiple>ترجمة</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>ت</single>
|
||||
<multiple>ت</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>تر</single>
|
||||
<multiple>تر</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">حرره</term>
|
||||
<term name="translator" form="verb">ترجمه</term>
|
||||
<term name="editor" form="verb-short">ح</term>
|
||||
<term name="translator" form="verb-short">تر</term>
|
||||
<term name="month-01">يناير</term>
|
||||
<term name="month-02">فبراير</term>
|
||||
<term name="month-03">مارس</term>
|
||||
<term name="month-04">ابريل</term>
|
||||
<term name="month-05">مايو</term>
|
||||
<term name="month-06">يونيو</term>
|
||||
<term name="month-07">يوليو</term>
|
||||
<term name="month-08">اغسطس</term>
|
||||
<term name="month-09">سبتمبر</term>
|
||||
<term name="month-10">اكتوبر</term>
|
||||
<term name="month-11">نوفمبر</term>
|
||||
<term name="month-12">ديسمبر</term>
|
||||
<term name="month-01" form="short">يناير</term>
|
||||
<term name="month-02" form="short">فبراير</term>
|
||||
<term name="month-03" form="short">مارس</term>
|
||||
<term name="month-04" form="short">ابريل</term>
|
||||
<term name="month-05" form="short">مايو</term>
|
||||
<term name="month-06" form="short">يونيو</term>
|
||||
<term name="month-07" form="short">يوليو</term>
|
||||
<term name="month-08" form="short">اغسطس</term>
|
||||
<term name="month-09" form="short">سبتمبر</term>
|
||||
<term name="month-10" form="short">اكتوبر</term>
|
||||
<term name="month-11" form="short">نوفمبر</term>
|
||||
<term name="month-12" form="short">ديسمبر</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-bg-BG.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-bg-BG.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="bg">
|
||||
<term name="at">at</term>
|
||||
<term name="in">в</term>
|
||||
<term name="ibid">пак там</term>
|
||||
<term name="accessed">отворен на</term>
|
||||
<term name="retrieved">изтеглен на</term>
|
||||
<term name="from">от</term>
|
||||
<term name="forthcoming">предстоящ</term>
|
||||
<term name="references">цитати</term>
|
||||
<term name="no date">без дата</term>
|
||||
<term name="and">и</term>
|
||||
<term name="et-al">и съавт.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>ред</single>
|
||||
<multiple>редове</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>страница</single>
|
||||
<multiple>страници</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>параграф</single>
|
||||
<multiple>параграфи</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">бр.</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>с.</single>
|
||||
<multiple>с-ци</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">т.</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>редактор</single>
|
||||
<multiple>редактори</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>преводач</single>
|
||||
<multiple>преводачи</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>ред.</single>
|
||||
<multiple>ред-ри</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>прев.</single>
|
||||
<multiple>прев-чи</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">редактиран от</term>
|
||||
<term name="translator" form="verb">преведен от</term>
|
||||
<term name="editor" form="verb-short">ред.</term>
|
||||
<term name="translator" form="verb-short">прев.</term>
|
||||
<term name="month-01">Януари</term>
|
||||
<term name="month-02">Февруари</term>
|
||||
<term name="month-03">Март</term>
|
||||
<term name="month-04">Април</term>
|
||||
<term name="month-05">Май</term>
|
||||
<term name="month-06">Юни</term>
|
||||
<term name="month-07">Юли</term>
|
||||
<term name="month-08">Август</term>
|
||||
<term name="month-09">Септември</term>
|
||||
<term name="month-10">Октомври</term>
|
||||
<term name="month-11">Ноември</term>
|
||||
<term name="month-12">Декември</term>
|
||||
<term name="month-01" form="short">Ян.</term>
|
||||
<term name="month-02" form="short">Фев.</term>
|
||||
<term name="month-03" form="short">Март</term>
|
||||
<term name="month-04" form="short">Апр.</term>
|
||||
<term name="month-05" form="short">Май</term>
|
||||
<term name="month-06" form="short">Юни</term>
|
||||
<term name="month-07" form="short">Юли</term>
|
||||
<term name="month-08" form="short">Авг.</term>
|
||||
<term name="month-09" form="short">Септ.</term>
|
||||
<term name="month-10" form="short">Окт.</term>
|
||||
<term name="month-11" form="short">Ноем.</term>
|
||||
<term name="month-12" form="short">Дек.</term>
|
||||
</locale>
|
||||
</terms>
|
|
@ -1,16 +1,53 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="en">
|
||||
<locale xml:lang="ca">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">accessed</term>
|
||||
<term name="retrieved">retrieved</term>
|
||||
<term name="from">from</term>
|
||||
<term name="forthcoming">forthcoming</term>
|
||||
<term name="references">References</term>
|
||||
<term name="no date">nd</term>
|
||||
<term name="and">and</term>
|
||||
<term name="et-al">et al.</term>
|
||||
|
||||
<!-- LONG LOCATOR FORMS -->
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>line</single>
|
||||
<multiple>line</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>page</single>
|
||||
<multiple>pages</multiple>
|
||||
|
@ -19,30 +56,49 @@
|
|||
<single>paragraph</single>
|
||||
<multiple>paragraph</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>line</single>
|
||||
<multiple>line</multiple>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="volume">volume</term>
|
||||
<term name="issue">number</term>
|
||||
|
||||
<!-- SHORT LOCATOR FORMS -->
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">no</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="line" form="short">
|
||||
<single>line</single>
|
||||
<multiple>line</multiple>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
<term name="issue" form="short">no</term>
|
||||
|
||||
<!-- LONG ROLE FORMS -->
|
||||
<term name="editor">
|
||||
<single>editor</single>
|
||||
<multiple>editors</multiple>
|
||||
|
@ -51,8 +107,6 @@
|
|||
<single>translator</single>
|
||||
<multiple>translators</multiple>
|
||||
</term>
|
||||
|
||||
<!-- SHORT ROLE FORMS -->
|
||||
<term name="editor" form="short">
|
||||
<single>ed</single>
|
||||
<multiple>eds</multiple>
|
||||
|
@ -61,12 +115,10 @@
|
|||
<single>tran</single>
|
||||
<multiple>trans</multiple>
|
||||
</term>
|
||||
|
||||
<!-- VERB ROLE FORMS -->
|
||||
<term name="editor" form="verb">edited by</term>
|
||||
<term name="translator" form="verb">translated by</term>
|
||||
|
||||
<!-- LONG MONTH FORMS -->
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">January</term>
|
||||
<term name="month-02">February</term>
|
||||
<term name="month-03">March</term>
|
||||
|
@ -79,8 +131,6 @@
|
|||
<term name="month-10">October</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">December</term>
|
||||
|
||||
<!-- SHORT MONTH FORMS -->
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
|
@ -94,4 +144,4 @@
|
|||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dec</term>
|
||||
</locale>
|
||||
</terms>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-da-DK.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-da-DK.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="da">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">accessed</term>
|
||||
<term name="retrieved">retrieved</term>
|
||||
<term name="from">from</term>
|
||||
<term name="forthcoming">forthcoming</term>
|
||||
<term name="references">References</term>
|
||||
<term name="no date">nd</term>
|
||||
<term name="and">and</term>
|
||||
<term name="et-al">et al.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>line</single>
|
||||
<multiple>line</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>page</single>
|
||||
<multiple>pages</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>paragraph</single>
|
||||
<multiple>paragraph</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">no</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>editor</single>
|
||||
<multiple>editors</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>translator</single>
|
||||
<multiple>translators</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>ed</single>
|
||||
<multiple>eds</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>tran</single>
|
||||
<multiple>trans</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">edited by</term>
|
||||
<term name="translator" form="verb">translated by</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">January</term>
|
||||
<term name="month-02">February</term>
|
||||
<term name="month-03">March</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">May</term>
|
||||
<term name="month-06">June</term>
|
||||
<term name="month-07">July</term>
|
||||
<term name="month-08">August</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">October</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">December</term>
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">May</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Oct</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dec</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-de-AT.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-de-AT.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="de">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ebd.</term>
|
||||
<term name="accessed">zugegriffen</term>
|
||||
<term name="retrieved">abgerufen</term>
|
||||
<term name="from">von</term>
|
||||
<term name="forthcoming">i.E.</term>
|
||||
<term name="references">Quellenangabe</term>
|
||||
<term name="no date">o.J.</term>
|
||||
<term name="and">und</term>
|
||||
<term name="et-al">u.a.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>Zeile</single>
|
||||
<multiple>Zeilen</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>Seite</single>
|
||||
<multiple>Seiten</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>Absatz</single>
|
||||
<multiple>Absätze</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">Nr.</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>S.</single>
|
||||
<multiple>S.</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">Bd.</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>Herausgeber</single>
|
||||
<multiple>Herausgeber</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>Übersetzer</single>
|
||||
<multiple>Übersetzer</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>Hrsg.</single>
|
||||
<multiple>Hrsg.</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>Übers.</single>
|
||||
<multiple>Übers.</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">Hg. v.</term>
|
||||
<term name="translator" form="verb">Übers. v.</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">Jänner</term>
|
||||
<term name="month-02">Februar</term>
|
||||
<term name="month-03">März</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">Mai</term>
|
||||
<term name="month-06">Juni</term>
|
||||
<term name="month-07">Juli</term>
|
||||
<term name="month-08">August</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">Oktober</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">Dezember</term>
|
||||
<term name="month-01" form="short">Jän</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">Mai</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Okt</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dez</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-de-CH.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-de-CH.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="de">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ebd.</term>
|
||||
<term name="accessed">zugegriffen</term>
|
||||
<term name="retrieved">abgerufen</term>
|
||||
<term name="from">von</term>
|
||||
<term name="forthcoming">i.E.</term>
|
||||
<term name="references">Quellenangabe</term>
|
||||
<term name="no date">o.J.</term>
|
||||
<term name="and">und</term>
|
||||
<term name="et-al">u.a.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>Zeile</single>
|
||||
<multiple>Zeilen</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>Seite</single>
|
||||
<multiple>Seiten</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>Absatz</single>
|
||||
<multiple>Absätze</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">Nr.</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>S.</single>
|
||||
<multiple>S.</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">Bd.</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>Herausgeber</single>
|
||||
<multiple>Herausgeber</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>Übersetzer</single>
|
||||
<multiple>Übersetzer</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>Hrsg.</single>
|
||||
<multiple>Hrsg.</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>Übers.</single>
|
||||
<multiple>Übers.</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">Hg. v.</term>
|
||||
<term name="translator" form="verb">Übers. v.</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">Januar</term>
|
||||
<term name="month-02">Februar</term>
|
||||
<term name="month-03">März</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">Mai</term>
|
||||
<term name="month-06">Juni</term>
|
||||
<term name="month-07">Juli</term>
|
||||
<term name="month-08">August</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">Oktober</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">Dezember</term>
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">Mai</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Okt</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dez</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-de-DE.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-de-DE.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="de">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ebd.</term>
|
||||
<term name="accessed">zugegriffen</term>
|
||||
<term name="retrieved">abgerufen</term>
|
||||
<term name="from">von</term>
|
||||
<term name="forthcoming">i.E.</term>
|
||||
<term name="references">Quellenangabe</term>
|
||||
<term name="no date">o.J.</term>
|
||||
<term name="and">und</term>
|
||||
<term name="et-al">u.a.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>Zeile</single>
|
||||
<multiple>Zeilen</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>Seite</single>
|
||||
<multiple>Seiten</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>Absatz</single>
|
||||
<multiple>Absätze</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">Nr.</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>S.</single>
|
||||
<multiple>S.</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">Bd.</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>Herausgeber</single>
|
||||
<multiple>Herausgeber</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>Übersetzer</single>
|
||||
<multiple>Übersetzer</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>Hrsg.</single>
|
||||
<multiple>Hrsg.</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>Übers.</single>
|
||||
<multiple>Übers.</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">Hg. v.</term>
|
||||
<term name="translator" form="verb">Übers. v.</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">Januar</term>
|
||||
<term name="month-02">Februar</term>
|
||||
<term name="month-03">März</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">Mai</term>
|
||||
<term name="month-06">Juni</term>
|
||||
<term name="month-07">Juli</term>
|
||||
<term name="month-08">August</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">Oktober</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">Dezember</term>
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">Mai</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Okt</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dez</term>
|
||||
</locale>
|
||||
</terms>
|
165
chrome/content/zotero/locale/csl/locales-el-GR.xml
Normal file
165
chrome/content/zotero/locale/csl/locales-el-GR.xml
Normal file
|
@ -0,0 +1,165 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="en">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">accessed</term>
|
||||
<term name="retrieved">retrieved</term>
|
||||
<term name="from">from</term>
|
||||
<term name="forthcoming">forthcoming</term>
|
||||
<term name="references">references</term>
|
||||
<term name="no date">n.d.</term>
|
||||
<term name="and">and</term>
|
||||
<term name="et-al">et al.</term>
|
||||
|
||||
<!-- LONG LOCATOR FORMS -->
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>line</single>
|
||||
<multiple>lines</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>page</single>
|
||||
<multiple>pages</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>paragraph</single>
|
||||
<multiple>paragraph</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
|
||||
<!-- SHORT LOCATOR FORMS -->
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">no</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
|
||||
<!-- SYMBOL LOCATOR FORMS -->
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
|
||||
<!-- LONG ROLE FORMS -->
|
||||
<term name="editor">
|
||||
<single>editor</single>
|
||||
<multiple>editors</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>translator</single>
|
||||
<multiple>translators</multiple>
|
||||
</term>
|
||||
|
||||
<!-- SHORT ROLE FORMS -->
|
||||
<term name="editor" form="short">
|
||||
<single>ed</single>
|
||||
<multiple>eds</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>tran</single>
|
||||
<multiple>trans</multiple>
|
||||
</term>
|
||||
|
||||
<!-- VERB ROLE FORMS -->
|
||||
<term name="editor" form="verb">edited by</term>
|
||||
<term name="translator" form="verb">translated by</term>
|
||||
|
||||
<!-- SHORT VERB ROLE FORMS -->
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
|
||||
<!-- LONG MONTH FORMS -->
|
||||
<term name="month-01">January</term>
|
||||
<term name="month-02">February</term>
|
||||
<term name="month-03">March</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">May</term>
|
||||
<term name="month-06">June</term>
|
||||
<term name="month-07">July</term>
|
||||
<term name="month-08">August</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">October</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">December</term>
|
||||
|
||||
<!-- SHORT MONTH FORMS -->
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">May</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Oct</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dec</term>
|
||||
</locale>
|
||||
</terms>
|
165
chrome/content/zotero/locale/csl/locales-en-US.xml
Normal file
165
chrome/content/zotero/locale/csl/locales-en-US.xml
Normal file
|
@ -0,0 +1,165 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="en">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">accessed</term>
|
||||
<term name="retrieved">retrieved</term>
|
||||
<term name="from">from</term>
|
||||
<term name="forthcoming">forthcoming</term>
|
||||
<term name="references">references</term>
|
||||
<term name="no date">n.d.</term>
|
||||
<term name="and">and</term>
|
||||
<term name="et-al">et al.</term>
|
||||
|
||||
<!-- LONG LOCATOR FORMS -->
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>line</single>
|
||||
<multiple>lines</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>page</single>
|
||||
<multiple>pages</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>paragraph</single>
|
||||
<multiple>paragraph</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
|
||||
<!-- SHORT LOCATOR FORMS -->
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">no</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
|
||||
<!-- SYMBOL LOCATOR FORMS -->
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
|
||||
<!-- LONG ROLE FORMS -->
|
||||
<term name="editor">
|
||||
<single>editor</single>
|
||||
<multiple>editors</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>translator</single>
|
||||
<multiple>translators</multiple>
|
||||
</term>
|
||||
|
||||
<!-- SHORT ROLE FORMS -->
|
||||
<term name="editor" form="short">
|
||||
<single>ed</single>
|
||||
<multiple>eds</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>tran</single>
|
||||
<multiple>trans</multiple>
|
||||
</term>
|
||||
|
||||
<!-- VERB ROLE FORMS -->
|
||||
<term name="editor" form="verb">edited by</term>
|
||||
<term name="translator" form="verb">translated by</term>
|
||||
|
||||
<!-- SHORT VERB ROLE FORMS -->
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
|
||||
<!-- LONG MONTH FORMS -->
|
||||
<term name="month-01">January</term>
|
||||
<term name="month-02">February</term>
|
||||
<term name="month-03">March</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">May</term>
|
||||
<term name="month-06">June</term>
|
||||
<term name="month-07">July</term>
|
||||
<term name="month-08">August</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">October</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">December</term>
|
||||
|
||||
<!-- SHORT MONTH FORMS -->
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">May</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Oct</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dec</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-es-ES.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-es-ES.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="es">
|
||||
<term name="at">at</term>
|
||||
<term name="in">en</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">accedido</term>
|
||||
<term name="retrieved">recuperado</term>
|
||||
<term name="from">a partir de</term>
|
||||
<term name="forthcoming">previsto</term>
|
||||
<term name="references">Referencias</term>
|
||||
<term name="no date">s.d.</term>
|
||||
<term name="and">y</term>
|
||||
<term name="et-al">et al.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>línea</single>
|
||||
<multiple>líneas</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>página</single>
|
||||
<multiple>páginas</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>párrafo</single>
|
||||
<multiple>párrafos</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">nº</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>pág.</single>
|
||||
<multiple>págs.</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol.</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>editor</single>
|
||||
<multiple>editores</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>traductor</single>
|
||||
<multiple>traductores</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>ed.</single>
|
||||
<multiple>eds.</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>trad.</single>
|
||||
<multiple>trads.</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">editado por</term>
|
||||
<term name="translator" form="verb">traducido por</term>
|
||||
<term name="editor" form="verb-short">ed.</term>
|
||||
<term name="translator" form="verb-short">trad.</term>
|
||||
<term name="month-01">Enero</term>
|
||||
<term name="month-02">Febrero</term>
|
||||
<term name="month-03">Marzo</term>
|
||||
<term name="month-04">Abril</term>
|
||||
<term name="month-05">Mayo</term>
|
||||
<term name="month-06">Junio</term>
|
||||
<term name="month-07">Julio</term>
|
||||
<term name="month-08">Agosto</term>
|
||||
<term name="month-09">Septiembre</term>
|
||||
<term name="month-10">Octubre</term>
|
||||
<term name="month-11">Noviembre</term>
|
||||
<term name="month-12">Diciembre</term>
|
||||
<term name="month-01" form="short">Ene</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Abr</term>
|
||||
<term name="month-05" form="short">May</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Ago</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Oct</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dic</term>
|
||||
</locale>
|
||||
</terms>
|
165
chrome/content/zotero/locale/csl/locales-et-EE.xml
Normal file
165
chrome/content/zotero/locale/csl/locales-et-EE.xml
Normal file
|
@ -0,0 +1,165 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="en">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">accessed</term>
|
||||
<term name="retrieved">retrieved</term>
|
||||
<term name="from">from</term>
|
||||
<term name="forthcoming">forthcoming</term>
|
||||
<term name="references">references</term>
|
||||
<term name="no date">n.d.</term>
|
||||
<term name="and">and</term>
|
||||
<term name="et-al">et al.</term>
|
||||
|
||||
<!-- LONG LOCATOR FORMS -->
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>line</single>
|
||||
<multiple>lines</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>page</single>
|
||||
<multiple>pages</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>paragraph</single>
|
||||
<multiple>paragraph</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
|
||||
<!-- SHORT LOCATOR FORMS -->
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">no</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
|
||||
<!-- SYMBOL LOCATOR FORMS -->
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
|
||||
<!-- LONG ROLE FORMS -->
|
||||
<term name="editor">
|
||||
<single>editor</single>
|
||||
<multiple>editors</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>translator</single>
|
||||
<multiple>translators</multiple>
|
||||
</term>
|
||||
|
||||
<!-- SHORT ROLE FORMS -->
|
||||
<term name="editor" form="short">
|
||||
<single>ed</single>
|
||||
<multiple>eds</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>tran</single>
|
||||
<multiple>trans</multiple>
|
||||
</term>
|
||||
|
||||
<!-- VERB ROLE FORMS -->
|
||||
<term name="editor" form="verb">edited by</term>
|
||||
<term name="translator" form="verb">translated by</term>
|
||||
|
||||
<!-- SHORT VERB ROLE FORMS -->
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
|
||||
<!-- LONG MONTH FORMS -->
|
||||
<term name="month-01">January</term>
|
||||
<term name="month-02">February</term>
|
||||
<term name="month-03">March</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">May</term>
|
||||
<term name="month-06">June</term>
|
||||
<term name="month-07">July</term>
|
||||
<term name="month-08">August</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">October</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">December</term>
|
||||
|
||||
<!-- SHORT MONTH FORMS -->
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">May</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Oct</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dec</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-fr-FR.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-fr-FR.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="fr">
|
||||
<term name="at">at</term>
|
||||
<term name="in">dans</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">accédé</term>
|
||||
<term name="retrieved">retrouvé</term>
|
||||
<term name="from">de</term>
|
||||
<term name="forthcoming">à venir</term>
|
||||
<term name="references">Références</term>
|
||||
<term name="no date">pas de date</term>
|
||||
<term name="and">et</term>
|
||||
<term name="et-al">et coll.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>ligne</single>
|
||||
<multiple>lignes</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>page</single>
|
||||
<multiple>pages</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>paragraphe</single>
|
||||
<multiple>paragraphes</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">n°</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>éditeur</single>
|
||||
<multiple>éditeurs</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>traducteur</single>
|
||||
<multiple>traducteurs</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>éd</single>
|
||||
<multiple>éd</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>trad</single>
|
||||
<multiple>trad</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">édité par</term>
|
||||
<term name="translator" form="verb">traduit par</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">Janvier</term>
|
||||
<term name="month-02">Février</term>
|
||||
<term name="month-03">Mars</term>
|
||||
<term name="month-04">Avril</term>
|
||||
<term name="month-05">Mai</term>
|
||||
<term name="month-06">Juin</term>
|
||||
<term name="month-07">Juillet</term>
|
||||
<term name="month-08">Août</term>
|
||||
<term name="month-09">Septembre</term>
|
||||
<term name="month-10">Octobre</term>
|
||||
<term name="month-11">Novembre</term>
|
||||
<term name="month-12">Décembre</term>
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Fév</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Avr</term>
|
||||
<term name="month-05" form="short">Mai</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aoû</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Oct</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Déc</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-he-IL.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-he-IL.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="he">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">accessed</term>
|
||||
<term name="retrieved">retrieved</term>
|
||||
<term name="from">from</term>
|
||||
<term name="forthcoming">forthcoming</term>
|
||||
<term name="references">References</term>
|
||||
<term name="no date">nd</term>
|
||||
<term name="and">and</term>
|
||||
<term name="et-al">et al.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>line</single>
|
||||
<multiple>line</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>page</single>
|
||||
<multiple>pages</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>paragraph</single>
|
||||
<multiple>paragraph</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">no</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>editor</single>
|
||||
<multiple>editors</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>translator</single>
|
||||
<multiple>translators</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>ed</single>
|
||||
<multiple>eds</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>tran</single>
|
||||
<multiple>trans</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">edited by</term>
|
||||
<term name="translator" form="verb">translated by</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">January</term>
|
||||
<term name="month-02">February</term>
|
||||
<term name="month-03">March</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">May</term>
|
||||
<term name="month-06">June</term>
|
||||
<term name="month-07">July</term>
|
||||
<term name="month-08">August</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">October</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">December</term>
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">May</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Oct</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dec</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-hu-HU.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-hu-HU.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="hu">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">elérés</term>
|
||||
<term name="retrieved">elérés</term>
|
||||
<term name="from">forrás</term>
|
||||
<term name="forthcoming">megjelenés alatt</term>
|
||||
<term name="references">Hivatkozások</term>
|
||||
<term name="no date">nd</term>
|
||||
<term name="and">és</term>
|
||||
<term name="et-al">et al.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>sor</single>
|
||||
<multiple>sor</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>oldal</single>
|
||||
<multiple>oldal</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>bekezdés</single>
|
||||
<multiple>bekezdés</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">no</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>o</single>
|
||||
<multiple>o</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>szerkesztő</single>
|
||||
<multiple>szerkesztő</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>fordító</single>
|
||||
<multiple>fordító</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>szerk</single>
|
||||
<multiple>szerk</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>ford</single>
|
||||
<multiple>ford</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">szerkesztette</term>
|
||||
<term name="translator" form="verb">fordította</term>
|
||||
<term name="editor" form="verb-short">szerk</term>
|
||||
<term name="translator" form="verb-short">ford</term>
|
||||
<term name="month-01">január</term>
|
||||
<term name="month-02">február</term>
|
||||
<term name="month-03">március</term>
|
||||
<term name="month-04">április</term>
|
||||
<term name="month-05">május</term>
|
||||
<term name="month-06">június</term>
|
||||
<term name="month-07">július</term>
|
||||
<term name="month-08">augusztus</term>
|
||||
<term name="month-09">szeptember</term>
|
||||
<term name="month-10">október</term>
|
||||
<term name="month-11">november</term>
|
||||
<term name="month-12">december</term>
|
||||
<term name="month-01" form="short">jan</term>
|
||||
<term name="month-02" form="short">febr</term>
|
||||
<term name="month-03" form="short">márc</term>
|
||||
<term name="month-04" form="short">ápr</term>
|
||||
<term name="month-05" form="short">máj</term>
|
||||
<term name="month-06" form="short">jún</term>
|
||||
<term name="month-07" form="short">júl</term>
|
||||
<term name="month-08" form="short">aug</term>
|
||||
<term name="month-09" form="short">szept</term>
|
||||
<term name="month-10" form="short">okt</term>
|
||||
<term name="month-11" form="short">nov</term>
|
||||
<term name="month-12" form="short">dec</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-is-IS.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-is-IS.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="is">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">accessed</term>
|
||||
<term name="retrieved">retrieved</term>
|
||||
<term name="from">from</term>
|
||||
<term name="forthcoming">forthcoming</term>
|
||||
<term name="references">References</term>
|
||||
<term name="no date">nd</term>
|
||||
<term name="and">and</term>
|
||||
<term name="et-al">et al.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>line</single>
|
||||
<multiple>line</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>page</single>
|
||||
<multiple>pages</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>paragraph</single>
|
||||
<multiple>paragraph</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">no</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>editor</single>
|
||||
<multiple>editors</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>translator</single>
|
||||
<multiple>translators</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>ed</single>
|
||||
<multiple>eds</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>tran</single>
|
||||
<multiple>trans</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">edited by</term>
|
||||
<term name="translator" form="verb">translated by</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">January</term>
|
||||
<term name="month-02">February</term>
|
||||
<term name="month-03">March</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">May</term>
|
||||
<term name="month-06">June</term>
|
||||
<term name="month-07">July</term>
|
||||
<term name="month-08">August</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">October</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">December</term>
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">May</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Oct</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dec</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-it-IT.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-it-IT.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="it">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">consultato</term>
|
||||
<term name="retrieved">recuperato</term>
|
||||
<term name="from">da</term>
|
||||
<term name="forthcoming">futuro</term>
|
||||
<term name="references">Riferimenti</term>
|
||||
<term name="no date">S.d.</term>
|
||||
<term name="and">e</term>
|
||||
<term name="et-al">et al.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>riga</single>
|
||||
<multiple>righe</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>pagina</single>
|
||||
<multiple>pagine</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>paragrafo</single>
|
||||
<multiple>paragrafi</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">n°</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>pag.</single>
|
||||
<multiple>pagg.</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol.</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>curatore</single>
|
||||
<multiple>curatori</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>traduttore</single>
|
||||
<multiple>traduttori</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>cur.</single>
|
||||
<multiple>cur.</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>trad.</single>
|
||||
<multiple>trad.</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">a cura di</term>
|
||||
<term name="translator" form="verb">tradotto da</term>
|
||||
<term name="editor" form="verb-short">cur. da</term>
|
||||
<term name="translator" form="verb-short">trad. da</term>
|
||||
<term name="month-01">Gennaio</term>
|
||||
<term name="month-02">Febbraio</term>
|
||||
<term name="month-03">Marzo</term>
|
||||
<term name="month-04">Aprile</term>
|
||||
<term name="month-05">Maggio</term>
|
||||
<term name="month-06">Giugno</term>
|
||||
<term name="month-07">Luglio</term>
|
||||
<term name="month-08">Agosto</term>
|
||||
<term name="month-09">Settembre</term>
|
||||
<term name="month-10">Ottobre</term>
|
||||
<term name="month-11">Novembre</term>
|
||||
<term name="month-12">Dicembre</term>
|
||||
<term name="month-01" form="short">Gen</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">Mag</term>
|
||||
<term name="month-06" form="short">Giu</term>
|
||||
<term name="month-07" form="short">Lug</term>
|
||||
<term name="month-08" form="short">Ago</term>
|
||||
<term name="month-09" form="short">Set</term>
|
||||
<term name="month-10" form="short">Ott</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dic</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-ja-JP.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-ja-JP.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="ja">
|
||||
<term name="at">at</term>
|
||||
<term name="in"> </term>
|
||||
<term name="ibid">前掲</term>
|
||||
<term name="accessed">アクセス</term>
|
||||
<term name="retrieved">読み込み</term>
|
||||
<term name="from">から</term>
|
||||
<term name="forthcoming">近刊</term>
|
||||
<term name="references">参考文献</term>
|
||||
<term name="no date">日付なし</term>
|
||||
<term name="and">と</term>
|
||||
<term name="et-al">他</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>行</single>
|
||||
<multiple>行</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>ページ</single>
|
||||
<multiple>ページ</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>段落</single>
|
||||
<multiple>段落</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">号</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>p</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">巻</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>編集者</single>
|
||||
<multiple>編集者</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>翻訳者</single>
|
||||
<multiple>翻訳者</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>編集者</single>
|
||||
<multiple>編集者</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>翻訳者</single>
|
||||
<multiple>翻訳者</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">編集者:</term>
|
||||
<term name="translator" form="verb">翻訳者:</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">1月</term>
|
||||
<term name="month-02">2月</term>
|
||||
<term name="month-03">3月</term>
|
||||
<term name="month-04">4月</term>
|
||||
<term name="month-05">5月</term>
|
||||
<term name="month-06">6月</term>
|
||||
<term name="month-07">7月</term>
|
||||
<term name="month-08">8月</term>
|
||||
<term name="month-09">9月</term>
|
||||
<term name="month-10">10月</term>
|
||||
<term name="month-11">11月</term>
|
||||
<term name="month-12">12月</term>
|
||||
<term name="month-01" form="short">1月</term>
|
||||
<term name="month-02" form="short">2月</term>
|
||||
<term name="month-03" form="short">3月</term>
|
||||
<term name="month-04" form="short">4月</term>
|
||||
<term name="month-05" form="short">5月</term>
|
||||
<term name="month-06" form="short">6月</term>
|
||||
<term name="month-07" form="short">7月</term>
|
||||
<term name="month-08" form="short">8月</term>
|
||||
<term name="month-09" form="short">9月</term>
|
||||
<term name="month-10" form="short">10月</term>
|
||||
<term name="month-11" form="short">11月</term>
|
||||
<term name="month-12" form="short">12月</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-ko-KR.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-ko-KR.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="ko">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">접근된</term>
|
||||
<term name="retrieved">retrieved</term>
|
||||
<term name="from">(으)로부터</term>
|
||||
<term name="forthcoming">근간</term>
|
||||
<term name="references">참고 문헌</term>
|
||||
<term name="no date">일자 없음</term>
|
||||
<term name="and">와/과</term>
|
||||
<term name="et-al">기타</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>행</single>
|
||||
<multiple>행</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>페이지</single>
|
||||
<multiple>페이지</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>단락</single>
|
||||
<multiple>단락</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">호</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">권</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>편집자</single>
|
||||
<multiple>편집자</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>번역자</single>
|
||||
<multiple>번역자</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>편집자</single>
|
||||
<multiple>편집자</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>번역자</single>
|
||||
<multiple>번역자</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">편집자:</term>
|
||||
<term name="translator" form="verb">번역자:</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">1월</term>
|
||||
<term name="month-02">2월</term>
|
||||
<term name="month-03">3월</term>
|
||||
<term name="month-04">4월</term>
|
||||
<term name="month-05">5월</term>
|
||||
<term name="month-06">6월</term>
|
||||
<term name="month-07">7월</term>
|
||||
<term name="month-08">8월</term>
|
||||
<term name="month-09">9월</term>
|
||||
<term name="month-10">10월</term>
|
||||
<term name="month-11">11월</term>
|
||||
<term name="month-12">12월</term>
|
||||
<term name="month-01" form="short">1</term>
|
||||
<term name="month-02" form="short">2</term>
|
||||
<term name="month-03" form="short">3</term>
|
||||
<term name="month-04" form="short">4</term>
|
||||
<term name="month-05" form="short">5</term>
|
||||
<term name="month-06" form="short">6</term>
|
||||
<term name="month-07" form="short">7</term>
|
||||
<term name="month-08" form="short">8</term>
|
||||
<term name="month-09" form="short">9</term>
|
||||
<term name="month-10" form="short">10</term>
|
||||
<term name="month-11" form="short">11</term>
|
||||
<term name="month-12" form="short">12</term>
|
||||
</locale>
|
||||
</terms>
|
165
chrome/content/zotero/locale/csl/locales-mn-MN.xml
Normal file
165
chrome/content/zotero/locale/csl/locales-mn-MN.xml
Normal file
|
@ -0,0 +1,165 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="en">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">accessed</term>
|
||||
<term name="retrieved">retrieved</term>
|
||||
<term name="from">from</term>
|
||||
<term name="forthcoming">forthcoming</term>
|
||||
<term name="references">references</term>
|
||||
<term name="no date">n.d.</term>
|
||||
<term name="and">and</term>
|
||||
<term name="et-al">et al.</term>
|
||||
|
||||
<!-- LONG LOCATOR FORMS -->
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>line</single>
|
||||
<multiple>lines</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>page</single>
|
||||
<multiple>pages</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>paragraph</single>
|
||||
<multiple>paragraph</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
|
||||
<!-- SHORT LOCATOR FORMS -->
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">no</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
|
||||
<!-- SYMBOL LOCATOR FORMS -->
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
|
||||
<!-- LONG ROLE FORMS -->
|
||||
<term name="editor">
|
||||
<single>editor</single>
|
||||
<multiple>editors</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>translator</single>
|
||||
<multiple>translators</multiple>
|
||||
</term>
|
||||
|
||||
<!-- SHORT ROLE FORMS -->
|
||||
<term name="editor" form="short">
|
||||
<single>ed</single>
|
||||
<multiple>eds</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>tran</single>
|
||||
<multiple>trans</multiple>
|
||||
</term>
|
||||
|
||||
<!-- VERB ROLE FORMS -->
|
||||
<term name="editor" form="verb">edited by</term>
|
||||
<term name="translator" form="verb">translated by</term>
|
||||
|
||||
<!-- SHORT VERB ROLE FORMS -->
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
|
||||
<!-- LONG MONTH FORMS -->
|
||||
<term name="month-01">January</term>
|
||||
<term name="month-02">February</term>
|
||||
<term name="month-03">March</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">May</term>
|
||||
<term name="month-06">June</term>
|
||||
<term name="month-07">July</term>
|
||||
<term name="month-08">August</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">October</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">December</term>
|
||||
|
||||
<!-- SHORT MONTH FORMS -->
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">May</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Oct</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dec</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-nb-NO.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-nb-NO.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="nb">
|
||||
<term name="at">at</term>
|
||||
<term name="in">i</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">aksessert</term>
|
||||
<term name="retrieved">hentet</term>
|
||||
<term name="from">fra</term>
|
||||
<term name="forthcoming">kommende</term>
|
||||
<term name="references">Referanser</term>
|
||||
<term name="no date">udatert</term>
|
||||
<term name="and">og</term>
|
||||
<term name="et-al">et al.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>linje</single>
|
||||
<multiple>linje</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>side</single>
|
||||
<multiple>sider</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>avsnitt</single>
|
||||
<multiple>avsnitt</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">nr</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>s</single>
|
||||
<multiple>s</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>redaktør</single>
|
||||
<multiple>redaktører</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>oversetter</single>
|
||||
<multiple>oversettere</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>red</single>
|
||||
<multiple>red</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>overs</single>
|
||||
<multiple>overs</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">redigert av</term>
|
||||
<term name="translator" form="verb">oversatt av</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">Januar</term>
|
||||
<term name="month-02">Februar</term>
|
||||
<term name="month-03">Mars</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">Mai</term>
|
||||
<term name="month-06">Juni</term>
|
||||
<term name="month-07">Juli</term>
|
||||
<term name="month-08">August</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">Oktober</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">Desember</term>
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">Mai</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Okt</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Des</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-nl-NL.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-nl-NL.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="nl">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">bezocht</term>
|
||||
<term name="retrieved">verkregen</term>
|
||||
<term name="from">van</term>
|
||||
<term name="forthcoming">in voorbereiding</term>
|
||||
<term name="references">Referenties</term>
|
||||
<term name="no date">n.d.</term>
|
||||
<term name="and">en</term>
|
||||
<term name="et-al">en anderen</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>regel</single>
|
||||
<multiple>regel</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>pagina</single>
|
||||
<multiple>pagina's</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>paragraaf</single>
|
||||
<multiple>paragrafen</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">nr</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>editor</single>
|
||||
<multiple>editors</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>vertaler</single>
|
||||
<multiple>vertalers</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>ed</single>
|
||||
<multiple>ed</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>vert</single>
|
||||
<multiple>vert</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">bewerkt door</term>
|
||||
<term name="translator" form="verb">vertaald door</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">Januari</term>
|
||||
<term name="month-02">Februari</term>
|
||||
<term name="month-03">Maart</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">Mei</term>
|
||||
<term name="month-06">Juni</term>
|
||||
<term name="month-07">Juli</term>
|
||||
<term name="month-08">Augustus</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">Oktober</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">December</term>
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Maa</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">Mei</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Okt</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dec</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-pl-PL.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-pl-PL.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="pl">
|
||||
<term name="at">at</term>
|
||||
<term name="in">[w:]</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">udostępniono</term>
|
||||
<term name="retrieved">pobrano</term>
|
||||
<term name="from">z</term>
|
||||
<term name="forthcoming">w druku</term>
|
||||
<term name="references">Referencje</term>
|
||||
<term name="no date">bez daty</term>
|
||||
<term name="and">i</term>
|
||||
<term name="et-al">et al.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>wers</single>
|
||||
<multiple>wersy</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>strona</single>
|
||||
<multiple>strony</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>akapit</single>
|
||||
<multiple>akapity</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">nr</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>s.</single>
|
||||
<multiple>s.</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">tom</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>redaktor</single>
|
||||
<multiple>redaktorzy</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>tłumacz</single>
|
||||
<multiple>tłumacze</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>red.</single>
|
||||
<multiple>red.</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>tłum.</single>
|
||||
<multiple>tłum.</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">zredagowane przez</term>
|
||||
<term name="translator" form="verb">przetłumaczone przez</term>
|
||||
<term name="editor" form="verb-short">red</term>
|
||||
<term name="translator" form="verb-short">tłum.</term>
|
||||
<term name="month-01">styczeń</term>
|
||||
<term name="month-02">luty</term>
|
||||
<term name="month-03">marzec</term>
|
||||
<term name="month-04">kwiecień</term>
|
||||
<term name="month-05">maj</term>
|
||||
<term name="month-06">czerwiec</term>
|
||||
<term name="month-07">lipiec</term>
|
||||
<term name="month-08">sierpień</term>
|
||||
<term name="month-09">wrzesień</term>
|
||||
<term name="month-10">październik</term>
|
||||
<term name="month-11">listopad</term>
|
||||
<term name="month-12">grudzień</term>
|
||||
<term name="month-01" form="short">styczeń</term>
|
||||
<term name="month-02" form="short">luty</term>
|
||||
<term name="month-03" form="short">marzec</term>
|
||||
<term name="month-04" form="short">kwiecień</term>
|
||||
<term name="month-05" form="short">maj</term>
|
||||
<term name="month-06" form="short">czerwiec</term>
|
||||
<term name="month-07" form="short">lipiec</term>
|
||||
<term name="month-08" form="short">sierpień</term>
|
||||
<term name="month-09" form="short">wrzesień</term>
|
||||
<term name="month-10" form="short">październik</term>
|
||||
<term name="month-11" form="short">listopad</term>
|
||||
<term name="month-12" form="short">grudzień</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-pt-BR.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-pt-BR.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="pt">
|
||||
<term name="at">at</term>
|
||||
<term name="in">em</term>
|
||||
<term name="ibid">ibidem</term>
|
||||
<term name="accessed">acessado</term>
|
||||
<term name="retrieved">restaurado</term>
|
||||
<term name="from">de</term>
|
||||
<term name="forthcoming">sugerido</term>
|
||||
<term name="references">Referências</term>
|
||||
<term name="no date">sd</term>
|
||||
<term name="and">e</term>
|
||||
<term name="et-al">et al.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>linha</single>
|
||||
<multiple>linhas</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>página</single>
|
||||
<multiple>páginas</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>parágrafo</single>
|
||||
<multiple>parágrafos</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">no</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>editor</single>
|
||||
<multiple>editores</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>tradutor</single>
|
||||
<multiple>tradutores</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>ed</single>
|
||||
<multiple>eds</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>tran</single>
|
||||
<multiple>trans</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">editado por</term>
|
||||
<term name="translator" form="verb">traduzido por</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">Janeiro</term>
|
||||
<term name="month-02">Fevereiro</term>
|
||||
<term name="month-03">Março</term>
|
||||
<term name="month-04">Abril</term>
|
||||
<term name="month-05">Maio</term>
|
||||
<term name="month-06">Junho</term>
|
||||
<term name="month-07">Julho</term>
|
||||
<term name="month-08">Agosto</term>
|
||||
<term name="month-09">Setembro</term>
|
||||
<term name="month-10">Outubro</term>
|
||||
<term name="month-11">Novembro</term>
|
||||
<term name="month-12">Dezembro</term>
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Fev</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Abr</term>
|
||||
<term name="month-05" form="short">Mai</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Ago</term>
|
||||
<term name="month-09" form="short">Set</term>
|
||||
<term name="month-10" form="short">Out</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dez</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-pt-PT.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-pt-PT.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="pt">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">accessed</term>
|
||||
<term name="retrieved">retrieved</term>
|
||||
<term name="from">from</term>
|
||||
<term name="forthcoming">forthcoming</term>
|
||||
<term name="references">References</term>
|
||||
<term name="no date">nd</term>
|
||||
<term name="and">and</term>
|
||||
<term name="et-al">et al.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>line</single>
|
||||
<multiple>line</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>page</single>
|
||||
<multiple>pages</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>paragraph</single>
|
||||
<multiple>paragraph</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">no</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>editor</single>
|
||||
<multiple>editors</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>translator</single>
|
||||
<multiple>translators</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>ed</single>
|
||||
<multiple>eds</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>tran</single>
|
||||
<multiple>trans</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">edited by</term>
|
||||
<term name="translator" form="verb">translated by</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">January</term>
|
||||
<term name="month-02">February</term>
|
||||
<term name="month-03">March</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">May</term>
|
||||
<term name="month-06">June</term>
|
||||
<term name="month-07">July</term>
|
||||
<term name="month-08">August</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">October</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">December</term>
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">May</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Oct</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dec</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-ro-RO.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-ro-RO.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="ro">
|
||||
<term name="at">at</term>
|
||||
<term name="in">în</term>
|
||||
<term name="ibid">ibidem</term>
|
||||
<term name="accessed">accesat în</term>
|
||||
<term name="retrieved">preluat în</term>
|
||||
<term name="from">din</term>
|
||||
<term name="forthcoming">în curs de apariţie</term>
|
||||
<term name="references">Bibliografie</term>
|
||||
<term name="no date">f.a.</term>
|
||||
<term name="and">şi</term>
|
||||
<term name="et-al">ş.a.</term>
|
||||
<term name="book">
|
||||
<single>carte</single>
|
||||
<multiple>cărţi</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>capitol</single>
|
||||
<multiple>capitole</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>coloană</single>
|
||||
<multiple>coloane</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figură</single>
|
||||
<multiple>figuri</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>număr</single>
|
||||
<multiple>numere</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>linie</single>
|
||||
<multiple>linii</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>notă</single>
|
||||
<multiple>note</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>operă</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>pagină</single>
|
||||
<multiple>pagini</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>paragraf</single>
|
||||
<multiple>paragrafe</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>parte</single>
|
||||
<multiple>părţi</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>secţiune</single>
|
||||
<multiple>secţiuni</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volum</single>
|
||||
<multiple>volume</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verset</single>
|
||||
<multiple>versete</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">car</term>
|
||||
<term name="chapter" form="short">cap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">nr</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>editor</single>
|
||||
<multiple>editors</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>translator</single>
|
||||
<multiple>translators</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>ed</single>
|
||||
<multiple>eds</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>tran</single>
|
||||
<multiple>trans</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">edited by</term>
|
||||
<term name="translator" form="verb">translated by</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">January</term>
|
||||
<term name="month-02">February</term>
|
||||
<term name="month-03">March</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">May</term>
|
||||
<term name="month-06">June</term>
|
||||
<term name="month-07">July</term>
|
||||
<term name="month-08">August</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">October</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">December</term>
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">May</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Oct</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dec</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-ru-RU.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-ru-RU.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="ru">
|
||||
<term name="at">at</term>
|
||||
<term name="in">в</term>
|
||||
<term name="ibid">так же</term>
|
||||
<term name="accessed">вызвано</term>
|
||||
<term name="retrieved">извлечено</term>
|
||||
<term name="from">от</term>
|
||||
<term name="forthcoming">грядущие</term>
|
||||
<term name="references">Ссылки</term>
|
||||
<term name="no date">нет даты</term>
|
||||
<term name="and">и</term>
|
||||
<term name="et-al">и др.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>линия</single>
|
||||
<multiple>линии</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>страницы</single>
|
||||
<multiple>страницы</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>параграф</single>
|
||||
<multiple>параграфы</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">ном</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>стр-а</single>
|
||||
<multiple>стр-ы</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">том</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>редактор</single>
|
||||
<multiple>редакторы</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>переводчик</single>
|
||||
<multiple>переводчики</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>ред-р</single>
|
||||
<multiple>ред-ры</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>перев-к</single>
|
||||
<multiple>перев-и</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">отредактировано</term>
|
||||
<term name="translator" form="verb">переведено</term>
|
||||
<term name="editor" form="verb-short">ред</term>
|
||||
<term name="translator" form="verb-short">перев</term>
|
||||
<term name="month-01">Январь</term>
|
||||
<term name="month-02">Февраль</term>
|
||||
<term name="month-03">Март</term>
|
||||
<term name="month-04">Апрель</term>
|
||||
<term name="month-05">Май</term>
|
||||
<term name="month-06">Июнь</term>
|
||||
<term name="month-07">Июль</term>
|
||||
<term name="month-08">Август</term>
|
||||
<term name="month-09">Сентябрь</term>
|
||||
<term name="month-10">Октябрь</term>
|
||||
<term name="month-11">Ноябрь</term>
|
||||
<term name="month-12">Декабрь</term>
|
||||
<term name="month-01" form="short">Янв</term>
|
||||
<term name="month-02" form="short">Фев</term>
|
||||
<term name="month-03" form="short">Мар</term>
|
||||
<term name="month-04" form="short">Апр</term>
|
||||
<term name="month-05" form="short">Май</term>
|
||||
<term name="month-06" form="short">Июн</term>
|
||||
<term name="month-07" form="short">Июл</term>
|
||||
<term name="month-08" form="short">Авг</term>
|
||||
<term name="month-09" form="short">Сен</term>
|
||||
<term name="month-10" form="short">Окт</term>
|
||||
<term name="month-11" form="short">Ноя</term>
|
||||
<term name="month-12" form="short">Дек</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-sr-YU.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-sr-YU.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="sr">
|
||||
<term name="at">at</term>
|
||||
<term name="in">у</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">приступљено</term>
|
||||
<term name="retrieved">обновљено</term>
|
||||
<term name="from">од</term>
|
||||
<term name="forthcoming">долазећи</term>
|
||||
<term name="references">Референце</term>
|
||||
<term name="no date">без датума</term>
|
||||
<term name="and">и</term>
|
||||
<term name="et-al">и остали</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>линија</single>
|
||||
<multiple>линије(а)</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>страница</single>
|
||||
<multiple>странице(а)</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>параграф</single>
|
||||
<multiple>параграфа(и)</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">изд.</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>стр.</single>
|
||||
<multiple>стр.</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">том</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>уредник</single>
|
||||
<multiple>уредици</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>преводилац</single>
|
||||
<multiple>преводиоци</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>Ур.</single>
|
||||
<multiple>Ур.</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>прев.</single>
|
||||
<multiple>прев.</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">уредио</term>
|
||||
<term name="translator" form="verb">превео</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">Јануар</term>
|
||||
<term name="month-02">Фебруар</term>
|
||||
<term name="month-03">Март</term>
|
||||
<term name="month-04">Април</term>
|
||||
<term name="month-05">Мај</term>
|
||||
<term name="month-06">Јуни</term>
|
||||
<term name="month-07">Јули</term>
|
||||
<term name="month-08">Август</term>
|
||||
<term name="month-09">Септембар</term>
|
||||
<term name="month-10">Октобар</term>
|
||||
<term name="month-11">Новембар</term>
|
||||
<term name="month-12">Децембар</term>
|
||||
<term name="month-01" form="short">Јан.</term>
|
||||
<term name="month-02" form="short">Феб.</term>
|
||||
<term name="month-03" form="short">Март</term>
|
||||
<term name="month-04" form="short">Апр.</term>
|
||||
<term name="month-05" form="short">Мај</term>
|
||||
<term name="month-06" form="short">Јуни</term>
|
||||
<term name="month-07" form="short">Јули</term>
|
||||
<term name="month-08" form="short">Ауг.</term>
|
||||
<term name="month-09" form="short">Сеп.</term>
|
||||
<term name="month-10" form="short">Окт.</term>
|
||||
<term name="month-11" form="short">Нов.</term>
|
||||
<term name="month-12" form="short">Дец.</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-sv-SE.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-sv-SE.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="sv">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">accessed</term>
|
||||
<term name="retrieved">retrieved</term>
|
||||
<term name="from">from</term>
|
||||
<term name="forthcoming">forthcoming</term>
|
||||
<term name="references">References</term>
|
||||
<term name="no date">nd</term>
|
||||
<term name="and">and</term>
|
||||
<term name="et-al">et al.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>line</single>
|
||||
<multiple>line</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>page</single>
|
||||
<multiple>pages</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>paragraph</single>
|
||||
<multiple>paragraph</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">no</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>editor</single>
|
||||
<multiple>editors</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>translator</single>
|
||||
<multiple>translators</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>ed</single>
|
||||
<multiple>eds</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>tran</single>
|
||||
<multiple>trans</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">edited by</term>
|
||||
<term name="translator" form="verb">translated by</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">January</term>
|
||||
<term name="month-02">February</term>
|
||||
<term name="month-03">March</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">May</term>
|
||||
<term name="month-06">June</term>
|
||||
<term name="month-07">July</term>
|
||||
<term name="month-08">August</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">October</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">December</term>
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">May</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Oct</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dec</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-tr-TR.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-tr-TR.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="tr">
|
||||
<term name="at">at</term>
|
||||
<term name="in">içinde</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">erişildi</term>
|
||||
<term name="retrieved">erişildi</term>
|
||||
<term name="from">den</term>
|
||||
<term name="forthcoming">gelecek</term>
|
||||
<term name="references">referans</term>
|
||||
<term name="no date">tarih yok</term>
|
||||
<term name="and">ve</term>
|
||||
<term name="et-al">ve diğ.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>satır</single>
|
||||
<multiple>satır</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>sayfa</single>
|
||||
<multiple>sayfalar</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>paragraf</single>
|
||||
<multiple>paragraf</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">sayı</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">cilt</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>editör</single>
|
||||
<multiple>editörler</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>çevirmen</single>
|
||||
<multiple>çevirmenler</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>ed</single>
|
||||
<multiple>ed</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>çev</single>
|
||||
<multiple>çev</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">editör</term>
|
||||
<term name="translator" form="verb">çeviren</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">çev</term>
|
||||
<term name="month-01">Ocak</term>
|
||||
<term name="month-02">Şubat</term>
|
||||
<term name="month-03">Mart</term>
|
||||
<term name="month-04">Nisan</term>
|
||||
<term name="month-05">Mayıs</term>
|
||||
<term name="month-06">Haziran</term>
|
||||
<term name="month-07">Temmuz</term>
|
||||
<term name="month-08">Ağustos</term>
|
||||
<term name="month-09">Eylül</term>
|
||||
<term name="month-10">Ekim</term>
|
||||
<term name="month-11">Kasım</term>
|
||||
<term name="month-12">Aralık</term>
|
||||
<term name="month-01" form="short">Oca</term>
|
||||
<term name="month-02" form="short">Şub</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Nis</term>
|
||||
<term name="month-05" form="short">May</term>
|
||||
<term name="month-06" form="short">Haz</term>
|
||||
<term name="month-07" form="short">Tem</term>
|
||||
<term name="month-08" form="short">Ağu</term>
|
||||
<term name="month-09" form="short">Eyl</term>
|
||||
<term name="month-10" form="short">Eki</term>
|
||||
<term name="month-11" form="short">Kas</term>
|
||||
<term name="month-12" form="short">Ara</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-zh-CN.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-zh-CN.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="zh">
|
||||
<term name="at">at</term>
|
||||
<term name="in">in</term>
|
||||
<term name="ibid">ibid</term>
|
||||
<term name="accessed">accessed</term>
|
||||
<term name="retrieved">retrieved</term>
|
||||
<term name="from">from</term>
|
||||
<term name="forthcoming">forthcoming</term>
|
||||
<term name="references">References</term>
|
||||
<term name="no date">nd</term>
|
||||
<term name="and">and</term>
|
||||
<term name="et-al">et al.</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>line</single>
|
||||
<multiple>line</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>page</single>
|
||||
<multiple>pages</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>paragraph</single>
|
||||
<multiple>paragraph</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">no</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>p</single>
|
||||
<multiple>pp</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">vol</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>editor</single>
|
||||
<multiple>editors</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>translator</single>
|
||||
<multiple>translators</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>ed</single>
|
||||
<multiple>eds</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>tran</single>
|
||||
<multiple>trans</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">edited by</term>
|
||||
<term name="translator" form="verb">translated by</term>
|
||||
<term name="editor" form="verb-short">ed</term>
|
||||
<term name="translator" form="verb-short">trans</term>
|
||||
<term name="month-01">January</term>
|
||||
<term name="month-02">February</term>
|
||||
<term name="month-03">March</term>
|
||||
<term name="month-04">April</term>
|
||||
<term name="month-05">May</term>
|
||||
<term name="month-06">June</term>
|
||||
<term name="month-07">July</term>
|
||||
<term name="month-08">August</term>
|
||||
<term name="month-09">September</term>
|
||||
<term name="month-10">October</term>
|
||||
<term name="month-11">November</term>
|
||||
<term name="month-12">December</term>
|
||||
<term name="month-01" form="short">Jan</term>
|
||||
<term name="month-02" form="short">Feb</term>
|
||||
<term name="month-03" form="short">Mar</term>
|
||||
<term name="month-04" form="short">Apr</term>
|
||||
<term name="month-05" form="short">May</term>
|
||||
<term name="month-06" form="short">Jun</term>
|
||||
<term name="month-07" form="short">Jul</term>
|
||||
<term name="month-08" form="short">Aug</term>
|
||||
<term name="month-09" form="short">Sep</term>
|
||||
<term name="month-10" form="short">Oct</term>
|
||||
<term name="month-11" form="short">Nov</term>
|
||||
<term name="month-12" form="short">Dec</term>
|
||||
</locale>
|
||||
</terms>
|
147
chrome/content/zotero/locale/csl/locales-zh-TW.xml
Normal file
147
chrome/content/zotero/locale/csl/locales-zh-TW.xml
Normal file
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<terms xmlns="http://purl.org/net/xbiblio/csl">
|
||||
<locale xml:lang="zh">
|
||||
<term name="at">at</term>
|
||||
<term name="in">在</term>
|
||||
<term name="ibid">同上出處</term>
|
||||
<term name="accessed">被取用</term>
|
||||
<term name="retrieved">被取回</term>
|
||||
<term name="from">從</term>
|
||||
<term name="forthcoming">將來的</term>
|
||||
<term name="references">參考資料</term>
|
||||
<term name="no date">無日期</term>
|
||||
<term name="and">及</term>
|
||||
<term name="et-al">等人</term>
|
||||
<term name="book">
|
||||
<single>book</single>
|
||||
<multiple>books</multiple>
|
||||
</term>
|
||||
<term name="chapter">
|
||||
<single>chapter</single>
|
||||
<multiple>chapters</multiple>
|
||||
</term>
|
||||
<term name="column">
|
||||
<single>column</single>
|
||||
<multiple>columns</multiple>
|
||||
</term>
|
||||
<term name="figure">
|
||||
<single>figure</single>
|
||||
<multiple>figures</multiple>
|
||||
</term>
|
||||
<term name="folio">
|
||||
<single>folio</single>
|
||||
<multiple>folios</multiple>
|
||||
</term>
|
||||
<term name="issue">
|
||||
<single>number</single>
|
||||
<multiple>numbers</multiple>
|
||||
</term>
|
||||
<term name="line">
|
||||
<single>行</single>
|
||||
<multiple>行</multiple>
|
||||
</term>
|
||||
<term name="note">
|
||||
<single>note</single>
|
||||
<multiple>notes</multiple>
|
||||
</term>
|
||||
<term name="opus">
|
||||
<single>opus</single>
|
||||
<multiple>opera</multiple>
|
||||
</term>
|
||||
<term name="page">
|
||||
<single>頁</single>
|
||||
<multiple>頁</multiple>
|
||||
</term>
|
||||
<term name="paragraph">
|
||||
<single>段落</single>
|
||||
<multiple>段落</multiple>
|
||||
</term>
|
||||
<term name="part">
|
||||
<single>part</single>
|
||||
<multiple>parts</multiple>
|
||||
</term>
|
||||
<term name="section">
|
||||
<single>section</single>
|
||||
<multiple>sections</multiple>
|
||||
</term>
|
||||
<term name="volume">
|
||||
<single>volume</single>
|
||||
<multiple>volumes</multiple>
|
||||
</term>
|
||||
<term name="verse">
|
||||
<single>verse</single>
|
||||
<multiple>verses</multiple>
|
||||
</term>
|
||||
<term name="book" form="short">bk</term>
|
||||
<term name="chapter" form="short">chap</term>
|
||||
<term name="column" form="short">col</term>
|
||||
<term name="figure" form="short">fig</term>
|
||||
<term name="folio" form="short">f</term>
|
||||
<term name="issue" form="short">期</term>
|
||||
<term name="opus" form="short">op</term>
|
||||
<term name="page" form="short">
|
||||
<single>頁</single>
|
||||
<multiple>頁</multiple>
|
||||
</term>
|
||||
<term name="paragraph" form="short">para</term>
|
||||
<term name="part" form="short">pt</term>
|
||||
<term name="section" form="short">sec</term>
|
||||
<term name="verse" form="short">
|
||||
<single>v</single>
|
||||
<multiple>vv</multiple>
|
||||
</term>
|
||||
<term name="volume" form="short">卷</term>
|
||||
<term name="paragraph" form="symbol">
|
||||
<single>¶</single>
|
||||
<multiple>¶¶</multiple>
|
||||
</term>
|
||||
<term name="section" form="symbol">
|
||||
<single>§</single>
|
||||
<multiple>§§</multiple>
|
||||
</term>
|
||||
<term name="editor">
|
||||
<single>編輯</single>
|
||||
<multiple>編輯</multiple>
|
||||
</term>
|
||||
<term name="translator">
|
||||
<single>翻譯</single>
|
||||
<multiple>翻譯</multiple>
|
||||
</term>
|
||||
<term name="editor" form="short">
|
||||
<single>編</single>
|
||||
<multiple>編</multiple>
|
||||
</term>
|
||||
<term name="translator" form="short">
|
||||
<single>譯</single>
|
||||
<multiple>譯</multiple>
|
||||
</term>
|
||||
<term name="editor" form="verb">編者是</term>
|
||||
<term name="translator" form="verb">譯者是</term>
|
||||
<term name="editor" form="verb-short">編</term>
|
||||
<term name="translator" form="verb-short">譯</term>
|
||||
<term name="month-01">一月</term>
|
||||
<term name="month-02">二月</term>
|
||||
<term name="month-03">三月</term>
|
||||
<term name="month-04">四月</term>
|
||||
<term name="month-05">五月</term>
|
||||
<term name="month-06">六月</term>
|
||||
<term name="month-07">七月</term>
|
||||
<term name="month-08">八月</term>
|
||||
<term name="month-09">九月</term>
|
||||
<term name="month-10">十月</term>
|
||||
<term name="month-11">十一月</term>
|
||||
<term name="month-12">十二月</term>
|
||||
<term name="month-01" form="short">1月</term>
|
||||
<term name="month-02" form="short">2月</term>
|
||||
<term name="month-03" form="short">3月</term>
|
||||
<term name="month-04" form="short">4月</term>
|
||||
<term name="month-05" form="short">5月</term>
|
||||
<term name="month-06" form="short">6月</term>
|
||||
<term name="month-07" form="short">7月</term>
|
||||
<term name="month-08" form="short">8月</term>
|
||||
<term name="month-09" form="short">9月</term>
|
||||
<term name="month-10" form="short">10月</term>
|
||||
<term name="month-11" form="short">11月</term>
|
||||
<term name="month-12" form="short">12月</term>
|
||||
</locale>
|
||||
</terms>
|
|
@ -28,6 +28,9 @@ function onLoad()
|
|||
noteEditor = document.getElementById('note-editor');
|
||||
noteEditor.focus();
|
||||
|
||||
// Set font size from pref
|
||||
Zotero.setFontSize(noteEditor);
|
||||
|
||||
var params = new Array();
|
||||
var b = document.location.href.substr(document.location.href.indexOf('?')+1).split('&');
|
||||
for(var i = 0; i < b.length; i++)
|
||||
|
@ -36,31 +39,26 @@ function onLoad()
|
|||
|
||||
params[b[i].substr(0,mid)] = b[i].substr(mid+1);
|
||||
}
|
||||
var id = params['id'];
|
||||
var itemID = params['id'];
|
||||
var collectionID = params['coll'];
|
||||
var parentItemID = params['p'];
|
||||
|
||||
if(id && id != '' && id != 'undefined')
|
||||
{
|
||||
var ref = Zotero.Items.get(id);
|
||||
if(ref.isNote())
|
||||
{
|
||||
noteEditor.note = ref;
|
||||
document.title = "Edit Note";
|
||||
}
|
||||
else
|
||||
{
|
||||
noteEditor.item = ref;
|
||||
document.title = "Add Note";
|
||||
}
|
||||
if (itemID) {
|
||||
var ref = Zotero.Items.get(itemID);
|
||||
noteEditor.note = ref;
|
||||
document.title = ref.getNoteTitle();
|
||||
}
|
||||
else if (parentItemID) {
|
||||
var ref = Zotero.Items.get(parentItemID);
|
||||
noteEditor.item = ref;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.title = "Add Note";
|
||||
if(collectionID && collectionID != '' && collectionID != 'undefined')
|
||||
noteEditor.collection = Zotero.Collections.get(collectionID);
|
||||
}
|
||||
|
||||
notifierUnregisterID = Zotero.Notifier.registerItemObserver(NotifyCallback);
|
||||
notifierUnregisterID = Zotero.Notifier.registerObserver(NotifyCallback, 'item');
|
||||
}
|
||||
|
||||
function onUnload()
|
||||
|
@ -68,13 +66,17 @@ function onUnload()
|
|||
if(noteEditor && noteEditor.value)
|
||||
noteEditor.save();
|
||||
|
||||
Zotero.Notifier.unregisterItemObserver(notifierUnregisterID);
|
||||
Zotero.Notifier.unregisterObserver(notifierUnregisterID);
|
||||
}
|
||||
|
||||
var NotifyCallback = {
|
||||
notify: function(){
|
||||
notify: function(action, type, ids){
|
||||
// DEBUG: why does this reset without checking the modified ids?
|
||||
if (noteEditor.note){
|
||||
noteEditor.note = noteEditor.note;
|
||||
document.title = noteEditor.note.getNoteTitle();
|
||||
// Update the window name (used for focusing) in case this is a new note
|
||||
window.name = 'zotero-note-' + noteEditor.note.getID();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,11 +2,15 @@
|
|||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
|
||||
<window
|
||||
id="zotero-note-window"
|
||||
orient="vertical"
|
||||
width="400"
|
||||
height="250"
|
||||
title="&zotero.items.menu.attach.note;"
|
||||
persist="screenX screenY width height"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script src="include.js"/>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -21,7 +21,11 @@
|
|||
***** END LICENSE BLOCK *****
|
||||
-->
|
||||
<?xml-stylesheet href="chrome://zotero/skin/overlay.css" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
|
||||
<!DOCTYPE overlay [
|
||||
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd"> %globalDTD;
|
||||
<!ENTITY % zoteroDTD SYSTEM "chrome://zotero/locale/zotero.dtd"> %zoteroDTD;
|
||||
]>
|
||||
|
||||
<overlay id="zotero"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
@ -32,178 +36,268 @@
|
|||
|
||||
<script src="overlay.js"/>
|
||||
<script src="fileInterface.js"/>
|
||||
<script src="reportInterface.js"/>
|
||||
<script src="timelineInterface.js"/>
|
||||
<script src="browser.js"/>
|
||||
<script src="chrome://global/content/nsDragAndDrop.js"/>
|
||||
<script src="chrome://global/content/nsTransferable.js"/>
|
||||
|
||||
<commandset id="mainCommandSet">
|
||||
<command id="cmd_zotero_newItem" oncommand="ZoteroPane.newItem(2);"/>
|
||||
<command id="cmd_zotero_newCollection" oncommand="ZoteroPane.newCollection();"/>
|
||||
<command id="cmd_zotero_search" oncommand="ZoteroPane.search();"/>
|
||||
<command id="cmd_zotero_reportErrors" oncommand="ZoteroPane.reportErrors();"/>
|
||||
</commandset>
|
||||
|
||||
<toolbarpalette id="BrowserToolbarPalette">
|
||||
<toolbarbutton id="scholar-toolbar-button"/> <!-- May be necessary to keep pre-1.0b2 installs from breaking -->
|
||||
<toolbarbutton id="zotero-toolbar-button" class="toolbarbutton-1"
|
||||
label="&zotero.name;"
|
||||
label="Zotero"
|
||||
oncommand="ZoteroPane.toggleDisplay();"/>
|
||||
</toolbarpalette>
|
||||
|
||||
<popup id="contentAreaContextMenu">
|
||||
<menuseparator id="zotero-context-separator" hidden="true"/>
|
||||
<menuitem id="zotero-context-add-to-current-note" class="menu-iconic"
|
||||
label="&zotero.contextMenu.addTextToCurrentNote;" hidden="true"
|
||||
oncommand="ZoteroPane.addTextToNote(window.content.getSelection().toString())"/>
|
||||
<menuitem id="zotero-context-add-to-new-note" class="menu-iconic"
|
||||
label="&zotero.contextMenu.addTextToNewNote;" hidden="true"
|
||||
oncommand="var itemID = ZoteroPane.addItemFromPage(); ZoteroPane.newNote(false, itemID, window.content.getSelection().toString())"/>
|
||||
<menuitem id="zotero-context-save-link-as-snapshot" class="menu-iconic"
|
||||
label="&zotero.contextMenu.saveLinkAsSnapshot;" hidden="true"
|
||||
oncommand="Zotero.Attachments.importFromURL(window.gContextMenu.linkURL, false, false, false, ZoteroPane.getSelectedCollection(true))"/>
|
||||
<menuitem id="zotero-context-save-image-as-snapshot" class="menu-iconic"
|
||||
label="&zotero.contextMenu.saveImageAsSnapshot;" hidden="true"
|
||||
oncommand="Zotero.Attachments.importFromURL(window.gContextMenu.onImage ? window.gContextMenu.imageURL : window.gContextMenu.bgImageURL, false, false, false, ZoteroPane.getSelectedCollection(true))"/>
|
||||
</popup>
|
||||
|
||||
<vbox id="appcontent">
|
||||
<!-- Changes to attributes of zotero-splitter and zotero-pane must be mirrored on overlay.js's onLoad() function -->
|
||||
<splitter id="zotero-splitter" resizebefore="closest" resizeafter="closest" collapsed="true"/>
|
||||
<hbox id="zotero-pane" persist="height" collapsed="true" flex="1">
|
||||
<!-- onmouseup shouldn't be necessary but seems to help prevent tag selector from sometimes going off the screen -->
|
||||
<splitter id="zotero-splitter" resizebefore="closest" resizeafter="closest" hidden="true"
|
||||
onmouseup="ZoteroPane.updateTagSelectorSize()"/>
|
||||
<hbox id="zotero-pane" persist="savedHeight" hidden="true"
|
||||
onkeydown="ZoteroPane.handleKeyDown(event, this.id)"
|
||||
onkeyup="ZoteroPane.handleKeyUp(event, this.id)"
|
||||
chromedir="&locale.dir;">
|
||||
<popupset>
|
||||
<popup id="zotero-collectionmenu" onpopupshowing="ZoteroPane.buildCollectionContextMenu();">
|
||||
<menuitem label="&toolbar.newCollection.label;" command="cmd_zotero_newCollection"/>
|
||||
<menuitem label="&toolbar.newSavedSearch.label;" oncommand="ZoteroPane.newSearch()"/>
|
||||
<menuitem label="&zotero.toolbar.newCollection.label;" oncommand="ZoteroPane.newCollection()"/>
|
||||
<menuitem label="&zotero.toolbar.newSavedSearch.label;" oncommand="ZoteroPane.newSearch()"/>
|
||||
<menuitem label="&zotero.toolbar.newSubcollection.label;" oncommand="ZoteroPane.newCollection(ZoteroPane.getSelectedCollection().getID())"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&toolbar.renameCollection.label;" oncommand="ZoteroPane.editSelectedCollection();"/>
|
||||
<menuitem label="&toolbar.renameSavedSearch.label;" oncommand="ZoteroPane.editSelectedCollection()"/>
|
||||
<menuitem label="&toolbar.removeCollection.label;" oncommand="ZoteroPane.deleteSelectedCollection();"/>
|
||||
<menuitem label="&toolbar.removeSavedSearch.label;" oncommand="ZoteroPane.deleteSelectedCollection()"/>
|
||||
<menuitem oncommand="ZoteroPane.editSelectedCollection();"/>
|
||||
<menuitem oncommand="ZoteroPane.deleteSelectedCollection();"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&toolbar.exportCollection.label;" oncommand="Zotero_File_Interface.exportCollection();"/>
|
||||
<menuitem label="&toolbar.exportSavedSearch.label;" oncommand="Zotero_File_Interface.exportCollection()"/>
|
||||
<menuitem label="&toolbar.createBibCollection.label;" oncommand="Zotero_File_Interface.bibliographyFromCollection();"/>
|
||||
<menuitem label="&toolbar.createBibSavedSearch.label;" oncommand="Zotero_File_Interface.bibliographyFromCollection()"/>
|
||||
<menuitem label="&toolbar.export.label;" oncommand="Zotero_File_Interface.exportFile()"/>
|
||||
<menuitem oncommand="Zotero_File_Interface.exportCollection();"/>
|
||||
<menuitem oncommand="Zotero_File_Interface.bibliographyFromCollection();"/>
|
||||
<menuitem label="&zotero.toolbar.export.label;" oncommand="Zotero_File_Interface.exportFile()"/>
|
||||
<menuitem oncommand="Zotero_Report_Interface.loadCollectionReport()"/>
|
||||
</popup>
|
||||
<popup id="zotero-itemmenu" onpopupshowing="ZoteroPane.buildItemContextMenu();">
|
||||
<menuitem label="&items.menu.attach.snapshot;" oncommand="ZoteroPane.addAttachmentFromPage(false, this.parentNode.getAttribute('itemID'));"/>
|
||||
<menuitem label="&items.menu.attach.link;" oncommand="ZoteroPane.addAttachmentFromPage(true, this.parentNode.getAttribute('itemID'));"/>
|
||||
<menuitem label="&zotero.items.menu.showInLibrary;" oncommand="ZoteroPane.selectItem(this.parentNode.getAttribute('itemID'), true)"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&zotero.items.menu.attach.note;" oncommand="ZoteroPane.newNote(false, this.parentNode.getAttribute('itemID'))"/>
|
||||
<menuitem label="&zotero.items.menu.attach.snapshot;" oncommand="ZoteroPane.addAttachmentFromPage(false, this.parentNode.getAttribute('itemID'));"/>
|
||||
<menuitem label="&zotero.items.menu.attach.link;" oncommand="ZoteroPane.addAttachmentFromPage(true, this.parentNode.getAttribute('itemID'));"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&zotero.items.menu.duplicateItem;" oncommand="ZoteroPane.duplicateSelectedItem();"/>
|
||||
<menuitem oncommand="ZoteroPane.deleteSelectedItem();"/>
|
||||
<menuitem oncommand="ZoteroPane.deleteSelectedItem(true);"/>
|
||||
<menuseparator/>
|
||||
<menuitem oncommand="Zotero_File_Interface.exportItems();"/>
|
||||
<menuitem oncommand="Zotero_File_Interface.bibliographyFromItems();"/>
|
||||
<menuitem oncommand="Zotero_Report_Interface.loadItemReport()"/>
|
||||
<menuseparator/>
|
||||
<menuitem oncommand="ZoteroPane.reindexItem();"/>
|
||||
</popup>
|
||||
</popupset>
|
||||
<vbox id="collections-pane" persist="width" flex="1">
|
||||
<toolbar>
|
||||
<toolbarbutton id="tb-collection-add" tooltiptext="&toolbar.newCollection.label;" command="cmd_zotero_newCollection"/>
|
||||
<toolbarbutton id="tb-collection-addsearch" tooltiptext="&toolbar.newSavedSearch.label;" oncommand="ZoteroPane.newSearch();"/>
|
||||
<toolbarbutton id="tb-collection-rename" tooltiptext="&toolbar.renameCollection.label;" oncommand="ZoteroPane.editSelectedCollection();" disabled="true"/>
|
||||
<spacer flex="1"/>
|
||||
<toolbarbutton id="tb-collection-menu" type="menu">
|
||||
<menupopup>
|
||||
<menuitem label="&toolbar.import.label;" oncommand="Zotero_File_Interface.importFile();"/>
|
||||
<menuitem label="&toolbar.export.label;" oncommand="Zotero_File_Interface.exportFile();"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&toolbar.preferences.label;" oncommand="window.openDialog('chrome://zotero/content/preferences.xul','prefs','chrome,modal')"/>
|
||||
<menuitem label="&toolbar.about.label;" oncommand="window.openDialog('chrome://zotero/content/about.xul','about','chrome,left=' + (window.screenX + 200) + ',top=' + (window.screenY + 100))"/>
|
||||
</menupopup>
|
||||
</toolbarbutton>
|
||||
</toolbar>
|
||||
<tree id="collections-tree" hidecolumnpicker="true" context="zotero-collectionmenu"
|
||||
onselect="ZoteroPane.onCollectionSelected();" seltype="single"
|
||||
ondragdrop="nsDragAndDrop.drop(event,ZoteroPane.getCollectionsView())"
|
||||
ondraggesture="if (event.target.localName == 'treechildren') nsDragAndDrop.startDrag(event,ZoteroPane.getCollectionsView());"
|
||||
onkeypress="if (event.keyCode == event.DOM_VK_BACK_SPACE || event.keyCode == event.DOM_VK_DELETE){ ZoteroPane.deleteSelectedCollection(); }"
|
||||
flex="1">
|
||||
<treecols>
|
||||
<treecol
|
||||
id="name_column"
|
||||
label="&collections.name_column;"
|
||||
flex="1"
|
||||
primary="true"/>
|
||||
</treecols>
|
||||
<treechildren/>
|
||||
</tree>
|
||||
|
||||
<vbox id="zotero-collections-pane" persist="width" flex="1">
|
||||
<!-- This extra vbox prevents the toolbar from getting compressed when resizing
|
||||
the tag selector to max height -->
|
||||
<vbox flex="1">
|
||||
<toolbar>
|
||||
<toolbarbutton id="zotero-tb-collection-add" tooltiptext="&zotero.toolbar.newCollection.label;" oncommand="ZoteroPane.newCollection()"/>
|
||||
<spacer flex="1"/>
|
||||
<toolbarbutton id="zotero-tb-tag-selector" tooltiptext="&zotero.toolbar.tagSelector.label;" oncommand="ZoteroPane.toggleTagSelector()"/>
|
||||
<toolbarbutton id="zotero-tb-actions-menu" tooltiptext="&zotero.toolbar.actions.label;" type="menu">
|
||||
<menupopup id="zotero-tb-actions-popup" onpopupshowing="document.getElementById('cmd_zotero_reportErrors').setAttribute('disabled', Zotero.getErrors().length == 0)">
|
||||
<menuitem id="zotero-tb-actions-import" label="&zotero.toolbar.import.label;" oncommand="Zotero_File_Interface.importFile();"/>
|
||||
<menuitem id="zotero-tb-actions-export" label="&zotero.toolbar.export.label;" oncommand="Zotero_File_Interface.exportFile();"/>
|
||||
<menuseparator id="zotero-tb-actions-utilities-separator"/>
|
||||
<menuitem id="zotero-tb-actions-timeline" label="&zotero.toolbar.timeline.label;" oncommand="Zotero_Timeline_Interface.loadTimeline()"/>
|
||||
<menuseparator id="zotero-tb-actions-separator"/>
|
||||
<menuitem id="zotero-tb-actions-prefs" label="&zotero.toolbar.preferences.label;"
|
||||
oncommand="window.openDialog('chrome://zotero/content/preferences/preferences.xul', 'zotero-prefs', 'chrome,titlebar,toolbar,' + Zotero.Prefs.get('browser.preferences.instantApply', true) ? 'dialog=no' : 'modal')"/>
|
||||
<menuitem id="zotero-tb-actions-reportErrors" command="cmd_zotero_reportErrors" disabled="true"/>
|
||||
<menuitem id="zotero-tb-actions-documentation" label="&zotero.toolbar.documentation.label;" oncommand="window.open('http://www.zotero.org/documentation/', '', 'menubar=yes,location=yes,toolbar=yes,personalbar=yes,resizable=yes,scrollbars=yes,status=yes');"/>
|
||||
<menuitem id="zotero-tb-actions-about" label="&zotero.toolbar.about.label;" oncommand="window.openDialog('chrome://zotero/content/about.xul', 'about', 'chrome')"/>
|
||||
</menupopup>
|
||||
</toolbarbutton>
|
||||
</toolbar>
|
||||
<tree id="zotero-collections-tree" hidecolumnpicker="true" context="zotero-collectionmenu"
|
||||
onmouseover="ZoteroPane.collectionsView.setHighlightedRows();"
|
||||
ondblclick="ZoteroPane.onDoubleClick(event, this);"
|
||||
onselect="ZoteroPane.onCollectionSelected();" seltype="single"
|
||||
ondragdrop="nsDragAndDrop.drop(event, ZoteroPane.collectionsView)"
|
||||
ondraggesture="if (event.target.localName == 'treechildren') nsDragAndDrop.startDrag(event, ZoteroPane.collectionsView);"
|
||||
onkeypress="ZoteroPane.handleKeyPress(event, this.id)"
|
||||
flex="1">
|
||||
<treecols>
|
||||
<treecol
|
||||
id="zotero-collections-name-column"
|
||||
label="&zotero.collections.name_column;"
|
||||
flex="1"
|
||||
primary="true"/>
|
||||
</treecols>
|
||||
<treechildren/>
|
||||
</tree>
|
||||
</vbox>
|
||||
<splitter id="zotero-tags-splitter" persist="collapsed" onmouseup="ZoteroPane.updateTagSelectorSize()"/>
|
||||
<zoterotagselector id="zotero-tag-selector" persist="height,collapsed,showAutomatic"
|
||||
oncommand="ZoteroPane.updateTagFilter()"/>
|
||||
</vbox>
|
||||
|
||||
<splitter id="zotero-tree-splitter" resizebefore="closest" resizeafter="closest"/>
|
||||
<vbox id="items-pane" persist="width" flex="1">
|
||||
|
||||
<vbox id="zotero-items-pane" persist="width" flex="1">
|
||||
<toolbar align="center">
|
||||
<toolbarbutton id="tb-add" tooltiptext="&toolbar.newItem.label;" type="menu">
|
||||
<toolbarbutton id="zotero-tb-add" tooltiptext="&zotero.toolbar.newItem.label;" type="menu">
|
||||
<!-- New Item drop-down built in overlay.js::onLoad() -->
|
||||
<menupopup>
|
||||
<menuseparator/>
|
||||
<menuitem label="&toolbar.attachment.linked;" oncommand="ZoteroPane.addAttachmentFromDialog(true);"/>
|
||||
<menuitem label="&toolbar.attachment.add;" oncommand="ZoteroPane.addAttachmentFromDialog();"/>
|
||||
<menuitem label="&zotero.toolbar.attachment.linked;" oncommand="ZoteroPane.addAttachmentFromDialog(true);"/>
|
||||
<menuitem label="&zotero.toolbar.attachment.add;" oncommand="ZoteroPane.addAttachmentFromDialog();"/>
|
||||
<menuseparator/>
|
||||
<menu label="&toolbar.moreItemTypes.label;">
|
||||
<menupopup id="tb-add-more"/>
|
||||
<menu label="&zotero.toolbar.moreItemTypes.label;">
|
||||
<menupopup id="zotero-tb-add-more"/>
|
||||
</menu>
|
||||
</menupopup>
|
||||
</toolbarbutton>
|
||||
<toolbarbutton id="tb-item-from-page" tooltiptext="&toolbar.newItemFromPage.label;" oncommand="ZoteroPane.addItemFromPage()"/>
|
||||
<toolbarbutton id="zotero-tb-item-from-page" tooltiptext="&zotero.toolbar.newItemFromPage.label;" oncommand="ZoteroPane.addItemFromPage()"/>
|
||||
<toolbarseparator/>
|
||||
<toolbarbutton id="tb-link-page" tooltiptext="&toolbar.attachment.weblink;" oncommand="ZoteroPane.addAttachmentFromPage(true)"/>
|
||||
<toolbarbutton id="tb-snapshot-page" tooltiptext="&toolbar.attachment.snapshot;" oncommand="ZoteroPane.addAttachmentFromPage()"/>
|
||||
<toolbarbutton id="tb-note-add" tooltiptext="&toolbar.note.standalone;" oncommand="ZoteroPane.newNote(event.shiftKey);"/>
|
||||
<toolbarbutton id="zotero-tb-link-page" tooltiptext="&zotero.toolbar.attachment.weblink;" oncommand="ZoteroPane.addAttachmentFromPage(true)"/>
|
||||
<toolbarbutton id="zotero-tb-snapshot-page" tooltiptext="&zotero.toolbar.attachment.snapshot;" oncommand="ZoteroPane.addAttachmentFromPage()"/>
|
||||
<toolbarbutton id="zotero-tb-note-add" tooltiptext="&zotero.toolbar.note.standalone;" oncommand="ZoteroPane.newNote(event.shiftKey);"/>
|
||||
<toolbarseparator/>
|
||||
<toolbarbutton id="zotero-tb-advanced-search" tooltiptext="&zotero.toolbar.advancedSearch;" oncommand="ZoteroPane.openAdvancedSearchWindow()"/>
|
||||
<spacer flex="1"/>
|
||||
<label value="&toolbar.search.label;" control="tb-search"/>
|
||||
<textbox id="tb-search" type="timed" timeout="250" command="cmd_zotero_search" dir="reverse" onkeypress="if(event.keyCode == event.DOM_VK_ESCAPE) { this.value = ''; this.doCommand('cmd_zotero_search'); return false; }">
|
||||
<toolbarbutton id="tb-search-cancel" oncommand="this.parentNode.value='';" hidden="true"/>
|
||||
<label value="&zotero.toolbar.search.label;" control="zotero-tb-search"/>
|
||||
<textbox id="zotero-tb-search" type="conditional-timed" timeout="250" command="cmd_zotero_search" dir="reverse"
|
||||
onkeypress="ZoteroPane.handleSearchKeypress(this, event)"
|
||||
oninput="ZoteroPane.handleSearchInput(this, event)"
|
||||
testcode="me.value.indexOf('"') == -1"
|
||||
prefire="ZoteroPane.clearItemsPaneMessage()"
|
||||
ontestfail="ZoteroPane.setItemsPaneMessage(Zotero.getString('advancedSearchMode'))">
|
||||
<toolbarbutton id="zotero-tb-search-cancel" oncommand="this.parentNode.value='';" hidden="true"/>
|
||||
</textbox>
|
||||
</toolbar>
|
||||
<tree
|
||||
id="items-tree" context="zotero-itemmenu"
|
||||
ondblclick="ZoteroPane.onDoubleClick(event, this);"
|
||||
enableColumnDrag="true"
|
||||
onkeypress="if (event.keyCode == event.DOM_VK_BACK_SPACE || event.keyCode == event.DOM_VK_DELETE){ ZoteroPane.deleteSelectedItem(); }"
|
||||
onselect="ZoteroPane.itemSelected();"
|
||||
ondraggesture="if (event.target.localName == 'treechildren') nsDragAndDrop.startDrag(event,ZoteroPane.getItemsView());"
|
||||
ondragover="nsDragAndDrop.dragOver(event,ZoteroPane.getItemsView())"
|
||||
ondragdrop="nsDragAndDrop.drop(event,ZoteroPane.getItemsView())"
|
||||
flex="1">
|
||||
<treecols>
|
||||
<treecol
|
||||
id="title" primary="true"
|
||||
label="&items.title_column;"
|
||||
flex="4" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="firstCreator"
|
||||
label="&items.creator_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="numChildren"
|
||||
label="&items.numChildren_column;"
|
||||
persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="typeIcon" hidden="true"
|
||||
label="&items.type_column;"
|
||||
width="40" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="source" hidden="true"
|
||||
label="&items.source_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="rights" hidden="true"
|
||||
label="&items.rights_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="dateAdded" hidden="true"
|
||||
label="&items.dateAdded_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="dateModified" hidden="true"
|
||||
label="&items.dateModified_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
</treecols>
|
||||
<treechildren/>
|
||||
</tree>
|
||||
|
||||
<deck id="zotero-items-pane-content" selectedIndex="0" flex="1">
|
||||
<tree
|
||||
id="zotero-items-tree" context="zotero-itemmenu"
|
||||
ondblclick="ZoteroPane.onDoubleClick(event, this);"
|
||||
enableColumnDrag="true"
|
||||
onfocus="if (ZoteroPane.itemsView.rowCount && !ZoteroPane.itemsView.selection.count) { ZoteroPane.itemsView.selection.select(0); }"
|
||||
onkeypress="ZoteroPane.handleKeyPress(event, this.id)"
|
||||
onselect="ZoteroPane.itemSelected();"
|
||||
ondraggesture="if (event.target.localName == 'treechildren') nsDragAndDrop.startDrag(event,ZoteroPane.itemsView);"
|
||||
ondragover="nsDragAndDrop.dragOver(event, ZoteroPane.itemsView)"
|
||||
ondragdrop="nsDragAndDrop.drop(event, ZoteroPane.itemsView)"
|
||||
flex="1">
|
||||
<treecols>
|
||||
<treecol
|
||||
id="zotero-items-column-title" primary="true"
|
||||
label="&zotero.items.title_column;"
|
||||
flex="4" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-firstCreator"
|
||||
label="&zotero.items.creator_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-type" hidden="true"
|
||||
label="&zotero.items.type_column;"
|
||||
width="40" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-date" hidden="true"
|
||||
label="&zotero.items.date_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-year" hidden="true"
|
||||
label="&zotero.items.year_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-publisher" hidden="true"
|
||||
label="&zotero.items.publisher_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-language" hidden="true"
|
||||
label="&zotero.items.language_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-callNumber" hidden="true"
|
||||
label="&zotero.items.callNumber_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-repository" hidden="true"
|
||||
label="&zotero.items.repository_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-rights" hidden="true"
|
||||
label="&zotero.items.rights_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-dateAdded" hidden="true"
|
||||
label="&zotero.items.dateAdded_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-dateModified" hidden="true"
|
||||
label="&zotero.items.dateModified_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-numChildren"
|
||||
label="&zotero.items.numChildren_column;"
|
||||
persist="width ordinal hidden sortActive sortDirection"/>
|
||||
</treecols>
|
||||
<treechildren/>
|
||||
</tree>
|
||||
|
||||
<!-- Label for displaying messages when items pane is hidden
|
||||
(e.g. "Advanced search mode — press Enter to search.")-->
|
||||
<vbox id="zotero-items-pane-message-box" pack="center" align="center"/>
|
||||
</deck>
|
||||
</vbox>
|
||||
|
||||
<splitter id="zotero-view-splitter" resizebefore="closest" resizeafter="closest"/>
|
||||
<vbox>
|
||||
|
||||
<vbox id="zotero-item-pane" persist="width">
|
||||
<toolbar align="right">
|
||||
<toolbarbutton id="tb-fullscreen" tooltiptext="&toolbar.fullscreen.tooltip;" oncommand="ZoteroPane.fullScreen();"/>
|
||||
<toolbarbutton id="zotero-tb-fullscreen" tooltiptext="&zotero.toolbar.fullscreen.tooltip;" oncommand="ZoteroPane.fullScreen();"/>
|
||||
<toolbarbutton class="tabs-closebutton" oncommand="ZoteroPane.toggleDisplay()"/>
|
||||
</toolbar>
|
||||
<groupbox flex="1">
|
||||
<caption>
|
||||
<tabs id="zotero-view-tabs" onselect="document.getElementById('zotero-view-item').selectedIndex = this.selectedIndex;" hidden="true">
|
||||
<tab label="&tabs.info.label;"/>
|
||||
<tab label="&tabs.notes.label;"/>
|
||||
<tab label="&tabs.attachments.label;"/>
|
||||
<tab label="&tabs.tags.label;"/>
|
||||
<tab label="&tabs.related.label;"/>
|
||||
<tab label="&zotero.tabs.info.label;"/>
|
||||
<tab label="&zotero.tabs.notes.label;"/>
|
||||
<tab label="&zotero.tabs.attachments.label;"/>
|
||||
<tab label="&zotero.tabs.tags.label;"/>
|
||||
<tab label="&zotero.tabs.related.label;"/>
|
||||
</tabs>
|
||||
</caption>
|
||||
<deck id="item-pane" selectedIndex="0" flex="1" onselect="document.getElementById('zotero-view-tabs').setAttribute('hidden',(this.selectedIndex != 1));">
|
||||
<deck id="zotero-item-pane-content" selectedIndex="0" flex="1" onselect="document.getElementById('zotero-view-tabs').setAttribute('hidden',(this.selectedIndex != 1));">
|
||||
<box pack="center" align="center">
|
||||
<label id="zotero-view-selected-label"/>
|
||||
</box>
|
||||
|
@ -211,53 +305,125 @@
|
|||
<!-- Note info pane -->
|
||||
<vbox id="zotero-view-note" flex="1">
|
||||
<noteeditor id="zotero-note-editor" flex="1"/>
|
||||
<button id="zotero-view-note-button" label="¬es.separate;" oncommand="ZoteroPane.openNoteWindow(this.getAttribute('noteID')); if(this.hasAttribute('sourceID')) ZoteroPane.selectItem(this.getAttribute('sourceID'));"/>
|
||||
<button id="zotero-view-note-button" label="&zotero.notes.separate;" oncommand="ZoteroPane.openNoteWindow(this.getAttribute('noteID')); if(this.hasAttribute('sourceID')) ZoteroPane.selectItem(this.getAttribute('sourceID'));"/>
|
||||
</vbox>
|
||||
<!-- Attachment info pane -->
|
||||
<vbox id="zotero-view-attachment" flex="1">
|
||||
<label id="zotero-attachment-label"/>
|
||||
<hbox>
|
||||
<button id="zotero-attachment-view" flex="1" oncommand="ZoteroPane.viewSelectedAttachment();"/>
|
||||
<button id="zotero-attachment-show" label="&item.attachment.file.show;" flex="1" oncommand="ZoteroPane.showSelectedAttachmentInFilesystem()"/>
|
||||
<button id="zotero-attachment-view" flex="1" oncommand="ZoteroPane.viewSelectedAttachment(event);"/>
|
||||
<button id="zotero-attachment-show" label="&zotero.item.attachment.file.show;" flex="1" oncommand="ZoteroPane.showSelectedAttachmentInFilesystem()"/>
|
||||
</hbox>
|
||||
<vbox>
|
||||
<label id="zotero-attachment-url" class="text-link" crop="end" onclick="window.loadURI(this.value)"/>
|
||||
<label id="zotero-attachment-accessed"/>
|
||||
</vbox>
|
||||
<label id="zotero-attachment-url" class="text-link" crop="end" onclick="ZoteroPane.loadURI(this.value, event)"/>
|
||||
|
||||
|
||||
<label id="zotero-attachment-accessed"/>
|
||||
<label id="zotero-attachment-pages"/>
|
||||
|
||||
<hbox id="zotero-attachment-index-box">
|
||||
<label id="zotero-attachment-index-status"/>
|
||||
<toolbarbutton id="zotero-attachment-reindex" oncommand="ZoteroPane.reindexItem()"/>
|
||||
</hbox>
|
||||
|
||||
<noteeditor id="zotero-attachment-note-editor" notitle="1" flex="1"/>
|
||||
</vbox>
|
||||
</deck>
|
||||
</groupbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<!-- Annotation Toolbar -->
|
||||
<toolbar id="zotero-annotate-tb" crop="end" insertbefore="content" hidden="true">
|
||||
<toolbarbutton id="zotero-annotate-tb-add" tooltiptext="&zotero.annotate.toolbar.add.label;" oncommand="Zotero_Browser.toggleMode(this.id);"/>
|
||||
<toolbarbutton id="zotero-annotate-tb-collapse" tooltiptext="&zotero.annotate.toolbar.collapse.label;" oncommand="Zotero_Browser.setCollapsed(true);"/>
|
||||
<toolbarbutton id="zotero-annotate-tb-expand" tooltiptext="&zotero.annotate.toolbar.expand.label;" oncommand="Zotero_Browser.setCollapsed(false);"/>
|
||||
<toolbarseparator/>
|
||||
<toolbarbutton id="zotero-annotate-tb-highlight" tooltiptext="&zotero.annotate.toolbar.highlight.label;" oncommand="Zotero_Browser.toggleMode(this.id);"/>
|
||||
<toolbarbutton id="zotero-annotate-tb-unhighlight" tooltiptext="&zotero.annotate.toolbar.unhighlight.label;" oncommand="Zotero_Browser.toggleMode(this.id);"/>
|
||||
</toolbar>
|
||||
</vbox>
|
||||
|
||||
<!-- Scrape Code -->
|
||||
<hbox id="urlbar-icons">
|
||||
<image src="chrome://zotero/skin/treeitem-book.png" id="zotero-status-image" onclick="Zotero_Browser.scrapeThisPage()" position="1" hidden="true"/>
|
||||
</hbox>
|
||||
|
||||
<statusbar id="status-bar">
|
||||
<statusbarpanel id="zotero-status-bar-icon"
|
||||
src="chrome://zotero/skin/zotero_logo_18px.png"
|
||||
class="statusbarpanel-iconic" onclick="ZoteroPane.toggleDisplay();"
|
||||
hidden="true"/>
|
||||
<statusbarpanel id="zotero-status-bar-icon" hidden="true"
|
||||
class="statusbarpanel-iconic" onclick="ZoteroPane.toggleDisplay();"/>
|
||||
</statusbar>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
window.addEventListener('load', function(e){
|
||||
if (Zotero){
|
||||
document.getElementById('zotero-status-bar-icon').setAttribute('hidden', 'false');
|
||||
var icon = document.getElementById('zotero-status-bar-icon');
|
||||
if (Zotero && Zotero.initialized){
|
||||
switch (Zotero.Prefs.get('statusBarIcon')) {
|
||||
case 2:
|
||||
icon.setAttribute('hidden', false);
|
||||
break;
|
||||
case 1:
|
||||
icon.setAttribute('hidden', false);
|
||||
icon.setAttribute('compact', true);
|
||||
break;
|
||||
}
|
||||
|
||||
// Set "Report Errors..." label via property rather than DTD entity,
|
||||
// since we need to reference it in script elsewhere
|
||||
document.getElementById('zotero-tb-actions-reportErrors').setAttribute('label',
|
||||
Zotero.getString('errorReport.reportErrors'));
|
||||
|
||||
// Used for loading the changelog after upgrades
|
||||
if (Zotero.initialURL) {
|
||||
setTimeout("gBrowser.selectedTab = gBrowser.addTab(Zotero.initialURL); Zotero.initialURL = null;", 1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (Zotero) {
|
||||
var errMsg = Zotero.startupError;
|
||||
}
|
||||
|
||||
// Use defaults if necessary
|
||||
if (!errMsg) {
|
||||
// Get the stringbundle manually
|
||||
var src = 'chrome://zotero/locale/zotero.properties';
|
||||
var localeService = Components.classes['@mozilla.org/intl/nslocaleservice;1'].
|
||||
getService(Components.interfaces.nsILocaleService);
|
||||
var appLocale = localeService.getApplicationLocale();
|
||||
var stringBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"]
|
||||
.getService(Components.interfaces.nsIStringBundleService);
|
||||
var stringBundle = stringBundleService.createBundle(src, appLocale);
|
||||
|
||||
var errMsg = stringBundle.GetStringFromName('startupError');
|
||||
}
|
||||
|
||||
icon.setAttribute('tooltiptext', errMsg);
|
||||
icon.setAttribute('error', 'true');
|
||||
icon.setAttribute('hidden', false);
|
||||
}
|
||||
}, false);
|
||||
|
||||
document.getElementById('appcontent').addEventListener('keydown', ZoteroPane.handleKeyDown, true);
|
||||
// Make sure open progress windows are fading
|
||||
document.getElementById('appcontent').addEventListener('mousemove', Zotero.ProgressWindowSet.updateTimers, false);
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<menupopup id="menu_ToolsPopup">
|
||||
<menuseparator id="zoteroSeparator" insertbefore="devToolsSeparator"/>
|
||||
<menuitem id="tools-zotero" insertbefore="devToolsSeparator"
|
||||
oncommand="ZoteroPane.toggleDisplay();" label="&zotero.name;"
|
||||
oncommand="ZoteroPane.toggleDisplay();" label="Zotero"
|
||||
key="key_openZotero"/>
|
||||
</menupopup>
|
||||
|
||||
|
||||
<keyset id="mainKeyset">
|
||||
<!--
|
||||
The key can be changed by the pref extensions.zotero.keys.openZotero,
|
||||
but if the values are changed here, the pref won't override them.
|
||||
-->
|
||||
<key id="key_openZotero"
|
||||
key="Z"
|
||||
oncommand="ZoteroPane.toggleDisplay();"
|
||||
modifiers="shift accel" />
|
||||
modifiers="accel alt" />
|
||||
</keyset>
|
||||
</overlay>
|
|
@ -1,122 +0,0 @@
|
|||
/*
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (c) 2006 Center for History and New Media
|
||||
George Mason University, Fairfax, Virginia, USA
|
||||
http://chnm.gmu.edu
|
||||
|
||||
Licensed under the Educational Community License, Version 1.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.opensource.org/licenses/ecl1.php
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
var autoUpdateBox;
|
||||
var positionMenu;
|
||||
var parseEndnoteBox;
|
||||
var automaticSnapshots;
|
||||
var openURLMenu;
|
||||
var openURLResolvers;
|
||||
var openURLServerField;
|
||||
var openURLVersionMenu;
|
||||
var zoteroPaneOnTopInitial;
|
||||
|
||||
/*
|
||||
To add a new preference:
|
||||
1) modify defaults/preferences/zotero.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
|
||||
4) (Optional) To add an observer for a preference change,
|
||||
add an appropriate case in the switch statement
|
||||
in Zotero.Prefs.observe()
|
||||
*/
|
||||
|
||||
function init()
|
||||
{
|
||||
autoUpdateBox = document.getElementById('autoUpdateBox');
|
||||
autoUpdateBox.checked = Zotero.Prefs.get('automaticScraperUpdates');
|
||||
|
||||
positionMenu = document.getElementById('positionMenu');
|
||||
positionMenu.selectedIndex = zoteroPaneOnTopInitial = Zotero.Prefs.get('zoteroPaneOnTop') ? 0 : 1;
|
||||
|
||||
parseEndnoteBox = document.getElementById('parseEndnoteBox');
|
||||
parseEndnoteBox.checked = Zotero.Prefs.get('parseEndNoteMIMETypes');
|
||||
|
||||
automaticSnapshots = document.getElementById('automaticSnapshots');
|
||||
automaticSnapshots.checked = Zotero.Prefs.get('automaticSnapshots');
|
||||
|
||||
openURLServerField = document.getElementById('openURLServerField');
|
||||
openURLServerField.value = Zotero.Prefs.get('openURL.resolver');
|
||||
openURLVersionMenu = document.getElementById('openURLVersionMenu');
|
||||
openURLVersionMenu.value = Zotero.Prefs.get('openURL.version');
|
||||
|
||||
openURLMenu = document.getElementById('openURLMenu');
|
||||
|
||||
openURLResolvers = Zotero.OpenURL.discoverResolvers();
|
||||
for(var i in openURLResolvers)
|
||||
{
|
||||
openURLMenu.insertItemAt(i,openURLResolvers[i]['name']);
|
||||
if(openURLResolvers[i]['url'] == Zotero.Prefs.get('openURL.resolver') && openURLResolvers[i]['version'] == Zotero.Prefs.get('openURL.version'))
|
||||
openURLMenu.selectedIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
function accept()
|
||||
{
|
||||
Zotero.Prefs.set('automaticScraperUpdates', autoUpdateBox.checked);
|
||||
Zotero.Prefs.set('zoteroPaneOnTop', positionMenu.selectedIndex == 0);
|
||||
|
||||
if(Zotero.Prefs.get('parseEndNoteMIMETypes') != parseEndnoteBox.checked)
|
||||
{
|
||||
Zotero.Prefs.set('parseEndNoteMIMETypes', parseEndnoteBox.checked);
|
||||
Zotero.Ingester.MIMEHandler.init();
|
||||
}
|
||||
|
||||
Zotero.Prefs.set('automaticSnapshots', automaticSnapshots.checked);
|
||||
|
||||
Zotero.Prefs.set('openURL.resolver', openURLServerField.value);
|
||||
Zotero.Prefs.set('openURL.version', openURLVersionMenu.value);
|
||||
}
|
||||
|
||||
function onOpenURLSelected()
|
||||
{
|
||||
if(openURLMenu.value == "custom")
|
||||
{
|
||||
openURLServerField.focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
openURLServerField.value = openURLResolvers[openURLMenu.selectedIndex]['url'];
|
||||
openURLVersionMenu.value = openURLResolvers[openURLMenu.selectedIndex]['version'];
|
||||
}
|
||||
}
|
||||
|
||||
function onOpenURLCustomized()
|
||||
{
|
||||
openURLMenu.value = "custom";
|
||||
}
|
||||
|
||||
function onPositionChange()
|
||||
{
|
||||
var statusLine = document.getElementById('statusLine');
|
||||
if (positionMenu.selectedIndex != zoteroPaneOnTopInitial)
|
||||
{
|
||||
statusLine.value = Zotero.getString('zotero.preferences.status.positionChange');
|
||||
}
|
||||
else
|
||||
{
|
||||
statusLine.value = '';
|
||||
}
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (c) 2006 Center for History and New Media
|
||||
George Mason University, Fairfax, Virginia, USA
|
||||
http://chnm.gmu.edu
|
||||
|
||||
Licensed under the Educational Community License, Version 1.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.opensource.org/licenses/ecl1.php
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
-->
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/preferences.dtd">
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
|
||||
<!-- TODO: change to prefWindow? -->
|
||||
<dialog id="winMain" title="&zotero.preferences.title;" style="min-width:400px;"
|
||||
onload="init();" ondialogaccept="accept()"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script src="preferences.js"/>
|
||||
<script src="include.js"/>
|
||||
|
||||
<dialogheader id="header" title="&zotero.name;" description="&zotero.preferences.title;"/>
|
||||
|
||||
<hbox align="center">
|
||||
<label value="&zotero.preferences.position.label;" control="positionMenu"/>
|
||||
<menulist id="positionMenu" oncommand="onPositionChange()">
|
||||
<menupopup>
|
||||
<menuitem label="&zotero.preferences.position.above;"/>
|
||||
<menuitem label="&zotero.preferences.position.below;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<label value="&zotero.preferences.position.browser;"/>
|
||||
</hbox>
|
||||
|
||||
<checkbox id="autoUpdateBox" label="&zotero.preferences.autoUpdate.label;"/>
|
||||
|
||||
<checkbox id="parseEndnoteBox" label="&zotero.preferences.parseEndnote.label;"/>
|
||||
|
||||
<checkbox id="automaticSnapshots" label="&zotero.preferences.automaticSnapshots.label;"/>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&zotero.preferences.openurl.caption;"/>
|
||||
|
||||
<menulist id="openURLMenu" oncommand="onOpenURLSelected();">
|
||||
<menupopup>
|
||||
<menuseparator/>
|
||||
<menuitem label="Custom..." value="custom" selected="true"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
|
||||
<hbox align="center">
|
||||
<label value="&zotero.preferences.openurl.server;"/>
|
||||
<textbox id="openURLServerField" flex="1" oninput="onOpenURLCustomized();"/>
|
||||
</hbox>
|
||||
|
||||
<hbox align="center">
|
||||
<label value="&zotero.preferences.openurl.version;"/>
|
||||
<menulist id="openURLVersionMenu" oncommand="onOpenURLCustomized();">
|
||||
<menupopup>
|
||||
<menuitem label="0.1" value="0.1"/>
|
||||
<menuitem label="1.0" value="1.0"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
<label id="statusLine" value="" style="color:red"/>
|
||||
|
||||
</dialog>
|
810
chrome/content/zotero/preferences/preferences.js
Normal file
810
chrome/content/zotero/preferences/preferences.js
Normal file
|
@ -0,0 +1,810 @@
|
|||
/*
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (c) 2006 Center for History and New Media
|
||||
George Mason University, Fairfax, Virginia, USA
|
||||
http://chnm.gmu.edu
|
||||
|
||||
Licensed under the Educational Community License, Version 1.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.opensource.org/licenses/ecl1.php
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
var openURLServerField;
|
||||
var openURLVersionMenu;
|
||||
|
||||
function init()
|
||||
{
|
||||
// Display the appropriate modifier keys for the platform
|
||||
var rows = document.getElementById('zotero-prefpane-keys').getElementsByTagName('row');
|
||||
for (var i=0; i<rows.length; i++) {
|
||||
rows[i].firstChild.nextSibling.value = Zotero.isMac ? 'Cmd+Shift+' : 'Ctrl+Alt+';
|
||||
}
|
||||
|
||||
populateQuickCopyList();
|
||||
updateQuickCopyInstructions();
|
||||
initSearchPane();
|
||||
}
|
||||
|
||||
|
||||
function onDataDirLoad() {
|
||||
var path = document.getElementById('dataDirPath');
|
||||
var useDataDir = Zotero.Prefs.get('useDataDir');
|
||||
path.setAttribute('disabled', !useDataDir);
|
||||
}
|
||||
|
||||
|
||||
function onDataDirUpdate(event) {
|
||||
var radiogroup = document.getElementById('dataDir');
|
||||
var path = document.getElementById('dataDirPath');
|
||||
var useDataDir = Zotero.Prefs.get('useDataDir');
|
||||
|
||||
// If triggered from the Choose button, don't show the dialog, since
|
||||
// Zotero.chooseZoteroDirectory() shows its own
|
||||
if (event.originalTarget.tagName == 'button') {
|
||||
return true;
|
||||
}
|
||||
// If directory not set or invalid, prompt for location
|
||||
if (!getDataDirPath()) {
|
||||
event.stopPropagation();
|
||||
var file = Zotero.chooseZoteroDirectory(true);
|
||||
radiogroup.selectedIndex = file ? 1 : 0;
|
||||
return !!file;
|
||||
}
|
||||
|
||||
var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService);
|
||||
|
||||
var buttonFlags = (ps.BUTTON_POS_0) * (ps.BUTTON_TITLE_IS_STRING)
|
||||
+ (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_CANCEL);
|
||||
var index = ps.confirmEx(window,
|
||||
Zotero.getString('general.restartRequired'),
|
||||
Zotero.getString('general.restartRequiredForChange'),
|
||||
buttonFlags,
|
||||
Zotero.getString('general.restartNow'),
|
||||
null, null, null, {});
|
||||
|
||||
if (index == 0) {
|
||||
useDataDir = !!radiogroup.selectedIndex;
|
||||
// quit() is asynchronous, but set this here just in case
|
||||
Zotero.Prefs.set('useDataDir', useDataDir);
|
||||
var appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"]
|
||||
.getService(Components.interfaces.nsIAppStartup);
|
||||
appStartup.quit(Components.interfaces.nsIAppStartup.eRestart);
|
||||
appStartup.quit(Components.interfaces.nsIAppStartup.eAttemptQuit);
|
||||
}
|
||||
|
||||
radiogroup.selectedIndex = useDataDir ? 1 : 0;
|
||||
return useDataDir;
|
||||
}
|
||||
|
||||
|
||||
function getDataDirPath() {
|
||||
var desc = Zotero.Prefs.get('dataDir');
|
||||
if (desc == '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
var file = Components.classes["@mozilla.org/file/local;1"].
|
||||
createInstance(Components.interfaces.nsILocalFile);
|
||||
try {
|
||||
file.persistentDescriptor = desc;
|
||||
}
|
||||
catch (e) {
|
||||
return '';
|
||||
}
|
||||
return file.path;
|
||||
}
|
||||
|
||||
|
||||
function populateOpenURLResolvers() {
|
||||
var openURLMenu = document.getElementById('openURLMenu');
|
||||
|
||||
var openURLResolvers = Zotero.OpenURL.discoverResolvers();
|
||||
for each(var r in openURLResolvers) {
|
||||
openURLMenu.insertItemAt(i, r.name);
|
||||
if (r.url == Zotero.Prefs.get('openURL.resolver') && r.version == Zotero.Prefs.get('openURL.version')) {
|
||||
openURLMenu.selectedIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
var button = document.getElementById('openURLSearchButton');
|
||||
switch (openURLResolvers.length) {
|
||||
case 0:
|
||||
var num = 'zero';
|
||||
break;
|
||||
case 1:
|
||||
var num = 'singular';
|
||||
break;
|
||||
default:
|
||||
var num = 'plural';
|
||||
}
|
||||
|
||||
button.setAttribute('label', Zotero.getString('zotero.preferences.openurl.resolversFound.' + num, openURLResolvers.length));
|
||||
}
|
||||
|
||||
|
||||
function populateQuickCopyList() {
|
||||
// Initialize default format drop-down
|
||||
var formatMenu = document.getElementById("quickCopy-menu");
|
||||
var format = Zotero.Prefs.get("export.quickCopy.setting");
|
||||
buildQuickCopyFormatDropDown(formatMenu, format);
|
||||
formatMenu.setAttribute('preference', "pref-quickCopy-setting");
|
||||
|
||||
refreshQuickCopySiteList();
|
||||
}
|
||||
|
||||
|
||||
function buildQuickCopyFormatDropDown(menulist, currentFormat) {
|
||||
// Prevent Cmd-w from setting "Wikipedia"
|
||||
menulist.onkeydown = function (event) {
|
||||
if ((Zotero.isMac && event.metaKey) || event.ctrlKey) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
var popup = document.createElement('menupopup');
|
||||
menulist.appendChild(popup);
|
||||
|
||||
var itemNode = document.createElement("menuitem");
|
||||
itemNode.setAttribute("label", Zotero.getString('zotero.preferences.export.quickCopy.bibStyles'));
|
||||
itemNode.setAttribute("disabled", true);
|
||||
popup.appendChild(itemNode);
|
||||
|
||||
// add styles to list
|
||||
var styles = Zotero.Cite.getStyles();
|
||||
for (var i in styles) {
|
||||
var val = 'bibliography=' + i;
|
||||
var itemNode = document.createElement("menuitem");
|
||||
itemNode.setAttribute("value", val);
|
||||
itemNode.setAttribute("label", styles[i]);
|
||||
popup.appendChild(itemNode);
|
||||
|
||||
if (val == currentFormat) {
|
||||
menulist.selectedItem = itemNode;
|
||||
}
|
||||
}
|
||||
|
||||
var itemNode = document.createElement("menuitem");
|
||||
itemNode.setAttribute("label", Zotero.getString('zotero.preferences.export.quickCopy.exportFormats'));
|
||||
itemNode.setAttribute("disabled", true);
|
||||
popup.appendChild(itemNode);
|
||||
|
||||
// add export formats to list
|
||||
var translation = new Zotero.Translate("export");
|
||||
var translators = translation.getTranslators();
|
||||
|
||||
for (var i=0; i<translators.length; i++) {
|
||||
// Skip RDF formats
|
||||
switch (translators[i].translatorID) {
|
||||
case '6e372642-ed9d-4934-b5d1-c11ac758ebb7':
|
||||
case '14763d24-8ba0-45df-8f52-b8d1108e7ac9':
|
||||
continue;
|
||||
}
|
||||
var val = 'export=' + translators[i].translatorID;
|
||||
var itemNode = document.createElement("menuitem");
|
||||
itemNode.setAttribute("value", val);
|
||||
itemNode.setAttribute("label", translators[i].label);
|
||||
popup.appendChild(itemNode);
|
||||
|
||||
if (val == currentFormat) {
|
||||
menulist.selectedItem = itemNode;
|
||||
}
|
||||
}
|
||||
|
||||
return popup;
|
||||
}
|
||||
|
||||
function showQuickCopySiteEditor(index) {
|
||||
var treechildren = document.getElementById('quickCopy-siteSettings-rows');
|
||||
|
||||
if (index != undefined && index > -1 && index < treechildren.childNodes.length) {
|
||||
var treerow = treechildren.childNodes[index].firstChild;
|
||||
var domain = treerow.childNodes[0].getAttribute('label')
|
||||
var format = treerow.childNodes[1].getAttribute('label')
|
||||
}
|
||||
|
||||
var format = Zotero.QuickCopy.getSettingFromFormattedName(format);
|
||||
|
||||
var io = {domain: domain, format: format, ok: false};
|
||||
window.openDialog('chrome://zotero/content/preferences/quickCopySiteEditor.xul', "zotero-preferences-quickCopySiteEditor", "chrome, modal", io);
|
||||
|
||||
if (!io.ok) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (domain && domain != io.domain) {
|
||||
Zotero.DB.query("DELETE FROM settings WHERE setting='quickCopySite' AND key=?", [domain]);
|
||||
}
|
||||
|
||||
Zotero.DB.query("REPLACE INTO settings VALUES ('quickCopySite', ?, ?)", [io.domain, io.format]);
|
||||
|
||||
refreshQuickCopySiteList();
|
||||
}
|
||||
|
||||
function refreshQuickCopySiteList() {
|
||||
var treechildren = document.getElementById('quickCopy-siteSettings-rows');
|
||||
while (treechildren.hasChildNodes()) {
|
||||
treechildren.removeChild(treechildren.firstChild);
|
||||
}
|
||||
|
||||
var sql = "SELECT key AS domainPath, value AS format FROM settings "
|
||||
+ "WHERE setting='quickCopySite' ORDER BY domainPath COLLATE NOCASE";
|
||||
var siteData = Zotero.DB.query(sql);
|
||||
|
||||
if (!siteData) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (var i=0; i<siteData.length; i++) {
|
||||
var treeitem = document.createElement('treeitem');
|
||||
var treerow = document.createElement('treerow');
|
||||
var domainCell = document.createElement('treecell');
|
||||
var formatCell = document.createElement('treecell');
|
||||
|
||||
domainCell.setAttribute('label', siteData[i].domainPath);
|
||||
|
||||
var formatted = Zotero.QuickCopy.getFormattedNameFromSetting(siteData[i].format);
|
||||
formatCell.setAttribute('label', formatted);
|
||||
|
||||
treerow.appendChild(domainCell);
|
||||
treerow.appendChild(formatCell);
|
||||
treeitem.appendChild(treerow);
|
||||
treechildren.appendChild(treeitem);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function deleteSelectedQuickCopySite() {
|
||||
var tree = document.getElementById('quickCopy-siteSettings');
|
||||
var treeitem = tree.lastChild.childNodes[tree.currentIndex];
|
||||
var domainPath = treeitem.firstChild.firstChild.getAttribute('label');
|
||||
Zotero.DB.query("DELETE FROM settings WHERE setting='quickCopySite' AND key=?", [domainPath]);
|
||||
refreshQuickCopySiteList();
|
||||
}
|
||||
|
||||
|
||||
function updateQuickCopyInstructions() {
|
||||
if (Zotero.isMac) {
|
||||
document.getElementById('quickCopy-macWarning').setAttribute('hidden', false);
|
||||
}
|
||||
|
||||
var prefix = Zotero.isMac ? 'Cmd+Shift+' : 'Ctrl+Alt+';
|
||||
var key = Zotero.Prefs.get('keys.copySelectedItemsToClipboard');
|
||||
|
||||
var instr = document.getElementById('quickCopy-instructions');
|
||||
var str = Zotero.getString('zotero.preferences.export.quickCopy.instructions', prefix + key);
|
||||
|
||||
while (instr.hasChildNodes()) {
|
||||
instr.removeChild(instr.firstChild);
|
||||
}
|
||||
instr.appendChild(document.createTextNode(str));
|
||||
}
|
||||
|
||||
|
||||
function rebuildIndexPrompt() {
|
||||
var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].
|
||||
createInstance(Components.interfaces.nsIPromptService);
|
||||
var buttonFlags = (ps.BUTTON_POS_0) * (ps.BUTTON_TITLE_IS_STRING)
|
||||
+ (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_IS_STRING)
|
||||
+ (ps.BUTTON_POS_2) * (ps.BUTTON_TITLE_CANCEL);
|
||||
|
||||
var index = ps.confirmEx(null,
|
||||
Zotero.getString('zotero.preferences.search.rebuildIndex'),
|
||||
Zotero.getString('zotero.preferences.search.rebuildWarning',
|
||||
Zotero.getString('zotero.preferences.search.indexUnindexed')),
|
||||
buttonFlags,
|
||||
Zotero.getString('zotero.preferences.search.rebuildIndex'),
|
||||
Zotero.getString('zotero.preferences.search.indexUnindexed'),
|
||||
null, null, {});
|
||||
|
||||
if (index == 0) {
|
||||
Zotero.Fulltext.rebuildIndex();
|
||||
}
|
||||
else if (index == 1) {
|
||||
Zotero.Fulltext.rebuildIndex(true)
|
||||
}
|
||||
|
||||
updateIndexStats();
|
||||
}
|
||||
|
||||
|
||||
function clearIndexPrompt() {
|
||||
var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].
|
||||
createInstance(Components.interfaces.nsIPromptService);
|
||||
var buttonFlags = (ps.BUTTON_POS_0) * (ps.BUTTON_TITLE_IS_STRING)
|
||||
+ (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_IS_STRING)
|
||||
+ (ps.BUTTON_POS_2) * (ps.BUTTON_TITLE_CANCEL);
|
||||
|
||||
var index = ps.confirmEx(null,
|
||||
Zotero.getString('zotero.preferences.search.clearIndex'),
|
||||
Zotero.getString('zotero.preferences.search.clearWarning',
|
||||
Zotero.getString('zotero.preferences.search.clearNonLinkedURLs')),
|
||||
buttonFlags,
|
||||
Zotero.getString('zotero.preferences.search.clearIndex'),
|
||||
Zotero.getString('zotero.preferences.search.clearNonLinkedURLs'),
|
||||
null, null, {});
|
||||
|
||||
if (index == 0) {
|
||||
Zotero.Fulltext.clearIndex();
|
||||
}
|
||||
else if (index == 1) {
|
||||
Zotero.Fulltext.clearIndex(true);
|
||||
}
|
||||
|
||||
updateIndexStats();
|
||||
}
|
||||
|
||||
|
||||
function initSearchPane() {
|
||||
document.getElementById('fulltext-rebuildIndex').setAttribute('label',
|
||||
Zotero.getString('zotero.preferences.search.rebuildIndex'));
|
||||
document.getElementById('fulltext-clearIndex').setAttribute('label',
|
||||
Zotero.getString('zotero.preferences.search.clearIndex'));
|
||||
updatePDFToolsStatus();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Update window according to installation status for PDF tools
|
||||
* (e.g. status line, install/update button, etc.)
|
||||
*/
|
||||
function updatePDFToolsStatus() {
|
||||
var converterIsRegistered = Zotero.Fulltext.pdfConverterIsRegistered();
|
||||
var infoIsRegistered = Zotero.Fulltext.pdfInfoIsRegistered();
|
||||
|
||||
var converterStatusLabel = document.getElementById('pdfconverter-status');
|
||||
var infoStatusLabel = document.getElementById('pdfinfo-status');
|
||||
var requiredLabel = document.getElementById('pdftools-required');
|
||||
var updateButton = document.getElementById('pdftools-update-button');
|
||||
var documentationLink = document.getElementById('pdftools-documentation-link');
|
||||
var settingsBox = document.getElementById('pdftools-settings');
|
||||
|
||||
// If we haven't already generated the required and documentation messages
|
||||
if (!converterIsRegistered && !requiredLabel.hasChildNodes()) {
|
||||
var utils = new Zotero.Utilities();
|
||||
|
||||
// Xpdf link
|
||||
var str = Zotero.getString('zotero.preferences.search.pdf.toolsRequired',
|
||||
[Zotero.Fulltext.pdfConverterName, Zotero.Fulltext.pdfInfoName,
|
||||
'<a href="' + Zotero.Fulltext.pdfToolsURL + '">'
|
||||
+ Zotero.Fulltext.pdfToolsName + '</a>']);
|
||||
var parts = utils.parseMarkup(str);
|
||||
for (var i=0; i<parts.length; i++) {
|
||||
var part = parts[i];
|
||||
if (part.type == 'text') {
|
||||
var elem = document.createTextNode(part.text);
|
||||
}
|
||||
else if (part.type == 'link') {
|
||||
var elem = document.createElement('label');
|
||||
elem.setAttribute('value', part.text);
|
||||
elem.setAttribute('class', 'text-link');
|
||||
for (var key in part.attributes) {
|
||||
elem.setAttribute(key, part.attributes[key]);
|
||||
|
||||
if (key == 'href') {
|
||||
elem.setAttribute('tooltiptext', part.attributes[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
requiredLabel.appendChild(elem);
|
||||
}
|
||||
|
||||
requiredLabel.appendChild(document.createTextNode(' '
|
||||
+ Zotero.getString('zotero.preferences.search.pdf.automaticInstall')));
|
||||
|
||||
// Documentation link
|
||||
var link = '<a href="http://www.zotero.org/documentation/pdf_fulltext_indexing">'
|
||||
+ Zotero.getString('zotero.preferences.search.pdf.documentationLink')
|
||||
+ '</a>';
|
||||
var str = Zotero.getString('zotero.preferences.search.pdf.advancedUsers', link);
|
||||
var parts = utils.parseMarkup(str);
|
||||
|
||||
for (var i=0; i<parts.length; i++) {
|
||||
var part = parts[i];
|
||||
if (part.type == 'text') {
|
||||
var elem = document.createTextNode(part.text);
|
||||
}
|
||||
else if (part.type == 'link') {
|
||||
var elem = document.createElement('label');
|
||||
elem.setAttribute('value', part.text);
|
||||
elem.setAttribute('class', 'text-link');
|
||||
for (var key in part.attributes) {
|
||||
elem.setAttribute(key, part.attributes[key]);
|
||||
|
||||
if (key == 'href') {
|
||||
elem.setAttribute('tooltiptext', part.attributes[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
documentationLink.appendChild(elem);
|
||||
}
|
||||
}
|
||||
|
||||
// converter status line
|
||||
var prefix = 'zotero.preferences.search.pdf.tool';
|
||||
if (converterIsRegistered) {
|
||||
var version = Zotero.Fulltext.pdfConverterVersion;
|
||||
str = Zotero.getString(prefix + 'Registered',
|
||||
Zotero.getString('zotero.preferences.search.pdf.toolVersionPlatform',
|
||||
[Zotero.Fulltext.pdfConverterName, version]));
|
||||
}
|
||||
else {
|
||||
str = Zotero.getString(prefix + 'NotRegistered',
|
||||
[Zotero.Fulltext.pdfConverterFileName]);
|
||||
}
|
||||
converterStatusLabel.setAttribute('value', str);
|
||||
|
||||
// pdfinfo status line
|
||||
if (infoIsRegistered) {
|
||||
var version = Zotero.Fulltext.pdfInfoVersion;
|
||||
str = Zotero.getString(prefix + 'Registered',
|
||||
Zotero.getString('zotero.preferences.search.pdf.toolVersionPlatform',
|
||||
[Zotero.Fulltext.pdfInfoName, version]));
|
||||
}
|
||||
else {
|
||||
str = Zotero.getString(prefix + 'NotRegistered',
|
||||
[Zotero.Fulltext.pdfInfoFileName]);
|
||||
}
|
||||
infoStatusLabel.setAttribute('value', str);
|
||||
|
||||
str = converterIsRegistered ?
|
||||
Zotero.getString('general.checkForUpdate') :
|
||||
Zotero.getString('zotero.preferences.search.pdf.checkForInstaller');
|
||||
updateButton.setAttribute('label', str);
|
||||
|
||||
requiredLabel.setAttribute('hidden', converterIsRegistered);
|
||||
documentationLink.setAttribute('hidden', converterIsRegistered);
|
||||
settingsBox.setAttribute('hidden', !converterIsRegistered);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check available versions of PDF tools from server and prompt for installation
|
||||
* if a newer version is available
|
||||
*/
|
||||
function checkPDFToolsDownloadVersion() {
|
||||
var url = Zotero.Fulltext.pdfToolsDownloadBaseURL
|
||||
+ Zotero.platform.replace(' ', '-') + '.latest';
|
||||
|
||||
// Find latest version for this platform
|
||||
var sent = Zotero.Utilities.HTTP.doGet(url, function (xmlhttp) {
|
||||
try {
|
||||
if (xmlhttp.status == 200) {
|
||||
var converterIsRegistered = Zotero.Fulltext.pdfConverterIsRegistered();
|
||||
var infoIsRegistered = Zotero.Fulltext.pdfInfoIsRegistered();
|
||||
var bothRegistered = converterIsRegistered && infoIsRegistered;
|
||||
|
||||
var converterVersion = xmlhttp.responseText.split(/\s/)[0];
|
||||
var infoVersion = xmlhttp.responseText.split(/\s/)[1];
|
||||
|
||||
var converterVersionAvailable = converterVersion &&
|
||||
(!converterIsRegistered ||
|
||||
Zotero.Fulltext.pdfConverterVersion == 'UNKNOWN' ||
|
||||
converterVersion > Zotero.Fulltext.pdfConverterVersion);
|
||||
var infoVersionAvailable = infoVersion &&
|
||||
(!infoIsRegistered ||
|
||||
Zotero.Fulltext.pdfInfoVersion == 'UNKNOWN' ||
|
||||
infoVersion > Zotero.Fulltext.pdfInfoVersion);
|
||||
var bothAvailable = converterVersionAvailable && infoVersionAvailable;
|
||||
|
||||
/*
|
||||
Zotero.debug(converterIsRegistered);
|
||||
Zotero.debug(infoIsRegistered);
|
||||
Zotero.debug(converterVersion);
|
||||
Zotero.debug(infoVersion);
|
||||
Zotero.debug(Zotero.Fulltext.pdfConverterVersion);
|
||||
Zotero.debug(Zotero.Fulltext.pdfInfoVersion);
|
||||
Zotero.debug(converterVersionAvailable);
|
||||
Zotero.debug(infoVersionAvailable);
|
||||
*/
|
||||
|
||||
// Up to date -- disable update button
|
||||
if (!converterVersionAvailable && !infoVersionAvailable) {
|
||||
var button = document.getElementById('pdftools-update-button');
|
||||
button.setAttribute('label', Zotero.getString('zotero.preferences.update.upToDate'));
|
||||
button.setAttribute('disabled', true);
|
||||
}
|
||||
// New version available -- display update prompt
|
||||
else {
|
||||
var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].
|
||||
createInstance(Components.interfaces.nsIPromptService);
|
||||
var buttonFlags = (ps.BUTTON_POS_0) * (ps.BUTTON_TITLE_IS_STRING)
|
||||
+ (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_CANCEL);
|
||||
|
||||
var msg = Zotero.getString('zotero.preferences.search.pdf.available'
|
||||
+ ((converterIsRegistered || infoIsRegistered) ? 'Updates' : 'Downloads'),
|
||||
[Zotero.platform, 'zotero.org']) + '\n\n';
|
||||
|
||||
if (converterVersionAvailable) {
|
||||
tvp = Zotero.getString('zotero.preferences.search.pdf.toolVersionPlatform',
|
||||
[Zotero.Fulltext.pdfConverterName, converterVersion]);
|
||||
msg += '- ' + tvp + '\n';
|
||||
}
|
||||
if (infoVersionAvailable) {
|
||||
tvp = Zotero.getString('zotero.preferences.search.pdf.toolVersionPlatform',
|
||||
[Zotero.Fulltext.pdfInfoName, infoVersion]);
|
||||
msg += '- ' + tvp + '\n';
|
||||
}
|
||||
msg += '\n';
|
||||
msg += Zotero.getString('zotero.preferences.search.pdf.zoteroCanInstallVersion'
|
||||
+ (bothAvailable ? 's' : ''));
|
||||
|
||||
var index = ps.confirmEx(null,
|
||||
converterIsRegistered ?
|
||||
Zotero.getString('general.updateAvailable') : '',
|
||||
msg,
|
||||
buttonFlags,
|
||||
converterIsRegistered ?
|
||||
Zotero.getString('general.upgrade') :
|
||||
Zotero.getString('general.install'),
|
||||
null, null, null, {});
|
||||
|
||||
if (index == 0) {
|
||||
var installVersions = {
|
||||
converter: converterVersionAvailable ?
|
||||
converterVersion : null,
|
||||
info: infoVersionAvailable ?
|
||||
infoVersion : null
|
||||
};
|
||||
installPDFTools(installVersions);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Version not found for platform
|
||||
else if (xmlhttp.status == 404) {
|
||||
onPDFToolsDownloadError(404);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
onPDFToolsDownloadError(e);
|
||||
}
|
||||
});
|
||||
|
||||
// Browser is offline
|
||||
if (!sent) {
|
||||
onPDFToolsDownloadError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Begin installation of specified PDF tools from server -- does a HEAD call to
|
||||
* make sure file exists and then calls downloadPDFTool() if so
|
||||
*/
|
||||
function installPDFTools(installVersions) {
|
||||
if (!installVersions) {
|
||||
installVersions = {
|
||||
converter: true,
|
||||
info: true
|
||||
};
|
||||
}
|
||||
|
||||
// We install the converter first if it's available
|
||||
var url = Zotero.Fulltext.pdfToolsDownloadBaseURL;
|
||||
if (installVersions.converter) {
|
||||
var tool = 'converter';
|
||||
var version = installVersions.converter;
|
||||
url += Zotero.Fulltext.pdfConverterFileName + '-' + installVersions.converter;
|
||||
}
|
||||
else if (installVersions.info) {
|
||||
var tool = 'info';
|
||||
var version = installVersions.info;
|
||||
url += Zotero.Fulltext.pdfInfoFileName + '-' + installVersions.info;
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
||||
// Find latest version for this platform
|
||||
var sent = Zotero.Utilities.HTTP.doHead(url, function (xmlhttp) {
|
||||
try {
|
||||
if (xmlhttp.status == 200) {
|
||||
// If doing both and on converter, chain pdfinfo
|
||||
if (installVersions.converter && installVersions.info) {
|
||||
downloadPDFTool(tool, version, function () {
|
||||
return installPDFTools({ info: installVersions.info });
|
||||
});
|
||||
}
|
||||
else {
|
||||
downloadPDFTool(tool, version);
|
||||
}
|
||||
}
|
||||
// Version not found for platform
|
||||
else if (xmlhttp.status == 404) {
|
||||
onPDFToolsDownloadError(404);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
onPDFToolsDownloadError(e);
|
||||
}
|
||||
});
|
||||
|
||||
// Browser is offline
|
||||
if (!sent) {
|
||||
onPDFToolsDownloadError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Download and install specified PDF tool
|
||||
*/
|
||||
function downloadPDFTool(tool, version, callback) {
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
|
||||
if (tool == 'converter') {
|
||||
var fileName = Zotero.Fulltext.pdfConverterFileName;
|
||||
}
|
||||
else {
|
||||
var fileName = Zotero.Fulltext.pdfInfoFileName;
|
||||
}
|
||||
|
||||
|
||||
var url = Zotero.Fulltext.pdfToolsDownloadBaseURL + fileName + '-' + version;
|
||||
var uri = ioService.newURI(url, null, null);
|
||||
|
||||
var file = Zotero.getZoteroDirectory();
|
||||
file.append(fileName);
|
||||
var fileURL = ioService.newFileURI(file);
|
||||
|
||||
const nsIWBP = Components.interfaces.nsIWebBrowserPersist;
|
||||
var wbp = Components.classes["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]
|
||||
.createInstance(nsIWBP);
|
||||
|
||||
var progressListener = new Zotero.WebProgressFinishListener(function () {
|
||||
// Set permissions to 755
|
||||
if (Zotero.isMac) {
|
||||
file.permissions = 33261;
|
||||
}
|
||||
else if (Zotero.isLinux) {
|
||||
file.permissions = 493;
|
||||
}
|
||||
|
||||
// Write the version number to a file
|
||||
var versionFile = Zotero.getZoteroDirectory();
|
||||
versionFile.append(fileName + '.version');
|
||||
Zotero.File.putContents(versionFile, version + '');
|
||||
|
||||
Zotero.Fulltext.registerPDFTool(tool);
|
||||
|
||||
// Used to install info tool after converter
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
// If done
|
||||
else {
|
||||
updatePDFToolsStatus();
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
var tr = Components.classes["@mozilla.org/transfer;1"].
|
||||
createInstance(Components.interfaces.nsITransfer);
|
||||
tr.init(uri, fileURL, "", null, null, null, wbp);
|
||||
*/
|
||||
|
||||
document.getElementById('pdftools-update-button').disabled = true;
|
||||
var str = Zotero.getString('zotero.preferences.search.pdf.downloading');
|
||||
document.getElementById('pdftools-update-button').setAttribute('label', str);
|
||||
|
||||
wbp.progressListener = progressListener;
|
||||
Zotero.debug("Saving " + uri.spec + " to " + fileURL.spec);
|
||||
wbp.saveURI(uri, null, null, null, null, fileURL);
|
||||
}
|
||||
|
||||
|
||||
function onPDFToolsDownloadError(e) {
|
||||
if (e == 404) {
|
||||
var str = Zotero.getString('zotero.preferences.search.pdf.toolDownloadsNotAvailable',
|
||||
Zotero.Fulltext.pdfToolsName) + ' '
|
||||
+ Zotero.getString('zotero.preferences.search.pdf.viewManualInstructions');
|
||||
}
|
||||
else if (e) {
|
||||
Components.utils.reportError(e);
|
||||
var str = Zotero.getString('zotero.preferences.search.pdf.toolsDownloadError', Zotero.Fulltext.pdfToolsName)
|
||||
+ ' ' + Zotero.getString('zotero.preferences.search.pdf.tryAgainOrViewManualInstructions');
|
||||
}
|
||||
else {
|
||||
var info = Components.classes["@mozilla.org/xre/app-info;1"]
|
||||
.getService(Components.interfaces.nsIXULAppInfo);
|
||||
var browser = info.name; // Returns "Firefox" for Firefox
|
||||
var str = Zotero.getString('general.browserIsOffline', browser);
|
||||
}
|
||||
alert(str);
|
||||
}
|
||||
|
||||
|
||||
function updateIndexStats() {
|
||||
var stats = Zotero.Fulltext.getIndexStats();
|
||||
document.getElementById('fulltext-stats-indexed').
|
||||
lastChild.setAttribute('value', stats.indexed);
|
||||
document.getElementById('fulltext-stats-partial').
|
||||
lastChild.setAttribute('value', stats.partial);
|
||||
document.getElementById('fulltext-stats-unindexed').
|
||||
lastChild.setAttribute('value', stats.unindexed);
|
||||
document.getElementById('fulltext-stats-words').
|
||||
lastChild.setAttribute('value', stats.words);
|
||||
}
|
||||
|
||||
|
||||
function revealDataDirectory() {
|
||||
var dataDir = Zotero.getZoteroDirectory();
|
||||
dataDir.QueryInterface(Components.interfaces.nsILocalFile);
|
||||
try {
|
||||
dataDir.reveal();
|
||||
}
|
||||
catch (e) {
|
||||
// On platforms that don't support nsILocalFile.reveal() (e.g. Linux), we
|
||||
// open a small window with a selected read-only textbox containing the
|
||||
// file path, so the user can open it, Control-c, Control-w, Alt-Tab, and
|
||||
// Control-v the path into another app
|
||||
var io = {alertText: dataDir.path};
|
||||
window.openDialog('chrome://zotero/content/selectableAlert.xul', "zotero-reveal-window", "chrome", io);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function runIntegrityCheck() {
|
||||
var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService);
|
||||
|
||||
var ok = Zotero.DB.integrityCheck();
|
||||
var str = ok ? 'passed' : 'failed';
|
||||
|
||||
ps.alert(window,
|
||||
Zotero.getString('general.' + str),
|
||||
Zotero.getString('db.integrityCheck.' + str));
|
||||
}
|
||||
|
||||
|
||||
function rebuildTranslators() {
|
||||
var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService);
|
||||
|
||||
var buttonFlags = (ps.BUTTON_POS_0) * (ps.BUTTON_TITLE_IS_STRING)
|
||||
+ (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_CANCEL);
|
||||
|
||||
var index = ps.confirmEx(null,
|
||||
Zotero.getString('general.warning'),
|
||||
Zotero.getString('zotero.preferences.advanced.rebuildTranslators.changesLost'),
|
||||
buttonFlags,
|
||||
Zotero.getString('zotero.preferences.advanced.rebuildTranslators.rebuildTable'),
|
||||
null, null, null, {});
|
||||
|
||||
if (index == 0) {
|
||||
Zotero.Schema.rebuildTranslatorsTable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function onOpenURLSelected()
|
||||
{
|
||||
var openURLMenu = document.getElementById('openURLMenu');
|
||||
|
||||
if(openURLMenu.value == "custom")
|
||||
{
|
||||
openURLServerField.focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
openURLServerField.value = openURLResolvers[openURLMenu.selectedIndex]['url'];
|
||||
openURLVersionMenu.value = openURLResolvers[openURLMenu.selectedIndex]['version'];
|
||||
}
|
||||
}
|
||||
|
||||
function onOpenURLCustomized()
|
||||
{
|
||||
document.getElementById('openURLMenu').value = "custom";
|
||||
}
|
415
chrome/content/zotero/preferences/preferences.xul
Normal file
415
chrome/content/zotero/preferences/preferences.xul
Normal file
|
@ -0,0 +1,415 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (c) 2006 Center for History and New Media
|
||||
George Mason University, Fairfax, Virginia, USA
|
||||
http://chnm.gmu.edu
|
||||
|
||||
Licensed under the Educational Community License, Version 1.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.opensource.org/licenses/ecl1.php
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
-->
|
||||
<!DOCTYPE prefwindow SYSTEM "chrome://zotero/locale/preferences.dtd">
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/preferences.css"?>
|
||||
|
||||
<!--
|
||||
|
||||
To add a new preference:
|
||||
1) Add a new <preference> to <preferences>
|
||||
2) Add a XUL control with a 'preference' attribute
|
||||
3) (Optional) Add additional setup/change logic to preferences.js
|
||||
4) (Optional) To add an observer for a preference change,
|
||||
add an appropriate case in the switch statement
|
||||
in Zotero.Prefs.observe()
|
||||
|
||||
-->
|
||||
<prefwindow id="zotero-prefs" title="&zotero.preferences.title;" onload="moveToAlertPosition(); init()"
|
||||
windowtype="zotero:pref" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<prefpane id="zotero-prefpane-general" label="&zotero.preferences.prefpane.general;">
|
||||
<preferences>
|
||||
<preference id="pref-zoteroPaneOnTop" name="extensions.zotero.zoteroPaneOnTop" type="bool"/>
|
||||
<preference id="pref-fontSize" name="extensions.zotero.fontSize" type="string"/>
|
||||
<preference id="pref-statusBarIcon" name="extensions.zotero.statusBarIcon" type="int"/>
|
||||
<preference id="pref-automaticScraperUpdates" name="extensions.zotero.automaticScraperUpdates" type="bool"/>
|
||||
<preference id="pref-reportTranslationFailure" name="extensions.zotero.reportTranslationFailure" type="bool"/>
|
||||
<preference id="pref-parseEndNoteMIMETypes" name="extensions.zotero.parseEndNoteMIMETypes" type="bool" onchange="Zotero.Ingester.MIMEHandler.init()"/>
|
||||
<preference id="pref-automaticSnapshots" name="extensions.zotero.automaticSnapshots" type="bool"/>
|
||||
<preference id="pref-downloadAssociatedFiles" name="extensions.zotero.downloadAssociatedFiles" type="bool"/>
|
||||
<preference id="pref-automaticTags" name="extensions.zotero.automaticTags" type="bool"/>
|
||||
<preference id="pref-openURL-resolver" name="extensions.zotero.openURL.resolver" type="string"/>
|
||||
<preference id="pref-openURL-version" name="extensions.zotero.openURL.version" type="string"/>
|
||||
</preferences>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&zotero.preferences.userInterface;"/>
|
||||
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
|
||||
<rows>
|
||||
<row>
|
||||
<hbox id="position-menu-box-label">
|
||||
<label value="&zotero.preferences.position;" control="positionMenu"/>
|
||||
</hbox>
|
||||
<hbox id="position-menu-box">
|
||||
<menulist id="positionMenu" preference="pref-zoteroPaneOnTop">
|
||||
<menupopup>
|
||||
<menuitem label="&zotero.preferences.position.above;" value="true"/>
|
||||
<menuitem label="&zotero.preferences.position.below;" value="false"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<label value="&zotero.preferences.position.browser;"/>
|
||||
</hbox>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<hbox>
|
||||
<label value="&zotero.preferences.fontSize;" control="fontSize"/>
|
||||
</hbox>
|
||||
<radiogroup id="fontSize" orient="horizontal" preference="pref-fontSize">
|
||||
<radio id="fontSize1" label="&zotero.preferences.fontSize.small;" value="1.0"/>
|
||||
<radio id="fontSize2" label="&zotero.preferences.fontSize.medium;" value="1.25"/>
|
||||
<radio id="fontSize3" label="&zotero.preferences.fontSize.large;" value="1.5"/>
|
||||
</radiogroup>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<hbox>
|
||||
<label value="&zotero.preferences.statusBarIcon;" control="statusBarIcon"/>
|
||||
</hbox>
|
||||
<radiogroup id="statusBarIcon" orient="horizontal" preference="pref-statusBarIcon">
|
||||
<radio src="chrome://zotero/skin/zotero_status_bar.png" value="2"/>
|
||||
<radio src="chrome://zotero/skin/zotero_status_bar_compact.png" value="1"/>
|
||||
<radio label="&zotero.preferences.statusBarIcon.none;" value="0"/>
|
||||
</radiogroup>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<label class="statusLine" value="&zotero.preferences.keys.changesTakeEffect;"/>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&zotero.preferences.miscellaneous;"/>
|
||||
|
||||
<hbox align="center">
|
||||
<checkbox label="&zotero.preferences.autoUpdate;" preference="pref-automaticScraperUpdates"/>
|
||||
<button id="updateButton" style="margin-top:0" label="&zotero.preferences.updateNow;" oncommand="Zotero.Schema.updateScrapersRemote(true)"/>
|
||||
</hbox>
|
||||
|
||||
<checkbox label="&zotero.preferences.reportTranslationFailure;" preference="pref-reportTranslationFailure"/>
|
||||
<checkbox label="&zotero.preferences.parseRISRefer;" preference="pref-parseEndNoteMIMETypes"/>
|
||||
<checkbox label="&zotero.preferences.automaticSnapshots;" preference="pref-automaticSnapshots"/>
|
||||
<checkbox label="&zotero.preferences.downloadAssociatedFiles;" preference="pref-downloadAssociatedFiles"/>
|
||||
<checkbox label="&zotero.preferences.automaticTags;" preference="pref-automaticTags"/>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&zotero.preferences.openurl.caption;"/>
|
||||
|
||||
<button id="openURLSearchButton" label="&zotero.preferences.openurl.search;" oncommand="populateOpenURLResolvers()"/>
|
||||
<menulist id="openURLMenu" oncommand="onOpenURLSelected();">
|
||||
<menupopup>
|
||||
<menuseparator/>
|
||||
<menuitem label="&zotero.preferences.openurl.custom;" value="custom" selected="true"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
|
||||
<hbox align="center">
|
||||
<label value="&zotero.preferences.openurl.server;"/>
|
||||
<textbox id="openURLServerField" flex="1" oninput="onOpenURLCustomized();" preference="pref-openURL-resolver"/>
|
||||
</hbox>
|
||||
|
||||
<hbox align="center">
|
||||
<label value="&zotero.preferences.openurl.version;" control="openURLVersionMenu"/>
|
||||
<menulist id="openURLVersionMenu" oncommand="onOpenURLCustomized();" preference="pref-openURL-version">
|
||||
<menupopup>
|
||||
<menuitem label="0.1" value="0.1"/>
|
||||
<menuitem label="1.0" value="1.0"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
</prefpane>
|
||||
|
||||
|
||||
<prefpane id="zotero-prefpane-search" label="&zotero.preferences.prefpane.search;"
|
||||
onpaneload="updateIndexStats()">
|
||||
<preferences>
|
||||
<preference id="pref-fulltext-textMaxLength" name="extensions.zotero.fulltext.textMaxLength" type="int"/>
|
||||
<preference id="pref-fulltext-pdfmaxpages" name="extensions.zotero.fulltext.pdfMaxPages" type="int"/>
|
||||
</preferences>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&zotero.preferences.search.fulltextCache;"/>
|
||||
|
||||
<hbox>
|
||||
<button id="fulltext-rebuildIndex" flex="1" oncommand="rebuildIndexPrompt()"/>
|
||||
<button id="fulltext-clearIndex" flex="1" oncommand="clearIndexPrompt()"/>
|
||||
</hbox>
|
||||
|
||||
<grid id="fulltext-settings">
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
|
||||
<rows>
|
||||
<row>
|
||||
<hbox>
|
||||
<label value="&zotero.preferences.fulltext.textMaxLength;"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<textbox size="10" preference="pref-fulltext-textMaxLength"/>
|
||||
<label value="(&zotero.preferences.default; 500000)"/>
|
||||
</hbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</groupbox>
|
||||
|
||||
<groupbox id="pdftools-box">
|
||||
<caption label="&zotero.preferences.search.pdfIndexing;"/>
|
||||
|
||||
<label id="pdfconverter-status"/>
|
||||
<label id="pdfinfo-status"/>
|
||||
<label id="pdftools-required" hidden="true"/>
|
||||
<hbox>
|
||||
<button id="pdftools-update-button" flex="1" oncommand="checkPDFToolsDownloadVersion()"/>
|
||||
</hbox>
|
||||
<label id="pdftools-documentation-link" hidden="true"/>
|
||||
|
||||
<grid id="pdftools-settings" hidden="true">
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
|
||||
<rows>
|
||||
<row>
|
||||
<hbox>
|
||||
<label value="&zotero.preferences.fulltext.pdfMaxPages;"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<textbox size="5" preference="pref-fulltext-pdfmaxpages"/>
|
||||
<label value="(&zotero.preferences.default; 100)"/>
|
||||
</hbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</groupbox>
|
||||
|
||||
<groupbox id="fulltext-stats">
|
||||
<caption label="&zotero.preferences.search.indexStats;"/>
|
||||
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
<column/>
|
||||
</columns>
|
||||
|
||||
<rows>
|
||||
<row id="fulltext-stats-indexed">
|
||||
<label value="&zotero.preferences.search.indexStats.indexed;"/>
|
||||
<label/>
|
||||
</row>
|
||||
<row id="fulltext-stats-partial">
|
||||
<label value="&zotero.preferences.search.indexStats.partial;"/>
|
||||
<label/>
|
||||
</row>
|
||||
<row id="fulltext-stats-unindexed">
|
||||
<label value="&zotero.preferences.search.indexStats.unindexed;"/>
|
||||
<label/>
|
||||
</row>
|
||||
<row id="fulltext-stats-words">
|
||||
<label value="&zotero.preferences.search.indexStats.words;"/>
|
||||
<label/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</groupbox>
|
||||
</prefpane>
|
||||
|
||||
|
||||
<prefpane id="zotero-prefpane-export" label="&zotero.preferences.prefpane.export;">
|
||||
<preferences>
|
||||
<preference id="pref-quickCopy-setting" name="extensions.zotero.export.quickCopy.setting" type="string"/>
|
||||
</preferences>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&zotero.preferences.quickCopy.caption;"/>
|
||||
|
||||
<label id="quickCopy-instructions"/>
|
||||
|
||||
<vbox>
|
||||
<label value="&zotero.preferences.quickCopy.defaultOutputFormat;" control="quickCopy-menu"/>
|
||||
<menulist id="quickCopy-menu"/>
|
||||
</vbox>
|
||||
|
||||
<vbox>
|
||||
<label value="&zotero.preferences.quickCopy.siteEditor.setings;" control="quickCopy-siteSettings"/>
|
||||
<tree flex="1" id="quickCopy-siteSettings" hidecolumnpicker="true" rows="6" seltype="single"
|
||||
ondblclick="showQuickCopySiteEditor(this.currentIndex)"
|
||||
onkeypress="if (event.keyCode == event.DOM_VK_DELETE) { deleteSelectedQuickCopySite(); }">
|
||||
<treecols>
|
||||
<treecol id="quickCopy-urlColumn" label="&zotero.preferences.quickCopy.siteEditor.domainPath;" flex="1"/>
|
||||
<treecol id="quickCopy-formatColumn" label="&zotero.preferences.quickCopy.siteEditor.outputFormat;" flex="2"/>
|
||||
</treecols>
|
||||
<treechildren id="quickCopy-siteSettings-rows"/>
|
||||
</tree>
|
||||
<hbox pack="end">
|
||||
<button label="-" onclick="deleteSelectedQuickCopySite()"/>
|
||||
<button label="+" onclick="showQuickCopySiteEditor()"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<label id="quickCopy-macWarning" hidden="true" value="&zotero.preferences.quickCopy.macWarning;"/>
|
||||
</groupbox>
|
||||
</prefpane>
|
||||
|
||||
|
||||
<prefpane id="zotero-prefpane-keys" label="&zotero.preferences.prefpane.keys;">
|
||||
<preferences>
|
||||
<preference id="pref-keys-openZotero" name="extensions.zotero.keys.openZotero" type="string"/>
|
||||
<preference id="pref-keys-toggleFullscreen" name="extensions.zotero.keys.toggleFullscreen" type="string"/>
|
||||
<preference id="pref-keys-library" name="extensions.zotero.keys.library" type="string"/>
|
||||
<preference id="pref-keys-quicksearch" name="extensions.zotero.keys.quicksearch" type="string"/>
|
||||
<preference id="pref-keys-newItem" name="extensions.zotero.keys.newItem" type="string"/>
|
||||
<preference id="pref-keys-newNote" name="extensions.zotero.keys.newNote" type="string"/>
|
||||
<preference id="pref-keys-toggleTagSelector" name="extensions.zotero.keys.toggleTagSelector" type="string"/>
|
||||
<preference id="pref-keys-copySelectedItemCitationsToClipboard" name="extensions.zotero.keys.copySelectedItemCitationsToClipboard" type="string"/>
|
||||
<preference id="pref-keys-copySelectedItemsToClipboard" name="extensions.zotero.keys.copySelectedItemsToClipboard" type="string"/>
|
||||
<preference id="pref-keys-overrideGlobal" name="extensions.zotero.keys.overrideGlobal" type="bool"/>
|
||||
</preferences>
|
||||
|
||||
<grid>
|
||||
<columns>
|
||||
<column flex="1"/>
|
||||
<column/>
|
||||
<column/>
|
||||
</columns>
|
||||
|
||||
<rows>
|
||||
<row>
|
||||
<label value="&zotero.preferences.keys.openZotero;" control="key-textbox-openZotero"/>
|
||||
<label/>
|
||||
<textbox id="textbox-openZotero" maxlength="1" size="1" preference="pref-keys-openZotero"/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label value="&zotero.preferences.keys.toggleFullscreen;" control="textbox-toggleFullscreen"/>
|
||||
<label/>
|
||||
<textbox id="textbox-toggleFullscreen" maxlength="1" size="1" preference="pref-keys-toggleFullscreen"/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label value="&zotero.preferences.keys.library;" control="textbox-library"/>
|
||||
<label/>
|
||||
<textbox id="textbox-library" maxlength="1" size="1" preference="pref-keys-library"/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label value="&zotero.preferences.keys.quicksearch;" control="textbox-quicksearch"/>
|
||||
<label/>
|
||||
<textbox id="textbox-quicksearch" maxlength="1" size="1" preference="pref-keys-quicksearch"/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label value="&zotero.preferences.keys.newItem;" control="textbox-newItem"/>
|
||||
<label/>
|
||||
<textbox id="textbox-newItem" maxlength="1" size="1" preference="pref-keys-newItem"/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label value="&zotero.preferences.keys.newNote;" control="textbox-newNote"/>
|
||||
<label/>
|
||||
<textbox id="textbox-newNote" maxlength="1" size="1" preference="pref-keys-newNote"/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label value="&zotero.preferences.keys.toggleTagSelector;" control="textbox-toggleTagSelector"/>
|
||||
<label/>
|
||||
<textbox id="textbox-toggleTagSelector" maxlength="1" size="1" preference="pref-keys-toggleTagSelector"/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label value="&zotero.preferences.keys.copySelectedItemCitationsToClipboard;" control="textbox-copySelectedItemCitationsToClipboard"/>
|
||||
<label/>
|
||||
<textbox id="textbox-copySelectedItemCitationsToClipboard" maxlength="1" size="1" preference="pref-keys-copySelectedItemCitationsToClipboard"/>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label value="&zotero.preferences.keys.copySelectedItemsToClipboard;" control="textbox-copySelectedItemsToClipboard"/>
|
||||
<label/>
|
||||
<textbox id="textbox-copySelectedItemsToClipboard" maxlength="1" size="1" preference="pref-keys-copySelectedItemsToClipboard" onchange="updateQuickCopyInstructions()"/>
|
||||
</row>
|
||||
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<checkbox label="&zotero.preferences.keys.overrideGlobal;" preference="pref-keys-overrideGlobal"/>
|
||||
|
||||
<label class="statusLine" value="&zotero.preferences.keys.changesTakeEffect;"/>
|
||||
</prefpane>
|
||||
|
||||
|
||||
<prefpane id="zotero-prefpane-advanced" label="&zotero.preferences.prefpane.advanced;">
|
||||
<preferences>
|
||||
<preference id="pref-useDataDir" name="extensions.zotero.useDataDir" type="bool"/>
|
||||
<preference id="pref-dataDir" name="extensions.zotero.dataDir" type="string"/>
|
||||
</preferences>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&zotero.preferences.dataDir;"/>
|
||||
|
||||
<radiogroup id="dataDir" preference="pref-useDataDir" onsyncfrompreference="onDataDirLoad();" onsynctopreference="return onDataDirUpdate(event);">
|
||||
<radio label="&zotero.preferences.dataDir.useProfile;" value="false"/>
|
||||
<hbox>
|
||||
<radio label="&zotero.preferences.dataDir.custom;" value="true"/>
|
||||
<textbox id="dataDirPath" preference="pref-dataDir" onsyncfrompreference="return getDataDirPath();" readonly="true" flex="1"/>
|
||||
<button label="&zotero.preferences.dataDir.choose;" oncommand="var file = Zotero.chooseZoteroDirectory(true); if (!file) { event.stopPropagation(); }"/>
|
||||
</hbox>
|
||||
</radiogroup>
|
||||
|
||||
<hbox>
|
||||
<button label="&zotero.preferences.dataDir.reveal;" oncommand="revealDataDirectory()"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<caption label="&zotero.preferences.dbMaintenance;"/>
|
||||
|
||||
<hbox>
|
||||
<button label="&zotero.preferences.dbMaintenance.integrityCheck;" oncommand="runIntegrityCheck()"/>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<button label="&zotero.preferences.dbMaintenance.rebuildTranslators;" oncommand="rebuildTranslators()"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
</prefpane>
|
||||
|
||||
|
||||
<!-- These mess up the prefwindow if they come before the prefpanes
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=296418 -->
|
||||
<script src="chrome://zotero/content/include.js"/>
|
||||
<script src="preferences.js"/>
|
||||
</prefwindow>
|
48
chrome/content/zotero/preferences/quickCopySiteEditor.xul
Normal file
48
chrome/content/zotero/preferences/quickCopySiteEditor.xul
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/preferences.css"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/preferences.dtd">
|
||||
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="" buttons="cancel,accept"
|
||||
id="zotero-quickCopySiteEditor"
|
||||
onload="sizeToContent();"
|
||||
ondialogaccept="Zotero_QuickCopySiteEditor.onAccept();">
|
||||
|
||||
<script src="chrome://zotero/content/include.js"/>
|
||||
<script src="preferences.js"/>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
var Zotero_QuickCopySiteEditor = new function () {
|
||||
this.onAccept = onAccept;
|
||||
|
||||
function onAccept() {
|
||||
var io = window.arguments[0];
|
||||
io.domain = document.getElementById('zotero-quickCopy-domain').value;
|
||||
io.format = document.getElementById('zotero-quickCopy-format').value;
|
||||
io.ok = true;
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<vbox id="zotero-preferences-quickCopySiteEditor">
|
||||
<vbox>
|
||||
<label value="&zotero.preferences.quickCopy.siteEditor.domainPath; &zotero.preferences.quickCopy.siteEditor.domainPath.example;" control="zotero-quickCopy-domain"/>
|
||||
<textbox id="zotero-quickCopy-domain"/>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<label value="&zotero.preferences.quickCopy.siteEditor.outputFormat;" control="zotero-quickCopy-format"/>
|
||||
<menulist id="zotero-quickCopy-format"/>
|
||||
</vbox>
|
||||
</vbox>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
var io = window.arguments[0];
|
||||
document.getElementById('zotero-quickCopy-domain').value = io.domain ? io.domain : '';
|
||||
buildQuickCopyFormatDropDown(document.getElementById('zotero-quickCopy-format'), io.format);
|
||||
]]>
|
||||
</script>
|
||||
</dialog>
|
|
@ -5,13 +5,11 @@
|
|||
|
||||
<window id="zotero-progress-window"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
windowtype="alert:alert"
|
||||
align="start">
|
||||
|
||||
windowtype="alert:alert">
|
||||
|
||||
<hbox id="zotero-progress-box">
|
||||
<vbox id="zotero-progress-text-box">
|
||||
<label id="zotero-progress-text-headline" style="font-weight: bold;" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
</window>
|
||||
|
|
84
chrome/content/zotero/reportInterface.js
Normal file
84
chrome/content/zotero/reportInterface.js
Normal file
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (c) 2006 Center for History and New Media
|
||||
George Mason University, Fairfax, Virginia, USA
|
||||
http://chnm.gmu.edu
|
||||
|
||||
Licensed under the Educational Community License, Version 1.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.opensource.org/licenses/ecl1.php
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
|
||||
var Zotero_Report_Interface = new function() {
|
||||
this.loadCollectionReport = loadCollectionReport;
|
||||
this.loadItemReport = loadItemReport;
|
||||
this.loadItemReportByIds = loadItemReportByIds;
|
||||
|
||||
|
||||
/*
|
||||
* Load a report for the currently selected collection
|
||||
*/
|
||||
function loadCollectionReport() {
|
||||
var queryString = '';
|
||||
|
||||
var id = ZoteroPane.getSelectedCollection(true);
|
||||
var sortColumn = ZoteroPane.getSortField();
|
||||
var sortDirection = ZoteroPane.getSortDirection();
|
||||
|
||||
if (sortColumn != 'title' || sortDirection != 'ascending') {
|
||||
queryString = '?sort=' + sortColumn +
|
||||
(sortDirection != 'ascending' ? '/d' : '');
|
||||
}
|
||||
|
||||
if (id) {
|
||||
window.loadURI('zotero://report/collection/' + id + '/html/report.html' + queryString);
|
||||
return;
|
||||
}
|
||||
|
||||
var id = ZoteroPane.getSelectedSavedSearch(true);
|
||||
if (id) {
|
||||
window.loadURI('zotero://report/search/' + id + '/html/report.html' + queryString);
|
||||
return;
|
||||
}
|
||||
|
||||
throw ('No collection currently selected');
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Load a report for the currently selected items
|
||||
*/
|
||||
function loadItemReport() {
|
||||
var items = ZoteroPane.getSelectedItems(true);
|
||||
|
||||
if (!items || !items.length) {
|
||||
throw ('No items currently selected');
|
||||
}
|
||||
|
||||
window.loadURI('zotero://report/items/' + items.join('-') + '/html/report.html');
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Load a report for the specified items
|
||||
*/
|
||||
function loadItemReportByIds(ids) {
|
||||
if (!ids || !ids.length) {
|
||||
throw ('No itemIDs provided to loadItemReportByIds()');
|
||||
}
|
||||
|
||||
window.loadURI('zotero://report/items/' + ids.join('-') + '/html/report.html');
|
||||
}
|
||||
}
|
|
@ -4,6 +4,10 @@ var io;
|
|||
|
||||
function doLoad()
|
||||
{
|
||||
// Set font size from pref
|
||||
var sbc = document.getElementById('zotero-search-box-container');
|
||||
Zotero.setFontSize(sbc);
|
||||
|
||||
io = window.arguments[0];
|
||||
|
||||
document.getElementById('search-box').search = io.dataIn.search;
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/overlay.css" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
|
||||
<!DOCTYPE bindings SYSTEM "chrome://zotero/locale/searchbox.dtd">
|
||||
|
||||
<dialog
|
||||
id="zotero-search-dialog"
|
||||
|
@ -18,6 +19,11 @@
|
|||
<script src="include.js"/>
|
||||
<script src="searchDialog.js"/>
|
||||
|
||||
<hbox align="center"><label value="Name:"/><textbox id="search-name" flex="1"/></hbox>
|
||||
<zoterosearch id="search-box" flex="1"/>
|
||||
<vbox id="zotero-search-box-container" flex="1">
|
||||
<hbox align="center">
|
||||
<label value="&zotero.search.name;"/>
|
||||
<textbox id="search-name" flex="1"/>
|
||||
</hbox>
|
||||
<zoterosearch id="search-box" flex="1"/>
|
||||
</vbox>
|
||||
</dialog>
|
||||
|
|
|
@ -31,17 +31,18 @@ var io;
|
|||
*/
|
||||
function doLoad()
|
||||
{
|
||||
// Set font size from pref
|
||||
var sbc = document.getElementById('zotero-select-items-container');
|
||||
Zotero.setFontSize(sbc);
|
||||
|
||||
io = window.arguments[0];
|
||||
|
||||
collectionsView = new Zotero.CollectionTreeView();
|
||||
document.getElementById('collections-tree').view = collectionsView;
|
||||
|
||||
document.getElementById('zotero-collections-tree').view = collectionsView;
|
||||
|
||||
// move to center of screen
|
||||
window.sizeToContent();
|
||||
window.moveTo(
|
||||
(self.screen.width-window.innerWidth)/2,
|
||||
(self.screen.height-window.innerHeight)/2
|
||||
);
|
||||
window.centerWindowOnScreen();
|
||||
}
|
||||
|
||||
function doUnload()
|
||||
|
@ -62,7 +63,7 @@ function onCollectionSelected()
|
|||
collection.setSearch('');
|
||||
|
||||
itemsView = new Zotero.ItemTreeView(collection, (window.arguments[1] ? true : false));
|
||||
document.getElementById('items-tree').view = itemsView;
|
||||
document.getElementById('zotero-items-tree').view = itemsView;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -71,10 +72,10 @@ function onSearch()
|
|||
{
|
||||
if(itemsView)
|
||||
{
|
||||
var searchVal = document.getElementById('tb-search').value;
|
||||
itemsView.searchText(searchVal);
|
||||
var searchVal = document.getElementById('zotero-tb-search').value;
|
||||
itemsView.setFilter('search', searchVal);
|
||||
|
||||
document.getElementById('tb-search-cancel').hidden = searchVal == "";
|
||||
document.getElementById('zotero-tb-search-cancel').hidden = searchVal == "";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,28 +84,7 @@ function onItemSelected()
|
|||
|
||||
}
|
||||
|
||||
function getSelectedItems(byID) {
|
||||
var start = new Object();
|
||||
var end = new Object();
|
||||
var returnArray = new Array();
|
||||
|
||||
for(var i = 0, rangeCount = itemsView.selection.getRangeCount(); i < rangeCount; i++)
|
||||
{
|
||||
itemsView.selection.getRangeAt(i,start,end);
|
||||
for(var j = start.value; j <= end.value; j++)
|
||||
{
|
||||
if(byID) {
|
||||
returnArray.push(itemsView._getItemAtRow(j).ref.getID());
|
||||
} else {
|
||||
returnArray.push(itemsView._getItemAtRow(j).ref);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returnArray;
|
||||
}
|
||||
|
||||
function doAccept()
|
||||
{
|
||||
io.dataOut = getSelectedItems(true);
|
||||
io.dataOut = itemsView.getSelectedItems(true);
|
||||
}
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
<dialog
|
||||
id="zotero-select-items-dialog"
|
||||
title="Select"
|
||||
title="&zotero.selectitems.title;"
|
||||
orient="vertical"
|
||||
width="600" height="450"
|
||||
buttons="cancel,accept"
|
||||
|
@ -40,52 +40,56 @@
|
|||
<script src="include.js"/>
|
||||
<script src="selectItemsDialog.js"/>
|
||||
|
||||
<vbox id="zotero-select-items-container" flex="1">
|
||||
|
||||
<hbox align="center" pack="end">
|
||||
<label value="&toolbar.search.label;" control="tb-search"/>
|
||||
<textbox id="tb-search" type="timed" timeout="250" oncommand="onSearch()" dir="reverse" onkeypress="if(event.keyCode == event.DOM_VK_ESCAPE) { this.value = ''; this.doCommand('cmd_zotero_search'); return false; }">
|
||||
<toolbarbutton id="tb-search-cancel" oncommand="this.parentNode.value='';" hidden="true"/>
|
||||
<label value="&zotero.toolbar.search.label;" control="zotero-tb-search"/>
|
||||
<textbox id="zotero-tb-search" type="timed" timeout="250" oncommand="onSearch()" dir="reverse" onkeypress="if(event.keyCode == event.DOM_VK_ESCAPE) { this.value = ''; this.doCommand('cmd_zotero_search'); return false; }">
|
||||
<toolbarbutton id="zotero-tb-search-cancel" oncommand="this.parentNode.value='';" hidden="true"/>
|
||||
</textbox>
|
||||
</hbox>
|
||||
|
||||
<hbox flex="1">
|
||||
<tree id="collections-tree"
|
||||
<tree id="zotero-collections-tree"
|
||||
style="width: 200px;" hidecolumnpicker="true" seltype="single"
|
||||
onselect="onCollectionSelected();">
|
||||
<treecols>
|
||||
<treecol
|
||||
id="name_column"
|
||||
label="&collections.name_column;"
|
||||
id="zotero-collections-name-column"
|
||||
label="&zotero.collections.name_column;"
|
||||
flex="1"
|
||||
primary="true"/>
|
||||
</treecols>
|
||||
<treechildren/>
|
||||
</tree>
|
||||
|
||||
<tree id="items-tree"
|
||||
<tree id="zotero-items-tree"
|
||||
flex="1" hidecolumnpicker="true" seltype="multiple"
|
||||
onselect="onItemSelected();">
|
||||
<treecols>
|
||||
<treecol
|
||||
id="title" primary="true"
|
||||
label="&items.title_column;"
|
||||
id="zotero-items-column-title" primary="true"
|
||||
label="&zotero.items.title_column;"
|
||||
flex="4" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="firstCreator"
|
||||
label="&items.creator_column;"
|
||||
id="zotero-items-column-firstCreator"
|
||||
label="&zotero.items.creator_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="dateAdded" hidden="true"
|
||||
label="&items.dateAdded_column;"
|
||||
id="zotero-items-column-dateAdded" hidden="true"
|
||||
label="&zotero.items.dateAdded_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="dateModified" hidden="true"
|
||||
label="&items.dateModified_column;"
|
||||
id="zotero-items-column-dateModified" hidden="true"
|
||||
label="&zotero.items.dateModified_column;"
|
||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||
</treecols>
|
||||
<treechildren/>
|
||||
</tree>
|
||||
</hbox>
|
||||
|
||||
</vbox>
|
||||
</dialog>
|
||||
|
|
23
chrome/content/zotero/selectableAlert.xul
Normal file
23
chrome/content/zotero/selectableAlert.xul
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
|
||||
<window
|
||||
orient="vertical"
|
||||
width="400"
|
||||
height="200"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<keyset>
|
||||
<key id="key_close" key="W" modifiers="accel" command="cmd_close"/>
|
||||
</keyset>
|
||||
<command id="cmd_close" oncommand="window.close();"/>
|
||||
|
||||
<textbox id="alert-textbox" class="plain" flex="1" readonly="true"/>
|
||||
|
||||
<script>
|
||||
window.addEventListener('load', function(e){
|
||||
document.getElementById('alert-textbox').value = window.arguments[0].alertText;
|
||||
document.getElementById('alert-textbox').select();
|
||||
}, false);
|
||||
</script>
|
||||
</window>
|
47
chrome/content/zotero/timelineInterface.js
Normal file
47
chrome/content/zotero/timelineInterface.js
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (c) 2006 Center for History and New Media
|
||||
George Mason University, Fairfax, Virginia, USA
|
||||
http://chnm.gmu.edu
|
||||
|
||||
Licensed under the Educational Community License, Version 1.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.opensource.org/licenses/ecl1.php
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
|
||||
var Zotero_Timeline_Interface = new function() {
|
||||
this.loadTimeline = loadTimeline;
|
||||
|
||||
/*
|
||||
* Load a timeline for the currently selected collection
|
||||
*/
|
||||
function loadTimeline() {
|
||||
var uri = 'zotero://timeline/';
|
||||
var id = ZoteroPane.getSelectedCollection(true);
|
||||
|
||||
if (id) {
|
||||
window.loadURI(uri + 'collection/' + id);
|
||||
return;
|
||||
}
|
||||
|
||||
var id = ZoteroPane.getSelectedSavedSearch(true);
|
||||
if (id) {
|
||||
window.loadURI(uri + 'search/' + id);
|
||||
return;
|
||||
}
|
||||
|
||||
window.loadURI(uri);
|
||||
}
|
||||
}
|
141
chrome/content/zotero/tools/csledit.xul
Normal file
141
chrome/content/zotero/tools/csledit.xul
Normal file
|
@ -0,0 +1,141 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
***** BEGIN LICENSE BLOCK *****
|
||||
|
||||
Copyright (c) 2006 Center for History and New Media
|
||||
George Mason University, Fairfax, Virginia, USA
|
||||
http://chnm.gmu.edu
|
||||
|
||||
Licensed under the Educational Community License, Version 1.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.opensource.org/licenses/ecl1.php
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
***** END LICENSE BLOCK *****
|
||||
-->
|
||||
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
|
||||
|
||||
<window
|
||||
id="csl-edit"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="Zotero_CSL_Editor.init();">
|
||||
|
||||
<script src="chrome://zotero/content/include.js"/>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
var Zotero_CSL_Editor = new function() {
|
||||
var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
||||
.getInterface(Components.interfaces.nsIWebNavigation)
|
||||
.QueryInterface(Components.interfaces.nsIDocShellTreeItem)
|
||||
.rootTreeItem
|
||||
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
||||
.getInterface(Components.interfaces.nsIDOMWindow);
|
||||
|
||||
this.init = init;
|
||||
this.handleKeyPress = handleKeyPress;
|
||||
this.loadCSL = loadCSL;
|
||||
this.generateBibliography = generateBibliography;
|
||||
|
||||
function init() {
|
||||
var cslList = document.getElementById('zotero-csl-list');
|
||||
if (cslList.getAttribute('initialized') == 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
var csls = Zotero.DB.query("SELECT title, cslID FROM csl ORDER BY title");
|
||||
|
||||
for (var i=0; i<csls.length; i++) {
|
||||
cslList.appendItem(csls[i].title, csls[i].cslID);
|
||||
}
|
||||
|
||||
cslList.setAttribute('initialized', true)
|
||||
}
|
||||
|
||||
|
||||
function handleKeyPress(event) {
|
||||
if (event.keyCode == 9 &&
|
||||
(!event.shiftKey && !event.metaKey && !event.altKey && !event.ctrlKey)) {
|
||||
_insertText("\t");
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function loadCSL(cslID) {
|
||||
var editor = document.getElementById('zotero-csl-editor')
|
||||
editor.value = Zotero.DB.valueQuery("SELECT csl FROM csl WHERE cslID=?", cslID);
|
||||
editor.doCommand();
|
||||
document.getElementById('zotero-csl-list').value = cslID;
|
||||
}
|
||||
|
||||
|
||||
function generateBibliography(str) {
|
||||
var iframe = document.getElementById('zotero-csl-preview-box');
|
||||
|
||||
var items = mainWindow.ZoteroPane.getSelectedItems();
|
||||
if (items.length == 0) {
|
||||
iframe.contentDocument.documentElement.innerHTML = '<html><head><title></title></head><body><p style="color: red">No references selected in Zotero.</p></body></html>';
|
||||
return;
|
||||
}
|
||||
|
||||
if (str.indexOf("<defaults") != -1) {
|
||||
csl = new Zotero.CSL.Compat(str);
|
||||
}
|
||||
else {
|
||||
csl = new Zotero.CSL(str);
|
||||
}
|
||||
|
||||
var itemSet = csl.createItemSet(items);
|
||||
|
||||
// Generate multiple citations
|
||||
var citation = csl.createCitation(itemSet.items);
|
||||
var multCitations = csl.formatCitation(citation, "HTML");
|
||||
|
||||
// Generate single citations
|
||||
var citations = '';
|
||||
for (var i=0; i<citation.citationItems.length; i++) {
|
||||
citations += csl.formatCitation(csl.createCitation([citation.citationItems[i]]), "HTML") + '<br />';
|
||||
}
|
||||
|
||||
// Generate bibliography
|
||||
var bibliography = csl.formatBibliography(itemSet, "HTML");
|
||||
iframe.contentDocument.documentElement.innerHTML =
|
||||
citations + '<hr/>' + multCitations + '<hr/>' + bibliography;
|
||||
}
|
||||
|
||||
|
||||
// From http://kb.mozillazine.org/Inserting_text_at_cursor
|
||||
function _insertText(text) {
|
||||
var command = "cmd_insertText";
|
||||
var controller = document.commandDispatcher.getControllerForCommand(command);
|
||||
if (controller && controller.isCommandEnabled(command)) {
|
||||
controller = controller.QueryInterface(Components.interfaces.nsICommandController);
|
||||
var params = Components.classes["@mozilla.org/embedcomp/command-params;1"];
|
||||
params = params.createInstance(Components.interfaces.nsICommandParams);
|
||||
params.setStringValue("state_data", "\t");
|
||||
controller.doCommandWithParams(command, params);
|
||||
}
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<vbox flex="1">
|
||||
<menulist id="zotero-csl-list" style="min-height: 1.6em" initialized="false" oncommand="Zotero_CSL_Editor.loadCSL(this.selectedItem.value)"/>
|
||||
<textbox id="zotero-csl-editor" type="timed" timeout="250" multiline="true"
|
||||
flex="1"
|
||||
onkeypress="Zotero_CSL_Editor.handleKeyPress(event)"
|
||||
oncommand="document.getElementById('zotero-csl-list').selectedIndex = -1; Zotero_CSL_Editor.generateBibliography(this.value)"/>
|
||||
<splitter/>
|
||||
<iframe id="zotero-csl-preview-box" flex="1" style="padding: 0 1em" overflow="auto"/>
|
||||
</vbox>
|
||||
|
||||
</window>
|
94
chrome/content/zotero/upgrade.xul
Normal file
94
chrome/content/zotero/upgrade.xul
Normal file
|
@ -0,0 +1,94 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero/skin/upgrade.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
|
||||
<wizard id="zotero-schema-upgrade" title="Zotero"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
var Zotero_Schema_Upgrade = new function() {
|
||||
this.init = init;
|
||||
this.onAdvance = onAdvance;
|
||||
this.doUpgrade = doUpgrade;
|
||||
this.onChangeLogLinkClick = onChangeLogLinkClick;
|
||||
|
||||
var obj = window.arguments[0].wrappedJSObject;
|
||||
var Zotero = obj.Zotero;
|
||||
var data = obj.data;
|
||||
|
||||
function init() {
|
||||
var wizard = document.getElementById('zotero-schema-upgrade');
|
||||
|
||||
var continueButtonName = wizard.getButton('next').getAttribute('label');
|
||||
var str = Zotero.getString('upgrade.advanceMessage', continueButtonName);
|
||||
document.getElementById('zotero-advance-message').setAttribute('value', str);
|
||||
}
|
||||
|
||||
|
||||
function onAdvance() {
|
||||
var wizard = document.getElementById('zotero-schema-upgrade');
|
||||
wizard.getButton('cancel').setAttribute('disabled', true);
|
||||
wizard.canRewind = false;
|
||||
wizard.getButton('finish').focus(); // prevent focusing of changelog link
|
||||
}
|
||||
|
||||
|
||||
function doUpgrade() {
|
||||
var wizard = document.getElementById('zotero-schema-upgrade');
|
||||
|
||||
onAdvance();
|
||||
|
||||
try {
|
||||
Zotero.Schema.updateSchema();
|
||||
}
|
||||
catch (e) {
|
||||
data.msg = Zotero.getString('upgrade.failed');
|
||||
data.e = e;
|
||||
|
||||
Components.utils.reportError(e);
|
||||
|
||||
var cancelButton = wizard.getButton('cancel');
|
||||
cancelButton.setAttribute('disabled', false);
|
||||
cancelButton.click();
|
||||
return;
|
||||
}
|
||||
|
||||
data.success = true;
|
||||
|
||||
wizard.advance();
|
||||
}
|
||||
|
||||
|
||||
function onChangeLogLinkClick() {
|
||||
Zotero.initialURL = 'http://www.zotero.org/documentation/changelog';
|
||||
document.getElementById('zotero-schema-upgrade').getButton('finish').click();
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<wizardpage onpageshow="Zotero_Schema_Upgrade.init()">
|
||||
<description>&zotero.upgrade.newVersionInstalled;</description>
|
||||
<description>&zotero.upgrade.upgradeRequired; &zotero.upgrade.autoBackup;</description>
|
||||
<description id="zotero-advance-message"/>
|
||||
</wizardpage>
|
||||
|
||||
<wizardpage onpageshow="setTimeout('Zotero_Schema_Upgrade.doUpgrade()', 100)">
|
||||
<description>&zotero.upgrade.upgradeInProgress;</description>
|
||||
<progressmeter mode="undetermined"/>
|
||||
</wizardpage>
|
||||
|
||||
<wizardpage onpageshow="Zotero_Schema_Upgrade.onAdvance()">
|
||||
<description>&zotero.upgrade.upgradeSucceeded;</description>
|
||||
<description>
|
||||
&zotero.upgrade.changeLogBeforeLink;
|
||||
<label id="zotero-change-log-link" class="text-link" value="&zotero.upgrade.changeLogLink;"
|
||||
onclick="Zotero_Schema_Upgrade.onChangeLogLinkClick()"/>
|
||||
&zotero.upgrade.changeLogAfterLink;
|
||||
</description>
|
||||
</wizardpage>
|
||||
</wizard>
|
793
chrome/content/zotero/webpagedump/common.js
Normal file
793
chrome/content/zotero/webpagedump/common.js
Normal file
|
@ -0,0 +1,793 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is ScrapBook.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Gomita.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2004
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Bernhard Pollak <pollak@dbai.tuwien.ac.at> (WebPageDump Fork)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
// "WebPageDump" Firefox Extension
|
||||
// --------------------------------------------------------------------------------
|
||||
// - File: "common.js" -
|
||||
// - Description:
|
||||
// provides common functions (file, preferences, windows, error,...)
|
||||
//
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
|
||||
var gBrowserWindow = null;
|
||||
var gExceptLocation = "about:blank";
|
||||
var gCallback = "";
|
||||
var gTimeOutID = 0;
|
||||
var gTimedOut = false;
|
||||
var gWaitForPaint = false;
|
||||
|
||||
var MODE_SIMULATE = false;
|
||||
var WPD_DEFAULTWIDTH=1024;
|
||||
var WPD_DEFAULTHEIGHT=768;
|
||||
|
||||
var WPD_MAXUIERRORCOUNT=8;
|
||||
|
||||
|
||||
/*function wpdGetTopBrowserWindow()
|
||||
{
|
||||
var winMed = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Components.interfaces.nsIWindowMediator);
|
||||
var winList = winMed.getZOrderDOMWindowEnumerator("navigator:browser", true);
|
||||
if (!winList.hasMoreElements())
|
||||
return top.getBrowser().contentWindow; // fallback
|
||||
|
||||
return winList.getNext().getBrowser().contentWindow;
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
/* [14:55:15] paolinho: var browserWin = windowMediator.getMostRecentWindow("navigator:browser");
|
||||
const mainTabBox = browserWin.getBrowser().mTabBox;
|
||||
const topWindow = browserWin.getBrowser().browsers[mainTabBox.selectedIndex].contentWindow;
|
||||
[14:55:50] … var windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
|
||||
*/
|
||||
|
||||
function wpdGetTopBrowserWindow()
|
||||
{
|
||||
var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService();
|
||||
var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);
|
||||
var topWindowOfType = windowManagerInterface.getMostRecentWindow( "navigator:browser" );
|
||||
|
||||
if (topWindowOfType) {
|
||||
return topWindowOfType;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
function wpdWindowLoaded()
|
||||
{
|
||||
try {
|
||||
// this will be called multiple times if the page contains more than one document (frames, flash,...)
|
||||
//var browser=this.document.getElementById("content");
|
||||
dump("[wpdWindowLoaded] ... \n");
|
||||
var browser = this.top.getBrowser();
|
||||
// each time we have to check if the page is fully loaded...
|
||||
if (!(browser.webProgress.isLoadingDocument || browser.contentDocument.location == gExceptLocation)) {
|
||||
dump("[wpdWindowLoaded] window finally loaded\n");
|
||||
gBrowserWindow.clearTimeout(gTimeOutID);
|
||||
gBrowserWindow.removeEventListener("load",wpdWindowLoaded,true);
|
||||
//dump("[wpdWindowLoaded] calling "+gCallback+"\n");
|
||||
if (gWaitForPaint) {
|
||||
wpdCommon.sizeWindow(WPD_DEFAULTWIDTH-1,WPD_DEFAULTHEIGHT); // this is for the strange empty lines bug
|
||||
wpdCommon.sizeWindow(WPD_DEFAULTWIDTH,WPD_DEFAULTHEIGHT);
|
||||
}
|
||||
var w=0;
|
||||
if (gWaitForPaint) w=5000; // wait for painting
|
||||
gBrowserWindow.setTimeout(gCallback, w);
|
||||
}
|
||||
} catch (ex) {
|
||||
dump("[wpdWindowLoaded] EXCEPTION: "+ex+"\n");
|
||||
}
|
||||
}
|
||||
|
||||
function wpdTimeOut()
|
||||
{
|
||||
dump("[wpdTimeOut] timeout triggered!\n");
|
||||
gTimedOut=true;
|
||||
gBrowserWindow.clearTimeout(gTimeOutID);
|
||||
gBrowserWindow.removeEventListener("load",wpdWindowLoaded,true);
|
||||
gBrowserWindow.setTimeout(gCallback, 0);
|
||||
}
|
||||
|
||||
function wpdIsTimedOut()
|
||||
{
|
||||
return gTimedOut;
|
||||
}
|
||||
|
||||
function wpdLoadURL(aURI,aCallback)
|
||||
{
|
||||
try {
|
||||
gTimedOut=false;
|
||||
dump("\n[wpdLoadURL] aURI: "+aURI+"\n");
|
||||
if (aURI=="") return;
|
||||
gBrowserWindow = wpdGetTopBrowserWindow();
|
||||
gBrowserWindow.loadURI(aURI);
|
||||
gCallback = aCallback;
|
||||
// 30 seconds maximum for loading the page
|
||||
gTimeOutID=gBrowserWindow.setTimeout(wpdTimeOut, 60000);
|
||||
gBrowserWindow.addEventListener("load",wpdWindowLoaded, true);
|
||||
} catch (ex) {
|
||||
dump("[wpdLoadURL] EXCEPTION: "+ex+"\n");
|
||||
}
|
||||
}
|
||||
|
||||
var wpdCommon = {
|
||||
|
||||
errList : "",
|
||||
errCount : 0,
|
||||
downloading : false,
|
||||
downloaded : false,
|
||||
|
||||
allowed_entities:
|
||||
""&'<> ¡¢£¤¥¦"+
|
||||
"§¨©ª«¬­®¯°±"+
|
||||
"²³´µ¶·¸¹º»"+
|
||||
"¼½¾¿ÀÁÂÃÄ"+
|
||||
"ÅÆÇÈÉÊËÌÍ"+
|
||||
"ÎÏÐÑÒÓÔÕÖ"+
|
||||
"×ØÙÚÛÜÝÞß"+
|
||||
"àáâãäåæçè"+
|
||||
"éêëìíîïðñò"+
|
||||
"óôõö÷øùúûü"+
|
||||
"ýþÿŒœŠšŸƒˆ"+
|
||||
"˜ΑΒΓΔΕΖΗΘΙΚ"+
|
||||
"ΛΜΝΞΟΠΡΣΤΥΦΧΨ"+
|
||||
"Ωαβγδεζηθικ"+
|
||||
"λμνξοπρςστυφ"+
|
||||
"χψωϑϒφϖ   ‌"+
|
||||
"‍‎‏–—‘’‚“”„"+
|
||||
"†‡•…‰′″‹›"+
|
||||
"‾⁄€ℑ℘ℜ™ℵ←↑"+
|
||||
"→↓↔↵⇐⇑⇒⇓⇔∀"+
|
||||
"∂∃∅∇∈∉∋∏∑−∗√"+
|
||||
"∝∞∠∨∩∪∫∴∼≅≈≠≡"+
|
||||
"≤≥⊂⊃⊄⊆⊇⊕⊗⊥⋅⌈"+
|
||||
"⌉⌊⌋⟨⟩◊♠♣♥♦",
|
||||
|
||||
|
||||
|
||||
trim : function (aString) {
|
||||
try {
|
||||
return (aString.replace(/\s+$/,"").replace(/^\s+/,""));
|
||||
} catch(ex) {
|
||||
return aString;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// checks the CRLFs at the beginning - if there are CRLFs present
|
||||
// one additional CRLF will be added at the beginning
|
||||
checkCRLF : function (aNode)
|
||||
{
|
||||
try {
|
||||
var before=false;
|
||||
var after=false;
|
||||
if (aNode.parentNode.firstChild==aNode) before=true;
|
||||
if (!before && !after) {
|
||||
throw new Error("return");
|
||||
}
|
||||
// why <BR>? Because the <BR> Tag ist not present in text DOM nodes...
|
||||
var aString=aNode.nodeValue;
|
||||
if (aString.search(/\n/)==-1) throw new Error("return");
|
||||
aString=(aString.replace(/\r\n/g,"<br>").replace(/\n/g,"<br>"));
|
||||
var a=aString.split("<br>");
|
||||
var s=0;
|
||||
var e=0;
|
||||
|
||||
|
||||
if (before) {
|
||||
for (var i=0;i<a.length;i++) {
|
||||
if (this.trim(a[i])!="") {
|
||||
break;
|
||||
} else {
|
||||
s++;
|
||||
break; //we only need to now if there are any
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
aString=a.join("\r\n");
|
||||
if (s>0) aString="\r\n"+aString;
|
||||
return aString;
|
||||
|
||||
} catch (ex) {
|
||||
return aNode.nodeValue;
|
||||
}
|
||||
},
|
||||
|
||||
unicodeToEntity : function (text,charset)
|
||||
{
|
||||
|
||||
function convertEntity(letter) {
|
||||
try {
|
||||
var l = gEntityConverter.ConvertToEntity(letter,entityVersion);
|
||||
// is the entity allowed?
|
||||
if (entities.indexOf(l)>=0) {
|
||||
return l;
|
||||
} else if ( (l!=letter) ) {
|
||||
return "&#"+letter.charCodeAt(0)+";";
|
||||
}
|
||||
} catch (ex) {
|
||||
}
|
||||
// now we check if the letter is valid inside the destination charset
|
||||
// (if the result is a ? it is not valid - except letter=?)
|
||||
try {
|
||||
var s=gUnicodeConverter.ConvertFromUnicode(letter);
|
||||
if ( (charset!="UTF-8") && (s=="?") ) {
|
||||
return "&#"+letter.charCodeAt(0)+";";
|
||||
}
|
||||
} catch (ex) {
|
||||
}
|
||||
return letter;
|
||||
}
|
||||
|
||||
if (!gUnicodeConverter) {
|
||||
try {
|
||||
var gUnicodeConverter = Components.classes['@mozilla.org/intl/scriptableunicodeconverter'].getService(Components.interfaces.nsIScriptableUnicodeConverter);
|
||||
gUnicodeConverter.charset = charset;
|
||||
} catch(ex) {
|
||||
dump ("gUnicodeConverter EXCEPTION:"+ex+"\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (!gEntityConverter) {
|
||||
try {
|
||||
var gEntityConverter = Components.classes["@mozilla.org/intl/entityconverter;1"].createInstance(Components.interfaces.nsIEntityConverter);
|
||||
} catch(e) {
|
||||
dump ("gEntityConverter EXCEPTION:"+ex+"\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Firefox - Source Code Snippet:
|
||||
// const unsigned long entityNone = 0;
|
||||
// const unsigned long html40Latin1 = 1;
|
||||
// const unsigned long html40Symbols = 2;
|
||||
// const unsigned long html40Special = 4; // excludes ", &, <, >
|
||||
// const unsigned long transliterate = 8;
|
||||
// const unsigned long mathml20 = 16;
|
||||
// const unsigned long html32 = html40Latin1;
|
||||
// const unsigned long html40 = html40Latin1+html40Symbols+html40Special;
|
||||
// const unsigned long entityW3C = html40+mathml20;
|
||||
const entityVersion = Components.interfaces.nsIEntityConverter.html40;
|
||||
// convert to entities (
|
||||
// replace other chars > 0x7f via nsIEntityConverter/convertEntity
|
||||
var entities = this.allowed_entities;
|
||||
text = text.replace(/[^\0-\u007f]/g, convertEntity);
|
||||
return text;
|
||||
},
|
||||
|
||||
|
||||
playSound : function()
|
||||
{
|
||||
try {
|
||||
var sound = Components.classes["@mozilla.org/sound;1"].createInstance(Components.interfaces.nsISound);
|
||||
sound.playSystemSound("ringin.wav");
|
||||
} catch(ex) {
|
||||
}
|
||||
},
|
||||
|
||||
// return the current focused window
|
||||
getFocusedWindow : function()
|
||||
{
|
||||
var win = document.commandDispatcher.focusedWindow;
|
||||
if ( !win || win == window || win instanceof Components.interfaces.nsIDOMChromeWindow ) win = window._content;
|
||||
return win;
|
||||
},
|
||||
|
||||
sizeWindow : function(w,h)
|
||||
{
|
||||
try {
|
||||
var window=this.getFocusedWindow();
|
||||
window.moveTo(0,0);
|
||||
if ((w==0) || (w>screen.availWidth)) w=screen.availWidth;
|
||||
if ((h==0) || (w>screen.availHeight)) h=screen.availHeight;
|
||||
window.resizeTo(w,h);
|
||||
window.focus();
|
||||
} catch(ex) {
|
||||
}
|
||||
},
|
||||
|
||||
// add a line to the error list (displays a maximum of 15 errors)
|
||||
addError : function(aError)
|
||||
{
|
||||
dump('ERROR: '+aError+"\n");
|
||||
if (this.errCount<WPD_MAXUIERRORCOUNT) {
|
||||
if (this.errList.indexOf(aError)>-1) return; // is the same
|
||||
this.errList = this.errList+aError+"\n";
|
||||
} else if (this.errCount==WPD_MAXUIERRORCOUNT) {
|
||||
this.errList = this.errList+'...';
|
||||
}
|
||||
this.errCount++;
|
||||
},
|
||||
|
||||
saveWebPage : function(aDestFile) {
|
||||
dump("[saveWebPage] "+aDestFile+"\n");
|
||||
var nsIWBP = Components.classes["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"].createInstance(Components.interfaces.nsIWebBrowserPersist);
|
||||
var doc = window.content.document;
|
||||
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
|
||||
file.initWithPath(aDestFile);
|
||||
var dataPath = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
|
||||
dataPath.initWithPath(this.getFilePath(aDestFile));
|
||||
nsIWBP.saveDocument(doc, file, dataPath, null, 0, 0);
|
||||
},
|
||||
|
||||
// returns num as string of length i filled up with 0s
|
||||
addLeftZeros : function(num,i)
|
||||
{
|
||||
var s=""+num;
|
||||
var r="";
|
||||
for (var f=0;f<i-s.length;f++) r=r+"0";
|
||||
return r+s;
|
||||
},
|
||||
|
||||
// split the filename in filename and extension
|
||||
splitFileName : function(aFileName)
|
||||
{
|
||||
var pos = aFileName.lastIndexOf(".");
|
||||
var ret = [];
|
||||
if ( pos != -1 ) {
|
||||
ret[0] = aFileName.substring(0, pos);
|
||||
ret[1] = aFileName.substring(pos + 1, aFileName.length);
|
||||
} else {
|
||||
ret[0] = aFileName;
|
||||
ret[1] = "";
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
|
||||
// replace illegal characters
|
||||
getValidFileName : function(aFileName)
|
||||
{
|
||||
aFileName = aFileName.replace(/[\"\?!~`]+/g, "");
|
||||
aFileName = aFileName.replace(/[\*\&]+/g, "+");
|
||||
aFileName = aFileName.replace(/[\\\/\|\:;]+/g, "-");
|
||||
aFileName = aFileName.replace(/[\<]+/g, "(");
|
||||
aFileName = aFileName.replace(/[\>]+/g, ")");
|
||||
aFileName = aFileName.replace(/[\s]+/g, "_");
|
||||
aFileName = aFileName.replace(/[%]+/g, "@");
|
||||
return aFileName;
|
||||
},
|
||||
|
||||
getURL : function()
|
||||
{
|
||||
return top.window._content.document.location.href;
|
||||
},
|
||||
|
||||
// remove get variables from an URL
|
||||
removeGETFromURL : function(aURL)
|
||||
{
|
||||
var pos;
|
||||
aURL = ( (pos = aURL.indexOf("?")) != -1 ) ? aURL.substring(0, pos) : aURL;
|
||||
aURL = ( (pos = aURL.indexOf("#")) != -1 ) ? aURL.substring(0, pos) : aURL;
|
||||
return aURL;
|
||||
},
|
||||
|
||||
// extract filename from URL
|
||||
getFileName : function(aURL)
|
||||
{
|
||||
var pos;
|
||||
aURL = this.removeGETFromURL(aURL);
|
||||
aURL = ( (pos = aURL.lastIndexOf("/")) != -1 ) ? aURL.substring(++pos) : aURL;
|
||||
return aURL;
|
||||
},
|
||||
|
||||
filePathToURI: function(filePath)
|
||||
{
|
||||
var obj_File = Components.classes["@mozilla.org/file/local;1"].getService(Components.interfaces.nsILocalFile);
|
||||
obj_File.initWithPath(filePath);
|
||||
var obj_FPH = Components.classes["@mozilla.org/network/protocol;1?name=file"].getService(Components.interfaces.nsIFileProtocolHandler);
|
||||
return obj_FPH.getURLSpecFromFile(obj_File);
|
||||
},
|
||||
|
||||
URLToFilePath: function(aURL)
|
||||
{
|
||||
var obj_FPH = Components.classes["@mozilla.org/network/protocol;1?name=file"].getService(Components.interfaces.nsIFileProtocolHandler);
|
||||
try {
|
||||
return obj_FPH.getFileFromURLSpec(aURL).path;
|
||||
} catch(ex) {
|
||||
return aURL;
|
||||
}
|
||||
},
|
||||
|
||||
// right part of filepath/filename
|
||||
getFileLeafName: function(filePath)
|
||||
{
|
||||
var obj_File = Components.classes["@mozilla.org/file/local;1"].getService(Components.interfaces.nsILocalFile);
|
||||
obj_File.initWithPath(filePath);
|
||||
return obj_File.leafName;
|
||||
},
|
||||
|
||||
getFilePath: function(filePath)
|
||||
{
|
||||
var obj_File = Components.classes["@mozilla.org/file/local;1"].getService(Components.interfaces.nsILocalFile);
|
||||
obj_File.initWithPath(filePath);
|
||||
var pos; // Added by Dan S. for Zotero
|
||||
return ( (pos = filePath.lastIndexOf(obj_File.leafName)) != -1 ) ? filePath.substring(0,pos) : filePath;
|
||||
},
|
||||
|
||||
appendFilePath: function(filePath,appendPath)
|
||||
{
|
||||
var obj_File = Components.classes["@mozilla.org/file/local;1"].getService(Components.interfaces.nsILocalFile);
|
||||
obj_File.initWithPath(filePath);
|
||||
obj_File.appendRelativePath(appendPath);
|
||||
return obj_File.path;
|
||||
},
|
||||
|
||||
pathExists: function(filePath)
|
||||
{
|
||||
var obj_File = Components.classes["@mozilla.org/file/local;1"].getService(Components.interfaces.nsILocalFile);
|
||||
try {
|
||||
obj_File.initWithPath(filePath);
|
||||
return obj_File.exists();
|
||||
} catch(ex) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
// add the HTML Tag Stuff to aNode and embedd the aNode.innerHTML between the tags
|
||||
nodeToHTMLString: function(aNode)
|
||||
{
|
||||
if (aNode==null) return "";
|
||||
var tag = "<" + aNode.nodeName.toLowerCase();
|
||||
for ( var i=0; i<aNode.attributes.length; i++ )
|
||||
tag += ' ' + aNode.attributes[i].name + '="' + aNode.attributes[i].value + '"';
|
||||
tag += ">\n";
|
||||
return tag + aNode.innerHTML + "</" + aNode.nodeName.toLowerCase() + ">\n";
|
||||
},
|
||||
|
||||
ConvertFromUnicode16 : function(aString,charset)
|
||||
{
|
||||
if ( !aString ) return "";
|
||||
try {
|
||||
var UNICODE = Components.classes['@mozilla.org/intl/scriptableunicodeconverter'].getService(Components.interfaces.nsIScriptableUnicodeConverter);
|
||||
UNICODE.charset = charset;
|
||||
aString = UNICODE.ConvertFromUnicode(aString);
|
||||
aString = aString + UNICODE.Finish();
|
||||
} catch(ex) {
|
||||
//this.addError("[wpdCommon.convertStringToCharset]:\n -> charset: "+charset+"\n -> "+ex);
|
||||
}
|
||||
return aString;
|
||||
},
|
||||
|
||||
ConvertToUnicode16 : function(aString,charset)
|
||||
{
|
||||
if ( !aString ) return "";
|
||||
try {
|
||||
var UNICODE = Components.classes['@mozilla.org/intl/scriptableunicodeconverter'].getService(Components.interfaces.nsIScriptableUnicodeConverter);
|
||||
UNICODE.charset = charset;
|
||||
aString = UNICODE.ConvertToUnicode(aString);
|
||||
} catch(ex) {
|
||||
//this.addError("[wpdCommon.convertStringToCharset]:\n -> charset: "+charset+"\n -> "+ex);
|
||||
}
|
||||
return aString;
|
||||
},
|
||||
|
||||
// convert the doctype to an HTML doctype String
|
||||
doctypeToHTMLString : function(aDoctype)
|
||||
{
|
||||
if ( !aDoctype ) return "";
|
||||
var ret = "<!DOCTYPE " + aDoctype.name;
|
||||
if ( aDoctype.publicId ) ret += ' PUBLIC "' + aDoctype.publicId + '"';
|
||||
if ( aDoctype.systemId ) ret += ' "' + aDoctype.systemId + '"';
|
||||
ret += ">\n";
|
||||
return ret;
|
||||
},
|
||||
|
||||
addCommentTag : function(targetNode, aComment)
|
||||
{
|
||||
targetNode.appendChild(document.createTextNode("\n"));
|
||||
targetNode.appendChild(document.createComment(aComment));
|
||||
targetNode.appendChild(document.createTextNode("\n"));
|
||||
},
|
||||
|
||||
|
||||
removeNodeFromParent : function(aNode)
|
||||
{
|
||||
// Added by Dan S. for Zotero
|
||||
var document = aNode.ownerDocument;
|
||||
|
||||
var newNode = document.createTextNode("");
|
||||
aNode.parentNode.replaceChild(newNode, aNode);
|
||||
aNode = newNode;
|
||||
return aNode;
|
||||
},
|
||||
|
||||
// convert URL String to Object
|
||||
// for easier URL handling
|
||||
convertURLToObject : function(aURLString)
|
||||
{
|
||||
var aURL = Components.classes['@mozilla.org/network/standard-url;1'].createInstance(Components.interfaces.nsIURL);
|
||||
aURL.spec = aURLString;
|
||||
return aURL;
|
||||
},
|
||||
|
||||
// resolves the relative URL (aRelURL) with the base URL (aBaseURL)
|
||||
resolveURL : function(aBaseURL, aRelURL)
|
||||
{
|
||||
try {
|
||||
var aBaseURLObj = this.convertURLToObject(aBaseURL);
|
||||
return aBaseURLObj.resolve(aRelURL);
|
||||
} catch(ex) {
|
||||
this.addError("[wpdCommon.resolveURL]:\n -> aBaseURL: "+aBaseURL+"\n -> aRelURL: "+aRelURL+"\n -> "+ex);
|
||||
}
|
||||
return "";
|
||||
},
|
||||
|
||||
getHostName : function(aURL)
|
||||
{
|
||||
try {
|
||||
var aURLObj = Components.classes['@mozilla.org/network/standard-url;1'].createInstance(Components.interfaces.nsIURI);
|
||||
aURLObj.spec = aURL
|
||||
return aURLObj.asciiHost;
|
||||
} catch(ex) {
|
||||
this.addError("[wpdCommon.getHostName]:\n -> aURL: "+aURL+"\n -> "+ex);
|
||||
}
|
||||
return "";
|
||||
},
|
||||
|
||||
convertUrlToASCII : function(aURL)
|
||||
{
|
||||
try {
|
||||
var aURLObj = Components.classes['@mozilla.org/network/standard-url;1'].createInstance(Components.interfaces.nsIURI);
|
||||
aURLObj.spec = aURL
|
||||
return aURLObj.asciiSpec;
|
||||
} catch(ex) {
|
||||
this.addError("[wpdCommon.getHostName]:\n -> aURL: "+aURL+"\n -> "+ex);
|
||||
}
|
||||
return "";
|
||||
},
|
||||
|
||||
createDir : function(str_Dir)
|
||||
{
|
||||
var obj_File = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
|
||||
obj_File.initWithPath(str_Dir);
|
||||
if (!obj_File.exists())
|
||||
obj_File.create(obj_File.DIRECTORY_TYPE, 0700);
|
||||
},
|
||||
|
||||
readDir : function(str_Dir)
|
||||
{
|
||||
var obj_File = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
|
||||
obj_File.initWithPath(str_Dir);
|
||||
if (obj_File.exists()) return obj_File.directoryEntries;
|
||||
return [];
|
||||
},
|
||||
|
||||
fileSize : function(str_Filename)
|
||||
{
|
||||
var obj_File = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
|
||||
obj_File.initWithPath(str_Filename);
|
||||
return obj_File.fileSize;
|
||||
},
|
||||
|
||||
// read the file (str_Filename) to a String Buffer (str_Buffer)
|
||||
readFile : function(str_Filename,removeComments,text)
|
||||
{
|
||||
try{
|
||||
var obj_File = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
|
||||
obj_File.initWithPath(str_Filename);
|
||||
if (!obj_File.exists()) {
|
||||
this.addError("[wpdCommon.readFile]:\n -> str_Filename: "+str_Filename+"\n -> file not found!");
|
||||
return "";
|
||||
}
|
||||
|
||||
var obj_Transport = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
|
||||
|
||||
obj_Transport.init( obj_File, 0x01 , 004, 0 );
|
||||
|
||||
var sis = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance( Components.interfaces.nsIScriptableInputStream );
|
||||
sis.init( obj_Transport );
|
||||
var output = sis.read( sis.available() );
|
||||
if (text) output = output.replace(/\r/g,"");
|
||||
if (text && removeComments) {
|
||||
output = output.replace(/^\/\/.*/g,"");
|
||||
output = output.replace(/\n\/\/.*/g,"");
|
||||
output = output.replace(/\n\n+/g,"\n");
|
||||
}
|
||||
if (text) output = output.split(/\n/g);
|
||||
return output;
|
||||
} catch (ex) {
|
||||
this.addError("[wpdCommon.readFile]:\n -> str_Filename: "+str_Filename+"\n -> "+ex);
|
||||
}
|
||||
return "";
|
||||
},
|
||||
|
||||
// write the String Buffer (str_Buffer) to a file (str_Filename)
|
||||
writeFile : function(str_Buffer,str_Filename)
|
||||
{
|
||||
if (MODE_SIMULATE) return true;
|
||||
try{
|
||||
var obj_File = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
|
||||
obj_File.initWithPath(str_Filename);
|
||||
if (!obj_File.exists())
|
||||
obj_File.create( Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0666 );
|
||||
|
||||
var obj_Transport = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
|
||||
|
||||
/* Open flags
|
||||
#define PR_RDONLY 0x01 - Open for reading only.
|
||||
#define PR_WRONLY 0x02 - Open for writing only.
|
||||
#define PR_RDWR 0x04 - Open for reading and writing.
|
||||
#define PR_CREATE_FILE 0x08 - If the file does not exist, the file is created. If the file exists, this flag has no effect.
|
||||
#define PR_APPEND 0x10 - The file pointer is set to the end of the file prior to each write.
|
||||
#define PR_TRUNCATE 0x20 - If the file exists, its length is truncated to 0.
|
||||
#define PR_SYNC 0x40 - If set, each write will wait for both the file data and file status to be physically updated.
|
||||
#define PR_EXCL 0x80 - With PR_CREATE_FILE, if the file does not exist, the file is created. If the file already exists, no action and NULL is returned.
|
||||
|
||||
File modes
|
||||
'mode' is currently only applicable on UNIX platforms.
|
||||
The 'mode' argument may be ignored by PR_Open on other platforms.
|
||||
00400 Read by owner.
|
||||
00200 Write by owner.
|
||||
00100 Execute (search if a directory) by owner.
|
||||
00040 Read by group.
|
||||
00020 Write by group.
|
||||
00010 Execute by group.
|
||||
00004 Read by others.
|
||||
00002 Write by others
|
||||
00001 Execute by others.
|
||||
*/
|
||||
obj_Transport.init( obj_File, 0x20 | 0x04 | 0x08, 064, 0 );
|
||||
obj_Transport.write(str_Buffer,str_Buffer.length);
|
||||
obj_Transport.flush();
|
||||
obj_Transport.close();
|
||||
return true;
|
||||
} catch (ex) {
|
||||
this.addError("[wpdCommon.writeFile]:\n -> str_Filename: "+str_Filename+"\n -> "+ex);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
|
||||
copyFile : function(sourcefile,destfile)
|
||||
{
|
||||
|
||||
var destdir=this.getFilePath(destfile);
|
||||
destfile=this.getFileLeafName(destfile);
|
||||
var aFile = Components.classes["@mozilla.org/file/local;1"]
|
||||
.createInstance(Components.interfaces.nsILocalFile);
|
||||
if (!aFile) return false;
|
||||
|
||||
var aDir = Components.classes["@mozilla.org/file/local;1"]
|
||||
.createInstance(Components.interfaces.nsILocalFile);
|
||||
if (!aDir) return false;
|
||||
|
||||
aFile.initWithPath(sourcefile);
|
||||
|
||||
aDir.initWithPath(destdir);
|
||||
|
||||
aFile.copyTo(aDir,destfile);
|
||||
return true; // Added by Dan S. for Zotero
|
||||
},
|
||||
|
||||
// download aSourceURL to aTargetFilename
|
||||
// (works also on local files...)
|
||||
downloadFile : function (aSourceURL,aTargetFilename)
|
||||
{
|
||||
if (MODE_SIMULATE) return true;
|
||||
try {
|
||||
//new obj_URI object
|
||||
var obj_URI = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI(aSourceURL, null, null);
|
||||
|
||||
//new file object
|
||||
var obj_TargetFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
|
||||
//set file with path
|
||||
// NOTE: This function has a known bug on the macintosh and other OSes
|
||||
// which do not represent file locations as paths. If you do use this
|
||||
// function, be very aware of this problem!
|
||||
obj_TargetFile.initWithPath(aTargetFilename);
|
||||
|
||||
//new persistence object
|
||||
var obj_Persist = Components.classes["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"].createInstance(Components.interfaces.nsIWebBrowserPersist);
|
||||
|
||||
// set flags
|
||||
const nsIWBP = Components.interfaces.nsIWebBrowserPersist;
|
||||
var flags = nsIWBP.PERSIST_FLAGS_REPLACE_EXISTING_FILES |
|
||||
nsIWBP.PERSIST_FLAGS_FROM_CACHE;
|
||||
//nsIWBP.PERSIST_FLAGS_BYPASS_CACHE;
|
||||
obj_Persist.persistFlags = flags;
|
||||
|
||||
// has the url the same filetype like the file extension?
|
||||
//save file to target
|
||||
obj_Persist.saveURI(obj_URI,null,null,null,null,obj_TargetFile);
|
||||
|
||||
return true;
|
||||
|
||||
} catch (ex) {
|
||||
aSourceURL=this.removeGETFromURL(aSourceURL);
|
||||
this.addError("[wpdCommon.downloadFile]:\n -> aSourceURL: "+aSourceURL.substring(aSourceURL.length-60)+"\n -> aTargetFilename: "+aTargetFilename+"\n -> "+ex);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
// get the integer preferences
|
||||
getIntPrefs : function (branch)
|
||||
{
|
||||
var mPrefSvc=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
|
||||
return mPrefSvc.getIntPref(branch);
|
||||
},
|
||||
|
||||
// set the integer preferences
|
||||
setIntPrefs : function (branch,value)
|
||||
{
|
||||
var mPrefSvc=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
|
||||
return mPrefSvc.setIntPref(branch,value);
|
||||
},
|
||||
|
||||
// get the integer preferences
|
||||
getStrPrefs : function (branch)
|
||||
{
|
||||
var mPrefSvc=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
|
||||
return mPrefSvc.getCharPref(branch);
|
||||
},
|
||||
|
||||
// set the string preferences
|
||||
setStrPrefs : function (branch,value)
|
||||
{
|
||||
var mPrefSvc=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
|
||||
return mPrefSvc.setCharPref(branch,value);
|
||||
},
|
||||
|
||||
// get the string preferences
|
||||
getStrPrefsEx : function (branch)
|
||||
{
|
||||
var mPrefSvc=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
|
||||
return mPrefSvc.getComplexValue(branch,Components.interfaces.nsISupportsString).data;
|
||||
},
|
||||
|
||||
// set the string preferences
|
||||
setStrPrefsEx : function (branch,value)
|
||||
{
|
||||
var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
|
||||
str.data = value;
|
||||
var mPrefSvc=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
|
||||
return mPrefSvc.setComplexValue(branch,Components.interfaces.nsISupportsString,str);
|
||||
},
|
||||
|
||||
|
||||
// Get the preferences branch ("browser.download." for normal 'save' mode)...
|
||||
setBoolPrefs : function (branch,value)
|
||||
{
|
||||
var mPrefSvc=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
|
||||
return mPrefSvc.setBoolPref(branch,value);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
1039
chrome/content/zotero/webpagedump/domsaver.js
Normal file
1039
chrome/content/zotero/webpagedump/domsaver.js
Normal file
File diff suppressed because it is too large
Load diff
1249
chrome/content/zotero/xpcom/annotate.js
Normal file
1249
chrome/content/zotero/xpcom/annotate.js
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
1981
chrome/content/zotero/xpcom/cite_compat.js
Normal file
1981
chrome/content/zotero/xpcom/cite_compat.js
Normal file
File diff suppressed because it is too large
Load diff
|
@ -34,9 +34,9 @@
|
|||
Zotero.CollectionTreeView = function()
|
||||
{
|
||||
this._treebox = null;
|
||||
this.refresh();
|
||||
|
||||
this._unregisterID = Zotero.Notifier.registerCollectionObserver(this);
|
||||
this.itemToSelect = null;
|
||||
this._highlightedRows = {};
|
||||
this._unregisterID = Zotero.Notifier.registerObserver(this, ['collection', 'search']);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -44,11 +44,44 @@ Zotero.CollectionTreeView = function()
|
|||
*/
|
||||
Zotero.CollectionTreeView.prototype.setTree = function(treebox)
|
||||
{
|
||||
if(this._treebox)
|
||||
if (this._treebox || !treebox) {
|
||||
return;
|
||||
}
|
||||
this._treebox = treebox;
|
||||
//select Library
|
||||
this.selection.select(0);
|
||||
|
||||
// Add a keypress listener for expand/collapse
|
||||
var expandAllRows = this.expandAllRows;
|
||||
var collapseAllRows = this.collapseAllRows;
|
||||
var tree = this._treebox.treeBody.parentNode;
|
||||
tree.addEventListener('keypress', function(event) {
|
||||
var key = String.fromCharCode(event.which);
|
||||
|
||||
if (key == '+' && !(event.ctrlKey || event.altKey || event.metaKey)) {
|
||||
expandAllRows(treebox);
|
||||
return;
|
||||
}
|
||||
else if (key == '-' && !(event.shiftKey || event.ctrlKey ||
|
||||
event.altKey || event.metaKey)) {
|
||||
collapseAllRows(treebox);
|
||||
return;
|
||||
}
|
||||
}, false);
|
||||
|
||||
this.refresh();
|
||||
|
||||
// Select the last-viewed collection
|
||||
var lastViewedFolder = Zotero.Prefs.get('lastViewedFolder');
|
||||
var matches = lastViewedFolder.match(/^(?:(C|S)([0-9]+)|L)$/);
|
||||
var select = 0;
|
||||
if (matches) {
|
||||
if (matches[1] == 'C' && this._collectionRowMap[matches[2]]) {
|
||||
select = this._collectionRowMap[matches[2]];
|
||||
}
|
||||
else if (matches[1] == 'S' && this._searchRowMap[matches[2]]) {
|
||||
select = this._searchRowMap[matches[2]];
|
||||
}
|
||||
}
|
||||
this.selection.select(select);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -57,7 +90,9 @@ Zotero.CollectionTreeView.prototype.setTree = function(treebox)
|
|||
*/
|
||||
Zotero.CollectionTreeView.prototype.refresh = function()
|
||||
{
|
||||
this._dataItems = new Array();
|
||||
this.selection.clearSelection();
|
||||
var oldCount = this.rowCount;
|
||||
this._dataItems = [];
|
||||
this.rowCount = 0;
|
||||
this._showItem(new Zotero.ItemGroup('library',null),0,1);
|
||||
|
||||
|
@ -66,10 +101,19 @@ Zotero.CollectionTreeView.prototype.refresh = function()
|
|||
this._showItem(new Zotero.ItemGroup('collection',newRows[i]), 0, this._dataItems.length); //itemgroup ref, level, beforeRow
|
||||
|
||||
var savedSearches = Zotero.Searches.getAll();
|
||||
for(var i = 0; i < savedSearches.length; i++)
|
||||
this._showItem(new Zotero.ItemGroup('search',savedSearches[i]), 0, this._dataItems.length); //itemgroup ref, level, beforeRow
|
||||
if (savedSearches) {
|
||||
for (var i=0; i<savedSearches.length; i++) {
|
||||
this._showItem(new Zotero.ItemGroup('search',savedSearches[i]), 0, this._dataItems.length); //itemgroup ref, level, beforeRow
|
||||
}
|
||||
}
|
||||
|
||||
this._refreshHashMap();
|
||||
|
||||
// Update the treebox's row count
|
||||
var diff = this.rowCount - oldCount;
|
||||
if (diff != 0) {
|
||||
this._treebox.rowCountChanged(0, diff);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -77,22 +121,23 @@ Zotero.CollectionTreeView.prototype.refresh = function()
|
|||
*/
|
||||
Zotero.CollectionTreeView.prototype.reload = function()
|
||||
{
|
||||
var openCollections = new Array();
|
||||
var openCollections = [];
|
||||
|
||||
for(var i = 0; i < this.rowCount; i++)
|
||||
if(this.isContainer(i) && this.isContainerOpen(i))
|
||||
for (var i=0; i<this.rowCount; i++) {
|
||||
if (this.isContainer(i) && this.isContainerOpen(i)) {
|
||||
openCollections.push(this._getItemAtRow(i).ref.getID());
|
||||
}
|
||||
}
|
||||
|
||||
var oldCount = this.rowCount;
|
||||
this._treebox.beginUpdateBatch();
|
||||
this.refresh();
|
||||
this._treebox.rowCountChanged(0,this.rowCount - oldCount);
|
||||
|
||||
for(var i = 0; i < openCollections.length; i++)
|
||||
{
|
||||
var row = this._collectionRowMap[openCollections[i]];
|
||||
if(row != null)
|
||||
if (row != null) {
|
||||
this.toggleOpenState(row);
|
||||
}
|
||||
}
|
||||
this._treebox.invalidate();
|
||||
this._treebox.endUpdateBatch();
|
||||
|
@ -103,12 +148,18 @@ Zotero.CollectionTreeView.prototype.reload = function()
|
|||
*/
|
||||
Zotero.CollectionTreeView.prototype.notify = function(action, type, ids)
|
||||
{
|
||||
var madeChanges = false;
|
||||
var ids = Zotero.flattenArguments(ids);
|
||||
if (!ids || ids.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(action == 'remove')
|
||||
this.selection.selectEventsSuppressed = true;
|
||||
var savedSelection = this.saveSelection();
|
||||
|
||||
var madeChanges = false;
|
||||
|
||||
if(action == 'delete')
|
||||
{
|
||||
//Since a remove involves shifting of rows, we have to do it in order
|
||||
//Since a delete involves shifting of rows, we have to do it in order
|
||||
|
||||
//sort the ids by row
|
||||
var rows = new Array();
|
||||
|
@ -143,39 +194,27 @@ Zotero.CollectionTreeView.prototype.notify = function(action, type, ids)
|
|||
this._treebox.rowCountChanged(row-i,-1);
|
||||
}
|
||||
|
||||
madeChanges = true;
|
||||
}
|
||||
|
||||
this._refreshHashMap();
|
||||
}
|
||||
}
|
||||
else if(action == 'move')
|
||||
{
|
||||
for (var i=0; i<ids.length; i++) {
|
||||
// Open the parent collection if closed
|
||||
var collection = Zotero.Collections.get(ids[i]);
|
||||
var parentID = collection.getParent();
|
||||
if (parentID && !this.isContainerOpen(this._collectionRowMap[parentID])) {
|
||||
this.toggleOpenState(this._collectionRowMap[parentID]);
|
||||
}
|
||||
}
|
||||
|
||||
this.reload();
|
||||
this.rememberSelection(savedSelection);
|
||||
}
|
||||
else if(action == 'modify')
|
||||
{
|
||||
for (var i in ids)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case 'collection':
|
||||
if (this._collectionRowMap[ids[i]] != null)
|
||||
{
|
||||
this._treebox.invalidateRow(this._collectionRowMap[ids[i]]);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'search':
|
||||
if (this._searchRowMap[ids[i]] != null)
|
||||
{
|
||||
// Search rows aren't mapped to native objects, so we
|
||||
// have to pull the new data manually
|
||||
this._getItemAtRow(this._searchRowMap[ids[i]]).ref =
|
||||
Zotero.Searches.get(ids[i]);
|
||||
this._treebox.invalidateRow(this._searchRowMap[ids[i]]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.reload();
|
||||
this.rememberSelection(savedSelection);
|
||||
}
|
||||
else if(action == 'add')
|
||||
{
|
||||
|
@ -185,31 +224,53 @@ Zotero.CollectionTreeView.prototype.notify = function(action, type, ids)
|
|||
switch (type)
|
||||
{
|
||||
case 'collection':
|
||||
var item = Zotero.Collections.get(ids);
|
||||
this._showItem(new Zotero.ItemGroup('collection',item), 0, this.rowCount);
|
||||
var collection = Zotero.Collections.get(ids);
|
||||
var collectionID = collection.getID();
|
||||
// Open container if creating subcollection
|
||||
var parentID = collection.getParent();
|
||||
if (parentID) {
|
||||
if (!this.isContainerOpen(this._collectionRowMap[parentID])){
|
||||
this.toggleOpenState(this._collectionRowMap[parentID]);
|
||||
}
|
||||
}
|
||||
|
||||
this.reload();
|
||||
this.selection.select(this._collectionRowMap[collectionID]);
|
||||
break;
|
||||
|
||||
case 'search':
|
||||
var search = Zotero.Searches.get(ids);
|
||||
this._showItem(new Zotero.ItemGroup('search', search), 0, this.rowCount);
|
||||
this.reload();
|
||||
this.selection.select(this._searchRowMap[search.id]);
|
||||
break;
|
||||
}
|
||||
|
||||
this._treebox.rowCountChanged(this.rowCount-1,1);
|
||||
this.selection.select(this.rowCount-1);
|
||||
madeChanges = true;
|
||||
}
|
||||
|
||||
if(madeChanges)
|
||||
this._refreshHashMap();
|
||||
this.selection.selectEventsSuppressed = false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the rows that should be highlighted -- actually highlighting is done
|
||||
* by getRowProperties based on the array set here
|
||||
*/
|
||||
Zotero.CollectionTreeView.prototype.setHighlightedRows = function (ids) {
|
||||
this._highlightedRows = {};
|
||||
this._treebox.invalidate();
|
||||
|
||||
for each(var id in ids) {
|
||||
this._highlightedRows[this._collectionRowMap[id]] = true;
|
||||
this._treebox.invalidateRow(this._collectionRowMap[id]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Unregisters view from Zotero.Notifier (called on window close)
|
||||
*/
|
||||
Zotero.CollectionTreeView.prototype.unregister = function()
|
||||
{
|
||||
Zotero.Notifier.unregisterCollectionObserver(this._unregisterID);
|
||||
Zotero.Notifier.unregisterObserver(this._unregisterID);
|
||||
}
|
||||
|
||||
Zotero.CollectionTreeView.prototype.isLibrary = function(row)
|
||||
|
@ -239,7 +300,7 @@ Zotero.CollectionTreeView.prototype.getCellText = function(row, column)
|
|||
{
|
||||
var obj = this._getItemAtRow(row);
|
||||
|
||||
if(column.id == "name_column")
|
||||
if(column.id == "zotero-collections-name-column")
|
||||
return obj.getName();
|
||||
else
|
||||
return "";
|
||||
|
@ -261,15 +322,16 @@ Zotero.CollectionTreeView.prototype.isContainerOpen = function(row)
|
|||
return this._dataItems[row][1];
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns true if the collection has no child collections
|
||||
*/
|
||||
Zotero.CollectionTreeView.prototype.isContainerEmpty = function(row)
|
||||
{
|
||||
//NOTE: this returns true if the collection has no child collections
|
||||
|
||||
var itemGroup = this._getItemAtRow(row);
|
||||
if(itemGroup.isCollection())
|
||||
if (itemGroup.isCollection()) {
|
||||
return !itemGroup.ref.hasChildCollections();
|
||||
else
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Zotero.CollectionTreeView.prototype.getLevel = function(row)
|
||||
|
@ -333,6 +395,31 @@ Zotero.CollectionTreeView.prototype.toggleOpenState = function(row)
|
|||
this._refreshHashMap();
|
||||
}
|
||||
|
||||
|
||||
Zotero.CollectionTreeView.prototype.expandAllRows = function(treebox) {
|
||||
var view = treebox.view;
|
||||
treebox.beginUpdateBatch();
|
||||
for (var i=0; i<view.rowCount; i++) {
|
||||
if (view.isContainer(i) && !view.isContainerOpen(i)) {
|
||||
view.toggleOpenState(i);
|
||||
}
|
||||
}
|
||||
treebox.endUpdateBatch();
|
||||
}
|
||||
|
||||
|
||||
Zotero.CollectionTreeView.prototype.collapseAllRows = function(treebox) {
|
||||
var view = treebox.view;
|
||||
treebox.beginUpdateBatch();
|
||||
for (var i=0; i<view.rowCount; i++) {
|
||||
if (view.isContainer(i) && view.isContainerOpen(i)) {
|
||||
view.toggleOpenState(i);
|
||||
}
|
||||
}
|
||||
treebox.endUpdateBatch();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
///
|
||||
/// Additional functions for managing data in the tree
|
||||
|
@ -397,7 +484,8 @@ Zotero.CollectionTreeView.prototype.deleteSelection = function()
|
|||
*/
|
||||
Zotero.CollectionTreeView.prototype._showItem = function(itemGroup, level, beforeRow)
|
||||
{
|
||||
this._dataItems.splice(beforeRow, 0, [itemGroup, false, level]); this.rowCount++;
|
||||
this._dataItems.splice(beforeRow, 0, [itemGroup, false, level]);
|
||||
this.rowCount++;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -416,6 +504,60 @@ Zotero.CollectionTreeView.prototype._getItemAtRow = function(row)
|
|||
return this._dataItems[row][0];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Saves the ids of the currently selected item for later
|
||||
*/
|
||||
Zotero.CollectionTreeView.prototype.saveSelection = function()
|
||||
{
|
||||
for (var i=0, len=this.rowCount; i<len; i++) {
|
||||
if (this.selection.isSelected(i)) {
|
||||
if (this._getItemAtRow(i).isLibrary()) {
|
||||
return 'L';
|
||||
}
|
||||
else if (this._getItemAtRow(i).isCollection()) {
|
||||
return 'C' + this._getItemAtRow(i).ref.getID();
|
||||
}
|
||||
else if (this._getItemAtRow(i).isSearch()) {
|
||||
return 'S' + this._getItemAtRow(i).ref.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets the selection based on saved selection ids (see above)
|
||||
*/
|
||||
Zotero.CollectionTreeView.prototype.rememberSelection = function(selection)
|
||||
{
|
||||
var id = selection.substr(1);
|
||||
switch (selection.substr(0, 1)) {
|
||||
// Library
|
||||
case 'L':
|
||||
this.selection.select(0);
|
||||
break;
|
||||
|
||||
// Collection
|
||||
case 'C':
|
||||
// This only selects the collection if it's still visible,
|
||||
// so we open the parent in notify()
|
||||
if (this._collectionRowMap[id] != undefined) {
|
||||
this.selection.select(this._collectionRowMap[id]);
|
||||
}
|
||||
break;
|
||||
|
||||
// Saved search
|
||||
case 'S':
|
||||
if (this._searchRowMap[id] != undefined) {
|
||||
this.selection.select(this._searchRowMap[id]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Creates hash map of collection and search ids to row indexes
|
||||
* e.g., var rowForID = this._collectionRowMap[]
|
||||
|
@ -475,9 +617,16 @@ Zotero.CollectionTreeCommandController.prototype.onEvent = function(evt)
|
|||
*/
|
||||
Zotero.CollectionTreeView.prototype.canDrop = function(row, orient)
|
||||
{
|
||||
if(typeof row == 'object') //workaround... two different services call canDrop (nsDragAndDrop, and the tree)
|
||||
// workaround... two different services call canDrop
|
||||
// (nsDragAndDrop, and the tree) -- this is for the former,
|
||||
// used when dragging between windows
|
||||
if (typeof row == 'object') {
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
//Zotero.debug('Row is ' + row);
|
||||
//Zotero.debug('Orient is ' + orient);
|
||||
|
||||
try
|
||||
{
|
||||
var dataSet = nsTransferable.get(this.getSupportedFlavours(),nsDragAndDrop.getDragData, true);
|
||||
|
@ -493,17 +642,15 @@ Zotero.CollectionTreeView.prototype.canDrop = function(row, orient)
|
|||
var data = dataSet.first.first;
|
||||
var dataType = data.flavour.contentType;
|
||||
|
||||
//Highlight the rows correctly on drag:
|
||||
if(orient == 1 && row == 0 && dataType == 'zotero/collection') //for dropping collections into root level
|
||||
{
|
||||
// For dropping collections onto root level
|
||||
if (orient == 1 && row == 0 && dataType == 'zotero/collection') {
|
||||
return true;
|
||||
}
|
||||
else if(orient == 0) //directly on a row...
|
||||
{
|
||||
var rowCollection = this._getItemAtRow(row).ref; //the collection we are dragging over
|
||||
|
||||
if(dataType == 'zotero/item' || dataType == "text/x-moz-url")
|
||||
{
|
||||
if (dataType == 'zotero/item') {
|
||||
var ids = data.data.split(',');
|
||||
for each(var id in ids)
|
||||
{
|
||||
|
@ -521,8 +668,22 @@ Zotero.CollectionTreeView.prototype.canDrop = function(row, orient)
|
|||
}
|
||||
return false;
|
||||
}
|
||||
else if(dataType='zotero/collection' && data.data != rowCollection.getID() && !Zotero.Collections.get(data.data).hasDescendent('collection',rowCollection.getID()) )
|
||||
return true; //collections cannot be dropped on themselves, nor in their children
|
||||
else if (dataType == 'text/x-moz-url'
|
||||
|| dataType == 'application/x-moz-file') {
|
||||
if (this._getItemAtRow(row).isSearch()) {
|
||||
return false;
|
||||
}
|
||||
// Don't allow folder drag
|
||||
if (dataType == 'application/x-moz-file' && data.data.isDirectory()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (dataType == 'zotero/collection'
|
||||
&& data.data != rowCollection.getID()
|
||||
&& !Zotero.Collections.get(data.data).hasDescendent('collection', rowCollection.getID())) {
|
||||
return true;//collections cannot be dropped on themselves, nor in their children
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -536,50 +697,102 @@ Zotero.CollectionTreeView.prototype.drop = function(row, orient)
|
|||
var data = dataSet.first.first;
|
||||
var dataType = data.flavour.contentType;
|
||||
|
||||
if (!this.canDrop(row, orient)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(dataType == 'zotero/collection')
|
||||
{
|
||||
var oldCount = this.rowCount;
|
||||
|
||||
var targetCollectionID;
|
||||
if(this._getItemAtRow(row).isCollection())
|
||||
targetCollectionID = this._getItemAtRow(row).ref.getID();
|
||||
var droppedCollection = Zotero.Collections.get(data.data);
|
||||
droppedCollection.changeParent(targetCollectionID);
|
||||
|
||||
var selectRow = this._collectionRowMap[data.data];
|
||||
if(selectRow == null)
|
||||
selectRow = this._collectionRowMap[targetCollectionID];
|
||||
|
||||
this.selection.selectEventsSuppressed = true;
|
||||
this.selection.clearSelection();
|
||||
this.selection.select(selectRow);
|
||||
this.selection.selectEventsSuppressed = false;
|
||||
|
||||
}
|
||||
else if(dataType == 'zotero/item' && this.canDrop(row, orient))
|
||||
{
|
||||
else if (dataType == 'zotero/item') {
|
||||
var ids = data.data.split(',');
|
||||
var targetCollection = this._getItemAtRow(row).ref;
|
||||
for each(var id in ids)
|
||||
{
|
||||
var item = Zotero.Items.get(id);
|
||||
if (ids.length < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
var toAdd = [];
|
||||
for (var i=0; i<ids.length; i++) {
|
||||
var item = Zotero.Items.get(ids[i]);
|
||||
// Only accept top-level items
|
||||
if (item.isRegularItem() || !item.getSource())
|
||||
{
|
||||
targetCollection.addItem(id);
|
||||
if (item.isRegularItem() || !item.getSource()) {
|
||||
toAdd.push(ids[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (toAdd.length > 0) {
|
||||
this._getItemAtRow(row).ref.addItems(toAdd);
|
||||
}
|
||||
}
|
||||
else if(dataType == 'text/x-moz-url' && this.canDrop(row, orient))
|
||||
{
|
||||
var url = data.data.split("\n")[0];
|
||||
else if (dataType == 'text/x-moz-url' || dataType == 'application/x-moz-file') {
|
||||
if (this._getItemAtRow(row).isCollection()) {
|
||||
var parentCollectionID = this._getItemAtRow(row).ref.getID();
|
||||
}
|
||||
else {
|
||||
var parentCollectionID = false;
|
||||
}
|
||||
|
||||
/* WAITING FOR INGESTER SUPPORT
|
||||
var newItem = Zotero.Ingester.scrapeURL(url);
|
||||
|
||||
if(newItem)
|
||||
this._getItemAtRow(row).ref.addItem(newItem.getID());
|
||||
*/
|
||||
var unlock = Zotero.Notifier.begin(true);
|
||||
try {
|
||||
var dataList = dataSet.dataList;
|
||||
for (var i=0, len=dataList.length; i<len; i++) {
|
||||
var file = dataList[i].first.data;
|
||||
|
||||
if (dataType == 'text/x-moz-url') {
|
||||
var url = file.split("\n")[0];
|
||||
|
||||
if (url.indexOf('file:///') == 0) {
|
||||
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Components.interfaces.nsIWindowMediator);
|
||||
var win = wm.getMostRecentWindow("navigator:browser");
|
||||
// If dragging currently loaded page, only convert to
|
||||
// file if not an HTML document
|
||||
if (win.content.location.href != url ||
|
||||
win.content.document.contentType != 'text/html') {
|
||||
var nsIFPH = Components.classes["@mozilla.org/network/protocol;1?name=file"]
|
||||
.getService(Components.interfaces.nsIFileProtocolHandler);
|
||||
try {
|
||||
var file = nsIFPH.getFileFromURLSpec(url);
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.debug(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Still string, so remote URL
|
||||
if (typeof file == 'string') {
|
||||
Zotero.Attachments.importFromURL(url, false, false, false, parentCollectionID);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Otherwise file, so fall through
|
||||
}
|
||||
|
||||
try {
|
||||
Zotero.DB.beginTransaction();
|
||||
var itemID = Zotero.Attachments.importFromFile(file, false);
|
||||
if (parentCollectionID) {
|
||||
var col = Zotero.Collections.get(parentCollectionID);
|
||||
if (col) {
|
||||
col.addItem(itemID);
|
||||
}
|
||||
}
|
||||
Zotero.DB.commitTransaction();
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.DB.rollbackTransaction();
|
||||
throw (e);
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
Zotero.Notifier.commit(unlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -600,9 +813,10 @@ Zotero.CollectionTreeView.prototype.onDragStart = function(evt,transferData,acti
|
|||
Zotero.CollectionTreeView.prototype.getSupportedFlavours = function ()
|
||||
{
|
||||
var flavors = new FlavourSet();
|
||||
flavors.appendFlavour("text/x-moz-url");
|
||||
flavors.appendFlavour("zotero/item");
|
||||
flavors.appendFlavour("zotero/collection");
|
||||
flavors.appendFlavour("zotero/item");
|
||||
flavors.appendFlavour("text/x-moz-url");
|
||||
flavors.appendFlavour("application/x-moz-file", "nsIFile");
|
||||
return flavors;
|
||||
}
|
||||
|
||||
|
@ -620,7 +834,16 @@ Zotero.CollectionTreeView.prototype.onDrop = function (evt,dropdata,session) { }
|
|||
Zotero.CollectionTreeView.prototype.isSorted = function() { return false; }
|
||||
Zotero.CollectionTreeView.prototype.isSeparator = function(row) { return false; }
|
||||
Zotero.CollectionTreeView.prototype.isEditable = function(row, idx) { return false; }
|
||||
Zotero.CollectionTreeView.prototype.getRowProperties = function(row, prop) { }
|
||||
|
||||
/* Set 'highlighted' property on rows set by setHighlightedRows */
|
||||
Zotero.CollectionTreeView.prototype.getRowProperties = function(row, props) {
|
||||
if (this._highlightedRows[row]) {
|
||||
var aServ = Components.classes["@mozilla.org/atom-service;1"].
|
||||
getService(Components.interfaces.nsIAtomService);
|
||||
props.AppendElement(aServ.getAtom("highlighted"));
|
||||
}
|
||||
}
|
||||
|
||||
Zotero.CollectionTreeView.prototype.getColumnProperties = function(col, prop) { }
|
||||
Zotero.CollectionTreeView.prototype.getCellProperties = function(row, col, prop) { }
|
||||
Zotero.CollectionTreeView.prototype.performAction = function(action) { }
|
||||
|
@ -670,38 +893,110 @@ Zotero.ItemGroup.prototype.getName = function()
|
|||
|
||||
Zotero.ItemGroup.prototype.getChildItems = function()
|
||||
{
|
||||
if(this.searchText)
|
||||
{
|
||||
var s = new Zotero.Search();
|
||||
if (this.isCollection())
|
||||
{
|
||||
s.addCondition('collectionID', 'is', this.ref.getID(), true);
|
||||
}
|
||||
else if (this.isSearch())
|
||||
{
|
||||
s.addCondition('savedSearchID', 'is', this.ref['id'], true);
|
||||
}
|
||||
s.addCondition('quicksearch', 'contains', this.searchText);
|
||||
return Zotero.Items.get(s.search());
|
||||
var s = this.getSearchObject();
|
||||
try {
|
||||
var ids = s.search();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(this.isCollection())
|
||||
return Zotero.getItems(this.ref.getID());
|
||||
else if(this.isLibrary())
|
||||
return Zotero.getItems();
|
||||
else if(this.isSearch())
|
||||
{
|
||||
var s = new Zotero.Search();
|
||||
s.load(this.ref['id']);
|
||||
return Zotero.Items.get(s.search());
|
||||
catch (e) {
|
||||
if (typeof e == 'string' && e.match(/Saved search [0-9]+ does not exist/)) {
|
||||
Zotero.DB.rollbackTransaction();
|
||||
Zotero.debug(e, 2);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
throw (e);
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
return Zotero.Items.get(ids);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Returns the search object for the currently display
|
||||
*
|
||||
* This accounts for the collection, saved search, quicksearch, tags, etc.
|
||||
*/
|
||||
Zotero.ItemGroup.prototype.getSearchObject = function() {
|
||||
var includeScopeChildren = false;
|
||||
|
||||
// Create/load the inner search
|
||||
var s = new Zotero.Search();
|
||||
if (this.isLibrary()) {
|
||||
s.addCondition('noChildren', 'true');
|
||||
includeScopeChildren = true;
|
||||
}
|
||||
else if (this.isCollection()) {
|
||||
s.addCondition('noChildren', 'true');
|
||||
s.addCondition('collectionID', 'is', this.ref.getID());
|
||||
if (Zotero.Prefs.get('recursiveCollections')) {
|
||||
s.addCondition('recursive', 'true');
|
||||
}
|
||||
includeScopeChildren = true;
|
||||
}
|
||||
else if (this.isSearch()){
|
||||
s.load(this.ref['id']);
|
||||
}
|
||||
else {
|
||||
throw ('Invalid search mode in Zotero.ItemGroup.getSearchObject()');
|
||||
}
|
||||
|
||||
// Create the outer (filter) search
|
||||
var s2 = new Zotero.Search();
|
||||
s2.setScope(s, includeScopeChildren);
|
||||
|
||||
if (this.searchText) {
|
||||
s2.addCondition('quicksearch', 'contains', this.searchText);
|
||||
}
|
||||
|
||||
if (this.tags){
|
||||
for (var tag in this.tags){
|
||||
if (this.tags[tag]){
|
||||
s2.addCondition('tag', 'is', tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return s2;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Returns all the tags used by items in the current view
|
||||
*/
|
||||
Zotero.ItemGroup.prototype.getChildTags = function() {
|
||||
var s = this.getSearchObject();
|
||||
return Zotero.Tags.getAllWithinSearch(s);
|
||||
}
|
||||
|
||||
|
||||
Zotero.ItemGroup.prototype.setSearch = function(searchText)
|
||||
{
|
||||
this.searchText = searchText;
|
||||
}
|
||||
|
||||
Zotero.ItemGroup.prototype.setTags = function(tags)
|
||||
{
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns TRUE if saved search, quicksearch or tag filter
|
||||
*/
|
||||
Zotero.ItemGroup.prototype.isSearchMode = function() {
|
||||
// Search
|
||||
if (this.isSearch()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Quicksearch
|
||||
if (this.searchText != '') {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Tag filter
|
||||
if (this.tags) {
|
||||
for (var i in this.tags) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -22,8 +22,12 @@
|
|||
|
||||
Zotero.File = new function(){
|
||||
this.getExtension = getExtension;
|
||||
this.getClosestDirectory = getClosestDirectory;
|
||||
this.getSample = getSample;
|
||||
this.getContents = getContents;
|
||||
this.getContentsFromURL = getContentsFromURL;
|
||||
this.putContents = putContents;
|
||||
this.copyToUnique = this.copyToUnique;
|
||||
this.getCharsetFromFile = getCharsetFromFile;
|
||||
this.addCharsetListener = addCharsetListener;
|
||||
|
||||
|
@ -34,13 +38,31 @@ Zotero.File = new function(){
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* Traverses up the filesystem from a file until it finds an existing
|
||||
* directory, or false if it hits the root
|
||||
*/
|
||||
function getClosestDirectory(file) {
|
||||
var dir = file.parent;
|
||||
|
||||
while (dir && !dir.exists()) {
|
||||
var dir = dir.parent;
|
||||
}
|
||||
|
||||
if (dir && dir.exists()) {
|
||||
return dir;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the first 128 bytes of the file as a string (multibyte-safe)
|
||||
*/
|
||||
function getSample(file){
|
||||
var fis = Components.classes["@mozilla.org/network/file-input-stream;1"].
|
||||
createInstance(Components.interfaces.nsIFileInputStream);
|
||||
fis.init(file, false, false, false);
|
||||
fis.init(file, 0x01, 0664, 0);
|
||||
|
||||
const replacementChar
|
||||
= Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER;
|
||||
|
@ -48,17 +70,17 @@ Zotero.File = new function(){
|
|||
.createInstance(Components.interfaces.nsIConverterInputStream);
|
||||
is.init(fis, "UTF-8", 128, replacementChar);
|
||||
var str = {};
|
||||
var numChars = is.readString(512, str);
|
||||
var numChars = is.readString(128, str);
|
||||
is.close();
|
||||
|
||||
return str.value;
|
||||
}
|
||||
|
||||
|
||||
function getContents(file, charset){
|
||||
function getContents(file, charset, maxLength){
|
||||
var fis = Components.classes["@mozilla.org/network/file-input-stream;1"].
|
||||
createInstance(Components.interfaces.nsIFileInputStream);
|
||||
fis.init(file, false, false, false);
|
||||
fis.init(file, 0x01, 0664, 0);
|
||||
|
||||
if (charset){
|
||||
charset = Zotero.CharacterSets.getName(charset);
|
||||
|
@ -72,10 +94,20 @@ Zotero.File = new function(){
|
|||
= Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER;
|
||||
var is = Components.classes["@mozilla.org/intl/converter-input-stream;1"]
|
||||
.createInstance(Components.interfaces.nsIConverterInputStream);
|
||||
is.init(fis, charset, 1024, replacementChar);
|
||||
is.init(fis, charset, 4096, replacementChar);
|
||||
var chars = 4096;
|
||||
|
||||
var contents = [], str = {};
|
||||
while (is.readString(4096, str) != 0) {
|
||||
if (maxLength) {
|
||||
chars += 4096;
|
||||
if (chars >= maxLength) {
|
||||
Zotero.debug('Stopping at ' + (chars - 4096)
|
||||
+ ' characters in File.getContents()');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
contents.push(str.value);
|
||||
}
|
||||
|
||||
|
@ -85,6 +117,48 @@ Zotero.File = new function(){
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* Return the contents of a URL as a string
|
||||
*
|
||||
* Runs asynchronously, so should only be run on local (e.g. chrome) URLs
|
||||
*/
|
||||
function getContentsFromURL(url) {
|
||||
var xmlhttp = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
|
||||
.createInstance();
|
||||
xmlhttp.open('GET', url, false);
|
||||
xmlhttp.send(null);
|
||||
return xmlhttp.responseText;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Write string to a file, overwriting existing file if necessary
|
||||
*
|
||||
* Note: Can only handle ASCII text!
|
||||
*/
|
||||
function putContents(file, str) {
|
||||
if (file.exists()) {
|
||||
file.remove(null);
|
||||
}
|
||||
var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"]
|
||||
.createInstance(Components.interfaces.nsIFileOutputStream);
|
||||
foStream.init(file, 0x02 | 0x08 | 0x20, 0664, 0); // write, create, truncate
|
||||
foStream.write(str, str.length);
|
||||
foStream.close();
|
||||
}
|
||||
|
||||
|
||||
function copyToUnique(file, newFile) {
|
||||
newFile.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0644);
|
||||
var newName = newFile.leafName;
|
||||
newFile.remove(null);
|
||||
|
||||
// Copy file to unique name
|
||||
file.copyTo(newFile.parent, newName);
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Not implemented, but it'd sure be great if it were
|
||||
*/
|
||||
|
@ -147,7 +221,9 @@ Zotero.File = new function(){
|
|||
prefService.setCharPref('intl.charset.detector', 'universal_charset_detector');
|
||||
}
|
||||
|
||||
browser.addEventListener("pageshow", function(){
|
||||
var onpageshow = function(){
|
||||
browser.removeEventListener("pageshow", onpageshow, false);
|
||||
|
||||
var charset = browser.contentDocument.characterSet;
|
||||
Zotero.debug("Detected character set '" + charset + "'");
|
||||
|
||||
|
@ -155,8 +231,8 @@ Zotero.File = new function(){
|
|||
prefService.setCharPref('intl.charset.detector', oldPref);
|
||||
|
||||
callback(charset, args);
|
||||
|
||||
Zotero.Browser.deleteHiddenBrowser(browser);
|
||||
}, false);
|
||||
};
|
||||
|
||||
browser.addEventListener("pageshow", onpageshow, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,63 +21,168 @@
|
|||
*/
|
||||
|
||||
Zotero.Fulltext = new function(){
|
||||
this.indexWord = indexWord;
|
||||
const FULLTEXT_VERSION = 1;
|
||||
const CACHE_FILE = '.zotero-ft-cache';
|
||||
|
||||
this.init = init;
|
||||
this.registerPDFTool = registerPDFTool;
|
||||
this.pdfConverterIsRegistered = pdfConverterIsRegistered;
|
||||
this.pdfInfoIsRegistered = pdfInfoIsRegistered;
|
||||
this.isCachedMIMEType = isCachedMIMEType;
|
||||
this.indexWords = indexWords;
|
||||
this.indexDocument = indexDocument;
|
||||
this.indexString = indexString;
|
||||
this.indexFile = indexFile;
|
||||
this.indexPDF = indexPDF;
|
||||
this.indexItems = indexItems;
|
||||
this.findTextInFile = findTextInFile;
|
||||
this.findTextInItems = findTextInItems;
|
||||
this.cacheIsOutdated = cacheIsOutdated;
|
||||
this.rebuildCache = rebuildCache;
|
||||
this.clearItemWords = clearItemWords;
|
||||
this.getPages = getPages;
|
||||
this.getTotalPagesFromFile = getTotalPagesFromFile;
|
||||
this.getChars = getChars;
|
||||
this.getTotalCharsFromFile = getTotalCharsFromFile;
|
||||
this.setChars = setChars;
|
||||
this.setPages = setPages;
|
||||
this.getIndexedState = getIndexedState;
|
||||
this.getIndexStats = getIndexStats;
|
||||
this.canReindex = canReindex;
|
||||
this.rebuildIndex = rebuildIndex;
|
||||
this.clearIndex = clearIndex;
|
||||
this.clearCacheFile = clearCacheFile;
|
||||
this.clearCacheFiles = clearCacheFiles;
|
||||
//this.clearItemContent = clearItemContent;
|
||||
this.purgeUnusedWords = purgeUnusedWords;
|
||||
this.HTMLToText = HTMLToText;
|
||||
this.semanticSplitter = semanticSplitter;
|
||||
|
||||
const FULLTEXT_VERSION = 1;
|
||||
this.__defineGetter__("pdfToolsDownloadBaseURL", function() { return 'http://www.zotero.org/download/xpdf/'; });
|
||||
this.__defineGetter__("pdfToolsName", function() { return 'Xpdf'; });
|
||||
this.__defineGetter__("pdfToolsURL", function() { return 'http://www.foolabs.com/xpdf/'; });
|
||||
this.__defineGetter__("pdfConverterName", function() { return 'pdftotext'; });
|
||||
this.__defineGetter__("pdfInfoName", function() { return 'pdfinfo'; });
|
||||
this.__defineGetter__("pdfConverterCacheFile", function () { return '.zotero-ft-cache'; });
|
||||
this.__defineGetter__("pdfInfoCacheFile", function () { return '.zotero-ft-info'; });
|
||||
|
||||
this.__defineGetter__("INDEX_STATE_UNAVAILABLE", function () { return 0; });
|
||||
this.__defineGetter__("INDEX_STATE_UNINDEXED", function () { return 1; });
|
||||
this.__defineGetter__("INDEX_STATE_PARTIAL", function () { return 2; });
|
||||
this.__defineGetter__("INDEX_STATE_INDEXED", function () { return 3; });
|
||||
|
||||
|
||||
function cacheIsOutdated(){
|
||||
var sql = "SELECT version FROM version WHERE schema='fulltext'";
|
||||
return Zotero.DB.valueQuery(sql) < FULLTEXT_VERSION;
|
||||
}
|
||||
var _pdfConverterVersion = null;
|
||||
var _pdfConverterFileName = null;
|
||||
var _pdfConverter = null; // nsIFile to executable
|
||||
var _pdfInfoVersion = null;
|
||||
var _pdfInfoFileName = null;
|
||||
var _pdfInfo = null; // nsIFile to executable
|
||||
|
||||
var self = this;
|
||||
|
||||
function rebuildCache(){
|
||||
Zotero.DB.beginTransaction();
|
||||
Zotero.DB.query("DELETE FROM fulltextWords");
|
||||
Zotero.DB.query("DELETE FROM fulltextItems");
|
||||
//Zotero.DB.query("DELETE FROM fulltextContent");
|
||||
function init() {
|
||||
var platform = Zotero.platform.replace(' ', '-');
|
||||
_pdfConverterFileName = this.pdfConverterName + '-' + platform;
|
||||
_pdfInfoFileName = this.pdfInfoName + '-' + platform;
|
||||
if (Zotero.isWin) {
|
||||
_pdfConverterFileName += '.exe';
|
||||
_pdfInfoFileName += '.exe';
|
||||
}
|
||||
|
||||
var sql = "SELECT itemID FROM itemAttachments";
|
||||
var items = Zotero.DB.columnQuery(sql);
|
||||
indexItems(items);
|
||||
this.__defineGetter__("pdfConverterFileName", function() { return _pdfConverterFileName; });
|
||||
this.__defineGetter__("pdfConverterVersion", function() { return _pdfConverterVersion; });
|
||||
this.__defineGetter__("pdfInfoFileName", function() { return _pdfInfoFileName; });
|
||||
this.__defineGetter__("pdfInfoVersion", function() { return _pdfInfoVersion; });
|
||||
|
||||
Zotero.DB.commitTransaction();
|
||||
this.registerPDFTool('converter');
|
||||
this.registerPDFTool('info');
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Index a single word
|
||||
* Looks for pdftotext-{platform}[.exe] in the Zotero data directory
|
||||
*
|
||||
* {platform} is navigator.platform, with spaces replaced by hyphens
|
||||
* e.g. "Win32", "Linux-i686", "MacPPC", "MacIntel", etc.
|
||||
*/
|
||||
function indexWord(itemID, word){
|
||||
Zotero.DB.beginTransaction();
|
||||
function registerPDFTool(tool) {
|
||||
var errMsg = false;
|
||||
var exec = Zotero.getZoteroDirectory();
|
||||
|
||||
var sql = "SELECT wordID FROM fulltextWords WHERE word=?";
|
||||
var wordID = Zotero.DB.valueQuery(sql, {string:word});
|
||||
|
||||
if (!wordID){
|
||||
var sql = "INSERT INTO fulltextWords (word) VALUES (?)";
|
||||
var wordID = Zotero.DB.query(sql, {string:word});
|
||||
switch (tool) {
|
||||
case 'converter':
|
||||
var toolName = this.pdfConverterName;
|
||||
var fileName = _pdfConverterFileName
|
||||
break;
|
||||
|
||||
case 'info':
|
||||
var toolName = this.pdfInfoName;
|
||||
var fileName = _pdfInfoFileName
|
||||
break;
|
||||
|
||||
default:
|
||||
throw ("Invalid PDF tool type '" + tool + "' in Zotero.Fulltext.registerPDFTool()");
|
||||
}
|
||||
|
||||
var sql = "INSERT OR IGNORE INTO fulltextItems VALUES (?,?)";
|
||||
Zotero.DB.query(sql, [wordID, itemID]);
|
||||
exec.append(fileName);
|
||||
if (!exec.exists()) {
|
||||
exec = null;
|
||||
errMsg = fileName + ' not found';
|
||||
}
|
||||
|
||||
Zotero.DB.commitTransaction();
|
||||
if (!exec) {
|
||||
if (tool == 'converter') {
|
||||
Zotero.debug(errMsg + ' -- PDF indexing disabled');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
versionFile = exec.parent;
|
||||
versionFile.append(fileName + '.version');
|
||||
if (versionFile.exists()) {
|
||||
var version = Zotero.File.getSample(versionFile).split(/[\r\n\s]/)[0];
|
||||
}
|
||||
if (!version) {
|
||||
var version = 'UNKNOWN';
|
||||
}
|
||||
|
||||
switch (tool) {
|
||||
case 'converter':
|
||||
_pdfConverter = exec;
|
||||
_pdfConverterVersion = version;
|
||||
break;
|
||||
|
||||
case 'info':
|
||||
_pdfInfo = exec;
|
||||
_pdfInfoVersion = version;
|
||||
break;
|
||||
}
|
||||
|
||||
Zotero.debug(toolName + ' version ' + version + ' registered at ' + exec.path);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function pdfConverterIsRegistered() {
|
||||
return !!_pdfConverter;
|
||||
}
|
||||
|
||||
|
||||
function pdfInfoIsRegistered() {
|
||||
return !!_pdfInfo;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Returns true if MIME type is converted to text and cached before indexing
|
||||
* (e.g. application/pdf is run through pdftotext)
|
||||
*/
|
||||
function isCachedMIMEType(mimeType) {
|
||||
switch (mimeType) {
|
||||
case 'application/pdf':
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -109,9 +214,12 @@ Zotero.Fulltext = new function(){
|
|||
existing['_' + wordIDs[i]['word']] = wordIDs[i]['wordID'];
|
||||
}
|
||||
|
||||
Zotero.DB.query("REPLACE INTO fulltextItems (itemID, version) VALUES (?,?)",
|
||||
[itemID, FULLTEXT_VERSION]);
|
||||
|
||||
// Handle bound parameters manually for optimal speed
|
||||
var statement1 = Zotero.DB.getStatement("INSERT INTO fulltextWords (word) VALUES (?)");
|
||||
var statement2 = Zotero.DB.getStatement("INSERT OR IGNORE INTO fulltextItems VALUES (?,?)");
|
||||
var statement2 = Zotero.DB.getStatement("INSERT OR IGNORE INTO fulltextItemWords VALUES (?,?)");
|
||||
|
||||
for each(var word in words){
|
||||
if (existing['_' + word]){
|
||||
|
@ -136,19 +244,26 @@ Zotero.Fulltext = new function(){
|
|||
|
||||
|
||||
function indexString(text, charset, itemID){
|
||||
var words = semanticSplitter(text, charset);
|
||||
|
||||
Zotero.DB.beginTransaction();
|
||||
|
||||
clearItemWords(itemID);
|
||||
indexWords(itemID, words);
|
||||
|
||||
/*
|
||||
var sql = "REPLACE INTO fulltextContent (itemID, textContent) VALUES (?,?)";
|
||||
Zotero.DB.query(sql, [itemID, {string:text}]);
|
||||
*/
|
||||
|
||||
Zotero.DB.commitTransaction();
|
||||
try {
|
||||
Zotero.UnresponsiveScriptIndicator.disable();
|
||||
|
||||
var words = semanticSplitter(text, charset);
|
||||
|
||||
Zotero.DB.beginTransaction();
|
||||
|
||||
this.clearItemWords(itemID);
|
||||
this.indexWords(itemID, words);
|
||||
|
||||
/*
|
||||
var sql = "REPLACE INTO fulltextContent (itemID, textContent) VALUES (?,?)";
|
||||
Zotero.DB.query(sql, [itemID, {string:text}]);
|
||||
*/
|
||||
|
||||
Zotero.DB.commitTransaction();
|
||||
}
|
||||
finally {
|
||||
Zotero.UnresponsiveScriptIndicator.enable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -159,37 +274,181 @@ Zotero.Fulltext = new function(){
|
|||
|
||||
Zotero.debug("Indexing document '" + document.title + "'");
|
||||
|
||||
var text = document.body.innerHTML.replace(/(>)/g, '$1 ');
|
||||
text = HTMLToText(text);
|
||||
indexString(text, document.characterSet, itemID);
|
||||
if (document.contentType.indexOf('text/') !== 0) {
|
||||
Zotero.debug('File is not text in indexDocument()', 2);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!document.characterSet){
|
||||
Zotero.debug("Text file didn't have charset in indexFile()", 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
var text = document.body.innerHTML;
|
||||
|
||||
var maxLength = Zotero.Prefs.get('fulltext.textMaxLength');
|
||||
if (text.length > maxLength) {
|
||||
Zotero.debug('Only indexing first ' + maxLength + ' characters of item '
|
||||
+ itemID + ' in indexDocument()');
|
||||
text = text.substr(0, maxLength);
|
||||
}
|
||||
|
||||
text = text.replace(/(>)/g, '$1 ');
|
||||
text = this.HTMLToText(text);
|
||||
this.indexString(text, document.characterSet, itemID);
|
||||
|
||||
var charsIndexed = Math.min(maxLength, text.length);
|
||||
this.setChars(itemID, { indexed: charsIndexed, total: text.length });
|
||||
}
|
||||
|
||||
|
||||
function indexFile(file, mimeType, charset, itemID){
|
||||
function indexFile(file, mimeType, charset, itemID, maxLength, isCacheFile) {
|
||||
if (!file.exists()){
|
||||
Zotero.debug('File not found in indexFile()', 2);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!itemID){ throw ('Item ID not provided to indexFile()'); }
|
||||
if (!mimeType){ throw ('MIME type not provided to indexFile()'); }
|
||||
|
||||
if (!mimeType) {
|
||||
Zotero.debug("MIME type not provided in indexFile()", 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (maxLength == undefined || maxLength === true) {
|
||||
maxLength = Zotero.Prefs.get('fulltext.textMaxLength');
|
||||
}
|
||||
// If maxLength is explicitly false, index everything
|
||||
else if (maxLength === false || maxLength === null) {
|
||||
maxLength = false;
|
||||
}
|
||||
|
||||
if (mimeType == 'application/pdf') {
|
||||
try {
|
||||
Zotero.UnresponsiveScriptIndicator.disable();
|
||||
return this.indexPDF(file, itemID, !maxLength);
|
||||
}
|
||||
finally {
|
||||
Zotero.UnresponsiveScriptIndicator.enable();
|
||||
}
|
||||
}
|
||||
|
||||
if (mimeType.substr(0, 5)!='text/'){
|
||||
Zotero.debug('File is not text in indexFile()', 2);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!charset){ throw ('Charset not provided to indexFile()'); }
|
||||
if (!charset){
|
||||
Zotero.debug("Text file didn't have charset in indexFile()", 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
var text = Zotero.File.getContents(file, charset);
|
||||
Zotero.debug('Indexing file ' + file.path);
|
||||
|
||||
var text = Zotero.File.getContents(file, charset, maxLength);
|
||||
// Split elements to avoid word concatentation
|
||||
text = text.replace(/(>)/g, '$1 ');
|
||||
text = HTMLToText(text);
|
||||
indexString(text, charset, itemID);
|
||||
text = this.HTMLToText(text);
|
||||
this.indexString(text, charset, itemID);
|
||||
|
||||
// Record number of characters indexed
|
||||
if (!isCacheFile) {
|
||||
var totalChars = this.getTotalCharsFromFile(itemID);
|
||||
if (maxLength) {
|
||||
var charsIndexed = Math.min(maxLength, totalChars);
|
||||
}
|
||||
else {
|
||||
var charsIndexed = totalChars;
|
||||
}
|
||||
this.setChars(itemID, { indexed: charsIndexed, total: totalChars });
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function indexItems(items){
|
||||
/*
|
||||
* Run PDF through pdfinfo and pdftotext to generate .zotero-ft-info
|
||||
* and .zotero-ft-cache, and pass the text file back to indexFile()
|
||||
*
|
||||
* @param allPages If true, index all pages rather than pdfMaxPages
|
||||
*/
|
||||
function indexPDF(file, itemID, allPages) {
|
||||
if (!_pdfConverter) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var item = Zotero.Items.get(itemID);
|
||||
var linkMode = item.getAttachmentLinkMode();
|
||||
// If file is stored outside of Zotero, create a directory for the item
|
||||
// in the storage directory and save the cache file there
|
||||
if (linkMode == Zotero.Attachments.LINK_MODE_LINKED_FILE) {
|
||||
var cacheFile = Zotero.Attachments.createDirectoryForItem(itemID);
|
||||
}
|
||||
else {
|
||||
var cacheFile = file.parent;
|
||||
}
|
||||
cacheFile.append(this.pdfConverterCacheFile);
|
||||
|
||||
if (_pdfInfo) {
|
||||
var infoFile = cacheFile.parent;
|
||||
infoFile.append(this.pdfInfoCacheFile);
|
||||
Zotero.debug('Running pdfinfo ' + file.path + '" "' + infoFile.path + '"');
|
||||
|
||||
var proc = Components.classes["@mozilla.org/process/util;1"].
|
||||
createInstance(Components.interfaces.nsIProcess);
|
||||
proc.init(_pdfInfo);
|
||||
|
||||
var args = [file.path, infoFile.path];
|
||||
proc.run(true, args, args.length);
|
||||
|
||||
var totalPages = this.getTotalPagesFromFile(itemID);
|
||||
}
|
||||
else {
|
||||
Zotero.debug(this.pdfInfoName + " is not available");
|
||||
}
|
||||
|
||||
var maxPages = Zotero.Prefs.get('fulltext.pdfMaxPages');
|
||||
|
||||
Zotero.debug('Running pdftotext -nopgbrk '
|
||||
+ (allPages ? '' : '-l ' + maxPages) + ' "' + file.path + '" "'
|
||||
+ cacheFile.path + '"');
|
||||
|
||||
var proc = Components.classes["@mozilla.org/process/util;1"].
|
||||
createInstance(Components.interfaces.nsIProcess);
|
||||
proc.init(_pdfConverter);
|
||||
|
||||
var args = ['-nopgbrk'];
|
||||
if (allPages) {
|
||||
if (totalPages) {
|
||||
var pagesIndexed = totalPages;
|
||||
}
|
||||
}
|
||||
else {
|
||||
args.push('-l', maxPages);
|
||||
var pagesIndexed = Math.min(maxPages, totalPages);
|
||||
}
|
||||
args.push(file.path, cacheFile.path);
|
||||
proc.run(true, args, args.length);
|
||||
|
||||
if (!cacheFile.exists()) {
|
||||
Zotero.debug("Cache file doesn't exist!");
|
||||
return false;
|
||||
}
|
||||
|
||||
Zotero.DB.beginTransaction();
|
||||
this.indexFile(cacheFile, 'text/plain', 'utf-8', itemID, false, true);
|
||||
this.setPages(itemID, { indexed: pagesIndexed, total: totalPages });
|
||||
Zotero.DB.commitTransaction();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function indexItems(items, complete) {
|
||||
if (items.constructor.name != 'Array') {
|
||||
items = [items];
|
||||
}
|
||||
|
||||
var items = Zotero.Items.get(items);
|
||||
var found = [];
|
||||
|
||||
|
@ -202,16 +461,15 @@ Zotero.Fulltext = new function(){
|
|||
|
||||
var file = i.getFile();
|
||||
if (!file){
|
||||
Zotero.debug("No file to index for item " + i.getID()
|
||||
+ " in Fulltext.indexItems()");
|
||||
continue;
|
||||
}
|
||||
|
||||
indexFile(file, i.getAttachmentMimeType(),
|
||||
i.getAttachmentCharset(), i.getID());
|
||||
this.indexFile(file, i.getAttachmentMIMEType(),
|
||||
i.getAttachmentCharset(), i.getID(), !complete);
|
||||
}
|
||||
|
||||
var sql = "REPLACE INTO version (schema,version) VALUES (?,?)";
|
||||
Zotero.DB.query(sql, ['fulltext', FULLTEXT_VERSION]);
|
||||
|
||||
Zotero.DB.commitTransaction();
|
||||
}
|
||||
|
||||
|
@ -230,7 +488,8 @@ Zotero.Fulltext = new function(){
|
|||
function findTextInFile(file, charset, searchText, mode){
|
||||
Zotero.debug("Searching for text '" + searchText + "' in " + file.path);
|
||||
|
||||
var str = Zotero.File.getContents(file, charset);
|
||||
var maxLength = Zotero.Prefs.get('fulltext.textMaxLength');
|
||||
var str = Zotero.File.getContents(file, charset, maxLength);
|
||||
|
||||
// If not binary mode, convert HTML to text
|
||||
if (!mode || mode.indexOf('Binary')==-1){
|
||||
|
@ -238,7 +497,7 @@ Zotero.Fulltext = new function(){
|
|||
str = str.replace(/(>)/g, '$1 ');
|
||||
|
||||
// Parse to avoid searching on HTML
|
||||
str = HTMLToText(str);
|
||||
str = this.HTMLToText(str);
|
||||
}
|
||||
|
||||
switch (mode){
|
||||
|
@ -315,16 +574,30 @@ Zotero.Fulltext = new function(){
|
|||
continue;
|
||||
}
|
||||
|
||||
// If not binary mode, only scan plaintext files
|
||||
if (!mode || mode.indexOf('Binary')==-1){
|
||||
if (i.getAttachmentMimeType().substr(0,5)!='text/'){
|
||||
var mimeType = i.getAttachmentMIMEType();
|
||||
|
||||
if (isCachedMIMEType(mimeType)) {
|
||||
var file = _getItemCacheFile(i.getID());
|
||||
if (!file.exists()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
mimeType = 'text/plain';
|
||||
var charset = 'utf-8';
|
||||
}
|
||||
else {
|
||||
// If not binary mode, only scan plaintext files
|
||||
if (!mode || mode.indexOf('Binary') == -1) {
|
||||
if (!Zotero.MIME.isTextType(mimeType)) {
|
||||
Zotero.debug('Not scanning MIME type ' + mimeType, 4);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
var charset = i.getAttachmentCharset();
|
||||
}
|
||||
|
||||
var charset = i.getAttachmentCharset();
|
||||
|
||||
var match = findTextInFile(file, charset, searchText, mode);
|
||||
var match = this.findTextInFile(file, charset, searchText, mode);
|
||||
|
||||
if (match != -1){
|
||||
found.push({id:i.getID(), match:match});
|
||||
|
@ -336,7 +609,297 @@ Zotero.Fulltext = new function(){
|
|||
|
||||
|
||||
function clearItemWords(itemID){
|
||||
Zotero.DB.beginTransaction();
|
||||
Zotero.DB.query("DELETE FROM fulltextItems WHERE itemID=" + itemID);
|
||||
Zotero.DB.query("DELETE FROM fulltextItemWords WHERE itemID=" + itemID);
|
||||
Zotero.DB.commitTransaction();
|
||||
|
||||
// Delete fulltext cache file if there is one
|
||||
this.clearCacheFile(itemID);
|
||||
}
|
||||
|
||||
|
||||
function getPages(itemID, force) {
|
||||
var sql = "SELECT indexedPages AS indexed, totalPages AS total "
|
||||
+ "FROM fulltextItems WHERE itemID=?";
|
||||
return Zotero.DB.rowQuery(sql, itemID);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Gets the number of pages from the PDF info cache file
|
||||
*/
|
||||
function getTotalPagesFromFile(itemID) {
|
||||
var item = Zotero.Items.get(itemID);
|
||||
var file = Zotero.Attachments.getStorageDirectory(item.getID());
|
||||
file.append(this.pdfInfoCacheFile);
|
||||
if (!file.exists()) {
|
||||
return false;
|
||||
}
|
||||
var contents = Zotero.File.getContents(file);
|
||||
try {
|
||||
// Parse pdfinfo output
|
||||
var pages = contents.match('Pages:[^0-9]+([0-9]+)')[1];
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.debug(e);
|
||||
return false;
|
||||
}
|
||||
return pages;
|
||||
}
|
||||
|
||||
|
||||
function getChars(itemID) {
|
||||
var sql = "SELECT indexedChars AS indexed, totalChars AS total "
|
||||
+ "FROM fulltextItems WHERE itemID=?";
|
||||
return Zotero.DB.rowQuery(sql, itemID);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Gets the number of characters from the PDF converter cache file
|
||||
*/
|
||||
function getTotalCharsFromFile(itemID) {
|
||||
var item = Zotero.Items.get(itemID);
|
||||
switch (item.getAttachmentMIMEType()) {
|
||||
case 'application/pdf':
|
||||
var file = Zotero.Attachments.getStorageDirectory(itemID);
|
||||
file.append(this.pdfConverterCacheFile);
|
||||
if (!file.exists()) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
var file = item.getFile();
|
||||
if (!file) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return Zotero.File.getContents(file).length;
|
||||
}
|
||||
|
||||
|
||||
function setPages(itemID, obj) {
|
||||
var sql = "UPDATE fulltextItems SET indexedPages=?, totalPages=? WHERE itemID=?";
|
||||
Zotero.DB.query(sql, [obj.indexed ? obj.indexed : null,
|
||||
obj.total ? obj.total : null, itemID]);
|
||||
}
|
||||
|
||||
|
||||
function setChars(itemID, obj) {
|
||||
var sql = "UPDATE fulltextItems SET indexedChars=?, totalChars=? WHERE itemID=?";
|
||||
Zotero.DB.query(sql, [obj.indexed ? obj.indexed : null,
|
||||
obj.total ? obj.total : null, itemID]);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Gets the indexed state of an item,
|
||||
*/
|
||||
function getIndexedState(itemID) {
|
||||
var item = Zotero.Items.get(itemID);
|
||||
if (!item) {
|
||||
throw ("Invalid item " + itemID + " in Zotero.Fulltext.getIndexedState()");
|
||||
}
|
||||
|
||||
if (!item.isAttachment()) {
|
||||
throw ('Item ' + itemID + ' is not an attachment in Zotero.Fulltext.getIndexedState()');
|
||||
}
|
||||
|
||||
switch (item.getAttachmentMIMEType()) {
|
||||
// Use pages for PDFs
|
||||
case 'application/pdf':
|
||||
var pages = this.getPages(itemID);
|
||||
if (pages) {
|
||||
var indexedPages = pages.indexed;
|
||||
var totalPages = pages.total;
|
||||
|
||||
if (!totalPages && !indexedPages) {
|
||||
var status = this.INDEX_STATE_UNAVAILABLE;
|
||||
}
|
||||
else if (!indexedPages) {
|
||||
var status = this.INDEX_STATE_UNINDEXED;
|
||||
}
|
||||
else if (indexedPages < totalPages) {
|
||||
var status = this.INDEX_STATE_PARTIAL;
|
||||
}
|
||||
else {
|
||||
var status = this.INDEX_STATE_INDEXED;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var status = this.INDEX_STATE_UNINDEXED;
|
||||
}
|
||||
break;
|
||||
|
||||
// Use chars
|
||||
default:
|
||||
var chars = this.getChars(itemID);
|
||||
if (chars) {
|
||||
var indexedChars = chars.indexed;
|
||||
var totalChars = chars.total;
|
||||
|
||||
if (!totalChars && !indexedChars) {
|
||||
var status = this.INDEX_STATE_UNAVAILABLE;
|
||||
}
|
||||
else if (!indexedChars) {
|
||||
var status = this.INDEX_STATE_UNINDEXED;
|
||||
}
|
||||
else if (indexedChars < totalChars) {
|
||||
var status = this.INDEX_STATE_PARTIAL;
|
||||
}
|
||||
else {
|
||||
var status = this.INDEX_STATE_INDEXED;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var status = this.INDEX_STATE_UNINDEXED;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
function getIndexStats() {
|
||||
var sql = "SELECT COUNT(*) FROM fulltextItems WHERE "
|
||||
+ "(indexedPages IS NOT NULL AND indexedPages=totalPages) OR "
|
||||
+ "(indexedChars IS NOT NULL AND indexedChars=totalChars)"
|
||||
var indexed = Zotero.DB.valueQuery(sql);
|
||||
|
||||
var sql = "SELECT COUNT(*) FROM fulltextItems WHERE "
|
||||
+ "(indexedPages IS NOT NULL AND indexedPages<totalPages) OR "
|
||||
+ "(indexedChars IS NOT NULL AND indexedChars<totalChars)"
|
||||
var partial = Zotero.DB.valueQuery(sql);
|
||||
|
||||
var sql = "SELECT COUNT(*) FROM itemAttachments WHERE itemID NOT IN "
|
||||
+ "(SELECT itemID FROM fulltextItems WHERE "
|
||||
+ "indexedPages IS NOT NULL OR indexedChars IS NOT NULL)";
|
||||
var unindexed = Zotero.DB.valueQuery(sql);
|
||||
|
||||
var sql = "SELECT COUNT(*) FROM fulltextWords";
|
||||
var words = Zotero.DB.valueQuery(sql);
|
||||
|
||||
return { indexed: indexed, partial: partial, unindexed: unindexed,
|
||||
words: words };
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Returns true if an item can be reindexed
|
||||
*
|
||||
* Item must be a non-web-link attachment that isn't already fully indexed
|
||||
*/
|
||||
function canReindex(itemID) {
|
||||
var item = Zotero.Items.get(itemID);
|
||||
if (item && item.isAttachment() && item.getAttachmentLinkMode() !=
|
||||
Zotero.Attachments.LINK_MODE_LINKED_URL) {
|
||||
switch (this.getIndexedState(itemID)) {
|
||||
case this.INDEX_STATE_UNAVAILABLE:
|
||||
case this.INDEX_STATE_UNINDEXED:
|
||||
case this.INDEX_STATE_PARTIAL:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function rebuildIndex(unindexedOnly){
|
||||
Zotero.DB.beginTransaction();
|
||||
|
||||
// Get all attachments other than web links
|
||||
var sql = "SELECT itemID FROM itemAttachments WHERE linkMode!="
|
||||
+ Zotero.Attachments.LINK_MODE_LINKED_URL;
|
||||
if (unindexedOnly) {
|
||||
sql += " AND itemID NOT IN (SELECT itemID FROM fulltextItems "
|
||||
+ "WHERE indexedChars IS NOT NULL OR indexedPages IS NOT NULL)";
|
||||
}
|
||||
var items = Zotero.DB.columnQuery(sql);
|
||||
if (items) {
|
||||
Zotero.DB.query("DELETE FROM fulltextItemWords WHERE itemID IN (" + sql + ")");
|
||||
Zotero.DB.query("DELETE FROM fulltextItems WHERE itemID IN (" + sql + ")");
|
||||
this.indexItems(items);
|
||||
}
|
||||
Zotero.DB.commitTransaction();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Clears full-text word index and all full-text cache files
|
||||
*/
|
||||
function clearIndex(skipLinkedURLs) {
|
||||
Zotero.DB.beginTransaction();
|
||||
|
||||
var sql = "DELETE FROM fulltextItems";
|
||||
if (skipLinkedURLs) {
|
||||
var linkSQL = "SELECT itemID FROM itemAttachments WHERE linkMode ="
|
||||
+ Zotero.Attachments.LINK_MODE_LINKED_URL;
|
||||
|
||||
sql += " WHERE itemID NOT IN (" + linkSQL + ")";
|
||||
}
|
||||
Zotero.DB.query(sql);
|
||||
|
||||
sql = "DELETE FROM fulltextItemWords";
|
||||
if (skipLinkedURLs) {
|
||||
sql += " WHERE itemID NOT IN (" + linkSQL + ")";
|
||||
}
|
||||
Zotero.DB.query(sql);
|
||||
|
||||
if (skipLinkedURLs) {
|
||||
this.purgeUnusedWords();
|
||||
}
|
||||
else {
|
||||
Zotero.DB.query("DELETE FROM fulltextWords");
|
||||
}
|
||||
|
||||
this.clearCacheFiles();
|
||||
|
||||
Zotero.DB.commitTransaction();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Clears cache file for an item
|
||||
*/
|
||||
function clearCacheFile(itemID) {
|
||||
var item = Zotero.Items.get(itemID);
|
||||
if (!item) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!item.isAttachment()) {
|
||||
Zotero.debug("Item " + itemID + " is not an attachment in Zotero.Fulltext.clearCacheFile()");
|
||||
return;
|
||||
}
|
||||
|
||||
Zotero.debug('Clearing full-text cache file for item ' + itemID);
|
||||
switch (item.getAttachmentMIMEType()) {
|
||||
case 'application/pdf':
|
||||
var cacheFile = _getItemCacheFile();
|
||||
if (cacheFile.exists()) {
|
||||
cacheFile.remove(null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Clear cache files for all attachments
|
||||
*/
|
||||
function clearCacheFiles(skipLinkedURLs) {
|
||||
var sql = "SELECT itemID FROM itemAttachments";
|
||||
if (skipLinkedURLs) {
|
||||
sql += " WHERE linkMode != " + Zotero.Attachments.LINK_MODE_LINKED_URL;
|
||||
}
|
||||
var items = Zotero.DB.columnQuery(sql);
|
||||
for (var i=0; i<items.length; i++) {
|
||||
this.clearCacheFile(items[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -349,7 +912,7 @@ Zotero.Fulltext = new function(){
|
|||
|
||||
function purgeUnusedWords(){
|
||||
var sql = "DELETE FROM fulltextWords WHERE wordID NOT IN "
|
||||
+ "(SELECT wordID FROM fulltextItems)";
|
||||
+ "(SELECT wordID FROM fulltextItemWords)";
|
||||
Zotero.DB.query(sql);
|
||||
}
|
||||
|
||||
|
@ -449,4 +1012,12 @@ Zotero.Fulltext = new function(){
|
|||
text = text.replace("zoteroapostrophe", "'");
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
function _getItemCacheFile(itemID) {
|
||||
var cacheFile = Zotero.getStorageDirectory();
|
||||
cacheFile.append(itemID);
|
||||
cacheFile.append(self.pdfConverterCacheFile);
|
||||
return cacheFile;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -259,6 +259,9 @@ Zotero.OpenURL = new function() {
|
|||
}
|
||||
|
||||
// encode ctx_ver (if available) and identifiers
|
||||
// TODO identifiers may need to be encoded as follows:
|
||||
// rft_id=info:doi/<the-url-encoded-doi>
|
||||
// rft_id=http://<the-rest-of-the-url-encoded-url>
|
||||
if(version == "0.1") {
|
||||
var co = "";
|
||||
|
||||
|
@ -280,11 +283,11 @@ Zotero.OpenURL = new function() {
|
|||
} else {
|
||||
co += "&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article";
|
||||
}
|
||||
co += _mapTag(item.title, "atitle", version)
|
||||
co += _mapTag(item.publicationTitle, (version == "0.1" ? "title" : "jtitle"), version)
|
||||
co += _mapTag(item.journalAbbreviation, "stitle", version);
|
||||
co += _mapTag(item.volume, "volume", version);
|
||||
co += _mapTag(item.issue, "issue", version);
|
||||
if(item.title) co += _mapTag(item.title, "atitle", version)
|
||||
if(item.publicationTitle) co += _mapTag(item.publicationTitle, (version == "0.1" ? "title" : "jtitle"), version)
|
||||
if(item.journalAbbreviation) co += _mapTag(item.journalAbbreviation, "stitle", version);
|
||||
if(item.volume) co += _mapTag(item.volume, "volume", version);
|
||||
if(item.issue) co += _mapTag(item.issue, "issue", version);
|
||||
} else if(item.itemType == "book" || item.itemType == "bookitem") {
|
||||
if(version == "0.1") {
|
||||
co += "&genre=book";
|
||||
|
@ -294,45 +297,64 @@ Zotero.OpenURL = new function() {
|
|||
|
||||
if(item.itemType == "book") {
|
||||
co += "&rft.genre=book";
|
||||
co += _mapTag(item.title, (version == "0.1" ? "title" : "btitle"), version);
|
||||
if(item.title) co += _mapTag(item.title, (version == "0.1" ? "title" : "btitle"), version);
|
||||
} else {
|
||||
co += "&rft.genre=bookitem";
|
||||
co += _mapTag(item.title, "atitle", version)
|
||||
co += _mapTag(item.publicationTitle, (version == "0.1" ? "title" : "btitle"), version);
|
||||
if(item.title) co += _mapTag(item.title, "atitle", version)
|
||||
if(item.publicationTitle) co += _mapTag(item.publicationTitle, (version == "0.1" ? "title" : "btitle"), version);
|
||||
}
|
||||
|
||||
co += _mapTag(item.place, "place", version);
|
||||
co += _mapTag(item.publisher, "publisher", version)
|
||||
co += _mapTag(item.edition, "edition", version);
|
||||
co += _mapTag(item.seriesTitle, "series", version);
|
||||
if(item.place) co += _mapTag(item.place, "place", version);
|
||||
if(item.publisher) co += _mapTag(item.publisher, "publisher", version)
|
||||
if(item.edition) co += _mapTag(item.edition, "edition", version);
|
||||
if(item.series) co += _mapTag(item.series, "series", version);
|
||||
} else if(item.itemType == "thesis" && version == "1.0") {
|
||||
co += "&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adissertation";
|
||||
|
||||
_mapTag(item.title, "title", version);
|
||||
_mapTag(item.publisher, "inst", version);
|
||||
_mapTag(item.type, "degree", version);
|
||||
if(item.title) co += _mapTag(item.title, "title", version);
|
||||
if(item.publisher) co += _mapTag(item.publisher, "inst", version);
|
||||
if(item.type) co += _mapTag(item.type, "degree", version);
|
||||
} else if(item.itemType == "patent" && version == "1.0") {
|
||||
co += "&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Apatent";
|
||||
|
||||
if(item.title) co += _mapTag(item.title, "title", version);
|
||||
if(item.assignee) co += _mapTag(item.assignee, "assignee", version);
|
||||
if(item.patentNumber) co += _mapTag(item.patentNumber, "number", version);
|
||||
|
||||
if(item.issueDate) {
|
||||
co += _mapTag(Zotero.Date.strToISO(item.issueDate), "date", version);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
// encode fields on all items
|
||||
for each(creator in item.creators) {
|
||||
if(creator.firstName) {
|
||||
co += _mapTag(creator.firstName, "aufirst", version);
|
||||
co += _mapTag(creator.lastName, "aulast", version);
|
||||
if(item.creators && item.creators.length) {
|
||||
// encode first author as first and last
|
||||
var firstCreator = item.creators[0];
|
||||
if(item.itemType == "patent") {
|
||||
co += _mapTag(firstCreator.firstName, "invfirst", version);
|
||||
co += _mapTag(firstCreator.lastName, "invlast", version);
|
||||
} else {
|
||||
co += _mapTag(creator.lastName, "aucorp", version);
|
||||
if(firstCreator.isInstitution) {
|
||||
co += _mapTag(firstCreator.lastName, "aucorp", version);
|
||||
} else {
|
||||
co += _mapTag(firstCreator.firstName, "aufirst", version);
|
||||
co += _mapTag(firstCreator.lastName, "aulast", version);
|
||||
}
|
||||
}
|
||||
|
||||
// encode subsequent creators as au
|
||||
for each(creator in item.creators) {
|
||||
co += _mapTag((creator.firstName ? creator.firstName+" " : "")+creator.lastName, (item.itemType == "patent" ? "inventor" : "au"), version);
|
||||
}
|
||||
}
|
||||
|
||||
if(item.date) {
|
||||
co += _mapTag(item.date, "date", version);
|
||||
} else {
|
||||
co += _mapTag(item.year, "date", version);
|
||||
co += _mapTag(Zotero.Date.strToISO(item.date), (item.itemType == "patent" ? "appldate" : "date"), version);
|
||||
}
|
||||
co += _mapTag(item.pages, "pages", version);
|
||||
co += _mapTag(item.ISBN, "isbn", version);
|
||||
co += _mapTag(item.ISSN, "issn", version);
|
||||
if(item.pages) co += _mapTag(item.pages, "pages", version);
|
||||
if(item.ISBN) co += _mapTag(item.ISBN, "isbn", version);
|
||||
if(item.ISSN) co += _mapTag(item.ISSN, "issn", version);
|
||||
|
||||
if(version == "0.1") {
|
||||
// chop off leading & sign if version is 0.1
|
||||
|
@ -359,13 +381,17 @@ Zotero.OpenURL = new function() {
|
|||
// get type
|
||||
for each(var part in coParts) {
|
||||
if(part.substr(0, 12) == "rft_val_fmt=") {
|
||||
var format = unescape(part.substr(12));
|
||||
var format = decodeURIComponent(part.substr(12));
|
||||
if(format == "info:ofi/fmt:kev:mtx:journal") {
|
||||
item.itemType = "journalArticle";
|
||||
break;
|
||||
} else if(format == "info:ofi/fmt:kev:mtx:book") {
|
||||
if(Zotero.inArray("rft.genre=bookitem", coParts)) {
|
||||
item.itemType = "bookSection";
|
||||
} else if(Zotero.inArray("rft.genre=conference", coParts) || Zotero.inArray("rft.genre=proceeding", coParts)) {
|
||||
item.itemType = "conferencePaper";
|
||||
} else if(Zotero.inArray("rft.genre=report", coParts)) {
|
||||
item.itemType = "report";
|
||||
} else {
|
||||
item.itemType = "book";
|
||||
}
|
||||
|
@ -373,6 +399,12 @@ Zotero.OpenURL = new function() {
|
|||
} else if(format == "info:ofi/fmt:kev:mtx:dissertation") {
|
||||
item.itemType = "thesis";
|
||||
break;
|
||||
} else if(format == "info:ofi/fmt:kev:mtx:patent") {
|
||||
item.itemType = "patent";
|
||||
break;
|
||||
} else if(format == "info:ofi/fmt:kev:mtx:dc") {
|
||||
item.itemType = "webpage";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -382,10 +414,13 @@ Zotero.OpenURL = new function() {
|
|||
|
||||
var pagesKey = "";
|
||||
|
||||
// keep track of "aucorp," "aufirst," "aulast"
|
||||
var complexAu = new Array();
|
||||
|
||||
for each(var part in coParts) {
|
||||
var keyVal = part.split("=");
|
||||
var key = keyVal[0];
|
||||
var value = unescape(keyVal[1].replace(/\+|%2[bB]/g, " "));
|
||||
var value = decodeURIComponent(keyVal[1].replace(/\+|%2[bB]/g, " "));
|
||||
if(!value) {
|
||||
continue;
|
||||
}
|
||||
|
@ -401,7 +436,7 @@ Zotero.OpenURL = new function() {
|
|||
item.accessDate = "";
|
||||
}
|
||||
} else if(key == "rft.btitle") {
|
||||
if(item.itemType == "book") {
|
||||
if(item.itemType == "book" || item.itemType == "conferencePaper" || item.itemType == "report") {
|
||||
item.title = value;
|
||||
} else if(item.itemType == "bookSection") {
|
||||
item.publicationTitle = value;
|
||||
|
@ -420,7 +455,11 @@ Zotero.OpenURL = new function() {
|
|||
item.title = value;
|
||||
}
|
||||
} else if(key == "rft.date") {
|
||||
item.date = value;
|
||||
if(item.itemType == "patent") {
|
||||
item.issueDate = value;
|
||||
} else {
|
||||
item.date = value;
|
||||
}
|
||||
} else if(key == "rft.volume") {
|
||||
item.volume = value;
|
||||
} else if(key == "rft.issue") {
|
||||
|
@ -454,43 +493,107 @@ Zotero.OpenURL = new function() {
|
|||
}
|
||||
} else if(key == "rft.issn" || (key == "rft.eissn" && !item.ISSN)) {
|
||||
item.ISSN = value;
|
||||
} else if(key == "rft.aulast") {
|
||||
var lastCreator = item.creators[item.creators.length-1];
|
||||
if(item.creators.length && !lastCreator.lastName && !lastCreator.institutional) {
|
||||
} else if(key == "rft.aulast" || key == "rft.invlast") {
|
||||
var lastCreator = complexAu[complexAu.length-1];
|
||||
if(complexAu.length && !lastCreator.lastName && !lastCreator.institutional) {
|
||||
lastCreator.lastName = value;
|
||||
} else {
|
||||
item.creators.push({lastName:value});
|
||||
complexAu.push({lastName:value, creatorType:(key == "rft.aulast" ? "author" : "inventor")});
|
||||
}
|
||||
} else if(key == "rft.aufirst") {
|
||||
var lastCreator = item.creators[item.creators.length-1];
|
||||
if(item.creators.length && !lastCreator.firstName && !lastCreator.institutional) {
|
||||
} else if(key == "rft.aufirst" || key == "rft.invfirst") {
|
||||
var lastCreator = complexAu[complexAu.length-1];
|
||||
if(complexAu.length && !lastCreator.firstName && !lastCreator.institutional) {
|
||||
lastCreator.firstName = value;
|
||||
} else {
|
||||
item.creators.push({firstName:value});
|
||||
complexAu.push({firstName:value, creatorType:(key == "rft.aufirst" ? "author" : "inventor")});
|
||||
}
|
||||
} else if(key == "rft.au" || key == "rft.creator" || key == "rft.contributor" || key == "rft.inventor") {
|
||||
if(key == "rft.contributor") {
|
||||
var type = "contributor";
|
||||
} else if(key == "rft.inventor") {
|
||||
var type = "inventor";
|
||||
} else {
|
||||
var type = "author";
|
||||
}
|
||||
|
||||
if(value.indexOf(",") !== -1) {
|
||||
item.creators.push(Zotero.Utilities.prototype.cleanAuthor(value, type, true));
|
||||
} else {
|
||||
item.creators.push(Zotero.Utilities.prototype.cleanAuthor(value, type, false));
|
||||
}
|
||||
} else if(key == "rft.au") {
|
||||
item.creators.push(Zotero.Utilities.prototype.cleanAuthor(value, "author", true));
|
||||
} else if(key == "rft.aucorp") {
|
||||
item.creators.push({lastName:value, fieldMode:true});
|
||||
complexAu.push({lastName:value, isInstitution:true});
|
||||
} else if(key == "rft.isbn" && !item.ISBN) {
|
||||
item.ISBN = value;
|
||||
} else if(key == "rft.pub") {
|
||||
} else if(key == "rft.pub" || key == "rft.publisher") {
|
||||
item.publisher = value;
|
||||
} else if(key == "rft.place") {
|
||||
item.place = value;
|
||||
} else if(key == "rft.edition") {
|
||||
item.edition = value;
|
||||
} else if(key == "rft.series") {
|
||||
item.seriesTitle = value;
|
||||
item.series = value;
|
||||
} else if(item.itemType == "thesis") {
|
||||
if(key == "rft.inst") {
|
||||
item.publisher = value;
|
||||
} else if(key == "rft.degree") {
|
||||
item.type = value;
|
||||
}
|
||||
} else if(item.itemType == "patent") {
|
||||
if(key == "rft.assignee") {
|
||||
item.assignee = value;
|
||||
} else if(key == "rft.number") {
|
||||
item.patentNumber = value;
|
||||
} else if(key == "rft.appldate") {
|
||||
item.date = value;
|
||||
}
|
||||
} else if(format == "info:ofi/fmt:kev:mtx:dc") {
|
||||
if(key == "rft.identifier") {
|
||||
if(value.length > 8) { // we could check length separately for
|
||||
// each type, but all of these identifiers
|
||||
// must be > 8 characters
|
||||
if(value.substr(0, 5) == "ISBN ") {
|
||||
item.ISBN = value.substr(5);
|
||||
} else if(value.substr(0, 5) == "ISSN ") {
|
||||
item.ISSN = value.substr(5);
|
||||
} else if(value.substr(0, 8) == "urn:doi:") {
|
||||
item.DOI = value.substr(4);
|
||||
} else if(value.substr(0, 7) == "http://" || value.substr(0, 8) == "https://") {
|
||||
item.url = value;
|
||||
}
|
||||
}
|
||||
} else if(key == "rft.description") {
|
||||
item.extra = value;
|
||||
} else if(key == "rft.rights") {
|
||||
item.rights = value;
|
||||
} else if(key == "rft.subject") {
|
||||
item.tags.push(value);
|
||||
} else if(key == "rft.type") {
|
||||
if(Zotero.ItemTypes.getID(value)) item.itemType = value;
|
||||
} else if(key == "rft.source") {
|
||||
item.publicationTitle = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// combine two lists of authors, eliminating duplicates
|
||||
for each(var au in complexAu) {
|
||||
var pushMe = true;
|
||||
for each(var pAu in item.creators) {
|
||||
// if there's a plain author that is close to this author (the
|
||||
// same last name, and the same first name up to a point), keep
|
||||
// the plain author, since it might have a middle initial
|
||||
if(pAu.lastName == au.lastName &&
|
||||
(pAu.firstName == au.firstName == "" ||
|
||||
(pAu.firstName.length >= au.firstName.length &&
|
||||
pAu.firstName.substr(0, au.firstName.length) == au.firstName))) {
|
||||
pushMe = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(pushMe) item.creators.push(au);
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
|
@ -500,9 +603,9 @@ Zotero.OpenURL = new function() {
|
|||
function _mapTag(data, tag, version) {
|
||||
if(data) {
|
||||
if(version == "0.1") {
|
||||
return "&"+tag+"="+escape(data);
|
||||
return "&"+tag+"="+encodeURIComponent(data);
|
||||
} else {
|
||||
return "&rft."+tag+"="+escape(data);
|
||||
return "&rft."+tag+"="+encodeURIComponent(data);
|
||||
}
|
||||
} else {
|
||||
return "";
|
||||
|
@ -599,7 +702,7 @@ Zotero.Ingester.MIMEHandler.StreamListener = function(request, contentType) {
|
|||
var windowWatcher = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].
|
||||
getService(Components.interfaces.nsIWindowWatcher);
|
||||
this._frontWindow = windowWatcher.activeWindow;
|
||||
this._frontWindow.Zotero_Ingester_Interface.Progress.show();
|
||||
this._frontWindow.Zotero_Browser.progress.show();
|
||||
|
||||
Zotero.debug("EndNote prepared to grab content type "+contentType);
|
||||
}
|
||||
|
@ -643,18 +746,26 @@ Zotero.Ingester.MIMEHandler.StreamListener.prototype.onStopRequest = function(ch
|
|||
var translation = new Zotero.Translate("import");
|
||||
translation.setLocation(this._request.name);
|
||||
translation.setString(this._readString);
|
||||
translation.setHandler("itemDone", this._frontWindow.Zotero_Ingester_Interface._itemDone);
|
||||
translation.setHandler("done", this._frontWindow.Zotero_Ingester_Interface._finishScraping);
|
||||
|
||||
// use front window's save functions and folder
|
||||
var frontWindow = this._frontWindow;
|
||||
|
||||
var saveLocation = null;
|
||||
try {
|
||||
saveLocation = frontWindow.ZoteroPane.getSelectedCollection();
|
||||
} catch(e) {}
|
||||
translation.setHandler("itemDone", function(obj, item) { frontWindow.Zotero_Browser.itemDone(obj, item, saveLocation) });
|
||||
translation.setHandler("done", function(obj, item) { frontWindow.Zotero_Browser.finishScraping(obj, item, saveLocation) });
|
||||
|
||||
// attempt to retrieve translators
|
||||
var translators = translation.getTranslators();
|
||||
if(!translators.length) {
|
||||
// we lied. we can't really translate this file. call
|
||||
// nsIExternalHelperAppService with the data
|
||||
this._frontWindow.Zotero_Ingester_Interface.Progress.kill();
|
||||
frontWindow.Zotero_Browser.progress.close();
|
||||
|
||||
var streamListener;
|
||||
if(streamListener = externalHelperAppService.doContent(this._contentType, this._request, this._frontWindow)) {
|
||||
if(streamListener = externalHelperAppService.doContent(this._contentType, this._request, frontWindow)) {
|
||||
// create a string input stream
|
||||
var inputStream = Components.classes["@mozilla.org/io/string-input-stream;1"].
|
||||
createInstance(Components.interfaces.nsIStringInputStream);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue