Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ftr/381 add about edirom #479

Merged
merged 13 commits into from
Dec 2, 2024
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
[![DOI](https://zenodo.org/badge/5966814.svg)](https://zenodo.org/badge/latestdoi/5966814)

</div>


<div align="center">

<div align="center">

**[Showcases](https://github.com/Edirom/Edirom-Online#showcases) •
[Get started](https://github.com/Edirom/Edirom-Online#get-started) •
[Documentation](https://github.com/Edirom/Edirom-Online#documentation) •
[Dependencies](https://github.com/Edirom/Edirom-Online#dependencies) •
[Roadmap](https://github.com/Edirom/Edirom-Online#roadmap) •
[Contributing](https://github.com/Edirom/Edirom-Online#contributing) •
[Get in touch](https://github.com/Edirom/Edirom-Online#get-in-touch) •
[Code of Conduct](https://github.com/Edirom/Edirom-Online#code-of-Conduct) •
[License](https://github.com/Edirom/Edirom-Online#license)**
**[Showcases](https://github.com/Edirom/Edirom-Online?tab=readme-ov-file#showcases) •
[Get started](https://github.com/Edirom/Edirom-Online?tab=readme-ov-file#get-started) •
[Dependencies](https://github.com/Edirom/Edirom-Online?tab=readme-ov-file#dependencies) •
[Roadmap](https://github.com/Edirom/Edirom-Online?tab=readme-ov-file#roadmap) •
[Contributing](https://github.com/Edirom/Edirom-Online?tab=readme-ov-file#contributing) •
[Get in touch](https://github.com/Edirom/Edirom-Online?tab=readme-ov-file#get-in-touch) •
[Code of Conduct](https://github.com/Edirom/Edirom-Online?tab=readme-ov-file#code-of-conduct) •
[Citation](https://github.com/Edirom/Edirom-Online?tab=readme-ov-file#citation)
[License](https://github.com/Edirom/Edirom-Online?tab=readme-ov-file#license)**

</div>

Expand Down
3 changes: 3 additions & 0 deletions add/data/locale/edirom-lang-de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<entry key="view.desktop.TaskBar_home" value="Startseite"/>
<entry key="view.desktop.TaskBar_work" value="Werk wählen"/>
<entry key="view.desktop.TaskBar_search" value="Suche"/>
<entry key="view.desktop.TaskBar_about" value="About"/>
<entry key="view.desktop.TaskBar_Desktop" value="Desktop {0}"/>
<entry key="view.desktop.TaskBar_searchWin" value="Öffne Suchfenster"/>
<entry key="view.desktop.TaskBar_Sort_grid" value="Im Raster anordnen"/>
Expand Down Expand Up @@ -99,6 +100,8 @@
<entry key="view.window.concordanceNavigator.ConcordanceNavigator_Show" value="Anzeigen"/>

<entry key="view.window.search.SearchWindow_Title" value="Suche"/>
<entry key="view.window.about.AboutWindow_Title" value="About Edirom Online"/>
<entry key="view.window.about.AboutWindow_License" value="Lizenz"/>
<entry key="view.window.source.SourceView_categoriesMenu" value="Kategorien…"/>
<entry key="view.window.source.SourceView_prioMenu" value="Prioritäten…"/>
<entry key="view.window.source.SourceView_gotoMovement" value="Gehe zu Satz/Nummer…"/>
Expand Down
3 changes: 3 additions & 0 deletions add/data/locale/edirom-lang-en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<entry key="view.desktop.TaskBar_home" value="Home"/>
<entry key="view.desktop.TaskBar_work" value="Select work"/>
<entry key="view.desktop.TaskBar_search" value="Search"/>
<entry key="view.desktop.TaskBar_about" value="About"/>
<entry key="view.desktop.TaskBar_Desktop" value="Desktop {0}"/>
<entry key="view.desktop.TaskBar_searchWin" value="Open search window"/>
<entry key="view.desktop.TaskBar_Sort_grid" value="Sort windows in grid"/>
Expand Down Expand Up @@ -99,6 +100,8 @@
<entry key="view.window.concordanceNavigator.ConcordanceNavigator_Show" value="Show"/>

<entry key="view.window.search.SearchWindow_Title" value="Search"/>
<entry key="view.window.about.AboutWindow_Title" value="About Edirom Online"/>
<entry key="view.window.about.AboutWindow_License" value="License"/>
<entry key="view.window.source.SourceView_categoriesMenu" value="Categories…"/>
<entry key="view.window.source.SourceView_prioMenu" value="Priorities…"/>
<entry key="view.window.source.SourceView_gotoMovement" value="Go to movement/number…"/>
Expand Down
1 change: 1 addition & 0 deletions app/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Ext.define('EdiromOnline.Application', {
'desktop.TaskBar',
'desktop.TopBar',
'navigator.Navigator',
'window.about.AboutWindow',
'window.AnnotationView',
'window.HeaderView',
'window.HelpWindow',
Expand Down
8 changes: 8 additions & 0 deletions app/controller/desktop/Desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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);
},
Expand Down
79 changes: 79 additions & 0 deletions app/controller/window/about/AboutWindow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/**
* 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 <http://www.gnu.org/licenses/>.
*/
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){

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];
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(`
<div class="tei_body">
<h1>About ${title}</h1>
<section class="teidiv0">
<p>${abstract}</p>
<p>Version: ${version}</p>
<p>Release date: ${releaseDate}</p>
<p>DOI: <a href="https://doi.org/${doi}">${doi}</a></p>
<p>${getLangString('view.window.about.AboutWindow_License')}: ${license}</p>
<p>GitHub: <a href="${repoUrl}">${repoUrl}</a></p>
<p>Contributors: <br/>
<a href="${repoUrl}/graphs/contributors" title="See contributors to ${title} GitHub project">
<img height="50px" id="github-contributors" src="https://contrib.rocks/image?repo=${repoUrl.replace(/^https?:\/\/github.com\//, '')}" alt="Avatars of contributors to ${title} in GitHub" />
</a>
</p>
</section>
</div>
`);

}, this)
);
}
});
23 changes: 23 additions & 0 deletions app/view/desktop/Desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions app/view/desktop/TaskBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Ext.define('EdiromOnline.view.desktop.TaskBar', {
'sortVertically',
'openConcordanceNavigator',
'openSearchWindow',
'openAboutWindow',
'switchLanguage');

me.windowSort = new Ext.toolbar.Toolbar(me.getWindowSortConfig());
Expand Down
10 changes: 9 additions & 1 deletion app/view/desktop/TopBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ 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'),
action: 'openAboutWindow'
});

me.searchTextField = Ext.create('Ext.form.TextField', {
width: 180,
id: 'searchTextFieldTop'
Expand All @@ -82,7 +89,8 @@ Ext.define('EdiromOnline.view.desktop.TopBar', {
me.workCombo,
'->',
me.searchTextField,
me.searchButton
me.searchButton,
me.aboutButton
]
})
];
Expand Down
84 changes: 84 additions & 0 deletions app/view/window/about/AboutWindow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/**
* 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 <http://www.gnu.org/licenses/>.
*
*/
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: '<div id="' + this.id + '_textCont" class="textViewContent"></div>'
}

];

me.callParent();
},

setResult: function(text) {
Ext.fly(this.id + '_textCont').update(text);
this.fireEvent('documentLoaded', this);
},

close: function() {
this.hide();
}
});
1 change: 1 addition & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
</filterset>
</copy>
<copy file="${build.dir}/resources/pix/ViFE-logo-small-144x144-trans.png" tofile="${build.dir}/icon.png" overwrite="true"/>
<copy file="${basedir}/CITATION.cff" tofile="${build.dir}/resources/CITATION.cff" overwrite="true"/>
</target>

<target name="xar">
Expand Down
9 changes: 9 additions & 0 deletions packages/eoTheme/sass/var/button/Button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down