Updated Web backend now with multi-user, misc data and endpoints improvements

This commit is contained in:
2024-08-12 02:03:47 +02:00
parent 6ebc68127e
commit 5ba0df43c4
16 changed files with 341 additions and 180 deletions

View File

@ -0,0 +1,30 @@
window.inputFrameResize = (function(height){
var frameEl = document.querySelector('.input-frame');
var frameWindow = frameEl.querySelector('iframe').contentWindow;
var textEl = frameWindow.document.querySelector('form > [name="text"]');
textEl.style.minHeight = 0;
frameEl.style.height = '1em';
//if (textEl.scrollHeight > frameWindow.document.documentElement.clientHeight) {
if (textEl.scrollHeight / parseInt(getComputedStyle(textEl).height.slice(0, -2)) < 5) {
frameEl.style.height = ('calc(3em + ' + (textEl.scrollHeight + 4) + 'px)');
frameEl.dataset.scrollHeightOld = textEl.scrollHeight;
} else {
frameEl.style.height = ('calc(3em + ' + (parseInt(frameEl.dataset.scrollHeightOld) + 4) + 'px)');
}
textEl.style.minHeight = null;
/* if (!frameEl.dataset.height) {
frameEl.dataset.height = 0;
}
if (frameEl.dataset.height > )
frameEl.style.height = ('calc(4em + ' + height + 'px)');
frameEl.dataset.height = height;
*/
});
if (document.documentElement.className.split(' ').includes('form')) {
var intervalFocus = setInterval(function(){
try {
document.querySelector('form > [name="text"]').focus();
clearInterval(intervalFocus);
} catch(err) {}
}, 100);
}