diff --git a/canticumMap.json b/canticumMap.json index 3f2ddd9e..6cea8e95 100644 --- a/canticumMap.json +++ b/canticumMap.json @@ -1 +1,55 @@ -{"Benedictus":{"ref":"Luc 1: 68-79","map":[0,1,2,3,4,5,6,7,8,9,10,11]},"Magnificat":{"ref":"Luc 1: 46-55","map":[0,1,2,3,4,5,6,7,8,9]},"Nunc dimittis":{"ref":"Luc 2: 29-32","map":[0,1,2,3]},"Canticum Annae":{"ref":"1 Reg 2: 1-10","map":[0,2,3,5,6,8,9,10,13,14]},"Canticum David":{"ref":"1 Par 29: 10-13","map":[0,1,4,6]},"Canticum Ecclesiastici":{"ref":"Eccli 36: 1-16","map":[0,1,3,4,5,6,6,7,7,8,9,10,11,13,14,15]},"Canticum Ezechiae":{"ref":"Is 38: 10-20","map":[0,1,3,5,6,8,10,10,12,13,14]},"Canticum Habacuc":{"ref":"Ha 3: 2-19","map":[0,3,5,6,7,10,11,13,14,16,17,18,20,22,23,26,29,30]},"Canticum Isaiae":{"ref":"Is 45: 15-25","map":[0,1,2,3,5,7,9,11,12,14,15]},"Canticum Isaiae (alterum)":{"ref":"Is 53: 1-5","map":[0,1,3,5,7]},"Canticum Jeremiae":{"ref":"Jer 31: 10-14","map":[0,2,3,6,8]},"Canticum Judith":{"ref":"Judith 16: 15-21","map":[0,1,2,4,5,6,7]},"Canticum Moysis":{"ref":"Exod 15: 1-19","map":[0,1,3,3,4,5,5,6,8,10,11,12,12,14,15,16,18,19,20]},"Canticum Moysis (Deut)":{"ref":"Deut 32: 1-18","map":[0,1,2,3,4,5,7,9,11,12,14,16,17,19,21,23,24,26]},"Canticum Tobiae":{"ref":"Tob 13: 1-10","map":[0,1,2,3,5,6,7,8,9,10]}} \ No newline at end of file +{ + "Benedictus": { + "ref": "Luc 1: 68-79", + "map": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] + }, + "Magnificat": { + "ref": "Luc 1: 46-55", + "map": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + }, + "Nunc dimittis": { "ref": "Luc 2: 29-32", "map": [0, 1, 2, 3] }, + "Canticum Annae": { + "ref": "1 Reg 2: 1-10", + "map": [0, 2, 3, 5, 6, 8, 9, 10, 13, 14] + }, + "Canticum David": { "ref": "1 Par 29: 10-13", "map": [0, 1, 4, 6] }, + "Canticum Ecclesiastici": { + "ref": "Eccli 36: 1-16", + "map": [0, 1, 3, 4, 5, 6, 6, 7, 7, 8, 9, 10, 11, 13, 14, 15] + }, + "Canticum Ezechiae": { + "ref": "Is 38: 10-20", + "map": [0, 1, 3, 5, 6, 8, 10, 10, 12, 13, 14] + }, + "Canticum Habacuc": { + "ref": "Ha 3: 2-19", + "map": [0, 3, 5, 6, 7, 10, 11, 13, 14, 16, 17, 18, 20, 22, 23, 26, 29, 30] + }, + "Canticum Isaiae": { + "ref": "Is 45: 15-25", + "map": [0, 1, 2, 3, 5, 7, 9, 11, 12, 14, 15] + }, + "Canticum Isaiae (alterum)": { "ref": "Is 53: 1-5", "map": [0, 1, 3, 5, 7] }, + "Canticum Jeremiae": { "ref": "Jer 31: 10-14", "map": [0, 2, 3, 6, 8] }, + "Canticum Judith": { + "ref": "Judith 16: 15-21", + "map": [0, 1, 2, 4, 5, 6, 7] + }, + "Canticum Moysis": { + "ref": "Exod 15: 1-19", + "map": [0, 1, 3, 3, 4, 5, 5, 6, 8, 10, 11, 12, 12, 14, 15, 16, 18, 19, 20] + }, + "Canticum Moysis (Deut)": { + "ref": "Deut 32: 1-18", + "map": [0, 1, 2, 3, 4, 5, 7, 9, 11, 12, 14, 16, 17, 19, 21, 23, 24, 26] + }, + "Canticum Tobiae": { + "ref": "Tob 13: 1-10", + "map": [0, 1, 2, 3, 5, 6, 7, 8, 9, 10] + }, + "Canticum Isaiae (35)": { + "ref": "Is 35: 1-7", + "text": "Lætábitur desérta et ínvia: * et exsultábit solitúdo, et florébit quasi lílium.\nGlória Líbani data est ei, * decor Carméli, et Saron.\nIpsi vidébunt glóriam Dómini, * et decórem Dei nostri.\nConfortáte manus dissolútas, * et génua debília roboráte.\nTunc aperiéntur óculi cæcórum, * et aures surdórum patébunt.\nTunc sáliet sicut cervus claudus, * et apérta erit lingua mutórum.\nQuia scissæ sunt in desérto aquæ, et torréntes in solitúdine.\nEt quæ erat árida, erit in stagnum, * et sítiens in fontes aquárum.", + "map": [0, 1, 3, 3, 4, 5, 6] + } +} diff --git a/propersdata.js b/propersdata.js index aca8b320..1182e7da 100644 --- a/propersdata.js +++ b/propersdata.js @@ -2409,7 +2409,7 @@ var proprium = { "grID": 1007, "gbid": "advent3", "inVerses": "Ps 84: 3-5, 7-8, 10-12, 14", - "coVerses": "Isaiae 35: 1, 2-3, 5-7" + "coVerses": "Is 35: 1, 2-3, 5-7" }, "Adv3w": { "inID": 79, diff --git a/verseRef.js b/verseRef.js index 4fc37aaf..2dc4fbdc 100644 --- a/verseRef.js +++ b/verseRef.js @@ -70,6 +70,7 @@ Ref.prototype.getLinesFromLiber = function() { }); } var book = mapBooks[self.book] || self.book; + var text = null; if(book in canticumMapByFile) { psalm = book; map = canticumMapByFile[book].map; @@ -81,11 +82,12 @@ Ref.prototype.getLinesFromLiber = function() { var startVerse = Object.keys(chapterMap).map(function(i) { return parseInt(i); }).filter(function(i) { return i<=self.verse; }).sort().slice(-1)[0]; map = chapterMap[startVerse]; psalm = map.file; + text = map.text; map = map.map; } } - return $.get(urlRoot+"psalms/"+psalm).pipe(function(liber) { + function produceResult(liber) { liber = liber.trim().replace(/\r\n?/g,'\n').split('\n'); return [].concat.apply([], map.map(function(a, index) { var b = map[index + 1], @@ -105,7 +107,9 @@ Ref.prototype.getLinesFromLiber = function() { } return []; })); - }); + } + if (text) return produceResult(text); + return $.get(urlRoot+"psalms/"+psalm).pipe(produceResult); } function refArrayString(array) { if(!array.length) return "";