diff --git a/songs2slides/static/create.css b/songs2slides/static/create.css index 1d8b1e5..738d53f 100644 --- a/songs2slides/static/create.css +++ b/songs2slides/static/create.css @@ -66,7 +66,7 @@ details { margin-bottom: 1rem; } textarea { - margin-top: 0.5rem; + margin: 0.5rem 0; width: 100%; height: 15rem; resize: vertical; diff --git a/songs2slides/static/create.js b/songs2slides/static/create.js index fe5b135..60abb32 100644 --- a/songs2slides/static/create.js +++ b/songs2slides/static/create.js @@ -38,9 +38,7 @@ addEventListener('submit', () => { // Show loading spinner document.getElementById('post-submit').hidden = false - if (STEP === 2) { - save_lyrics() - } else if (STEP === 3) { + if (STEP === 3) { // Save settings storage_set('title-slides', form['title-slides'].checked) storage_set('blank-slides', form['blank-slides'].checked) @@ -109,6 +107,15 @@ function save_lyrics() { } } +function revert_lyrics(n) { + form[`lyrics-${n}`].value = DEFAULT_LYRICS[n-1] + if (DEFAULT_LYRICS[n-1] === '') { + document.getElementsByTagName('details')[n-1].classList.add('missing') + update_missing_message() + } + save_lyrics() +} + function load_lyrics() { songs = document.getElementsByTagName('details') for (let i = 1; `title-${i}` in form; i++) { @@ -122,7 +129,10 @@ function load_lyrics() { songs[i - 1].open = false } } + update_missing_message() +} +function update_missing_message() { // Update missing label const number = document.getElementsByClassName('missing').length document.getElementById('missing-count').textContent = number diff --git a/songs2slides/static/revert.svg b/songs2slides/static/revert.svg new file mode 100644 index 0000000..ade5dc4 --- /dev/null +++ b/songs2slides/static/revert.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/songs2slides/templates/create-step-2.html b/songs2slides/templates/create-step-2.html index 7a15c37..d3df466 100644 --- a/songs2slides/templates/create-step-2.html +++ b/songs2slides/templates/create-step-2.html @@ -54,8 +54,17 @@
+ Lyric modifications are saved across sessions + +
{% endfor %} @@ -77,5 +86,10 @@