Skip to content

Commit

Permalink
fetching info from CITATION.cff; refs #381
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-jettka committed Nov 21, 2024
1 parent 4b0f32c commit 429783a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions add/data/locale/edirom-lang-de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@

<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
1 change: 1 addition & 0 deletions add/data/locale/edirom-lang-en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@

<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
35 changes: 34 additions & 1 deletion app/controller/window/about/AboutWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,40 @@ Ext.define('EdiromOnline.controller.window.about.AboutWindow', {
window.doAJAXRequest('resources/CITATION.cff',
'GET', {},
Ext.bind(function(response){
view.setResult('<pre>'+response.responseText+'</pre>');

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(`
<div class="tei_body">
<h1>About ${title}</h1>
<section class="teidiv0">
<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)
);
}
Expand Down

0 comments on commit 429783a

Please sign in to comment.