Changeset 459acd9 in Klonkt


Ignore:
Timestamp:
06/20/2026 05:09:30 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
183875b
Parents:
3ec691c
Message:

feat(editor): © insert button next to the credit field

No more looking up ©: a button inserts the copyright symbol at the cursor
position in the Owner/credit field.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/partials/track-editor.ejs

    r3ec691c r459acd9  
    194194  border-color: var(--accent);
    195195}
     196
     197/* ── Credit-veld met ©-invoegknop ──────────────────────────── */
     198.te-credit-row { display: flex; gap: 0.4rem; align-items: stretch; }
     199.te-credit-row input { flex: 1; min-width: 0; }
     200.te-sym-btn {
     201  flex: 0 0 auto;
     202  width: 44px; min-height: 44px;
     203  border: 1px solid var(--rule); border-radius: 6px;
     204  background: var(--paper-2); color: var(--ink);
     205  font-size: 1.1rem; cursor: pointer;
     206  transition: border-color 120ms, background 120ms;
     207}
     208.te-sym-btn:hover { border-color: var(--accent); }
    196209
    197210/* ── Cover field with thumb + button + URL ─────────────────── */
     
    389402              <label class="te-field">
    390403                <span>Eigenaar / credit <small>(copyright-houder)</small></span>
    391                 <input type="text" id="te-credit" maxlength="200"
    392                        autocomplete="off" spellcheck="false"
    393                        placeholder="bv. © 2025 Mara Vos"
    394                        value="${esc(track.credit || '')}">
     404                <div class="te-credit-row">
     405                  <input type="text" id="te-credit" maxlength="200"
     406                         autocomplete="off" spellcheck="false"
     407                         placeholder="bv. © 2025 Mara Vos"
     408                         value="${esc(track.credit || '')}">
     409                  <button type="button" class="te-sym-btn" id="te-credit-copyr"
     410                          title="© invoegen" aria-label="Copyright-teken invoegen">©</button>
     411                </div>
    395412              </label>
    396413              <label class="te-field">
     
    611628    }
    612629
     630    // ── ©-teken invoegen in het credit-veld ─────────────────
     631    const copyrBtn = $('#te-credit-copyr');
     632    if (copyrBtn) {
     633      copyrBtn.addEventListener('click', () => {
     634        const inp = $('#te-credit');
     635        if (!inp) return;
     636        const sym = '© ';
     637        const start = inp.selectionStart != null ? inp.selectionStart : inp.value.length;
     638        const end = inp.selectionEnd != null ? inp.selectionEnd : inp.value.length;
     639        inp.value = inp.value.slice(0, start) + sym + inp.value.slice(end);
     640        inp.focus();
     641        const pos = start + sym.length;
     642        try { inp.setSelectionRange(pos, pos); } catch (e) {}
     643      });
     644    }
     645
    613646    // ── Save ────────────────────────────────────────────────
    614647    $('#te-save').addEventListener('click', async () => {
Note: See TracChangeset for help on using the changeset viewer.