yCanta / yCanta2

yCanta rewrite as an offline first installable website: an intuitive song manager featuring type-to-search presentation mode and PDF songbook export.
https://ycanta.github.io/yCanta2
1 stars 0 forks source link

copy paste issue with song chunks #11

Open carlhemp opened 5 years ago

carlhemp commented 5 years ago

When you copy a chunk in android into a new one, often the chords are not recognized when you click save. Resaving does not fix it.

carlhemp commented 5 years ago

Seems to be wrapping lines in div's, on ff and chrome

<song data-rev="8-0090366f966a8ffeedd995066b262832" data-id="s-aSong.song">
    <stitle>Jesu Jesu</stitle>
    <authors>
        <author>Tom Colvin</author>,
        <author>yolo</author>
    </authors>
    <scripture_ref>
        <scrip_ref></scrip_ref>
    </scripture_ref>
    <introduction></introduction>
    <key>E</key>
    <div class="transpose-keys"><a id="Ab">Ab</a><a id="A">A</a><a id="A_">A#</a><a id="Bb">Bb</a><a id="B">B</a><a id="C">C</a><a id="C_">C#</a><a id="Db">Db</a><a id="D">D</a><a id="D_">D#</a><a id="Eb">Eb</a><a id="E" class="selected">E</a><a id="F">F</a><a id="F_">F#</a><a id="Gb">Gb</a><a id="G">G</a><a id="G_">G#</a></div>
    <categories>
        <cat>Children's Songs</cat>,
        <cat>Humility</cat>,
        <cat>Love for Others</cat>,
        <cat>Servanthood</cat>
    </categories>
    <cclis>true</cclis>
    <chunk type="chorus">
        <line>
            <c>E</c>Jesu, Jesu,</line>
        <line>Fill us with you
            <c>A</c>love,</line>
        <line>Show us how to
            <c>E</c>serve</line>
        <line>The neighbors we
            <c>B</c> have from
            <c>E</c>You.</line>
    </chunk>
    <chunk type="verse">
        <line>
            <c>E</c>Jesu, Jesu,</line>
        <line>Fill us with you
            <c>A</c>love,</line>
        <line>Show us how to
            <c>E</c>serve</line>
        <line>The neighbors we
            <c>B</c> have from
            <c>E</c>You.</line>
        <line></line>
    </chunk>
    <chunk type="verse">
        <line>E
            <div>Jesu, Jesu,</div>
            <div> A </div>
            <div>Fill us with you love,</div>
            <div> E </div>
            <div>Show us how to serve</div>
            <div> B E </div>
            <div>The neighbors we have from You.</div>
        </line>
    </chunk>
    <copyright>© 1969 Hope Publishing Company</copyright>
</song>
</div>
carlhemp commented 2 years ago

Will need to fully ensure that all formatting is stripped when copy/pasted.

carlhemp commented 2 years ago

https://stackoverflow.com/questions/12027137/javascript-trick-for-paste-as-plain-text-in-execcommand This should do the trick.

carlhemp commented 5 months ago

if #116 works out, this should fix this bug.

carlhemp commented 3 weeks ago

Explore if the issue is with the toTextArea function - it should be doing copy/paste as plain text.

carlhemp commented 1 week ago

Possible solution https://css-tricks.com/auto-growing-inputs-textareas/

Would have to rewrite the add/delete chunk by adding lines code. May solve some issues that we're having on mobile with copy/paste. Could still hack in double enter new chunk creation/deletion code.