Introducing Zotero tab

- Prefer to show zotero related actions within a dedicated tab (instead
of adding those within references tab as it was previously). This,
hopefully is more familiar to user using similar interface elsewhere
- Show this new tab conditionally (if zotero is enabled)

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I1690295724d54693aca68ade567e9d1076f26876
This commit is contained in:
Pedro Pinto Silva 2022-12-07 17:52:24 +01:00 committed by pedropintosilva
parent 0321254443
commit 431ba6206f

View file

@ -7,7 +7,7 @@
L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
getTabs: function() {
return [
var tabs = [
{
'text': _('~File'),
'id': '-1',
@ -34,6 +34,17 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
'id': '-6',
'name': 'References'
},
];
if (this._map.zotero && this._map.zotero.enable) {
tabs.push(
{
'text': _('Zotero'),
'id': 'zotero',
'name': 'Zotero',
}
);
}
tabs.push(
{
'text': _('~Review'),
'id': '-7',
@ -71,17 +82,22 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
'id': '-2',
'name': 'Help',
}
];
);
return tabs;
},
getFullJSON: function(selectedId) {
return this.getNotebookbar(
[
var tabPages = [
this.getFileTab(),
this.getHomeTab(),
this.getInsertTab(),
this.getLayoutTab(),
this.getReferencesTab(),
this.getReferencesTab()
];
if (this._map.zotero && this._map.zotero.enable) {
tabPages.push(this.getZoteroTab());
}
tabPages.push(
this.getReviewTab(),
this.getFormatTab(),
this.getFormTab(),
@ -89,7 +105,8 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
this.getDrawTab(),
this.getViewTab(),
this.getHelpTab()
], selectedId);
);
return this.getNotebookbar(tabPages, selectedId);
},
getFileTab: function() {
@ -1501,8 +1518,11 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
}
];
if (this._map.zotero && this._map.zotero.enable) {
content.push(
return this.getTabPage('References', content);
},
getZoteroTab: function() {
var content = [
{
'id': 'zoteroedit',
'type': 'bigmenubartoolitem',
@ -1515,10 +1535,9 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
'text': _('Citation Style'),
'command': 'zoteroStyle'
}
);
}
];
return this.getTabPage('References', content);
return this.getTabPage('Zotero', content);
},
getReviewTab: function() {