-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description, Context and related Issue <!--- Please describe your changes. Why is this change required? What problem does it solve? --> added button and window fpr about page; reads from CITATION.cff to display basic information <!--- This project only accepts pull requests related to open issues. Please link to the issue here: --> Refs #381 and Refs #213 ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran. --> local build of Edirom ## Types of changes <!--- What types of changes does your code introduce? Please DELETE options that are not relevant. --> - New feature (non-breaking change which adds functionality) - Improvement ## Overview <!--- Go over all the following points, and DELETE options that are not relevant. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - I have updated the inline documentation accordingly. - I have performed a self-review of my code, according to the [style guide](https://github.com/Edirom/Edirom-Online/blob/develop/STYLE-GUIDE.md) - I have read the [CONTRIBUTING](https://github.com/Edirom/Edirom-Online/blob/develop/CONTRIBUTING.md) document. - All new and existing tests passed.
- Loading branch information
Showing
12 changed files
with
232 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters