diff --git a/chrome/content/zotero/preferences/preferences_file_renaming.js b/chrome/content/zotero/preferences/preferences_file_renaming.js
index 0fd01ab7c5..5a303d3687 100644
--- a/chrome/content/zotero/preferences/preferences_file_renaming.js
+++ b/chrome/content/zotero/preferences/preferences_file_renaming.js
@@ -22,42 +22,41 @@
***** END LICENSE BLOCK *****
*/
-/* eslint-disable camelcase */
/* global Zotero_Preferences: false */
Zotero_Preferences.FileRenaming = {
mockItem: null,
init: function () {
- this.inputRef = document.getElementById('file-renaming-template');
+ this.inputRef = document.getElementById('file-renaming-format-template');
this.updatePreview();
- this.inputRef.addEventListener('keyup', this.updatePreview.bind(this));
+ this.inputRef.addEventListener('input', this.updatePreview.bind(this));
Zotero.getActiveZoteroPane()?.itemsView.onSelect.addListener(this.updatePreview.bind(this));
},
updatePreview() {
const item = Zotero.getActiveZoteroPane()?.getSelectedItems()?.[0] ?? this.mockItem ?? this.makeMockItem();
- const tpl = document.getElementById('file-renaming-template').value;
+ const tpl = document.getElementById('file-renaming-format-template').value;
const preview = Zotero.Attachments.getFileBaseNameFromItem(item, tpl);
- document.getElementById('file-renaming-preview').innerText = `${preview}.pdf`;
+ document.getElementById('file-renaming-format-preview').innerText = `${preview}.pdf`;
},
makeMockItem() {
this.mockItem = new Zotero.Item('journalArticle');
- this.mockItem.setField('title', 'Example Article: Zotero Engineering');
+ this.mockItem.setField('title', 'Example Title: Example Subtitle');
this.mockItem.setCreators([
{ firstName: 'Jane', lastName: 'Doe', creatorType: 'author' },
{ firstName: 'John', lastName: 'Smith', creatorType: 'author' }
]);
- this.mockItem.setField('shortTitle', 'Example Article');
- this.mockItem.setField('publicationTitle', 'Advances in Zotero Engineering');
+ this.mockItem.setField('shortTitle', 'Example Title');
+ this.mockItem.setField('publicationTitle', 'Advances in Example Engineering');
this.mockItem.setField('volume', '9');
this.mockItem.setField('issue', '1');
this.mockItem.setField('pages', '34-55');
- this.mockItem.setField('date', '2016');
+ this.mockItem.setField('date', '2018');
this.mockItem.setField('DOI', '10.1016/1234-example');
this.mockItem.setField('ISSN', '1234-5678');
this.mockItem.setField('abstractNote', 'This is an example abstract.');
- this.mockItem.setField('extra', 'This is an example extra field.');
+ this.mockItem.setField('extra', 'This is an example Extra field.');
this.mockItem.setField('accessDate', '2020-01-01');
this.mockItem.setField('url', 'https://example.com');
this.mockItem.setField('libraryCatalog', 'Example Library Catalog');
diff --git a/chrome/content/zotero/preferences/preferences_file_renaming.xhtml b/chrome/content/zotero/preferences/preferences_file_renaming.xhtml
index 364c22c969..2ed192c4de 100644
--- a/chrome/content/zotero/preferences/preferences_file_renaming.xhtml
+++ b/chrome/content/zotero/preferences/preferences_file_renaming.xhtml
@@ -22,40 +22,47 @@
***** END LICENSE BLOCK *****
-->
-
-
-
+
+
+
+
-
+
-
diff --git a/chrome/content/zotero/preferences/preferences_general.xhtml b/chrome/content/zotero/preferences/preferences_general.xhtml
index cc7fd123d4..34b440dcc3 100644
--- a/chrome/content/zotero/preferences/preferences_general.xhtml
+++ b/chrome/content/zotero/preferences/preferences_general.xhtml
@@ -47,13 +47,6 @@
native="true"/>
-
-
@@ -78,6 +71,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
&zotero.preferences.prefpane.locate;
@@ -153,9 +168,4 @@
-
-
-
-
diff --git a/chrome/content/zotero/preferences/preferences_sync_reset.xhtml b/chrome/content/zotero/preferences/preferences_sync_reset.xhtml
index 4e3a96b5d3..55130ffda4 100644
--- a/chrome/content/zotero/preferences/preferences_sync_reset.xhtml
+++ b/chrome/content/zotero/preferences/preferences_sync_reset.xhtml
@@ -1,4 +1,4 @@
-
+
&zotero.preferences.sync.reset;
diff --git a/chrome/locale/en-US/zotero/preferences.dtd b/chrome/locale/en-US/zotero/preferences.dtd
index 7a63a832e7..d53efcc043 100644
--- a/chrome/locale/en-US/zotero/preferences.dtd
+++ b/chrome/locale/en-US/zotero/preferences.dtd
@@ -15,7 +15,6 @@
-
diff --git a/chrome/locale/en-US/zotero/preferences.ftl b/chrome/locale/en-US/zotero/preferences.ftl
index f2cdb300aa..f76d1b9dcb 100644
--- a/chrome/locale/en-US/zotero/preferences.ftl
+++ b/chrome/locale/en-US/zotero/preferences.ftl
@@ -1,10 +1,17 @@
preferences-window =
.title = { -app-name } Settings
-preferences-show-file-renaming-button = Show File Renaming Options
+
preferences-file-renaming-title = File Renaming
-preferences-file-renaming-template = Rename Template:
-preferences-file-renaming-preview = Preview:
-preferences-file-renaming-instructions = Zotero automatically renames attached files saved from translators. This setting controls how those names are formatted.
-preferences-file-renaming-instructions-example = For example “{ $example }” in this template will be replaced with the title of an item, truncated at 50 characters.
-preferences-file-renaming-instructions-more = See the documentation for more information.
\ No newline at end of file
+preferences-file-renaming-intro = { -app-name } automatically renames downloaded files based on the details of the parent item (title, author, etc.). You can choose to rename files added from your computer as well.
+preferences-file-renaming-auto-rename-files =
+ .label = Automatically rename locally added files
+preferences-file-renaming-customize-button =
+ .label = Customize Filename Format…
+
+preferences-file-renaming-format-title = Filename Format
+preferences-file-renaming-format-instructions = You can customize the filename pattern { -app-name } uses to rename attachment files from parent metadata.
+preferences-file-renaming-format-instructions-example = For example, “{ $example }” in this template will be replaced with the title of the parent item, truncated at 50 characters.
+preferences-file-renaming-format-instructions-more = See the documentation for more information.
+preferences-file-renaming-format-template = Filename Template:
+preferences-file-renaming-format-preview = Preview:
\ No newline at end of file
diff --git a/chrome/skin/default/zotero/preferences.css b/chrome/skin/default/zotero/preferences.css
index 137a678286..0a491fdf65 100644
--- a/chrome/skin/default/zotero/preferences.css
+++ b/chrome/skin/default/zotero/preferences.css
@@ -115,11 +115,16 @@
}
h1 {
- margin: 0 0 4px 0;
+ margin: 0 0 12px 0;
font-size: 1.3em;
font-weight: normal;
}
+.header {
+ margin-bottom: 8px;
+}
+
+/* Headers in subsections */
.main-section {
margin-bottom: 16px;
}
@@ -135,6 +140,10 @@ groupbox > label > h2, groupbox > * > label > h2 {
font-weight: bold;
}
+groupbox:first-of-type label > h2 {
+ margin-top: .5em !important;
+}
+
/* Space out sections */
groupbox:not(:first-of-type) label > h2 {
margin-top: 2em !important;
@@ -273,6 +282,29 @@ button {
height: 16px;
}
+/* File Renaming tab */
+#file-renaming-customize-button {
+ margin-top: .6em;
+}
+
+#zotero-prefpane-file-renaming-format label:not([is=zotero-text-link]) {
+ display: block;
+}
+
+#file-renaming-format-template {
+ width: 100%;
+ min-height: 1.25em;
+ padding: 0.4em;
+ /* Match label margins */
+ margin-block: 1px 2px;
+ margin-inline: 6px 5px;
+}
+
+#file-renaming-format-preview {
+ width: 100%;
+ padding: 0.4em;
+}
+
/*
* Sync pane
*/
@@ -568,27 +600,6 @@ button {
margin-bottom: .5em;
}
-#zotero-prefpane-file-renaming label:not([is=zotero-text-link]),
-#zotero-prefpane-file-renaming div {
- display: block;
-}
-
-#file-renaming-template {
- width: 100%;
- min-height: 1.25em;
- padding: 0.25em;
-}
-
-#file-renaming-preview {
- width: 100%;
- padding: 0.25em;
- font-family: monospace;
-}
-
-#file-renaming button {
- font-size: 14px;
-}
-
/* BEGIN 2X BLOCK -- DO NOT EDIT MANUALLY -- USE 2XIZE */
@media (min-resolution: 1.25dppx) {