35 lines
1 KiB
JavaScript
35 lines
1 KiB
JavaScript
function formkey() {
|
|
return document.getElementById("formkey").innerHTML;
|
|
}
|
|
|
|
function autoExpand (field) {
|
|
xpos=window.scrollX;
|
|
ypos=window.scrollY;
|
|
|
|
field.style.height = 'inherit';
|
|
|
|
var computed = window.getComputedStyle(field);
|
|
|
|
var height = parseInt(computed.getPropertyValue('border-top-width'), 10)
|
|
+ parseInt(computed.getPropertyValue('padding-top'), 10)
|
|
+ field.scrollHeight
|
|
+ parseInt(computed.getPropertyValue('padding-bottom'), 10)
|
|
+ parseInt(computed.getPropertyValue('border-bottom-width'), 10)
|
|
+ 32;
|
|
|
|
field.style.height = height + 'px';
|
|
|
|
window.scrollTo(xpos,ypos);
|
|
};
|
|
|
|
|
|
document.addEventListener('input', function (event) {
|
|
if (event.target.tagName.toLowerCase() !== 'textarea') return;
|
|
autoExpand(event.target);
|
|
}, false);
|
|
|
|
function expandDesktopImage(image) {
|
|
document.getElementById("desktop-expanded-image").src = image.replace("200w_d.webp", "giphy.webp");
|
|
document.getElementById("desktop-expanded-image-link").href = image;
|
|
document.getElementById("desktop-expanded-image-wrap-link").href=image;
|
|
};
|