From a46e0d7c1c863cafd5277e5c3016a72feae4f0c7 Mon Sep 17 00:00:00 2001 From: Philipp Zumstein Date: Mon, 26 Feb 2018 21:43:09 +0100 Subject: [PATCH] List fields also for all other item types (#68) --- src/chrome/content/scaffold/scaffold.js | 12 ++++++++++++ src/chrome/content/scaffold/scaffold.xul | 7 +++++++ src/chrome/locale/en-US/scaffold/scaffold.dtd | 5 +++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/chrome/content/scaffold/scaffold.js b/src/chrome/content/scaffold/scaffold.js index 58333c15..e1f9aa34 100644 --- a/src/chrome/content/scaffold/scaffold.js +++ b/src/chrome/content/scaffold/scaffold.js @@ -123,6 +123,18 @@ var Scaffold = new function() { }, true); generateTranslatorID(); + + // Add List fields help menu entries for all other item types + var types = Zotero.ItemTypes.getAll().map(t => t.name).sort(); + var morePopup = document.getElementById('mb-help-fields-more-popup'); + var primaryTypes = ['book', 'bookSection', 'conferencePaper', 'journalArticle', 'magazineArticle', 'newspaperArticle']; + for (let type of types) { + if (primaryTypes.includes(type)) continue; + var menuitem = document.createElement('menuitem'); + menuitem.setAttribute('label', type); + menuitem.addEventListener('command', () => { Scaffold.addTemplate('templateNewItem', type) }); + morePopup.appendChild(menuitem); + } } function onResize() { diff --git a/src/chrome/content/scaffold/scaffold.xul b/src/chrome/content/scaffold/scaffold.xul index 77f70af7..1f491293 100644 --- a/src/chrome/content/scaffold/scaffold.xul +++ b/src/chrome/content/scaffold/scaffold.xul @@ -50,8 +50,15 @@ + + + + + + + diff --git a/src/chrome/locale/en-US/scaffold/scaffold.dtd b/src/chrome/locale/en-US/scaffold/scaffold.dtd index 4dc8a106..87e6576d 100644 --- a/src/chrome/locale/en-US/scaffold/scaffold.dtd +++ b/src/chrome/locale/en-US/scaffold/scaffold.dtd @@ -3,8 +3,6 @@ - - @@ -18,6 +16,9 @@ + + +