Tweak wording of delayed-citations mode

"Delay citation updates until manual refresh" would be fine in the doc
prefs, but "until manual refresh" is a bit too awkward for the prompt.
Instead, go with @rmzelle's suggestion from #1242 of referring to
"automatic citation updates", and invert the checkbox.
This commit is contained in:
Dan Stillman 2018-01-16 12:36:27 -05:00
parent cc9efde843
commit e4cc28ac60
5 changed files with 42 additions and 39 deletions

View file

@ -146,8 +146,7 @@ var Zotero_File_Interface_Bibliography = new function() {
if(_io.useEndnotes && _io.useEndnotes == 1) document.getElementById("displayAs").selectedIndex = 1;
let dialog = document.getElementById("zotero-doc-prefs-dialog");
dialog.setAttribute('title', `${Zotero.clientName} - ${dialog.getAttribute('title')}`);
}
if(document.getElementById("formatUsing")) {
if(_io.fieldType == "Bookmark") document.getElementById("formatUsing").selectedIndex = 1;
var formatOption = (_io.primaryFieldType == "ReferenceMark" ? "referenceMarks" : "fields");
document.getElementById("fields").label =
@ -158,19 +157,16 @@ var Zotero_File_Interface_Bibliography = new function() {
Zotero.getString("integration."+formatOption+".fileFormatNotice");
document.getElementById("bookmarks-file-format-notice").textContent =
Zotero.getString("integration.fields.fileFormatNotice");
}
if(document.getElementById("automaticJournalAbbreviations-checkbox")) {
if(_io.automaticJournalAbbreviations === undefined) {
_io.automaticJournalAbbreviations = Zotero.Prefs.get("cite.automaticJournalAbbreviations");
}
if(_io.automaticJournalAbbreviations) {
document.getElementById("automaticJournalAbbreviations-checkbox").checked = true;
}
}
if (document.getElementById("delayCitationUpdates-checkbox")) {
if (_io.delayCitationUpdates) {
document.getElementById("delayCitationUpdates-checkbox").checked = true;
}
document.getElementById("automaticCitationUpdates-checkbox").checked = !_io.delayCitationUpdates;
}
// set style to false, in case this is cancelled
@ -205,31 +201,29 @@ var Zotero_File_Interface_Bibliography = new function() {
//
// For integrationDocPrefs.xul
//
// update status of displayAs box based on style class
if(document.getElementById("displayAs-groupbox")) {
if (isDocPrefs) {
// update status of displayAs box based on style class
var isNote = selectedStyleObj.class == "note";
document.getElementById("displayAs-groupbox").hidden = !isNote;
// update status of formatUsing box based on style class
if(document.getElementById("formatUsing")) {
if(isNote) document.getElementById("formatUsing").selectedIndex = 0;
document.getElementById("bookmarks").disabled = isNote;
document.getElementById("bookmarks-caption").disabled = isNote;
}
}
// update status of displayAs box based on style class
if(document.getElementById("automaticJournalAbbreviations-vbox")) {
if(isNote) document.getElementById("formatUsing").selectedIndex = 0;
document.getElementById("bookmarks").disabled = isNote;
document.getElementById("bookmarks-caption").disabled = isNote;
// update status of displayAs box based on style class
document.getElementById("automaticJournalAbbreviations-vbox").hidden =
!selectedStyleObj.usesAbbreviation;
}
// Hide the delayCitationUpdates checkbox before the prompt is shown
document.getElementById("delayCitationUpdates-vbox").hidden = _io.dontAskDelayCitationUpdates == undefined;
// Highlight delay citations checkbox after displaying the alert
// NOTE: Currently unused
if (_io.highlightDelayCitations) {
document.getElementById("delayCitationUpdates-vbox").style.border = "1px dashed #e52e2e"
// Hide the automaticCitationUpdates checkbox before the prompt is shown
document.getElementById("automaticCitationUpdates-vbox").hidden
= _io.dontAskDelayCitationUpdates == undefined;
// Highlight delay citations checkbox after displaying the alert
// NOTE: Currently unused
if (_io.highlightDelayCitations) {
document.getElementById("automaticCitationUpdates-vbox").style.border = "1px dashed #e52e2e"
}
}
//
@ -286,7 +280,7 @@ var Zotero_File_Interface_Bibliography = new function() {
}
_io.useEndnotes = document.getElementById("displayAs").selectedIndex;
_io.fieldType = (document.getElementById("formatUsing").selectedIndex == 0 ? _io.primaryFieldType : _io.secondaryFieldType);
_io.delayCitationUpdates = document.getElementById("delayCitationUpdates-checkbox").checked;
_io.delayCitationUpdates = !document.getElementById("automaticCitationUpdates-checkbox").checked;
}
// remember style and locale if user selected these explicitly

View file

@ -86,9 +86,9 @@
<description class="radioDescription">&zotero.integration.prefs.automaticJournalAbbeviations.caption;</description>
</vbox>
<vbox id="delayCitationUpdates-vbox">
<checkbox id="delayCitationUpdates-checkbox" label="&zotero.integration.prefs.delayCitationUpdates.label;" tooltiptext="&zotero.integration.prefs.delayCitationUpdates.tooltip;"/>
<description class="radioDescription">&zotero.integration.prefs.delayCitationUpdates.description;</description>
<vbox id="automaticCitationUpdates-vbox">
<checkbox id="automaticCitationUpdates-checkbox" label="&zotero.integration.prefs.automaticCitationUpdates.label;" tooltiptext="&zotero.integration.prefs.automaticCitationUpdates.tooltip;"/>
<description class="radioDescription">&zotero.integration.prefs.automaticCitationUpdates.description;</description>
</vbox>
</vbox>
</dialog>

View file

@ -939,8 +939,15 @@ Zotero.Integration.Fields.prototype.updateDocument = Zotero.Promise.coroutine(fu
// If the update takes longer than 5s suggest delaying citation updates
if (diff > DELAY_CITATIONS_PROMPT_TIMEOUT && !this._session.data.prefs.dontAskDelayCitationUpdates && !this._session.data.prefs.delayCitationUpdates) {
this._doc.activate();
var result = this._session.displayAlert(Zotero.getString('integration.delayCitationUpdates.alert'),
DIALOG_ICON_WARNING, DIALOG_BUTTONS_YES_NO_CANCEL);
var result = this._session.displayAlert(
Zotero.getString('integration.delayCitationUpdates.alert.text1')
+ "\n\n"
+ Zotero.getString('integration.delayCitationUpdates.alert.text2')
+ "\n\n"
+ Zotero.getString('integration.delayCitationUpdates.alert.text3'),
DIALOG_ICON_WARNING,
DIALOG_BUTTONS_YES_NO_CANCEL
);
if (result == 2) {
this._session.data.prefs.delayCitationUpdates = true;
}

View file

@ -231,9 +231,9 @@
<!ENTITY zotero.integration.prefs.bookmarks.label "Bookmarks">
<!ENTITY zotero.integration.prefs.bookmarks.caption "Bookmarks can be shared between Word and LibreOffice, but may cause errors if accidentally modified and cannot be inserted into footnotes.">
<!ENTITY zotero.integration.prefs.delayCitationUpdates.label "Delay citation updates until manual refresh">
<!ENTITY zotero.integration.prefs.delayCitationUpdates.tooltip "Citations with pending updates are visually highlighted">
<!ENTITY zotero.integration.prefs.delayCitationUpdates.description "Delaying updates can speed up citation insertion in large documents.">
<!ENTITY zotero.integration.prefs.automaticCitationUpdates.label "Automatically update citations">
<!ENTITY zotero.integration.prefs.automaticCitationUpdates.tooltip "Citations with pending updates will be highlighted in the document">
<!ENTITY zotero.integration.prefs.automaticCitationUpdates.description "Disabling updates can speed up citation insertion in large documents. Click Refresh to update citations manually.">
<!ENTITY zotero.integration.prefs.automaticJournalAbbeviations.label "Use MEDLINE journal abbreviations">

View file

@ -870,8 +870,10 @@ integration.corruptBibliography.description = All items cited in the text will a
integration.citationChanged = You have modified this citation since Zotero generated it. Do you want to keep your modifications and prevent future updates?
integration.citationChanged.description = Clicking "Yes" will prevent Zotero from updating this citation if you add additional citations, switch styles, or modify the item to which it refers. Clicking "No" will erase your changes.
integration.citationChanged.edit = You have modified this citation since Zotero generated it. Editing will clear your modifications. Do you want to continue?
integration.delayCitationUpdates.alert = Updating citations in this document is taking a long time. Would you like to delay citation updates until manual refresh?\n\nYou can change this setting later in the document preferences.
integration.delayCitationUpdates.bibliography = Delayed citing mode is enabled. To see the bibliography click Refresh in Zotero plugin.
integration.delayCitationUpdates.alert.text1 = Updating citations in this document is taking a long time. Would you like to disable automatic citation updates?
integration.delayCitationUpdates.alert.text2 = You will need to click Refresh in the Zotero plugin when you are done inserting citations.
integration.delayCitationUpdates.alert.text3 = You can change this setting later in the document preferences.
integration.delayCitationUpdates.bibliography = Automatic citation updates are disabled. To see the bibliography, click Refresh in the Zotero plugin.
styles.install.title = Install Style
styles.install.unexpectedError = An unexpected error occurred while installing "%1$S"