www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 0061ff3ca581d3ef33b6f00aaefefd6b27b4495d
parent 6de5cb4ab1a642ee6a80edb437635cf78ef799dd
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon,  4 Feb 2013 07:02:38 -0500

Merge branch '3.0'

Conflicts:
	chrome/content/zotero/preferences/preferences.xul
	chrome/content/zotero/xpcom/data/item.js
	chrome/content/zotero/xpcom/utilities_translate.js

Diffstat:
Mchrome/content/zotero/integration/quickFormat.xul | 2+-
Mchrome/content/zotero/preferences/preferences.js | 8++++++++
Mchrome/content/zotero/preferences/preferences.xul | 30+++++++++++-------------------
Mchrome/content/zotero/preferences/preferences_firefox.xul | 21+++++++++++++++++++++
Mchrome/content/zotero/xpcom/attachments.js | 1+
Mchrome/content/zotero/xpcom/collectionTreeView.js | 2+-
Mchrome/content/zotero/xpcom/data/item.js | 278+++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------
Mchrome/content/zotero/xpcom/http.js | 5+++--
Mchrome/content/zotero/xpcom/itemTreeView.js | 103++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------
Mchrome/content/zotero/xpcom/notifier.js | 8++++++--
Mchrome/content/zotero/xpcom/utilities_translate.js | 10+++++++++-
Mchrome/content/zotero/zoteroPane.js | 12++++++++++++
Mchrome/locale/af-ZA/zotero/zotero.dtd | 1+
Mchrome/locale/ar/zotero/zotero.dtd | 1+
Mchrome/locale/bg-BG/zotero/zotero.dtd | 1+
Mchrome/locale/ca-AD/zotero/zotero.dtd | 1+
Mchrome/locale/cs-CZ/zotero/zotero.dtd | 1+
Mchrome/locale/da-DK/zotero/zotero.dtd | 1+
Mchrome/locale/de/zotero/zotero.dtd | 1+
Mchrome/locale/el-GR/zotero/zotero.dtd | 1+
Mchrome/locale/en-US/zotero/zotero.dtd | 1+
Mchrome/locale/en-US/zotero/zotero.properties | 1+
Mchrome/locale/es-ES/zotero/zotero.dtd | 1+
Mchrome/locale/et-EE/zotero/zotero.dtd | 1+
Mchrome/locale/eu-ES/zotero/zotero.dtd | 1+
Mchrome/locale/fa/zotero/zotero.dtd | 1+
Mchrome/locale/fi-FI/zotero/zotero.dtd | 1+
Mchrome/locale/fr-FR/zotero/zotero.dtd | 1+
Mchrome/locale/gl-ES/zotero/zotero.dtd | 1+
Mchrome/locale/he-IL/zotero/zotero.dtd | 1+
Mchrome/locale/hr-HR/zotero/zotero.dtd | 1+
Mchrome/locale/hu-HU/zotero/zotero.dtd | 1+
Mchrome/locale/is-IS/zotero/zotero.dtd | 1+
Mchrome/locale/it-IT/zotero/zotero.dtd | 1+
Mchrome/locale/ja-JP/zotero/zotero.dtd | 1+
Mchrome/locale/km/zotero/zotero.dtd | 1+
Mchrome/locale/ko-KR/zotero/zotero.dtd | 1+
Mchrome/locale/mn-MN/zotero/zotero.dtd | 1+
Mchrome/locale/nb-NO/zotero/zotero.dtd | 1+
Mchrome/locale/nl-NL/zotero/zotero.dtd | 1+
Mchrome/locale/nn-NO/zotero/zotero.dtd | 1+
Mchrome/locale/pl-PL/zotero/zotero.dtd | 1+
Mchrome/locale/pt-BR/zotero/zotero.dtd | 1+
Mchrome/locale/pt-PT/zotero/zotero.dtd | 1+
Mchrome/locale/ro-RO/zotero/zotero.dtd | 1+
Mchrome/locale/ru-RU/zotero/zotero.dtd | 1+
Mchrome/locale/sk-SK/zotero/zotero.dtd | 1+
Mchrome/locale/sl-SI/zotero/zotero.dtd | 1+
Mchrome/locale/sr-RS/zotero/zotero.dtd | 1+
Mchrome/locale/sv-SE/zotero/zotero.dtd | 1+
Mchrome/locale/th-TH/zotero/zotero.dtd | 1+
Mchrome/locale/tr-TR/zotero/zotero.dtd | 1+
Mchrome/locale/vi-VN/zotero/zotero.dtd | 1+
Mchrome/locale/zh-CN/zotero/zotero.dtd | 1+
Mchrome/locale/zh-TW/zotero/zotero.dtd | 1+
Mcomponents/zotero-autocomplete.js | 3+++
56 files changed, 401 insertions(+), 125 deletions(-)

diff --git a/chrome/content/zotero/integration/quickFormat.xul b/chrome/content/zotero/integration/quickFormat.xul @@ -33,7 +33,7 @@ <window id="quick-format-dialog" orient="vertical" - title="Quick Format Citation" + title="&zotero.integration.quickFormatDialog.title;" width="600" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js @@ -90,6 +90,14 @@ function init() rows[i].firstChild.nextSibling.value = Zotero.isMac ? 'Cmd+Shift+' : 'Ctrl+Alt+'; } + // JS-based strings + var checkbox = document.getElementById('launchNonNativeFiles-checkbox'); + if (checkbox ) { + checkbox.label = Zotero.getString( + 'zotero.preferences.launchNonNativeFiles', Zotero.appName + ); + } + updateStorageSettings(null, null, true); updateWordProcessorInstructions(); refreshStylesList(); diff --git a/chrome/content/zotero/preferences/preferences.xul b/chrome/content/zotero/preferences/preferences.xul @@ -54,8 +54,6 @@ To add a new preference: <preference id="pref-noteFontSize" name="extensions.zotero.note.fontSize" type="string"/> <preference id="pref-automaticScraperUpdates" name="extensions.zotero.automaticScraperUpdates" type="bool"/> <preference id="pref-reportTranslationFailure" name="extensions.zotero.reportTranslationFailure" type="bool"/> - <preference id="pref-zoteroDotOrgVersionHeader" name="extensions.zotero.zoteroDotOrgVersionHeader" type="bool"/> - <preference id="pref-parseEndNoteMIMETypes" name="extensions.zotero.parseEndNoteMIMETypes" type="bool" onchange="Zotero.MIMETypeHandler.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"/> @@ -117,7 +115,7 @@ To add a new preference: <label class="statusLine" value="&zotero.preferences.keys.changesTakeEffect;"/> </groupbox> - <groupbox> + <groupbox id="zotero-prefpane-miscellaneous-groupbox"> <caption label="&zotero.preferences.miscellaneous;"/> <hbox align="center"> @@ -126,14 +124,11 @@ To add a new preference: </hbox> <checkbox label="&zotero.preferences.reportTranslationFailure;" preference="pref-reportTranslationFailure"/> - <checkbox label="&zotero.preferences.zoteroDotOrgVersionHeader;" - tooltiptext="&zotero.preferences.zoteroDotOrgVersionHeader.tooltip;" - preference="pref-zoteroDotOrgVersionHeader"/> - <checkbox label="&zotero.preferences.parseRISRefer;" preference="pref-parseEndNoteMIMETypes"/> - <checkbox label="&zotero.preferences.automaticSnapshots;" preference="pref-automaticSnapshots"/> + <checkbox id="automaticSnapshots-checkbox" + label="&zotero.preferences.automaticSnapshots;" + preference="pref-automaticSnapshots"/> <checkbox label="&zotero.preferences.downloadAssociatedFiles;" preference="pref-downloadAssociatedFiles"/> <checkbox label="&zotero.preferences.automaticTags;" preference="pref-automaticTags"/> - <hbox align="center"> <label value="&zotero.preferences.trashAutoEmptyDaysPre;"/> <textbox size="2" preference="pref-trashAutoEmptyDays"/> @@ -167,9 +162,9 @@ To add a new preference: <preference id="pref-sync-username" name="extensions.zotero.sync.server.username" type="string" instantApply="true"/> <preference id="pref-storage-enabled" name="extensions.zotero.sync.storage.enabled" type="bool"/> <preference id="pref-storage-protocol" name="extensions.zotero.sync.storage.protocol" type="string" onchange="unverifyStorageServer()"/> - <preference id="pref-storage-scheme" name="extensions.zotero.sync.storage.scheme" type="string"/> - <preference id="pref-storage-url" name="extensions.zotero.sync.storage.url" type="string" instantApply="true"/> - <preference id="pref-storage-username" name="extensions.zotero.sync.storage.username" type="string" instantApply="true"/> + <preference id="pref-storage-scheme" name="extensions.zotero.sync.storage.scheme" type="string" instantApply="true"/> + <preference id="pref-storage-url" name="extensions.zotero.sync.storage.url" type="string"/> + <preference id="pref-storage-username" name="extensions.zotero.sync.storage.username" type="string"/> <preference id="pref-storage-downloadMode-personal" name="extensions.zotero.sync.storage.downloadMode.personal" type="string"/> <preference id="pref-storage-downloadMode-groups" name="extensions.zotero.sync.storage.downloadMode.groups" type="string"/> <preference id="pref-group-storage-enabled" name="extensions.zotero.sync.storage.groups.enabled" type="bool"/> @@ -272,9 +267,8 @@ To add a new preference: <label value="://"/> <textbox id="storage-url" flex="1" preference="pref-storage-url" - onkeypress="if (Zotero.isMac &amp;&amp; event.keyCode == 13) { this.blur(); verifyStorageServer(); }" - onsynctopreference="unverifyStorageServer();" - onchange="this.value = this.value.replace(/(^https?:\/\/|\/zotero\/?$|\/$)/g, '')"/> + onkeypress="if (Zotero.isMac &amp;&amp; event.keyCode == 13) { this.blur(); setTimeout(verifyStorageServer, 1); }" + onchange="unverifyStorageServer(); this.value = this.value.replace(/(^https?:\/\/|\/zotero\/?$|\/$)/g, ''); Zotero.Prefs.set('extensions.zotero.sync.storage.url', this.value)"/> <label value="/zotero/"/> </hbox> </row> @@ -284,8 +278,7 @@ To add a new preference: <textbox id="storage-username" preference="pref-storage-username" onkeypress="if (Zotero.isMac &amp;&amp; event.keyCode == 13) { this.blur(); setTimeout(verifyStorageServer, 1); }" - onsynctopreference="unverifyStorageServer();" - onchange="var pass = document.getElementById('storage-password'); if (pass.value) { Zotero.Sync.Storage.WebDAV.password = pass.value; }"/> + onchange="unverifyStorageServer(); Zotero.Prefs.set('extensions.zotero.sync.storage.username', this.value); var pass = document.getElementById('storage-password'); if (pass.value) { Zotero.Sync.Storage.WebDAV.password = pass.value; }"/> </hbox> </row> <row> @@ -293,8 +286,7 @@ To add a new preference: <hbox> <textbox id="storage-password" flex="0" type="password" onkeypress="if (Zotero.isMac &amp;&amp; event.keyCode == 13) { this.blur(); setTimeout(verifyStorageServer, 1); }" - oninput="unverifyStorageServer()" - onchange="Zotero.Sync.Storage.WebDAV.password = this.value;"/> + onchange="unverifyStorageServer(); Zotero.Sync.Storage.WebDAV.password = this.value;"/> </hbox> </row> <row> diff --git a/chrome/content/zotero/preferences/preferences_firefox.xul b/chrome/content/zotero/preferences/preferences_firefox.xul @@ -48,6 +48,13 @@ To add a new preference: <preferences id="zotero-prefpane-general-preferences"> <preference id="pref-showIn" name="extensions.zotero.showIn" type="int"/> <preference id="pref-statusBarIcon" name="extensions.zotero.statusBarIcon" type="int"/> + <preference id="pref-launchNonNativeFiles" name="extensions.zotero.launchNonNativeFiles" type="bool"/> + <preference id="pref-zoteroDotOrgVersionHeader" + name="extensions.zotero.zoteroDotOrgVersionHeader" + type="bool"/> + <preference id="pref-parseEndNoteMIMETypes" + name="extensions.zotero.parseEndNoteMIMETypes" + type="bool" onchange="Zotero.MIMETypeHandler.init()"/> </preferences> <groupbox id="zotero-prefpane-general-groupbox"> <grid id="zotero-prefpane-general-grid"> @@ -75,6 +82,20 @@ To add a new preference: </rows> </grid> </groupbox> + <groupbox id="zotero-prefpane-miscellaneous-groupbox"> + <checkbox label="&zotero.preferences.zoteroDotOrgVersionHeader;" + tooltiptext="&zotero.preferences.zoteroDotOrgVersionHeader.tooltip;" + preference="pref-zoteroDotOrgVersionHeader" + insertbefore="automaticSnapshots-checkbox"/> + <checkbox id="launchNonNativeFiles-checkbox" + preference="pref-launchNonNativeFiles" + onsyncfrompreference="return !document.getElementById(this.getAttribute('preference')).value" + onsynctopreference="return !this.checked" + insertbefore="automaticSnapshots-checkbox"/> + <checkbox label="&zotero.preferences.parseRISRefer;" + preference="pref-parseEndNoteMIMETypes" + insertbefore="automaticSnapshots-checkbox"/> + </groupbox> </prefpane> <prefpane id="zotero-prefpane-export" diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js @@ -1367,6 +1367,7 @@ Zotero.Attachments = new function(){ // Chain fulltext indexer inside the charset callback, // since it's asynchronous and a prerequisite Zotero.Fulltext.indexDocument(browser.contentDocument, itemID); + Zotero.Browser.deleteHiddenBrowser(browser); } // Since the callback can be called during an import process that uses diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js @@ -1854,10 +1854,10 @@ Zotero.ItemGroupCache = { "clear":function() { this.lastItemGroup = null; this.lastSearch = null; - this.lastTempTable = null; if(this.lastTempTable) { Zotero.DB.query("DROP TABLE "+this.lastTempTable); } + this.lastTempTable = null; this.lastResults = null; } }; diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -67,7 +67,7 @@ Zotero.Item.prototype._init = function () { this._itemDataLoaded = false; this._relatedItemsLoaded = false; - this._changed = false; + this._changed = {}; this._changedPrimaryData = false; this._changedItemData = false; this._changedCreators = false; @@ -77,7 +77,7 @@ Zotero.Item.prototype._init = function () { this._changedAttachmentData = false; this._skipModTimeUpdate = false; - this._previousData = null; + this._previousData = {}; this._bestAttachmentState = null; this._fileExists = null; @@ -87,6 +87,8 @@ Zotero.Item.prototype._init = function () { this._noteTitle = null; this._noteText = null; this._noteAccessTime = null; + this._cachedAttachments = null; + this._cachedNotes = null; this._attachmentLinkMode = null; this._attachmentMIMEType = null; @@ -422,7 +424,7 @@ Zotero.Item.prototype.loadFromRow = function(row, reload) { * Check if any data fields have changed since last save */ Zotero.Item.prototype.hasChanged = function() { - return !!(this._changed + return !!(Object.keys(this._changed).length || this._changedPrimaryData || this._changedItemData || this._changedCreators @@ -564,7 +566,7 @@ Zotero.Item.prototype.setType = function(itemTypeID, loadIn) { if (copiedFields) { for each(var f in copiedFields) { - this.setField(f[0], f[1]); + this.setField(f[0], f[1], true); } } @@ -572,6 +574,7 @@ Zotero.Item.prototype.setType = function(itemTypeID, loadIn) { this._itemDataLoaded = false; } else { + this._markFieldChange('itemType', Zotero.ItemTypes.getName(oldItemTypeID)); if (!this._changedPrimaryData) { this._changedPrimaryData = {}; } @@ -731,10 +734,9 @@ Zotero.Item.prototype.setField = function(field, value, loadIn) { if (this['_' + field] != value) { Zotero.debug("Field '" + field + "' has changed from '" + this['_' + field] + "' to '" + value + "'", 4); - // Save a copy of the object before modifying - if (this.id && this.exists() && !this._previousData) { - this._previousData = this.serialize(); - } + // Save a copy of the field before modifying + this._markFieldChange(field, this['_' + field]); + if (field == 'itemTypeID') { this.setType(value, loadIn); } @@ -779,7 +781,11 @@ Zotero.Item.prototype.setField = function(field, value, loadIn) { return true; } - if (!Zotero.ItemFields.isValidForType(fieldID, this.itemTypeID)) { + if (value === "") { + value = false; + } + + if (value !== false && !Zotero.ItemFields.isValidForType(fieldID, this.itemTypeID)) { var msg = "'" + field + "' is not a valid field for type " + this.itemTypeID; if (loadIn) { @@ -815,14 +821,16 @@ Zotero.Item.prototype.setField = function(field, value, loadIn) { } // If existing value, make sure it's actually changing - if ((this._itemData[fieldID] + "") === (value + "")) { + if ((typeof this._itemData[fieldID] == 'undefined' && value === false) + || (typeof this._itemData[fieldID] != 'undefined' + && this._itemData[fieldID] === value)) { return false; } - // Save a copy of the object before modifying - if (this.id && this.exists() && !this._previousData) { - this._previousData = this.serialize(); - } + // Save a copy of the field before modifying + this._markFieldChange( + Zotero.ItemFields.getName(field), this._itemData[fieldID] + ); } this._itemData[fieldID] = value; @@ -1063,15 +1071,20 @@ Zotero.Item.prototype.setCreator = function(orderIndex, creator, creatorTypeIDOr return false; } + // Save copy of old creators for notifier + if (!this._changedCreators) { + this._changedCreators = {}; + + var oldCreators = this._getOldCreators() + this._markFieldChange('creators', oldCreators); + } + this._changedCreators[orderIndex] = true; + this._creators[orderIndex] = { ref: creator, creatorTypeID: creatorTypeID }; - if (!this._changedCreators) { - this._changedCreators = {}; - } - this._changedCreators[orderIndex] = true; return true; } @@ -1094,6 +1107,14 @@ Zotero.Item.prototype.removeCreator = function(orderIndex) { Zotero.Prefs.set('purge.creators', true); } + // Save copy of old creators for notifier + if (!this._changedCreators) { + this._changedCreators = {}; + + var oldCreators = this._getOldCreators(); + this._markFieldChange('creators', oldCreators); + } + // Shift creator orderIndexes down, going to length+1 so we clear the last one for (var i=orderIndex, max=this._creators.length+1; i<max; i++) { var next = this._creators[i+1] ? this._creators[i+1] : false; @@ -1104,9 +1125,6 @@ Zotero.Item.prototype.removeCreator = function(orderIndex) { this._creators.splice(i, 1); } - if (!this._changedCreators) { - this._changedCreators = {}; - } this._changedCreators[i] = true; } @@ -1178,7 +1196,8 @@ Zotero.Item.prototype.addRelatedItem = function (itemID) { } */ - this._prepFieldChange('relatedItems'); + this._markFieldChange('related', current); + this._changed.relatedItems = true; this._relatedItems.push(item); return true; } @@ -1200,7 +1219,8 @@ Zotero.Item.prototype.removeRelatedItem = function (itemID) { return false; } - this._prepFieldChange('relatedItems'); + this._markFieldChange('related', current); + this._changed.relatedItems = true; this._relatedItems.splice(index, 1); return true; } @@ -1517,9 +1537,7 @@ Zotero.Item.prototype.save = function() { } var newSourceItemNotifierData = {}; - newSourceItemNotifierData[newSourceItem.id] = { - old: newSourceItem.serialize() - }; + //newSourceItemNotifierData[newSourceItem.id] = {}; Zotero.Notifier.trigger('modify', 'item', newSourceItem.id, newSourceItemNotifierData); switch (Zotero.ItemTypes.getName(this.itemTypeID)) { @@ -1539,16 +1557,13 @@ Zotero.Item.prototype.save = function() { var newids = []; var currentIDs = this._getRelatedItems(true); - if (this._previousData && this._previousData.related) { - for each(var id in this._previousData.related) { - if (currentIDs.indexOf(id) == -1) { - removed.push(id); - } + for each(var id in this._previousData.related) { + if (currentIDs.indexOf(id) == -1) { + removed.push(id); } } for each(var id in currentIDs) { - if (this._previousData && this._previousData.related && - this._previousData.related.indexOf(id) != -1) { + if (this._previousData.related.indexOf(id) != -1) { continue; } newids.push(id); @@ -1876,11 +1891,17 @@ Zotero.Item.prototype.save = function() { Zotero.DB.query(sql, bindParams); if (this.isAttachment()) { - var parent = this.getSource(); if (parent) { Zotero.Items.get(parent).updateNumNotes(); } } + + // Clear cached child notes of the parent. If the note + // moved between parents, the old one will be cleared + // when changing the note count below + if (parent) { + Zotero.Items.get(parent).clearCachedNotes(); + } } @@ -1906,9 +1927,18 @@ Zotero.Item.prototype.save = function() { this.id ]; Zotero.DB.query(sql, bindParams); + + // Clear cached child attachments of the parent. If the note + // moved between parents, the old one will be cleared + // when changing the note count below + if (parent) { + Zotero.Items.get(parent).clearCachedAttachments(); + } } - Zotero.Notifier.trigger('modify', 'item', this.id, { old: this._previousData }); + var notifierData = {}; + notifierData[this.id] = { changed: this._previousData }; + Zotero.Notifier.trigger('modify', 'item', this.id, notifierData); // Parent if (this._changedSource) { @@ -1931,22 +1961,16 @@ Zotero.Item.prototype.save = function() { } var newSourceItemNotifierData = {}; - newSourceItemNotifierData[newSourceItem.id] = { - old: newSourceItem.serialize() - }; + //newSourceItemNotifierData[newSourceItem.id] = {}; Zotero.Notifier.trigger('modify', 'item', newSourceItem.id, newSourceItemNotifierData); } - if (this._previousData) { - var oldSourceItemKey = this._previousData.sourceItemKey; - if (oldSourceItemKey) { - var oldSourceItem = Zotero.Items.getByLibraryAndKey(this.libraryID, oldSourceItemKey); - } + var oldSourceItemKey = this._previousData.parent; + if (oldSourceItemKey) { + var oldSourceItem = Zotero.Items.getByLibraryAndKey(this.libraryID, oldSourceItemKey); if (oldSourceItem) { var oldSourceItemNotifierData = {}; - oldSourceItemNotifierData[oldSourceItem.id] = { - old: oldSourceItem.serialize() - }; + //oldSourceItemNotifierData[oldSourceItem.id] = {}; Zotero.Notifier.trigger('modify', 'item', oldSourceItem.id, oldSourceItemNotifierData); } else if (oldSourceItemKey) { @@ -1957,6 +1981,7 @@ Zotero.Item.prototype.save = function() { } + // If this was an independent item, remove from any collections // where it existed previously and add source instead if // there is one @@ -2029,16 +2054,13 @@ Zotero.Item.prototype.save = function() { var newids = []; var currentIDs = this._getRelatedItems(true); - if (this._previousData && this._previousData.related) { - for each(var id in this._previousData.related) { - if (currentIDs.indexOf(id) == -1) { - removed.push(id); - } + for each(var id in this._previousData.related) { + if (currentIDs.indexOf(id) == -1) { + removed.push(id); } } for each(var id in currentIDs) { - if (this._previousData && this._previousData.related && - this._previousData.related.indexOf(id) != -1) { + if (this._previousData.related.indexOf(id) != -1) { continue; } newids.push(id); @@ -2269,12 +2291,9 @@ Zotero.Item.prototype.setSource = function(sourceItemID) { return false; } - if (this.id && this.exists() && !this._previousData) { - this._previousData = this.serialize(); - } - - this._sourceItem = sourceItemID ? parseInt(sourceItemID) : false; + this._markFieldChange('parentItem', this.getSourceKey()); this._changedSource = true; + this._sourceItem = sourceItemID ? parseInt(sourceItemID) : false; return true; } @@ -2306,12 +2325,9 @@ Zotero.Item.prototype.setSourceKey = function(sourceItemKey) { return false; } - if (this.id && this.exists() && !this._previousData) { - this._previousData = this.serialize(); - } - - this._sourceItem = sourceItemKey ? sourceItemKey : false; + this._markFieldChange('parentItem', oldSourceItemKey); this._changedSource = true; + this._sourceItem = sourceItemKey ? sourceItemKey : false; return true; } @@ -2324,11 +2340,18 @@ Zotero.Item.prototype.setSourceKey = function(sourceItemKey) { //////////////////////////////////////////////////////// Zotero.Item.prototype.incrementNoteCount = function() { this._numNotes++; + this._cachedNotes = null; } Zotero.Item.prototype.decrementNoteCount = function() { this._numNotes--; + this._cachedNotes = null; +} + + +Zotero.Item.prototype.clearCachedNotes = function () { + this._cachedNotes = null; } @@ -2524,13 +2547,11 @@ Zotero.Item.prototype.setNote = function(text) { return false; } - if (this.id && this.exists() && !this._previousData) { - this._previousData = this.serialize(); - } - this._hasNote = text !== ''; this._noteText = text; this._noteTitle = Zotero.Notes.noteToTitle(text); + + this._markFieldChange('note', oldText); this._changedNote = true; return true; @@ -2552,6 +2573,23 @@ Zotero.Item.prototype.getNotes = function(includeTrashed) { return []; } + // Get the right cache array + if (!this._cachedNotes) { + this._cachedNotes = { + chronologicalWithTrashed: null, + chronologicalWithoutTrashed: null, + alphabeticalWithTrashed: null, + alphabeticalWithoutTrashed: null + }; + } + var cache = this._cachedNotes; + var cacheKey = (Zotero.Prefs.get('sortNotesChronologically') + ? 'chronological' : 'alphabetical') + + 'With' + (includeTrashed ? '' : 'out') + 'Trashed'; + if (cache[cacheKey] !== null) { + return cache[cacheKey]; + } + var sql = "SELECT N.itemID, title FROM itemNotes N NATURAL JOIN items " + "WHERE sourceItemID=?"; if (!includeTrashed) { @@ -2561,11 +2599,14 @@ Zotero.Item.prototype.getNotes = function(includeTrashed) { if (Zotero.Prefs.get('sortNotesChronologically')) { sql += " ORDER BY dateAdded"; var results = Zotero.DB.columnQuery(sql, this.id); - return results ? results : []; + results = results ? results : []; + cache[cacheKey] = results; + return results; } var notes = Zotero.DB.query(sql, this.id); if (!notes) { + cache[cacheKey] = []; return []; } @@ -2582,6 +2623,7 @@ Zotero.Item.prototype.getNotes = function(includeTrashed) { for each(var note in notes) { noteIDs.push(note.itemID); } + cache[cacheKey] = noteIDs; return noteIDs; } @@ -2596,11 +2638,18 @@ Zotero.Item.prototype.getNotes = function(includeTrashed) { /////////////////////////////////////////////////////// Zotero.Item.prototype.incrementAttachmentCount = function() { this._numAttachments++; + this._cachedAttachments = null; } Zotero.Item.prototype.decrementAttachmentCount = function() { this._numAttachments--; + this._cachedAttachments = null; +} + + +Zotero.Item.prototype.clearCachedAttachments = function () { + this._cachedAttachments = null; } @@ -3383,7 +3432,24 @@ Zotero.Item.prototype.getAttachments = function(includeTrashed) { if (!this.id) { return []; } - + + // Get the right cache array + if (!this._cachedAttachments) { + this._cachedAttachments = { + chronologicalWithTrashed: null, + chronologicalWithoutTrashed: null, + alphabeticalWithTrashed: null, + alphabeticalWithoutTrashed: null + }; + } + var cache = this._cachedAttachments; + var cacheKey = (Zotero.Prefs.get('sortAttachmentsChronologically') + ? 'chronological' : 'alphabetical') + + 'With' + (includeTrashed ? '' : 'out') + 'Trashed'; + if (cache[cacheKey] !== null) { + return cache[cacheKey]; + } + var sql = "SELECT A.itemID, value AS title FROM itemAttachments A " + "NATURAL JOIN items I LEFT JOIN itemData ID " + "ON (fieldID=110 AND A.itemID=ID.itemID) " @@ -3397,11 +3463,14 @@ Zotero.Item.prototype.getAttachments = function(includeTrashed) { if (Zotero.Prefs.get('sortAttachmentsChronologically')) { sql += " ORDER BY dateAdded"; var results = Zotero.DB.columnQuery(sql, this.id); - return results ? results : []; + results = results ? results : []; + cache[cacheKey] = results; + return results; } var attachments = Zotero.DB.query(sql, this.id); if (!attachments) { + cache[cacheKey] = []; return []; } @@ -3416,6 +3485,7 @@ Zotero.Item.prototype.getAttachments = function(includeTrashed) { for each(var attachment in attachments) { attachmentIDs.push(attachment.itemID); } + cache[cacheKey] = attachmentIDs; return attachmentIDs; } @@ -4241,7 +4311,7 @@ Zotero.Item.prototype.erase = function() { var sourceItemID = Zotero.DB.valueQuery(sql); if (sourceItemID) { var sourceItem = Zotero.Items.get(sourceItemID); - changedItemsNotifierData[sourceItem.id] = { old: sourceItem.serialize() }; + //changedItemsNotifierData[sourceItem.id] = {}; if (!this.deleted) { sourceItem.decrementNoteCount(); } @@ -4255,7 +4325,7 @@ Zotero.Item.prototype.erase = function() { var sourceItemID = Zotero.DB.valueQuery(sql); if (sourceItemID) { var sourceItem = Zotero.Items.get(sourceItemID); - changedItemsNotifierData[sourceItem.id] = { old: sourceItem.serialize() }; + //changedItemsNotifierData[sourceItem.id] = {}; if (!this.deleted) { sourceItem.decrementAttachmentCount(); } @@ -4302,7 +4372,7 @@ Zotero.Item.prototype.erase = function() { for each(var id in relateds) { var relatedItem = Zotero.Items.get(id); if (changedItems.indexOf(id) != -1) { - changedItemsNotifierData[id] = { old: relatedItem.serialize() }; + //changedItemsNotifierData[id] = {}; changedItems.push(id); } } @@ -4902,7 +4972,8 @@ Zotero.Item.prototype._setRelatedItems = function (itemIDs) { // Mark as changed if new or removed ids if (newIDs.length > 0 || oldIDs.length != currentIDs.length) { - this._prepFieldChange('relatedItems'); + this._markFieldChange('related', currentIDs); + this._changed.relatedItems = true } else { Zotero.debug('Related items not changed in Zotero.Item._setRelatedItems()', 4); @@ -4918,17 +4989,58 @@ Zotero.Item.prototype._setRelatedItems = function (itemIDs) { } -// TODO: use for stuff other than related items -Zotero.Item.prototype._prepFieldChange = function (field) { - if (!this._changed) { - this._changed = {}; +/** + * The creator has already been changed in itembox.xml before being passed + * to setCreator()/removeCreator(), so we have to reach in and get its + * previousData, and ideally try to detect when this private data structure + * has changed, which it almost certainly will. I am so sorry. + */ +Zotero.Item.prototype._getOldCreators = function () { + var oldCreators = []; + for (var i in this._creators) { + if (this._creators[i].ref._changed) { + if (!this._creators[i].ref._previousData + && !this._creators[i].ref._previousData.fields) { + Components.utils.reportError("Previous creator data not available in expected form"); + oldCreators.push(false); + continue; + } + var c = this._creators[i].ref._previousData.fields; + } + else { + var c = this._creators[i].ref; + } + + var old = { + // Convert creatorTypeIDs to text + creatorType: Zotero.CreatorTypes.getName( + this._creators[i].creatorTypeID + ) + }; + + if (c.fieldMode) { + // In 'fields' there's just 'name' for single-field mode + old.name = typeof c.name == 'undefined' ? c.lastName : c.name; + } + else { + old.firstName = c.firstName; + old.lastName = c.lastName; + } + oldCreators.push(old); } - this._changed[field] = true; - - // Save a copy of the data before changing - if (this.id && this.exists() && !this._previousData) { - this._previousData = this.serialize(); + return oldCreators; +} + + +/** + * Save old version of data that's being changed, to pass to the notifier + */ +Zotero.Item.prototype._markFieldChange = function (field, oldValue) { + // Only save if item already exists and field not already changed + if (!this.id || !this.exists() || this._previousData[field]) { + return; } + this._previousData[field] = oldValue; } diff --git a/chrome/content/zotero/xpcom/http.js b/chrome/content/zotero/xpcom/http.js @@ -746,9 +746,10 @@ Zotero.HTTP = new function() { /** * Handler for XMLHttpRequest state change * - * @param {nsIXMLHttpRequest} XMLHttpRequest whose state just changed - * @param {Function} [onDone] Callback for request completion + * @param {nsIXMLHttpRequest} xmlhttp XMLHttpRequest whose state just changed + * @param {Function} [callback] Callback for request completion * @param {String} [responseCharset] Character set to force on the response + * @param {*} [data] Data to be passed back to callback as the second argument * @private */ function _stateChange(xmlhttp, callback, responseCharset, data) { diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js @@ -231,6 +231,14 @@ Zotero.ItemTreeView.prototype._refreshGenerator = function() this._searchMode = this._itemGroup.isSearchMode(); + if (!this.selection.selectEventsSuppressed) { + var unsuppress = this.selection.selectEventsSuppressed = true; + this._treebox.beginUpdateBatch(); + } + var savedSelection = this.saveSelection(); + var savedOpenState = this.saveOpenState(); + var savedFirstRow = this.saveFirstRow(); + var oldRows = this.rowCount; this._dataItems = []; this._searchItemIDs = {}; // items matching the search @@ -317,6 +325,15 @@ Zotero.ItemTreeView.prototype._refreshGenerator = function() Zotero.UnresponsiveScriptIndicator.enable(); } + this.rememberOpenState(savedOpenState); + this.rememberFirstRow(savedFirstRow); + this.rememberSelection(savedSelection); + this.expandMatchParents(); + if (unsuppress) { + this._treebox.endUpdateBatch(); + this.selection.selectEventsSuppressed = false; + } + yield false; } @@ -425,6 +442,7 @@ Zotero.ItemTreeView.prototype.notify = function(action, type, ids, extraData) } this.selection.selectEventsSuppressed = true; + this._treebox.beginUpdateBatch(); if ((action == 'remove' && !itemGroup.isLibrary(true)) || action == 'delete' || action == 'trash') { @@ -607,9 +625,20 @@ Zotero.ItemTreeView.prototype.notify = function(action, type, ids, extraData) // Otherwise re-run the search, which refreshes the item list else { - // For item adds, clear quicksearch + // For item adds, clear the quicksearch, unless all the new items + // are child items if (activeWindow && type == 'item') { - quicksearch.value = ''; + var clear = false; + var items = Zotero.Items.get(ids); + for each(var item in items) { + if (!item.getSource()) { + clear = true; + break; + } + } + if (clear) { + quicksearch.value = ''; + } } quicksearch.doCommand(); madeChanges = true; @@ -755,6 +784,7 @@ Zotero.ItemTreeView.prototype.notify = function(action, type, ids, extraData) this.rememberSelection(savedSelection); } + this._treebox.endUpdateBatch(); this.selection.selectEventsSuppressed = false; } @@ -1462,6 +1492,11 @@ Zotero.ItemTreeView.prototype.sort = function(itemID) } // Need to close all containers before sorting + if (!this.selection.selectEventsSuppressed) { + var unsuppress = this.selection.selectEventsSuppressed = true; + this._treebox.beginUpdateBatch(); + } + var savedSelection = this.saveSelection(); var openItemIDs = this.saveOpenState(true); // Single-row sort @@ -1505,6 +1540,12 @@ Zotero.ItemTreeView.prototype.sort = function(itemID) this._refreshHashMap(); this.rememberOpenState(openItemIDs); + this.rememberSelection(savedSelection); + + if (unsuppress) { + this.selection.selectEventsSuppressed = false; + this._treebox.endUpdateBatch(); + } } //////////////////////////////////////////////////////////////////////////////// @@ -1720,7 +1761,7 @@ Zotero.ItemTreeView.prototype.deleteSelection = function (force) /* - * Set the tags filter on the view + * Set the search/tags filter on the view */ Zotero.ItemTreeView.prototype.setFilter = function(type, data) { if (!this._treebox || !this._treebox.treeBody) { @@ -1729,9 +1770,7 @@ Zotero.ItemTreeView.prototype.setFilter = function(type, data) { } this.selection.selectEventsSuppressed = true; - var savedSelection = this.saveSelection(); - var savedOpenState = this.saveOpenState(); - var savedFirstRow = this.saveFirstRow(); + this._treebox.beginUpdateBatch(); switch (type) { case 'search': @@ -1748,11 +1787,7 @@ Zotero.ItemTreeView.prototype.setFilter = function(type, data) { this.sort(); - this.rememberOpenState(savedOpenState); - this.expandMatchParents(); - this.rememberFirstRow(savedFirstRow); - this.rememberSelection(savedSelection); - this._treebox.invalidate(); + this._treebox.endUpdateBatch(); this.selection.selectEventsSuppressed = false; //Zotero.debug('Running callbacks in itemTreeView.setFilter()', 4); @@ -1833,6 +1868,10 @@ Zotero.ItemTreeView.prototype.rememberSelection = function(selection) { this.selection.clearSelection(); + if (!this.selection.selectEventsSuppressed) { + var unsuppress = this.selection.selectEventsSuppressed = true; + this._treebox.beginUpdateBatch(); + } for(var i=0; i < selection.length; i++) { if (this._itemRowMap[selection[i]] != null) { @@ -1859,6 +1898,10 @@ Zotero.ItemTreeView.prototype.rememberSelection = function(selection) } } } + if (unsuppress) { + this._treebox.endUpdateBatch(); + this.selection.selectEventsSuppressed = false; + } } @@ -1878,6 +1921,12 @@ Zotero.ItemTreeView.prototype.selectSearchMatches = function () { Zotero.ItemTreeView.prototype.saveOpenState = function(close) { var itemIDs = []; + if (close) { + if (!this.selection.selectEventsSuppressed) { + var unsuppress = this.selection.selectEventsSuppressed = true; + this._treebox.beginUpdateBatch(); + } + } for (var i=0; i<this._dataItems.length; i++) { if (this.isContainer(i) && this.isContainerOpen(i)) { itemIDs.push(this._getItemAtRow(i).ref.id); @@ -1888,6 +1937,10 @@ Zotero.ItemTreeView.prototype.saveOpenState = function(close) { } if (close) { this._refreshHashMap(); + if (unsuppress) { + this._treebox.endUpdateBatch(); + this.selection.selectEventsSuppressed = false; + } } return itemIDs; } @@ -1907,13 +1960,19 @@ Zotero.ItemTreeView.prototype.rememberOpenState = function(itemIDs) { return a - b; }); - this._treebox.beginUpdateBatch(); + if (!this.selection.selectEventsSuppressed) { + var unsuppress = this.selection.selectEventsSuppressed = true; + this._treebox.beginUpdateBatch(); + } // Reopen from bottom up for (var i=rowsToOpen.length-1; i>=0; i--) { this.toggleOpenState(rowsToOpen[i], true); } - this._treebox.endUpdateBatch(); this._refreshHashMap(); + if (unsuppress) { + this._treebox.endUpdateBatch(); + this.selection.selectEventsSuppressed = false; + } } @@ -1928,7 +1987,10 @@ Zotero.ItemTreeView.prototype.expandMatchParents = function () { hash[id] = true; } - this._treebox.beginUpdateBatch(); + if (!this.selection.selectEventsSuppressed) { + var unsuppress = this.selection.selectEventsSuppressed = true; + this._treebox.beginUpdateBatch(); + } for (var i=0; i<this.rowCount; i++) { var id = this._getItemAtRow(i).ref.id; if (hash[id] && this.isContainer(i) && !this.isContainerOpen(i)) { @@ -1936,7 +1998,10 @@ Zotero.ItemTreeView.prototype.expandMatchParents = function () { } } this._refreshHashMap(); - this._treebox.endUpdateBatch(); + if (unsuppress) { + this._treebox.endUpdateBatch(); + this.selection.selectEventsSuppressed = false; + } } @@ -1957,7 +2022,7 @@ Zotero.ItemTreeView.prototype.rememberFirstRow = function(firstRow) { Zotero.ItemTreeView.prototype.expandAllRows = function() { - this.selection.selectEventsSuppressed = true; + var unsuppress = this.selection.selectEventsSuppressed = true; this._treebox.beginUpdateBatch(); for (var i=0; i<this.rowCount; i++) { if (this.isContainer(i) && !this.isContainerOpen(i)) { @@ -1971,6 +2036,7 @@ Zotero.ItemTreeView.prototype.expandAllRows = function() { Zotero.ItemTreeView.prototype.collapseAllRows = function() { + var unsuppress = this.selection.selectEventsSuppressed = true; this._treebox.beginUpdateBatch(); for (var i=0; i<this.rowCount; i++) { if (this.isContainer(i) && this.isContainerOpen(i)) { @@ -1979,11 +2045,13 @@ Zotero.ItemTreeView.prototype.collapseAllRows = function() { } this._refreshHashMap(); this._treebox.endUpdateBatch(); + this.selection.selectEventsSuppressed = false; } Zotero.ItemTreeView.prototype.expandSelectedRows = function() { var start = {}, end = {}; + this.selection.selectEventsSuppressed = true; this._treebox.beginUpdateBatch(); for (var i = 0, len = this.selection.getRangeCount(); i<len; i++) { this.selection.getRangeAt(i, start, end); @@ -1995,11 +2063,13 @@ Zotero.ItemTreeView.prototype.expandSelectedRows = function() { } this._refreshHashMap(); this._treebox.endUpdateBatch(); + this.selection.selectEventsSuppressed = false; } Zotero.ItemTreeView.prototype.collapseSelectedRows = function() { var start = {}, end = {}; + this.selection.selectEventsSuppressed = true; this._treebox.beginUpdateBatch(); for (var i = 0, len = this.selection.getRangeCount(); i<len; i++) { this.selection.getRangeAt(i, start, end); @@ -2011,6 +2081,7 @@ Zotero.ItemTreeView.prototype.collapseSelectedRows = function() { } this._refreshHashMap(); this._treebox.endUpdateBatch(); + this.selection.selectEventsSuppressed = false; } diff --git a/chrome/content/zotero/xpcom/notifier.js b/chrome/content/zotero/xpcom/notifier.js @@ -136,7 +136,9 @@ Zotero.Notifier = new function(){ // Merge extraData keys if (extraData) { for (var dataID in extraData) { - _queue[type][event].data[dataID] = extraData[dataID]; + if (extraData[dataID]) { + _queue[type][event].data[dataID] = extraData[dataID]; + } } } @@ -271,7 +273,9 @@ Zotero.Notifier = new function(){ if (runQueue[type][event].ids.indexOf(id) == -1) { runQueue[type][event].ids.push(id); - runQueue[type][event].data[id] = data; + if (data) { + runQueue[type][event].data[id] = data; + } } } diff --git a/chrome/content/zotero/xpcom/utilities_translate.js b/chrome/content/zotero/xpcom/utilities_translate.js @@ -208,6 +208,7 @@ Zotero.Utilities.Translate.prototype.processDocuments = function(urls, processor var translate = this._translate; if(exception) { var myException = function(e) { + var browserDeleted; try { exception(e); } catch(e) { @@ -216,8 +217,15 @@ Zotero.Utilities.Translate.prototype.processDocuments = function(urls, processor Zotero.Browser.deleteHiddenBrowser(hiddenBrowser); } catch(e) {} } + browserDeleted = true; translate.complete(false, e); } + + if(!browserDeleted) { + try { + Zotero.Browser.deleteHiddenBrowser(hiddenBrowser); + } catch(e) {} + } } } else { var myException = function(e) { @@ -313,7 +321,7 @@ Zotero.Utilities.Translate.prototype.doGet = function(urls, processor, done, res } if(callAgain) { - me.doGet(urls, processor, done); + me.doGet(urls, processor, done, responseCharset); } else { if(done) { done(); diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js @@ -3300,6 +3300,7 @@ var ZoteroPane = new function() for each(var item in items) { if (item.isRegularItem()) { + // Prefer local file attachments var uri = Components.classes["@mozilla.org/network/standard-url;1"] .createInstance(Components.interfaces.nsIURI); var snapID = item.getBestAttachment(); @@ -3308,6 +3309,7 @@ var ZoteroPane = new function() continue; } + // Fall back to URI field, then DOI var uri = item.getField('url'); if (!uri) { var doi = item.getField('DOI'); @@ -3319,6 +3321,16 @@ var ZoteroPane = new function() } } } + + // Fall back to first attachment link + if (!uri) { + var link = item.getAttachments()[0]; + if (link) { + link = Zotero.Items.get(link); + if (link) uri = link.getField('url'); + } + } + if (uri) { ZoteroPane_Local.loadURI(uri, event); } diff --git a/chrome/locale/af-ZA/zotero/zotero.dtd b/chrome/locale/af-ZA/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Dokumentvoorkeure"> <!ENTITY zotero.integration.addEditCitation.title "Voeg by/redigeer aanhaling"> <!ENTITY zotero.integration.editBibliography.title "Redigeer bronnelys"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Vordering"> diff --git a/chrome/locale/ar/zotero/zotero.dtd b/chrome/locale/ar/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "تفضيلات المستند"> <!ENTITY zotero.integration.addEditCitation.title "اضافة/تحرير استشهاد مرجعي"> <!ENTITY zotero.integration.editBibliography.title "تحرير ببليوجرافية"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "التقدم"> diff --git a/chrome/locale/bg-BG/zotero/zotero.dtd b/chrome/locale/bg-BG/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Настройки на докумета"> <!ENTITY zotero.integration.addEditCitation.title "Добавя/редактира на цитат"> <!ENTITY zotero.integration.editBibliography.title "Редактира на библиографията"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Напредък"> diff --git a/chrome/locale/ca-AD/zotero/zotero.dtd b/chrome/locale/ca-AD/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Preferències del document"> <!ENTITY zotero.integration.addEditCitation.title "Afegeix/Edita cita"> <!ENTITY zotero.integration.editBibliography.title "Edita bibliografia"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Progrés"> diff --git a/chrome/locale/cs-CZ/zotero/zotero.dtd b/chrome/locale/cs-CZ/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Vlastnosti dokumentu"> <!ENTITY zotero.integration.addEditCitation.title "Přidat/Upravit citaci"> <!ENTITY zotero.integration.editBibliography.title "Upravit bibliografii"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Postup"> diff --git a/chrome/locale/da-DK/zotero/zotero.dtd b/chrome/locale/da-DK/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Dokumentindstillinger"> <!ENTITY zotero.integration.addEditCitation.title "Tilføj/rediger reference"> <!ENTITY zotero.integration.editBibliography.title "Rediger referenceliste"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Fremgang"> diff --git a/chrome/locale/de/zotero/zotero.dtd b/chrome/locale/de/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Dokument-Eigenschaften"> <!ENTITY zotero.integration.addEditCitation.title "Zitation hinzufügen/ändern"> <!ENTITY zotero.integration.editBibliography.title "Literaturverzeichnis editieren"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Fortschritt"> diff --git a/chrome/locale/el-GR/zotero/zotero.dtd b/chrome/locale/el-GR/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Document Preferences"> <!ENTITY zotero.integration.addEditCitation.title "Add/Edit Citation"> <!ENTITY zotero.integration.editBibliography.title "Edit Bibliography"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Progress"> diff --git a/chrome/locale/en-US/zotero/zotero.dtd b/chrome/locale/en-US/zotero/zotero.dtd @@ -159,6 +159,7 @@ <!ENTITY zotero.integration.docPrefs.title "Document Preferences"> <!ENTITY zotero.integration.addEditCitation.title "Add/Edit Citation"> <!ENTITY zotero.integration.editBibliography.title "Edit Bibliography"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Progress"> diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties @@ -449,6 +449,7 @@ db.integrityCheck.reportInForums = You can report this problem in the Zotero For zotero.preferences.update.updated = Updated zotero.preferences.update.upToDate = Up to date zotero.preferences.update.error = Error +zotero.preferences.launchNonNativeFiles = Open PDFs and other files within %S when possible zotero.preferences.openurl.resolversFound.zero = %S resolvers found zotero.preferences.openurl.resolversFound.singular = %S resolver found zotero.preferences.openurl.resolversFound.plural = %S resolvers found diff --git a/chrome/locale/es-ES/zotero/zotero.dtd b/chrome/locale/es-ES/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Ajustes de documento"> <!ENTITY zotero.integration.addEditCitation.title "Añadir o modificar cita"> <!ENTITY zotero.integration.editBibliography.title "Modificar bibliografía"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Progreso"> diff --git a/chrome/locale/et-EE/zotero/zotero.dtd b/chrome/locale/et-EE/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Dokumendi sätted"> <!ENTITY zotero.integration.addEditCitation.title "Lisa/toimeta viidet"> <!ENTITY zotero.integration.editBibliography.title "Toimeta bibliograafiat"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Progress"> diff --git a/chrome/locale/eu-ES/zotero/zotero.dtd b/chrome/locale/eu-ES/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Dokumentu honetako ezaugarriak"> <!ENTITY zotero.integration.addEditCitation.title "Erreferentzia gehitu/editatu"> <!ENTITY zotero.integration.editBibliography.title "Bibliografia editatu"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Aurrerapena"> diff --git a/chrome/locale/fa/zotero/zotero.dtd b/chrome/locale/fa/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "تنظیمات سند"> <!ENTITY zotero.integration.addEditCitation.title "افزودن/ویرایش یادکرد"> <!ENTITY zotero.integration.editBibliography.title "ویرایش کتابنامه"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "پیشرفت"> diff --git a/chrome/locale/fi-FI/zotero/zotero.dtd b/chrome/locale/fi-FI/zotero/zotero.dtd @@ -144,6 +144,7 @@ <!ENTITY zotero.integration.docPrefs.title "Asiakirjan asetukset"> <!ENTITY zotero.integration.addEditCitation.title "Lisää/muokkaa sitaatti"> <!ENTITY zotero.integration.editBibliography.title "Muokkaa lähdeluetteloa"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Eteneminen"> diff --git a/chrome/locale/fr-FR/zotero/zotero.dtd b/chrome/locale/fr-FR/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Préférences du document"> <!ENTITY zotero.integration.addEditCitation.title "Ajouter/Modifier la citation"> <!ENTITY zotero.integration.editBibliography.title "Modifier la bibliographie"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Progression"> diff --git a/chrome/locale/gl-ES/zotero/zotero.dtd b/chrome/locale/gl-ES/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Preferencias do Documento"> <!ENTITY zotero.integration.addEditCitation.title "Engadir/Editar Cita"> <!ENTITY zotero.integration.editBibliography.title "Editar Bibliografía"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Progreso"> diff --git a/chrome/locale/he-IL/zotero/zotero.dtd b/chrome/locale/he-IL/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Document Preferences"> <!ENTITY zotero.integration.addEditCitation.title "Add/Edit Citation"> <!ENTITY zotero.integration.editBibliography.title "ערוך ביבליוגרפיה"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Progress"> diff --git a/chrome/locale/hr-HR/zotero/zotero.dtd b/chrome/locale/hr-HR/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Document Preferences"> <!ENTITY zotero.integration.addEditCitation.title "Add/Edit Citation"> <!ENTITY zotero.integration.editBibliography.title "Edit Bibliography"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Progress"> diff --git a/chrome/locale/hu-HU/zotero/zotero.dtd b/chrome/locale/hu-HU/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Dokumentum beállításai"> <!ENTITY zotero.integration.addEditCitation.title "Hivatkozás hozzáadása/szerkesztése"> <!ENTITY zotero.integration.editBibliography.title "Bibliográfia szerkesztése"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Folyamatban"> diff --git a/chrome/locale/is-IS/zotero/zotero.dtd b/chrome/locale/is-IS/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Document Preferences"> <!ENTITY zotero.integration.addEditCitation.title "Add/Edit Citation"> <!ENTITY zotero.integration.editBibliography.title "Edit Bibliography"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Progress"> diff --git a/chrome/locale/it-IT/zotero/zotero.dtd b/chrome/locale/it-IT/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Impostazioni documento"> <!ENTITY zotero.integration.addEditCitation.title "Aggiungi o modifica citazione"> <!ENTITY zotero.integration.editBibliography.title "Modifica bibliografia"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Avanzamento"> diff --git a/chrome/locale/ja-JP/zotero/zotero.dtd b/chrome/locale/ja-JP/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "ドキュメントの設定"> <!ENTITY zotero.integration.addEditCitation.title "出典表記を追加・編集"> <!ENTITY zotero.integration.editBibliography.title "参考文献目録を編集"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "進行"> diff --git a/chrome/locale/km/zotero/zotero.dtd b/chrome/locale/km/zotero/zotero.dtd @@ -144,6 +144,7 @@ <!ENTITY zotero.integration.docPrefs.title "ជម្រើសរចនាបថសម្រាប់យោងឯកសារ"> <!ENTITY zotero.integration.addEditCitation.title "បន្ថែម ឬ កែតម្រូវអាគតដ្ឋាន"> <!ENTITY zotero.integration.editBibliography.title "កែតម្រូវគន្ថនិទេ្ទស"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "កំពុងដំណើរ"> diff --git a/chrome/locale/ko-KR/zotero/zotero.dtd b/chrome/locale/ko-KR/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "문서 환경설정"> <!ENTITY zotero.integration.addEditCitation.title "인용 추가/편집"> <!ENTITY zotero.integration.editBibliography.title "참고문헌 목록 편집"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "진행"> diff --git a/chrome/locale/mn-MN/zotero/zotero.dtd b/chrome/locale/mn-MN/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Document Preferences"> <!ENTITY zotero.integration.addEditCitation.title "Add/Edit Citation"> <!ENTITY zotero.integration.editBibliography.title "Edit Bibliography"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Progress"> diff --git a/chrome/locale/nb-NO/zotero/zotero.dtd b/chrome/locale/nb-NO/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Dokumentegenskaper"> <!ENTITY zotero.integration.addEditCitation.title "Legg til/endre henvisning"> <!ENTITY zotero.integration.editBibliography.title "Rediger bibliografi"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Framgang"> diff --git a/chrome/locale/nl-NL/zotero/zotero.dtd b/chrome/locale/nl-NL/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Documentvoorkeuren"> <!ENTITY zotero.integration.addEditCitation.title "Verwijzing toevoegen/aanpassen"> <!ENTITY zotero.integration.editBibliography.title "Bibliografie aanpassen"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Voortgang"> diff --git a/chrome/locale/nn-NO/zotero/zotero.dtd b/chrome/locale/nn-NO/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Dokumenteigenskapar"> <!ENTITY zotero.integration.addEditCitation.title "Legg til/endra henvisning"> <!ENTITY zotero.integration.editBibliography.title "Rediger bibliografi"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Framgang"> diff --git a/chrome/locale/pl-PL/zotero/zotero.dtd b/chrome/locale/pl-PL/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Ustawienia dokumentu"> <!ENTITY zotero.integration.addEditCitation.title "Dodaj/Edytuj odnośnik bibliograficzny"> <!ENTITY zotero.integration.editBibliography.title "Edytuj bibliografię"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Postęp"> diff --git a/chrome/locale/pt-BR/zotero/zotero.dtd b/chrome/locale/pt-BR/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Preferências do documento"> <!ENTITY zotero.integration.addEditCitation.title "Adicionar/Modificar citação"> <!ENTITY zotero.integration.editBibliography.title "Editar bibliografia"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Progresso"> diff --git a/chrome/locale/pt-PT/zotero/zotero.dtd b/chrome/locale/pt-PT/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Preferências do Documento"> <!ENTITY zotero.integration.addEditCitation.title "Adicionar/Editar Citação"> <!ENTITY zotero.integration.editBibliography.title "Editar Bibliografia"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Progresso"> diff --git a/chrome/locale/ro-RO/zotero/zotero.dtd b/chrome/locale/ro-RO/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Preferințe document"> <!ENTITY zotero.integration.addEditCitation.title "Adaugă/Editează citarea"> <!ENTITY zotero.integration.editBibliography.title "Editează bibliografia"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Progres"> diff --git a/chrome/locale/ru-RU/zotero/zotero.dtd b/chrome/locale/ru-RU/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Параметры документа"> <!ENTITY zotero.integration.addEditCitation.title "Добавить/редактировать цитату"> <!ENTITY zotero.integration.editBibliography.title "Редактировать библиографию"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Ход выполнения"> diff --git a/chrome/locale/sk-SK/zotero/zotero.dtd b/chrome/locale/sk-SK/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Vlastnosti dokumentu"> <!ENTITY zotero.integration.addEditCitation.title "Pridať/Upraviť citáciu"> <!ENTITY zotero.integration.editBibliography.title "Upraviť bibliografiu"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Postup"> diff --git a/chrome/locale/sl-SI/zotero/zotero.dtd b/chrome/locale/sl-SI/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Lastnosti dokumenta"> <!ENTITY zotero.integration.addEditCitation.title "Dodaj/uredi navedek"> <!ENTITY zotero.integration.editBibliography.title "Uredi bibliografijo"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Napredek"> diff --git a/chrome/locale/sr-RS/zotero/zotero.dtd b/chrome/locale/sr-RS/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Поставке документа"> <!ENTITY zotero.integration.addEditCitation.title "Додај/уреди цитације"> <!ENTITY zotero.integration.editBibliography.title "Уреди библиографију"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Напредак"> diff --git a/chrome/locale/sv-SE/zotero/zotero.dtd b/chrome/locale/sv-SE/zotero/zotero.dtd @@ -144,6 +144,7 @@ <!ENTITY zotero.integration.docPrefs.title "Dokumentinställningar"> <!ENTITY zotero.integration.addEditCitation.title "Lägg till/redigera källhänvisning"> <!ENTITY zotero.integration.editBibliography.title "Redigera källförteckning"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Förlopp"> diff --git a/chrome/locale/th-TH/zotero/zotero.dtd b/chrome/locale/th-TH/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "ค่าตั้งพึงใจเกี่ยวกับแฟ้มเอกสาร"> <!ENTITY zotero.integration.addEditCitation.title "เพิ่ม/แก้ไขการอ้างอิง"> <!ENTITY zotero.integration.editBibliography.title "แก้ไขบรรณานุกรม"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "ความคืบหน้า"> diff --git a/chrome/locale/tr-TR/zotero/zotero.dtd b/chrome/locale/tr-TR/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Döküman Tercihleri"> <!ENTITY zotero.integration.addEditCitation.title "Gönderme Ekle/Düzenle"> <!ENTITY zotero.integration.editBibliography.title "Kaynakça Düzenle"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "İşlem"> diff --git a/chrome/locale/vi-VN/zotero/zotero.dtd b/chrome/locale/vi-VN/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "Các tùy chọn về Tài liệu"> <!ENTITY zotero.integration.addEditCitation.title "Thêm/Soạn thảo Trích dẫn"> <!ENTITY zotero.integration.editBibliography.title "Soạn thảo Thư tịch"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "Tiến triển"> diff --git a/chrome/locale/zh-CN/zotero/zotero.dtd b/chrome/locale/zh-CN/zotero/zotero.dtd @@ -143,6 +143,7 @@ <!ENTITY zotero.integration.docPrefs.title "文档选项"> <!ENTITY zotero.integration.addEditCitation.title "添加/编辑引文"> <!ENTITY zotero.integration.editBibliography.title "编辑文献目录"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "进度"> diff --git a/chrome/locale/zh-TW/zotero/zotero.dtd b/chrome/locale/zh-TW/zotero/zotero.dtd @@ -144,6 +144,7 @@ <!ENTITY zotero.integration.docPrefs.title "文件的偏好設定"> <!ENTITY zotero.integration.addEditCitation.title "新增/編輯引用文獻"> <!ENTITY zotero.integration.editBibliography.title "編輯參考書目"> +<!ENTITY zotero.integration.quickFormatDialog.title "Quick Format Citation"> <!ENTITY zotero.progress.title "進度"> diff --git a/components/zotero-autocomplete.js b/components/zotero-autocomplete.js @@ -88,6 +88,9 @@ ZoteroAutoComplete.prototype.startSearch = function(searchString, searchParam, p statement = this._zotero.DB.getStatement(sql, sqlParams); var resultsCallback = function (results) { + if (!results) { + return; + } var collation = self._zotero.getLocaleCollation(); results.sort(function(a, b) { return collation.compareString(1, a.val, b.val);