diff --git a/res/less/song.less b/res/less/song.less index f98d06d..2edfdc8 100644 --- a/res/less/song.less +++ b/res/less/song.less @@ -67,7 +67,7 @@ div.chorus, p.chorus { font-style: italic; } -button, select#transposeSelect { +button, select.transposeSelect { min-width: 2em; min-height: 2em; padding: .4em; @@ -88,7 +88,7 @@ button, select#transposeSelect { } } -select#transposeSelect { +select.transposeSelect { -webkit-appearance: none; -moz-appearance: none; font-weight: bold; diff --git a/res/static/song.js b/res/static/song.js index 40e6529..164507a 100644 --- a/res/static/song.js +++ b/res/static/song.js @@ -11,7 +11,8 @@ function size(steps) { currSize = SIZE_STEPS.indexOf(100); } currSize += steps; - document.getElementById('wholeSongDiv').style.fontSize = SIZE_STEPS[currSize] + '%'; + for (let div of document.getElementsByClassName('fullsong')) + div.style.fontSize = SIZE_STEPS[currSize] + '%'; } /* =========================================== @@ -25,13 +26,18 @@ CHORDS_ENG = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'Bb', 'B'] /** Changes all chords to a given semitone relative to the original */ -function transpose(n) { - transposeAdd(n - getTranspose()) +function transpose(n, song) { + transposeAdd(n - getTranspose(song), song) } /** Transposes all chords by n steps */ -function transposeAdd(n) { - for (c of document.getElementsByClassName('c')) { +function transposeAdd(n, song) { // TODO use song! + let div; + if (song) + div = document.getElementById("song" + song); + else + div = document.getElementsByClassName("fullsong")[0]; + for (c of div.getElementsByClassName('c')) { chord = c.innerHTML nbsp = chord.endsWith(" ") if (nbsp) { @@ -45,17 +51,21 @@ function transposeAdd(n) { c.innerHTML = CHORDS_LAT[j] + (nbsp ? " " : "") } - setTransposeSelector(getTranspose() + n) + setTransposeSelector(getTranspose(song) + n, song); } -function setTransposeSelector(n) { +function setTransposeSelector(n, song) { while (n > 6) { n -= 12 } while (n < -6) { n += 12 } - ts = document.getElementById("transposeSelect") + let ts; + if (song) + ts = document.getElementById("transposeSelect" + song); + else + ts = document.getElementById("transposeSelect"); if (n > 0) { ts.value = "+" + n } else { @@ -63,7 +73,9 @@ function setTransposeSelector(n) { } } -function getTranspose() { +function getTranspose(song) { + if (song) + return Number.parseInt(document.getElementById("transposeSelect" + song).value) return Number.parseInt(document.getElementById("transposeSelect").value) } diff --git a/res/templates/header.html b/res/templates/header.html index 09e6a02..befe946 100644 --- a/res/templates/header.html +++ b/res/templates/header.html @@ -6,6 +6,8 @@
  • Parroquia San Leandro
  • Grabaciones
  • Cancionero en PDF
  • +
  • Preparar misa
  • +
  • ¿Cuándo se entra?
  • {% endif %} diff --git a/res/templates/preparar-misa.html b/res/templates/preparar-misa.html new file mode 100644 index 0000000..54317d6 --- /dev/null +++ b/res/templates/preparar-misa.html @@ -0,0 +1,204 @@ + + + + {% include "head.html" with path=path title=title only %} + + + + + + +{% include "header.html" %} +
    +

    Preparar una misa

    +

    A continuación puedes crear una web con una lista de canciones y + .

    +

    Si prefieres crear un PDF, pulsa aquí.

    +

    + + + +

    +

    + + + + + +

    + + + +

    Copia y comparte el enlace: tus canciones

    + +
    + +
    + +{% include "footer.html" %} + + diff --git a/res/templates/song.html b/res/templates/song.html index 2b54893..a8d32a7 100644 --- a/res/templates/song.html +++ b/res/templates/song.html @@ -31,7 +31,7 @@ - @@ -58,7 +58,7 @@ {% endif %} {% endif %}

    Canción

    -
    +