Skip to content

Commit e5ec442

Browse files
author
Dennis Ried
committed
Merge branch 'rel/1.0.0-beta.5'
Data for Release Christmas22
2 parents cb7df65 + dfcab07 commit e5ec442

File tree

16 files changed

+343
-132
lines changed

16 files changed

+343
-132
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "packages/eoTheme/resources/fonts/euryanthe"]
2+
path = packages/eoTheme/resources/fonts/euryanthe
3+
url = https://github.com/Edirom/EuryantheFont

README.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
# Edirom Online
22

3-
Edirom Online is a web application written in XQuery and Javascript, and designed for deployment in eXist-db[http://exist-db.org/exist/apps/homepage/index.html](http://exist-db.org/exist/apps/homepage/index.html). It is based on the work of the [_Edirom_-Project](https://edirom.de/edirom-projekt/) that originally was funded by the German Research Foundation (DFG). This software brings paperbased historio-critical editions of music texts to the web.
3+
Edirom Online is a web application written in XQuery and JavaScript, and designed for deployment in [eXist-db](https://exist-db.org/). It is based on the work of the [_Edirom_-Project](https://edirom.de/edirom-projekt/) that originally was funded by the German Research Foundation (DFG). This software brings paperbased historio-critical editions of music texts to the web.
44

55
The software is still under high development and has to be seen as beta software.
66

7+
## Cloning this repository
8+
9+
Since this repository uses submodules for e.g. fonts, it is necessary to clone the repository with the recursive addition.
10+
11+
```bash
12+
git clone --recursive <project url>
13+
```
14+
15+
If the submodules are not yet present after cloning, you can update them with:
16+
17+
```bash
18+
git submodule update --init --recursive
19+
```
20+
721
## Dependencies
822

9-
Edirom Online depends heavily on the javascript framework ExtJS (<http://www.sencha.com/products/extjs/>) which is included in parts in our code base. We use ExtJS 4.2.1 in the GPL version. Edirom Online also includes the Raphaël javscript library (<http://raphaeljs.com>, MIT License) and the ACE editor (<http://ace.ajax.org>, BSD license).
23+
Edirom Online depends heavily on the JavaScript framework [Ext JS](https://www.sencha.com/products/extjs) which is included in parts in our code base. We use Ext JS 4.2.1 in the GPL version. Edirom Online also includes the Raphaël javscript library (<http://raphaeljs.com>, MIT License) and the ACE editor (<http://ace.ajax.org>, BSD license).
1024

1125
## Contributing
1226

add/data/xql/getMeasures.xql

+14-2
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,26 @@ declare function local:getMeasures($mei as node(), $mdivID as xs:string) as xs:s
6464
then (
6565
for $part in $mdiv//mei:part
6666
for $measure in $part//mei:measure[@label = $measureN][1] | $measures[ancestor::mei:part = $part]
67+
let $voiceRef := $part//mei:staffDef/@decls
68+
let $voiceID := substring-after($voiceRef, '#')
6769
return
68-
concat('{id:"', $measure/@xml:id, '", voice: "', $part//mei:staffDef/@decls, '"}')
70+
concat('{id:"', $measure/@xml:id, '",
71+
voice: "', $voiceRef,
72+
'", partLabel: "', $mei/id($voiceID)/@label,
73+
'"}')
6974
)
7075
else (
7176
for $part in $mdiv//mei:part
77+
(: let $partMeasures := $part//mei:measure:)
7278
for $measure in $part//mei:measure[@n = $measureN][1] | $measures[ancestor::mei:part = $part]
79+
let $voiceRef := $part//mei:staffDef/@decls
80+
let $voiceID := substring-after($voiceRef, '#')
7381
return
74-
concat('{id:"', $measure/@xml:id, '", voice: "', $part//mei:staffDef/@decls, '"}')
82+
concat('{id:"',
83+
$measure/@xml:id,
84+
'", voice: "', $voiceRef,
85+
'", partLabel: "', $mei/id($voiceID)/@label,
86+
'"}')
7587
)
7688
return
7789
concat('{',

add/data/xqm/edition.xqm

+8-6
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,21 @@ declare function edition:getPreferencesURI($uri as xs:string) as xs:string {
9696
};
9797

9898
(:~
99-
: Returns the URI of the first found Edition
99+
: Returns the URI of the edition specified by the submitted $editionID parameter.
100+
: Only succeeds if the supplied id is the @xml:id of a edirom:edition element in '/db/apps'.
101+
: If $editionID is the empty string, returns the URI of the first edition found in '/db/apps'.
100102
:
101-
: @param $uri The URI of the Edition's document to process
102-
: @return The URI
103+
: @param $editionID The '@xml:id' of the edirom:edition document to process
104+
: @return The URI of the Edition file
103105
:)
104-
declare function edition:findEdition($uri as xs:string) as xs:string {
105-
if($uri eq '')
106+
declare function edition:findEdition($editionID as xs:string) as xs:string {
107+
if($editionID eq '')
106108
then(
107109
let $edition := (collection('/db/apps')//edirom:edition)[1]
108110
return 'xmldb:exist://' || document-uri($edition/root())
109111
)
110112
else (
111-
let $edition := collection('/db/apps')//edirom:edition[@xml:id eq $uri]
113+
let $edition := collection('/db/apps')//edirom:edition/id($editionID)
112114
return 'xmldb:exist://' || document-uri($edition/root())
113115
)
114116
};

add/data/xqm/util.xqm

+4-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ declare function eutil:getNamespace($node as node()) as xs:string {
6666
: @return The string
6767
:)
6868

69-
declare function eutil:getLocalizedName($node, $lang) as xs:string {
69+
declare function eutil:getLocalizedName($node, $lang) {
7070

7171
let $name :=
7272
if ($node/mei:title)
@@ -91,7 +91,9 @@ let $name :=
9191
then(annotation:generateTitle($node))
9292
else (normalize-space($node))
9393
return
94-
$name => string-join(' ')
94+
if($node/edirom:names)
95+
then($name)
96+
else($name => string-join(' ') => normalize-space())
9597
};
9698

9799
(:~

add/data/xslt/meiP2html.xsl

+44-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3-
xmlns:xs="http://www.w3.org/2001/XMLSchema"
4-
xmlns:mei="http://www.music-encoding.org/ns/mei"
5-
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl" exclude-result-prefixes="xs xd mei" version="2.0">
2+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mei="http://www.music-encoding.org/ns/mei" xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl" xmlns:functx="http://www.functx.com" exclude-result-prefixes="xs xd" version="2.0">
63
<xd:doc scope="stylesheet">
74
<xd:desc>
85
<xd:p>
@@ -15,8 +12,45 @@
1512
<xsl:output method="xhtml" media-type="text/html" indent="yes" omit-xml-declaration="yes"/>
1613
<xsl:param name="idPrefix" select="string('')"/>
1714
<xsl:param name="imagePrefix" select="string('')"/>
15+
16+
<xsl:variable name="footnotes">
17+
<xsl:copy-of select=".//mei:annot[@type = 'note' and @place = 'foot']"/>
18+
</xsl:variable>
19+
20+
<xsl:variable name="footnotesBlock">
21+
<xsl:for-each select="$footnotes/mei:annot">
22+
<xsl:variable name="counter">
23+
<xsl:value-of select="position()"></xsl:value-of>
24+
</xsl:variable>
25+
<xsl:variable name="content">
26+
<xsl:apply-templates/>
27+
</xsl:variable>
28+
<div style="display:flex; color: grey; font-size: smaller; margin-bottom:0.5rem;">
29+
<span class="superscript">
30+
<xsl:value-of select="$counter"></xsl:value-of>
31+
</span>
32+
<div style="display: inline; margin-left: .25rem;">
33+
<xsl:copy-of select="$content"></xsl:copy-of>
34+
</div>
35+
</div>
36+
</xsl:for-each>
37+
</xsl:variable>
38+
39+
<xsl:function name="functx:index-of-deep-equal-node" as="xs:integer*">
40+
<xsl:param name="nodes" as="node()*"/>
41+
<xsl:param name="nodeToFind" as="node()"/>
42+
<xsl:sequence select="
43+
for $seq in (1 to count($nodes))
44+
return $seq[deep-equal($nodes[$seq],$nodeToFind)]
45+
"/>
46+
</xsl:function>
47+
1848
<xsl:template match="/">
1949
<xsl:apply-templates/>
50+
<xsl:if test="$footnotes != ''">
51+
<hr/>
52+
<xsl:copy-of select="$footnotesBlock"/>
53+
</xsl:if>
2054
</xsl:template>
2155
<xsl:template match="mei:p">
2256
<p>
@@ -26,6 +60,12 @@
2660
<xsl:apply-templates select="* | text()"/>
2761
</p>
2862
</xsl:template>
63+
<xsl:template match="mei:annot[@type = 'note' and @place = 'foot']">
64+
<xsl:variable name="footnoteCount">
65+
<xsl:value-of select="functx:index-of-deep-equal-node($footnotes/mei:annot, .)"></xsl:value-of>
66+
</xsl:variable>
67+
<span class="superscript"><xsl:value-of select="$footnoteCount"/></span>
68+
</xsl:template>
2969
<xsl:template match="mei:ref">
3070
<span class="ref">
3171
<xsl:choose>

app/view/window/image/ImageViewer.js

+25-4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Ext.define('EdiromOnline.view.window.image.ImageViewer', {
4646

4747
shapes: null,
4848
shapesHidden: false,
49+
partLabel: null,
4950

5051
svgOverlays: null,
5152
annotSVGOverlays: null,
@@ -65,10 +66,30 @@ Ext.define('EdiromOnline.view.window.image.ImageViewer', {
6566

6667
me.addEvents('zoomChanged',
6768
'imageChanged');
68-
69-
me.html = '<div id="' + me.id + '_facsCont" style="overflow: hidden; background-color: black; top:0px; bottom: 0px; left: 0px; right: 0px; position:absolute;"></div>' +
70-
'<div id="' + me.id + '_facsContEvents" class="facsContEvents"></div>';
71-
69+
70+
/* from OPERA*/
71+
var facsContEvents;
72+
73+
if (me.partLabel != null) {
74+
facsContEvents = '<div id="' + me.id + '_facsContEvents" class="facsContEvents">' +
75+
'<div id="' + me.id + '_' + me.partLabel + '" class="part">' +
76+
'<span class="partInner" id="' + me.id + '_' + me.partLabel + '_inner">' +
77+
me.partLabel + '</span>' +
78+
'</div>' +
79+
'</div>';
80+
}
81+
else {
82+
facsContEvents = '<div id="' + me.id + '_facsContEvents" class="facsContEvents"></div>';
83+
};
84+
85+
me.html = '<div id="' + me.id + '_facsCont" style="background-color: black; top:0px; bottom: 0px; left: 0px; right: 0px; position:absolute;"></div>' + facsContEvents;
86+
87+
/* from OPERA END*/
88+
89+
/* */
90+
/* me.html = '<div id="' + me.id + '_facsCont" style="overflow: hidden; background-color: black; top:0px; bottom: 0px; left: 0px; right: 0px; position:absolute;"></div>' +*/
91+
/* '<div id="' + me.id + '_facsContEvents" class="facsContEvents"></div>';*/
92+
/* */
7293
me.imageLoader = new EdiromOnline.view.window.image.ImageLoader({
7394
viewer: me
7495
});

app/view/window/image/VerovioImage.js

+11
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,16 @@ Ext.define('EdiromOnline.view.window.image.VerovioImage', {
4545

4646
var iframe = Ext.fly(me.id + '_rendContIFrame').dom.contentWindow;
4747
iframe.showMovement(movementId);
48+
},
49+
50+
/*
51+
* Call showMeasure of corresponding iframe.
52+
* @param {string} movementId - The XML-ID of the selected movement.
53+
* @param {string} measureId - The XML-ID of the selected measure.
54+
*/
55+
showMeasure: function (movementId, measureId) {
56+
var me = this;
57+
var iframe = Ext.fly(me.id + '_rendContIFrame').dom.contentWindow;
58+
iframe.showMeasure(movementId, measureId);
4859
}
4960
});

app/view/window/source/MeasureBasedView.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,16 @@ Ext.define('EdiromOnline.view.window.source.MeasureBasedView', {
225225
Ext.Array.each(me.measures.get('measures'), function(m) {
226226

227227
var voice = m['voice'];
228+
var partLabel = m['partLabel'];
228229

229230
if(voice == 'score' || me.parts.getById(voice.substr(1)).get('selected')) {
230231

231232
var viewer = me.viewers.get(voice);
232233

233234
if(typeof viewer == 'undefined') {
234235
viewer = Ext.create('EdiromOnline.view.window.source.HorizontalMeasureViewer', {
235-
owner: me
236+
owner: me,
237+
partLabel: partLabel
236238
});
237239

238240
me.viewers.add(voice, viewer);
@@ -391,6 +393,8 @@ Ext.define('EdiromOnline.view.window.source.HorizontalMeasureViewer', {
391393

392394
border: false,
393395

396+
partLabel: '',
397+
394398
style: {
395399
borderColor: 'black',
396400
borderStyle: 'solid',
@@ -417,12 +421,12 @@ Ext.define('EdiromOnline.view.window.source.HorizontalMeasureViewer', {
417421
var image_server = getPreference('image_server');
418422
var viewer = null;
419423
if(image_server === 'leaflet'){
420-
viewer = Ext.create('EdiromOnline.view.window.image.LeafletFacsimile', {flex: 1, width: '100%'});
424+
viewer = Ext.create('EdiromOnline.view.window.image.LeafletFacsimile', {flex: 1, width: '100%', partLabel: me.partLabel});
421425
}
422426
else if(image_server === 'openseadragon'){
423-
viewer = Ext.create('EdiromOnline.view.window.image.OpenSeaDragonViewer', {flex: 1, width: '100%'});
427+
viewer = Ext.create('EdiromOnline.view.window.image.OpenSeaDragonViewer', {flex: 1, width: '100%', partLabel: me.partLabel});
424428
}else {
425-
viewer = Ext.create('EdiromOnline.view.window.image.ImageViewer', {flex: 1});
429+
viewer = Ext.create('EdiromOnline.view.window.image.ImageViewer', {flex: 1, partLabel: me.partLabel});
426430
}
427431

428432
viewer.on('imageChanged', me.onViewerImageChange, me);

0 commit comments

Comments
 (0)