diff --git a/android-client/web/app.html b/android-client/web/app.html index 15b8791..38c7cb3 100644 --- a/android-client/web/app.html +++ b/android-client/web/app.html @@ -301,7 +301,7 @@ jamais - la fin d'une URL longue restait hors d'atteinte. */ -webkit-user-select: text; user-select: text; } - .field-in.multi { height: auto; padding: 12px 44px 12px 14px; resize: none; + .field-in.multi { height: auto; min-height: 46px; overflow: hidden; padding: 12px 44px 12px 14px; resize: none; line-height: 1.35; word-break: break-all; display: block; } .field-in::placeholder { color: var(--muted); } /* La fleche dit si le panneau est deplie, et de quel bouton il descend. */ @@ -572,7 +572,7 @@ - @@ -778,6 +778,7 @@ document.getElementById('settings').addEventListener('click', function (ev) { if (!id) return; var el = document.getElementById(id); el.value = ''; + if (el.classList.contains('multi')) autoGrow(el); el.focus(); }); @@ -1629,6 +1630,7 @@ function openSettings() { document.getElementById('secCode').hidden = !vaultOpen; showLog(false); document.body.classList.add('on-settings'); + autoGrow(document.getElementById('sUrl')); // mesurable seulement une fois affiche send('state?view=settings'); } @@ -1639,6 +1641,16 @@ function openSettings() { // https://git.example.com/OWNER/REPO (ou .../src/branch/main/FICHIER) devient // l'URL de l'API des contenus. Une URL d'API ou d'endpoint PHP passe telle quelle, // et une forme non reconnue aussi - Sync dira alors ce qui ne va pas. +// LA ZONE DE L'URL PREND LA HAUTEUR DE SON TEXTE : une ligne pour une adresse +// courte, davantage si elle passe a la ligne. +function autoGrow(el) { + el.style.height = 'auto'; + el.style.height = el.scrollHeight + 'px'; +} +document.addEventListener('input', function (ev) { + if (ev.target.classList && ev.target.classList.contains('multi')) autoGrow(ev.target); +}); + // L'inverse, pour l'affichage : l'URL d'API se relit comme l'adresse du depot. function shortRepoUrl(u) { var m = /^(https?:\/\/[^\/]+)\/api\/v1\/repos\/([^\/]+)\/([^\/]+)\/contents\/(.+)$/i.exec(u || ''); @@ -1657,6 +1669,7 @@ document.getElementById('sSave').addEventListener('click', function () { var sUrl = document.getElementById('sUrl'); elUrl.value = normalizeRepoUrl(sUrl.value); sUrl.value = shortRepoUrl(elUrl.value); + autoGrow(sUrl); elTok.value = document.getElementById('sTok').value.trim(); elPwd.value = document.getElementById('sPwd').value; pushConfig();