From 804bda4160a41234edea7edf5bfc1066094c52f3 Mon Sep 17 00:00:00 2001 From: Daniel Jettka Date: Fri, 15 Nov 2024 17:09:17 +0100 Subject: [PATCH 1/9] added about button (not yet actionable) --- add/data/locale/edirom-lang-de.xml | 1 + add/data/locale/edirom-lang-en.xml | 1 + app/view/desktop/TopBar.js | 13 ++++++++++++- packages/eoTheme/sass/var/button/Button.scss | 9 +++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/add/data/locale/edirom-lang-de.xml b/add/data/locale/edirom-lang-de.xml index 2623dec9e..7d6f47e3c 100644 --- a/add/data/locale/edirom-lang-de.xml +++ b/add/data/locale/edirom-lang-de.xml @@ -64,6 +64,7 @@ + diff --git a/add/data/locale/edirom-lang-en.xml b/add/data/locale/edirom-lang-en.xml index 44d568e4a..614368df3 100644 --- a/add/data/locale/edirom-lang-en.xml +++ b/add/data/locale/edirom-lang-en.xml @@ -64,6 +64,7 @@ + diff --git a/app/view/desktop/TopBar.js b/app/view/desktop/TopBar.js index 85f330dc7..4e6367445 100644 --- a/app/view/desktop/TopBar.js +++ b/app/view/desktop/TopBar.js @@ -57,6 +57,16 @@ Ext.define('EdiromOnline.view.desktop.TopBar', { action: 'openSearchWindow' }); + me.aboutButton = Ext.create('Ext.button.Button', { + id: 'aboutBtn', + cls: 'taskLinkButton about', + text: getLangString('view.desktop.TaskBar_about'), + renderTo: Ext.getBody(), + handler: function() { + alert('You clicked the button!'); + } + }); + me.searchTextField = Ext.create('Ext.form.TextField', { width: 180, id: 'searchTextFieldTop' @@ -82,7 +92,8 @@ Ext.define('EdiromOnline.view.desktop.TopBar', { me.workCombo, '->', me.searchTextField, - me.searchButton + me.searchButton, + me.aboutButton ] }) ]; diff --git a/packages/eoTheme/sass/var/button/Button.scss b/packages/eoTheme/sass/var/button/Button.scss index b7f102363..04775c46b 100644 --- a/packages/eoTheme/sass/var/button/Button.scss +++ b/packages/eoTheme/sass/var/button/Button.scss @@ -112,6 +112,15 @@ $edirom-taskbarWindowButton-background-color: #cccccc; } } +.taskLinkButton.about { + border: 1px solid #949393; + background-image: -webkit-linear-gradient(top, #adadad, #a79b9b 48%, #979797 52%, #c3c2c2); +} + +.taskLinkButton.about:hover { + background-image: -webkit-linear-gradient(top, #cdcdcd, #c5c5c5 48%, #c3c3c3 52%, #d3d2d2); +} + .x-btn-default-toolbar-small.x-pressed { background-color: #A3A3A3 !important; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4) inset; From 13c1d4ed453f56eeaa3964b2e2428bfdaa19a8cf Mon Sep 17 00:00:00 2001 From: Daniel Jettka Date: Fri, 15 Nov 2024 17:46:05 +0100 Subject: [PATCH 2/9] action for window opening --- add/data/locale/edirom-lang-de.xml | 1 + add/data/locale/edirom-lang-en.xml | 1 + app/controller/desktop/Desktop.js | 8 ++++++++ app/view/desktop/Desktop.js | 23 +++++++++++++++++++++++ app/view/desktop/TaskBar.js | 1 + app/view/desktop/TopBar.js | 5 +---- 6 files changed, 35 insertions(+), 4 deletions(-) diff --git a/add/data/locale/edirom-lang-de.xml b/add/data/locale/edirom-lang-de.xml index 7d6f47e3c..1a2e8ef44 100644 --- a/add/data/locale/edirom-lang-de.xml +++ b/add/data/locale/edirom-lang-de.xml @@ -100,6 +100,7 @@ + diff --git a/add/data/locale/edirom-lang-en.xml b/add/data/locale/edirom-lang-en.xml index 614368df3..a73cb2b64 100644 --- a/add/data/locale/edirom-lang-en.xml +++ b/add/data/locale/edirom-lang-en.xml @@ -100,6 +100,7 @@ + diff --git a/app/controller/desktop/Desktop.js b/app/controller/desktop/Desktop.js index b91a06754..a768c6c8e 100644 --- a/app/controller/desktop/Desktop.js +++ b/app/controller/desktop/Desktop.js @@ -34,6 +34,9 @@ Ext.define('EdiromOnline.controller.desktop.Desktop', { 'topbar button[action=openSearchWindow]': { click: this.onOpenSearchWindow }, + 'topbar button[action=openAboutWindow]': { + click: this.onOpenAboutWindow + }, 'topbar #searchTextFieldTop': { specialkey: this.onSpecialKey } @@ -94,6 +97,11 @@ Ext.define('EdiromOnline.controller.desktop.Desktop', { me.desktop.openSearchWindow(term); }, + onOpenAboutWindow: function(button, event, args) { + var me = this; + me.desktop.openAboutWindow(); + }, + switchDesktop: function(desk) { this.desktop.switchDesktop(desk); }, diff --git a/app/view/desktop/Desktop.js b/app/view/desktop/Desktop.js index 6dea2561f..4dcf31e4f 100644 --- a/app/view/desktop/Desktop.js +++ b/app/view/desktop/Desktop.js @@ -207,6 +207,29 @@ Ext.define('EdiromOnline.view.desktop.Desktop', { //win.doSearch(term); }, + openAboutWindow: function() { + + var me = this; + var win = null; + + me.getActiveWindowsSet().each(function(window) { + if(Ext.getClassName(window) == 'EdiromOnline.view.window.about.AboutWindow') + win = window; + }); + + if(win == null) { + win = Ext.create('EdiromOnline.view.window.about.AboutWindow', me.getSizeAndPosition(700, 600)); + me.addWindow(win); + win.show(); + + }else if(win != me.getActiveWindow()) + win.show(); + + else + win.hide(); + + }, + getSizeAndPosition: function(maxWidth, maxHeight) { var me = this; diff --git a/app/view/desktop/TaskBar.js b/app/view/desktop/TaskBar.js index c34be95a5..9c3ec67bd 100644 --- a/app/view/desktop/TaskBar.js +++ b/app/view/desktop/TaskBar.js @@ -43,6 +43,7 @@ Ext.define('EdiromOnline.view.desktop.TaskBar', { 'sortVertically', 'openConcordanceNavigator', 'openSearchWindow', + 'openAboutWindow', 'switchLanguage'); me.windowSort = new Ext.toolbar.Toolbar(me.getWindowSortConfig()); diff --git a/app/view/desktop/TopBar.js b/app/view/desktop/TopBar.js index 4e6367445..1e60b1e25 100644 --- a/app/view/desktop/TopBar.js +++ b/app/view/desktop/TopBar.js @@ -61,10 +61,7 @@ Ext.define('EdiromOnline.view.desktop.TopBar', { id: 'aboutBtn', cls: 'taskLinkButton about', text: getLangString('view.desktop.TaskBar_about'), - renderTo: Ext.getBody(), - handler: function() { - alert('You clicked the button!'); - } + action: 'openAboutWindow' }); me.searchTextField = Ext.create('Ext.form.TextField', { From 8728fb2dba0089e6850e9555d0d2bb35ce6185fb Mon Sep 17 00:00:00 2001 From: Daniel Jettka Date: Fri, 15 Nov 2024 17:48:23 +0100 Subject: [PATCH 3/9] about window definition --- app/view/window/about/AboutWindow.js | 83 ++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 app/view/window/about/AboutWindow.js diff --git a/app/view/window/about/AboutWindow.js b/app/view/window/about/AboutWindow.js new file mode 100644 index 000000000..7277d4dd3 --- /dev/null +++ b/app/view/window/about/AboutWindow.js @@ -0,0 +1,83 @@ +/** + * Edirom Online + * Copyright (C) 2014 The Edirom Project + * http://www.edirom.de + * + * Edirom Online is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Edirom Online is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Edirom Online. If not, see . + * + */ +Ext.define('EdiromOnline.view.window.about.AboutWindow', { + + extend: 'Ext.window.Window', + + mixins: { + observable: 'Ext.util.Observable' + }, + + alias: 'widget.aboutWindow', + + requires: [ + ], + + stateful: false, + isWindow: true, + //closeAction: 'hide', + constrainHeader: true, + minimizable: false, + maximizable: false, + closable: true, + shadow: false, + + layout: { + type: 'vbox', + align: 'stretch' + }, + border: 0, + bodyBorder: false, + + padding: 0, + + bodyPadding: '0', + + cls: 'ediromWindow aboutWindow', + + defaults: { + border:false + }, + + initComponent: function() { + var me = this; + + me.title = getLangString('view.window.about.AboutWindow_Title'); + + me.items = [ + { + xtype: 'panel', + flex: 1, + html: '
' + } + ]; + + me.callParent(); + }, + + setResult: function(text) { + Ext.fly(this.id + '_textCont').update(text); + this.fireEvent('documentLoaded', this); + }, + + close: function() { + this.hide(); + } +}); \ No newline at end of file From 59e0c86b8d07bc9d18f33e5ce97e8a4075e60cdc Mon Sep 17 00:00:00 2001 From: Daniel Jettka Date: Fri, 15 Nov 2024 18:03:24 +0100 Subject: [PATCH 4/9] added panel for version number --- app/view/window/about/AboutWindow.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/view/window/about/AboutWindow.js b/app/view/window/about/AboutWindow.js index 7277d4dd3..d01699eeb 100644 --- a/app/view/window/about/AboutWindow.js +++ b/app/view/window/about/AboutWindow.js @@ -66,7 +66,14 @@ Ext.define('EdiromOnline.view.window.about.AboutWindow', { xtype: 'panel', flex: 1, html: '
' + }, + // read property project.version from build.xml + { + xtype: 'panel', + flex: 1, + html: '
Version: ' + /* TODO: version no. here (from build.xml?) */ '###' + '
' } + ]; me.callParent(); From 525fae5b1b126c7c4520325598c0648d624ff52e Mon Sep 17 00:00:00 2001 From: Daniel Jettka Date: Wed, 20 Nov 2024 16:24:26 +0100 Subject: [PATCH 5/9] writing CITATION.cff to about window --- app/Application.js | 1 + app/controller/window/about/AboutWindow.js | 49 ++++++++++++++++++++++ app/view/window/about/AboutWindow.js | 6 --- build.xml | 1 + 4 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 app/controller/window/about/AboutWindow.js diff --git a/app/Application.js b/app/Application.js index 76fd97764..c8f379a62 100644 --- a/app/Application.js +++ b/app/Application.js @@ -32,6 +32,7 @@ Ext.define('EdiromOnline.Application', { 'desktop.TaskBar', 'desktop.TopBar', 'navigator.Navigator', + 'window.about.AboutWindow', 'window.AnnotationView', 'window.HeaderView', 'window.HelpWindow', diff --git a/app/controller/window/about/AboutWindow.js b/app/controller/window/about/AboutWindow.js new file mode 100644 index 000000000..abfc76b4d --- /dev/null +++ b/app/controller/window/about/AboutWindow.js @@ -0,0 +1,49 @@ +/** + * Edirom Online + * Copyright (C) 2014 The Edirom Project + * http://www.edirom.de + * + * Edirom Online is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Edirom Online is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Edirom Online. If not, see . + */ +Ext.define('EdiromOnline.controller.window.about.AboutWindow', { + + extend: 'Ext.app.Controller', + + views: [ + 'window.about.AboutWindow' + ], + + init: function() { + this.control({ + 'aboutWindow': { + afterlayout : this.onAfterLayout + } + }); + }, + + onAfterLayout: function(view) { + + var me = this; + + if(view.initialized) return; + view.initialized = true; + + window.doAJAXRequest('resources/CITATION.cff', + 'GET', {}, + Ext.bind(function(response){ + view.setResult(response.responseText); + }, this) + ); + } +}); diff --git a/app/view/window/about/AboutWindow.js b/app/view/window/about/AboutWindow.js index d01699eeb..784938941 100644 --- a/app/view/window/about/AboutWindow.js +++ b/app/view/window/about/AboutWindow.js @@ -66,12 +66,6 @@ Ext.define('EdiromOnline.view.window.about.AboutWindow', { xtype: 'panel', flex: 1, html: '
' - }, - // read property project.version from build.xml - { - xtype: 'panel', - flex: 1, - html: '
Version: ' + /* TODO: version no. here (from build.xml?) */ '###' + '
' } ]; diff --git a/build.xml b/build.xml index 6a6345f76..16eb84b61 100755 --- a/build.xml +++ b/build.xml @@ -45,6 +45,7 @@ + From 4b0f32c14ed4276d4077583c062f4d3c8f625f41 Mon Sep 17 00:00:00 2001 From: Daniel Jettka Date: Thu, 21 Nov 2024 08:30:04 +0100 Subject: [PATCH 6/9] set pre tags to display CITATION.cff content in window --- app/controller/window/about/AboutWindow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controller/window/about/AboutWindow.js b/app/controller/window/about/AboutWindow.js index abfc76b4d..3af2de088 100644 --- a/app/controller/window/about/AboutWindow.js +++ b/app/controller/window/about/AboutWindow.js @@ -42,7 +42,7 @@ Ext.define('EdiromOnline.controller.window.about.AboutWindow', { window.doAJAXRequest('resources/CITATION.cff', 'GET', {}, Ext.bind(function(response){ - view.setResult(response.responseText); + view.setResult('
'+response.responseText+'
'); }, this) ); } From 429783adfdd1154afa7839728af4d314be05e418 Mon Sep 17 00:00:00 2001 From: Daniel Jettka Date: Thu, 21 Nov 2024 17:31:14 +0100 Subject: [PATCH 7/9] fetching info from CITATION.cff; refs #381 --- add/data/locale/edirom-lang-de.xml | 1 + add/data/locale/edirom-lang-en.xml | 1 + app/controller/window/about/AboutWindow.js | 35 +++++++++++++++++++++- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/add/data/locale/edirom-lang-de.xml b/add/data/locale/edirom-lang-de.xml index 1a2e8ef44..60ea41462 100644 --- a/add/data/locale/edirom-lang-de.xml +++ b/add/data/locale/edirom-lang-de.xml @@ -101,6 +101,7 @@ + diff --git a/add/data/locale/edirom-lang-en.xml b/add/data/locale/edirom-lang-en.xml index a73cb2b64..5f94ad188 100644 --- a/add/data/locale/edirom-lang-en.xml +++ b/add/data/locale/edirom-lang-en.xml @@ -101,6 +101,7 @@ + diff --git a/app/controller/window/about/AboutWindow.js b/app/controller/window/about/AboutWindow.js index 3af2de088..34585da3b 100644 --- a/app/controller/window/about/AboutWindow.js +++ b/app/controller/window/about/AboutWindow.js @@ -42,7 +42,40 @@ Ext.define('EdiromOnline.controller.window.about.AboutWindow', { window.doAJAXRequest('resources/CITATION.cff', 'GET', {}, Ext.bind(function(response){ - view.setResult('
'+response.responseText+'
'); + + const citation = response.responseText; + + // find keys in citation + const version = citation.match(/^version: (.*)/m)[1]; + const title = citation.match(/^title: (.*)/m)[1]; + const license = citation.match(/^license: (.*)/m)[1]; + const repoUrl = citation.match(/^repository\-code: '(.*)'/m)[1]; + const releaseDate = citation.match(/^date\-released: '(.*)'/m)[1]; + const doi = citation.match(/value: ([0-9]+\.[0-9]+\/zenodo\.[0-9]+)/)[1]; + + + + + + view.setResult(` +
+

About ${title}

+
+

Version: ${version}

+

Release date: ${releaseDate}

+

DOI: ${doi}

+

${getLangString('view.window.about.AboutWindow_License')}: ${license}

+

GitHub: ${repoUrl}

+

Contributors:
+ + Avatars of contributors to ${title} in GitHub + +

+
+
+ `); + + }, this) ); } From 10c47ac3428dcead84cafdf0768f5e427e7de1be Mon Sep 17 00:00:00 2001 From: Daniel Jettka Date: Thu, 21 Nov 2024 18:25:17 +0100 Subject: [PATCH 8/9] removed some empty lines --- app/controller/window/about/AboutWindow.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/controller/window/about/AboutWindow.js b/app/controller/window/about/AboutWindow.js index 34585da3b..f223c49b6 100644 --- a/app/controller/window/about/AboutWindow.js +++ b/app/controller/window/about/AboutWindow.js @@ -53,10 +53,6 @@ Ext.define('EdiromOnline.controller.window.about.AboutWindow', { const releaseDate = citation.match(/^date\-released: '(.*)'/m)[1]; const doi = citation.match(/value: ([0-9]+\.[0-9]+\/zenodo\.[0-9]+)/)[1]; - - - - view.setResult(`

About ${title}

@@ -74,7 +70,6 @@ Ext.define('EdiromOnline.controller.window.about.AboutWindow', {
`); - }, this) ); From a6a14847510b845330e970dd3f5be6ee582b3d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20R=C3=B6wenstrunk?= Date: Mon, 2 Dec 2024 11:31:40 +0100 Subject: [PATCH 9/9] Abstract of CITATION.CFF in About window --- app/controller/window/about/AboutWindow.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controller/window/about/AboutWindow.js b/app/controller/window/about/AboutWindow.js index f223c49b6..4bc211e4d 100644 --- a/app/controller/window/about/AboutWindow.js +++ b/app/controller/window/about/AboutWindow.js @@ -46,6 +46,7 @@ Ext.define('EdiromOnline.controller.window.about.AboutWindow', { const citation = response.responseText; // find keys in citation + const abstract = String(citation.match(/^abstract:\s>-\n(\s+.*\n)+/gm)).replace(/^abstract:\s>-\n/, ''); const version = citation.match(/^version: (.*)/m)[1]; const title = citation.match(/^title: (.*)/m)[1]; const license = citation.match(/^license: (.*)/m)[1]; @@ -57,6 +58,7 @@ Ext.define('EdiromOnline.controller.window.about.AboutWindow', {

About ${title}

+

${abstract}

Version: ${version}

Release date: ${releaseDate}

DOI: ${doi}