From 6a36a14203614a9e1cc20a3a8cdab1a2d96b2c1a Mon Sep 17 00:00:00 2001 From: Benjamin Bloomfield Date: Tue, 25 Jul 2023 16:25:58 -0400 Subject: [PATCH] Fix an issue with not including the annotation for psalm toned chants in PDF --- propers.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/propers.js b/propers.js index 88c52e43..bcafc394 100644 --- a/propers.js +++ b/propers.js @@ -94,6 +94,22 @@ $(function(){ if(!LocationHash) return null; return new LocationHash(location.hash); } + function makeAnnotationArrayFromHeader(gabcHeader) { + if(gabcHeader.mode || gabcHeader['office-part']) { + var annotation; + if(gabcHeader['office-part']) annotation = partAbbrev[gabcHeader['office-part'].toLowerCase()]; + if(annotation) { + if(annotation == 'V/.') { + return [annotation]; + } else { + return [annotation, romanNumeral[gabcHeader.mode]]; + } + } else if(gabcHeader.mode) { + return [romanNumeral[gabcHeader.mode]]; + } + } + return + } var gregobaseUrlPrefix = 'http://gregobase.selapa.net/chant.php?id='; var $gradualeOptions = $('#selStyleGraduale>option').clone(); var $alleluiaOptions = $('#selStyleAlleluia>option').clone(); @@ -2090,6 +2106,13 @@ $(function(){ header.mode = mode; delete header.annotationArray; delete header.annotation; + var annotationArray = makeAnnotationArrayFromHeader(header); + if (annotationArray) { + if (annotationArray.length > 1) { + header.annotationArray = annotationArray; + } + header.annotation = annotationArray[0]; + } var useBigInitial = header.initialStyle != '0'; var originalClef = fullGabc.match(regexGabcClef);