Skip to content

Commit

Permalink
Merge pull request #53 from effective-webwork/verovio-neu-measure-nav…
Browse files Browse the repository at this point in the history
…igation

Support for musical sources
  • Loading branch information
MarcMoschSLUB authored Jul 29, 2024
2 parents adee936 + 98a7a94 commit 05313de
Show file tree
Hide file tree
Showing 10 changed files with 208 additions and 524 deletions.
7 changes: 7 additions & 0 deletions Configuration/TypoScript/Plugin/Kitodo/setup.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ plugin.tx_dlf_fulltexttool {
}
}

plugin.tx_dlf_scoretool < plugin.tx_dlf_toolbox
plugin.tx_dlf_scoretool {
settings {
tools = scoretool
}
}

plugin.tx_dlf_imagemanipulationtool < plugin.tx_dlf_toolbox
plugin.tx_dlf_imagemanipulationtool {
settings {
Expand Down
6 changes: 5 additions & 1 deletion Resources/Private/Language/de.locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@
<source><![CDATA[No fulltext in gridpage mode.]]></source>
<target><![CDATA[Keine Volltexte in der Vorschau-Ansicht.]]></target>
</trans-unit>
<trans-unit id="score.no_score_gridpage" approved="yes">
<source><![CDATA[No fulltext in gridpage mode.]]></source>
<target><![CDATA[Keine Notentexte in der Vorschau-Ansicht.]]></target>
</trans-unit>
<trans-unit id="gridpage.preview" approved="yes">
<source><![CDATA[Thumbnail Preview]]></source>
<target><![CDATA[Vorschaubilder]]></target>
Expand Down Expand Up @@ -139,4 +143,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
5 changes: 5 additions & 0 deletions Resources/Private/Less/Controls.less
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@
background-position: -40px 0;
}
}
&.score {
> a, > span {
background-position: -120px 0;
}
}
&.fulltext {
> a, > span {
background-position: -120px 0;
Expand Down
1 change: 1 addition & 0 deletions Resources/Private/Less/Digitalcollections.less
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
@import "Modules/Newspapers.less";
@import "Modules/Pagegrid.less";
@import "Modules/Fulltext.less";
@import "Modules/Score.less";
@import "Modules/Indocsearch.less";

// Theming Options (see '/Resources/Private/Less/Themes' for more)
Expand Down
77 changes: 77 additions & 0 deletions Resources/Private/Less/Modules/Score.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
*
* Score
* ================================================
* Specials for the score view
*
* Author: Matthias Richter <[email protected]>
*
*/

.fulltext-container {
position: absolute;
top: 55px;
right: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.95);
text-align: left;
.transition();
#tx-dlf-score, {
position: relative;
top: 0;
right: 0;
width: 100%;
height: 100%;
padding: 60px 20px 60px 0px;
overflow: hidden;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
line-height: 1.6em;
font-size: 16px;
color: @basegrey-color;
display: none;
&:empty {
padding: 0;
}
.textline {
&:after {
content: " ";
}
}
.score-visible & {
display: block;
}
}
.fullscreen & {
top: 0;
}
@media screen and (min-width: @tabletViewportWidth) {
#tx-dlf-score {
padding: 60px 70px 60px 0px;
}
}
@media screen and (min-width: @tabletLandscapeViewportWidth) {
top: 0;
max-width: 71.7%;
&:before {
height: 100px;
}
&:after {
height: 80px;
}
#tx-dlf-score {
padding: 80px 100px 60px 30px;
line-height: 1.8;
border-left: 1px solid @secondary-color-light;
.highlight {
padding: 3px 0;
background: lighten(@secondary-color-light,30%);
}
}
}
@media screen and (min-width: @desktopViewportWidth) {
max-width: 50%;
}
}

// EOF
513 changes: 0 additions & 513 deletions Resources/Private/Partials/KitodoPageView.html.orig

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
action="main"
pageUid="{settings.targetPid}"
additionalParams="{f:if(condition:'{child.id}', then:'{\'tx_dlf[id]\':child.id, \'tx_dlf[page]\':child.page}', else: '{\'tx_dlf[page]\':child.page}')}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}"
addQueryString="1"
addQueryStringMethod="GET"
title="{f:if(condition:'{child.title}', then: '{child.title}', else: '{child.type}')}">
Expand Down
86 changes: 77 additions & 9 deletions Resources/Private/Plugins/Kitodo/Templates/Navigation/Main.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@
<f:if condition="{viewData.requestData.double}">
<f:then>
<div class="tx-dlf-navigation-double">
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[double]':'0'}">
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[double]':'0'}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="doublePageOn"/>
</f:link.action>
</div>
<div class="tx-dlf-navigation-double+">
<f:if condition="{viewData.requestData.double} && ({viewData.requestData.page} < {numPages})">
<f:then>
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page + 1}'}">
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page + 1}'}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="doublePage+1"/>
</f:link.action>
</f:then>
Expand All @@ -45,7 +47,8 @@
</div>
</f:then>
<f:else>
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[double]':'1'}">
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[double]':'1'}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="doublePageOn"/>
</f:link.action>
</f:else>
Expand All @@ -66,7 +69,8 @@
<span class="first">
<f:if condition="{viewData.requestData.page} > 1">
<f:then>
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[page]':'1'}" class="first" >
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[page]':'1'}" class="first"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="firstPage"/>
</f:link.action>
</f:then>
Expand All @@ -83,7 +87,8 @@
<span class="rwnd">
<f:if condition="{viewData.requestData.page} > {pageSteps}">
<f:then>
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page - pageSteps}'}">
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page - pageSteps}'}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="backXPages" arguments="{0: '{pageSteps}'}"/>
</f:link.action>
</f:then>
Expand All @@ -100,7 +105,8 @@
<span class="prev">
<f:if condition="{viewData.requestData.page} > {viewData.requestData.double + 1}">
<f:then>
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page - 1 - viewData.requestData.double}'}">
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page - 1 - viewData.requestData.double}'}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="prevPage"/>
</f:link.action>
</f:then>
Expand Down Expand Up @@ -143,7 +149,8 @@
<span class="next">
<f:if condition="{viewData.requestData.page + viewData.requestData.double} < {numPages}">
<f:then>
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page + 1 + viewData.requestData.double}'}">
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page + 1 + viewData.requestData.double}'}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="nextPage"/>
</f:link.action>
</f:then>
Expand All @@ -160,7 +167,8 @@
<span class="fwd">
<f:if condition="{viewData.requestData.page} <= {numPages - pageSteps}">
<f:then>
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page + pageSteps}'}">
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[page]':'{viewData.requestData.page + pageSteps}'}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="forwardXPages" arguments="{0: '{pageSteps}'}"/>
</f:link.action>
</f:then>
Expand All @@ -177,7 +185,8 @@
<span class="last">
<f:if condition="{viewData.requestData.page} < {numPages - viewData.requestData.double}">
<f:then>
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[page]':'{numPages - viewData.requestData.double}'}">
<f:link.action addQueryString="1" addQueryStringMethod="GET" additionalParams="{'tx_dlf[page]':'{numPages - viewData.requestData.double}'}"
argumentsToBeExcludedFromQueryString="{0: 'tx_dlf[measure]'}">
<f:translate key="lastPage"/>
</f:link.action>
</f:then>
Expand Down Expand Up @@ -226,4 +235,63 @@
</a>
</li>
</f:section>

<f:section name="render.measureBack">
<f:if condition="{numMeasures} > 0">
<f:then>
<div class="measureBacks" style="top: 100px;">
<span class="prev">
<f:if condition="{currentMeasure} > 1}">
<f:then>
<f:variable name="prevMeasure" value="{currentMeasure - 1}" />
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[measure]':'{currentMeasure - 1}', 'tx_dlf[page]':'{measurePages.{prevMeasure}}'}">
<f:translate key="prevMeasure"/>
</f:link.action>
</f:then>
<f:else>
<span title="{f:translate(key: 'prevPage')}">
<f:translate key="prevMeasure"/>
</span>
</f:else>
</f:if>
</span>
</div>
</f:then>
</f:if>
</f:section>

<f:section name="render.measureForward">
<f:if condition="{numMeasures} > 0">
<f:then>
<div class="measureFwds" style="top: 200px;">
<span class="next">
<f:if condition="{currentMeasure} < {numMeasures}">
<f:then>
<f:if condition="{currentMeasure} > 0">
<f:then>
<f:variable name="nextMeasure" value="{currentMeasure + 1}" />
<f:link.action addQueryString="1" additionalParams="{'tx_dlf[measure]':'{currentMeasure + 1}', 'tx_dlf[page]':'{measurePages.{nextMeasure}}'}">
<f:translate key="nextMeasure"/>
</f:link.action>
</f:then>
<f:else>
<f:link.action
addQueryString="1" additionalParams="{'tx_dlf[measure]':'1', 'tx_dlf[page]':'{measurePages.1}'}">
<f:translate key="nextMeasure"/>
</f:link.action>
</f:else>
</f:if>
</f:then>
<f:else>
<span title="{f:translate(key: 'nextMeasure')}">
<f:translate key="nextMeasure"/>
</span>
</f:else>
</f:if>
</span>
</div>
</f:then>
</f:if>
</f:section>

</html>
34 changes: 34 additions & 0 deletions Resources/Private/Plugins/Kitodo/Templates/Toolbox/Main.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,32 @@
</f:then>
</f:if>

<f:if condition="{settings.tools} == 'scoretool'">
<f:then>
<f:if condition="{score}">
<f:then>
<a class="select switchoff" id="tx-dlf-tools-score-0" title=""
data-dic="fulltext:{f:translate(key: 'tools.score')}
;fulltext-on:{f:translate(key: 'tools.score.on')}
;fulltext-off:{f:translate(key: 'tools.score.off')}
;activate-score-initially:{activateScoreInitially}
;score-scroll-element:{settings.scoreScrollElement}
;search-hl-parameters:{settings.searchHlParameters}">
&nbsp;
</a>
<a class="select switchoff" id="tx-dlf-tools-midi" title=""
data-dic=""> &nbsp;
</a>
</f:then>
<f:else>
<span class="no-score">
<f:translate key="tools.fulltext.not-available"/>
</span>
</f:else>
</f:if>
</f:then>
</f:if>

<f:if condition="{renderFulltextTool}">
<f:then>
<f:if condition="{fulltext}">
Expand Down Expand Up @@ -150,6 +176,14 @@
</li>
</f:then>
</f:if>
<li>
<a href="#" id="tx_dlf_mididownload" class="download-document">
<f:translate key="mididownload"/> (MIDI)
</a>
<a href="#" id="tx_dlf_scoredownload" class="download-document">
<f:translate key="scoredownload"/> (PDF)
</a>
</li>
</f:then>
</f:if>

Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/Css/Digitalcollections.css

Large diffs are not rendered by default.

0 comments on commit 05313de

Please sign in to comment.