File Renaming: Rearrange prefs (#4487)

This commit is contained in:
Abe Jellinek 2024-08-03 01:28:28 -04:00 committed by GitHub
parent aa19153ebc
commit 8209ee6279
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 37 deletions

View file

@ -236,15 +236,15 @@ Zotero_Preferences.General = {
},
updateAutoRenameFilesUI: function () {
setTimeout(() => {
document.getElementById('rename-linked-files').disabled = !Zotero.Prefs.get('autoRenameFiles');
});
let disabled = !Zotero.Prefs.get('autoRenameFiles');
let typesBox = document.getElementById('zotero-prefpane-file-renaming-file-types-box');
let enabledTypes = Zotero.Prefs.get('autoRenameFiles.fileTypes').split(',');
for (let checkbox of typesBox.querySelectorAll('checkbox')) {
checkbox.checked = enabledTypes.includes(checkbox.dataset.contentType);
checkbox.disabled = disabled;
}
document.getElementById('rename-linked-files').disabled = disabled;
},
//

View file

@ -109,14 +109,9 @@
<separator class="thin"/>
<checkbox data-l10n-id="preferences-file-renaming-auto-rename-files"
preference="extensions.zotero.autoRenameFiles"
oncommand="Zotero_Preferences.General.updateAutoRenameFilesUI()" native="true"
oncommand="setTimeout(() => Zotero_Preferences.General.updateAutoRenameFilesUI())" native="true"
/>
<checkbox id="rename-linked-files" class="indented-pref"
label="&zotero.preferences.autoRenameFiles.renameLinked;"
preference="extensions.zotero.autoRenameFiles.linked"
oncommand="Zotero_Preferences.General.updateAutoRenameFilesUI()" native="true"
/>
<vbox class="indented-pref">
<label data-l10n-id="preferences-file-renaming-file-types"/>
<hbox
id="zotero-prefpane-file-renaming-file-types-box"
@ -149,6 +144,12 @@
native="true"
/>
</hbox>
</vbox>
<checkbox id="rename-linked-files" class="indented-pref"
label="&zotero.preferences.autoRenameFiles.renameLinked;"
preference="extensions.zotero.autoRenameFiles.linked"
oncommand="Zotero_Preferences.General.updateAutoRenameFilesUI()" native="true"
/>
<button id="file-renaming-button"
data-l10n-id="preferences-file-renaming-customize-button"