diff --git a/chrome.manifest b/chrome.manifest index d6ad9a764..f8b8f8493 100644 --- a/chrome.manifest +++ b/chrome.manifest @@ -47,7 +47,6 @@ 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/statusBarOverlay.xul appversion<4.0 overlay chrome://browser/content/browser.xul chrome://zotero/content/overlay.xul overlay chrome://zotero/content/preferences/preferences.xul chrome://zotero/content/preferences/preferences_firefox.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} @@ -55,6 +54,7 @@ overlay chrome://zotero/content/preferences/preferences.xul#cite chrome://zotero overlay chrome://zotero/content/preferences/preferences_general.xul chrome://zotero/content/preferences/preferences_general_firefox.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} overlay chrome://zotero/content/preferences/preferences_export.xul chrome://zotero/content/preferences/preferences_export_firefox.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} overlay chrome://zotero/content/preferences/preferences_advanced.xul chrome://zotero/content/preferences/preferences_advanced_firefox.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} +overlay chrome://zotero/content/preferences/preferences_advanced.xul chrome://zotero/content/preferences/preferences_advanced_standalone.xul application=zotero@chnm.gmu.edu overlay chrome://mozapps/content/downloads/unknownContentType.xul chrome://zotero/content/downloadOverlay.xul diff --git a/chrome/content/zotero/bibliography.js b/chrome/content/zotero/bibliography.js index f68dfe2d8..c61be77be 100644 --- a/chrome/content/zotero/bibliography.js +++ b/chrome/content/zotero/bibliography.js @@ -88,10 +88,10 @@ var Zotero_File_Interface_Bibliography = new function() { } // Has to be async to work properly - setTimeout(function () { + window.setTimeout(function () { listbox.ensureIndexIsVisible(selectIndex); listbox.selectedIndex = selectIndex; - }); + }, 0); // ONLY FOR bibliography.xul: export options if(document.getElementById("save-as-rtf")) { @@ -119,8 +119,7 @@ var Zotero_File_Interface_Bibliography = new function() { // bookmarks text if(document.getElementById("displayAs")) { if(_io.useEndnotes && _io.useEndnotes == 1) document.getElementById("displayAs").selectedIndex = 1; - styleChanged(selectIndex); - } + } if(document.getElementById("formatUsing")) { if(_io.fieldType == "Bookmark") document.getElementById("formatUsing").selectedIndex = 1; var formatOption = (_io.primaryFieldType == "ReferenceMark" ? "referenceMarks" : "fields"); diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index f463ccf6e..bea4490bd 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -552,7 +552,7 @@ this._displayAllCreators = true; if (this._addCreatorRow) { - this.addCreatorRow(false, false, true); + this.addCreatorRow(false, this.item.getCreator(max-1).creatorTypeID, true); this._addCreatorRow = false; this.disableCreatorAddButtons(); } @@ -1416,11 +1416,17 @@ || fieldName == 'creator') { t.setAttribute('type', 'autocomplete'); t.setAttribute('autocompletesearch', 'zotero'); - var suffix = itemID ? itemID : ''; - if (field=='creator') { - suffix = elem.getAttribute('fieldMode') + '-' + suffix; - } - t.setAttribute('autocompletesearchparam', fieldName + '/' + suffix); + let params = { + fieldName: fieldName, + libraryID: this.item.libraryID + }; + if (field == 'creator') { + params.fieldMode = parseInt(elem.getAttribute('fieldMode')); + params.itemID = itemID ? itemID : ''; + }; + t.setAttribute( + 'autocompletesearchparam', JSON.stringify(params) + ); t.setAttribute('ontextentered', 'document.getBindingParent(this).handleCreatorAutoCompleteSelect(this)'); } @@ -1555,8 +1561,8 @@ this._focusNextField(this._dynamicFields, this._lastTabIndex, false); } else { - // TODO: should use current creator type - this.addCreatorRow(false, false, true); + var creatorFields = this.getCreatorFields(Zotero.getAncestorByTagName(target, 'row')); + this.addCreatorRow(false, creatorFields.creatorTypeID, true); } } // Value has changed diff --git a/chrome/content/zotero/bindings/tagsbox.xml b/chrome/content/zotero/bindings/tagsbox.xml index 9ef7ab6ab..bd4bf15c6 100644 --- a/chrome/content/zotero/bindings/tagsbox.xml +++ b/chrome/content/zotero/bindings/tagsbox.xml @@ -437,8 +437,14 @@ else { t.setAttribute('type', 'autocomplete'); t.setAttribute('autocompletesearch', 'zotero'); - var suffix = itemID ? itemID : ''; - t.setAttribute('autocompletesearchparam', fieldName + '/' + suffix); + let params = { + fieldName: fieldName, + libraryID: this.item.libraryID + }; + params.itemID = itemID ? itemID : ''; + t.setAttribute( + 'autocompletesearchparam', JSON.stringify(params) + ); } var box = elem.parentNode; diff --git a/chrome/content/zotero/bindings/zoterosearch.xml b/chrome/content/zotero/bindings/zoterosearch.xml index f08d5effe..477b29d0b 100644 --- a/chrome/content/zotero/bindings/zoterosearch.xml +++ b/chrome/content/zotero/bindings/zoterosearch.xml @@ -813,22 +813,20 @@ textbox.setAttribute('autocompletesearch', 'zotero'); textbox.setAttribute('timeout', '250'); - if (condition=='creator') - { - // 2 searches both single- and double-field creators - var autocompleteCondition = condition + '/2' + var autocompleteParams = { + fieldName: condition + }; + if (condition == 'creator') { + autocompleteParams.fieldMode = 2; } - else - { - var autocompleteCondition = condition; - } - - textbox.setAttribute('autocompletesearchparam', autocompleteCondition); + textbox.setAttribute( + 'autocompletesearchparam', + JSON.stringify(autocompleteParams) + ); } } - if (!autocompleteCondition) - { + if (!autocompleteParams) { var textbox = document.getAnonymousNodes(this)[0]; textbox.removeAttribute('type'); } diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js index baf7d7c5f..08d853060 100644 --- a/chrome/content/zotero/browser.js +++ b/chrome/content/zotero/browser.js @@ -804,16 +804,23 @@ Zotero_Browser.Tab.prototype._selectItems = function(obj, itemList, callback) { */ Zotero_Browser.Tab.prototype._translatorsAvailable = function(translate, translators) { if(translators && translators.length) { - // 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.page.document.defaultView && !this.page.document.defaultView.closed - && this.page.document.location.href != translate.document.location.href) { - // if it is still there, switch translation to take place on - if(!translators.length || this.page.translators[0].priority <= translators[0].priority) return; - } else { - this.clear(); - } + //see if we should keep the previous set of translators + if(//we already have a translator for part of this page + this.page.translators && this.page.translators.length && this.page.document.location + //and the page is still there + && this.page.document.defaultView && !this.page.document.defaultView.closed + //this set of translators is not targeting the same URL as a previous set of translators, + // because otherwise we want to use the newer set + && this.page.document.location.href != translate.document.location.href + //the previous set of translators targets the top frame or the current one does not either + && (this.page.document.defaultView == this.page.document.defaultView.top + || translate.document.defaultView !== this.page.document.defaultView.top) + //the best translator we had was of higher priority than the new set + && this.page.translators[0].priority <= translators[0].priority + ) { + return; //keep what we had + } else { + this.clear(); //clear URL bar icon } this.page.translate = translate; diff --git a/chrome/content/zotero/locale/csl b/chrome/content/zotero/locale/csl index 5b7a687df..007de1a82 160000 --- a/chrome/content/zotero/locale/csl +++ b/chrome/content/zotero/locale/csl @@ -1 +1 @@ -Subproject commit 5b7a687df6464af87eaacc4088bd136ec1039d1b +Subproject commit 007de1a82c0359e897610d67edd11e0086f48689 diff --git a/chrome/content/zotero/preferences/preferences_advanced.js b/chrome/content/zotero/preferences/preferences_advanced.js index c185a358e..3fb5489de 100644 --- a/chrome/content/zotero/preferences/preferences_advanced.js +++ b/chrome/content/zotero/preferences/preferences_advanced.js @@ -364,22 +364,30 @@ Zotero_Preferences.Attachment_Base_Directory = { .createInstance(Components.interfaces.nsILocalFile); for (let i=0; i + + + + + + +