feat: mandatory auto-generated passwords for share links + admin password copy/regeneration + password gate rate limiting

This commit is contained in:
Pontoporeia
2026-05-12 13:50:13 +02:00
parent 8bb0b3a1f2
commit 9152b120e8
15 changed files with 294 additions and 68 deletions

View File

@@ -0,0 +1,30 @@
/**
* acces-password.js — copy text to clipboard helper.
*
* Usage:
* copyTextToClipboard('some text')
*
* Provides visual feedback on the originating button.
*/
(function () {
'use strict';
window.copyTextToClipboard = function (text) {
if (!text) return;
navigator.clipboard.writeText(text).then(function () {
var btn = window.event && window.event.target ? window.event.target.closest('button') : null;
if (btn) {
var origTitle = btn.getAttribute('title') || '';
var origHTML = btn.innerHTML;
btn.setAttribute('title', '\u2713 Copi\u00e9');
btn.innerHTML = '\u2713';
setTimeout(function () {
btn.setAttribute('title', origTitle);
btn.innerHTML = origHTML;
}, 1200);
}
}).catch(function () {
// Clipboard write failed — silently ignore
});
};
})();