Add Filename option for PDF tab title pref
This commit is contained in:
parent
962cc23d1a
commit
b956d9b429
3 changed files with 5 additions and 2 deletions
|
@ -102,6 +102,7 @@
|
|||
<menupopup>
|
||||
<menuitem label="&zotero.preferences.reader.tabsTitle.titleCreatorYear;" value="titleCreatorYear"/>
|
||||
<menuitem label="&zotero.preferences.reader.tabsTitle.creatorYearTitle;" value="creatorYearTitle"/>
|
||||
<menuitem label="&zotero.preferences.reader.tabsTitle.filename;" value="filename"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
|
|
|
@ -172,14 +172,15 @@ class ReaderInstance {
|
|||
}
|
||||
|
||||
async updateTitle() {
|
||||
let type = Zotero.Prefs.get('tabs.title.reader');
|
||||
let item = Zotero.Items.get(this._itemID);
|
||||
let readerTitle = item.getDisplayTitle();
|
||||
let parentItem = item.parentItem;
|
||||
if (parentItem) {
|
||||
// If type is "filename", then readerTitle already has it
|
||||
if (parentItem && type !== 'filename') {
|
||||
let attachment = await parentItem.getBestAttachment();
|
||||
if (attachment && attachment.id === this._itemID) {
|
||||
let parts = [];
|
||||
let type = Zotero.Prefs.get('tabs.title.reader');
|
||||
let creator = parentItem.getField('firstCreator');
|
||||
let year = parentItem.getField('year');
|
||||
let title = parentItem.getDisplayTitle();
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
<!ENTITY zotero.preferences.reader.tabsTitle.label "Show tabs as">
|
||||
<!ENTITY zotero.preferences.reader.tabsTitle.creatorYearTitle "Creator - Year - Title">
|
||||
<!ENTITY zotero.preferences.reader.tabsTitle.titleCreatorYear "Title - Creator - Year">
|
||||
<!ENTITY zotero.preferences.reader.tabsTitle.filename "Filename">
|
||||
|
||||
<!ENTITY zotero.preferences.groups "Groups">
|
||||
<!ENTITY zotero.preferences.groups.whenCopyingInclude "When copying items between libraries, include:">
|
||||
|
|
Loading…
Reference in a new issue