RCC: Write blog posts online

This commit is contained in:
mmk2410 2015-11-17 22:46:20 +01:00
parent 5568943994
commit e8a2557c4a
6 changed files with 378 additions and 222 deletions

17
rcc/res/rcc.js Normal file
View file

@ -0,0 +1,17 @@
window.onload = function () {
var t = document.getElementsByTagName('textarea')[0];
var offset = !window.opera ? (t.offsetHeight - t.clientHeight) : (t.offsetHeight + parseInt(window.getComputedStyle(t, null).getPropertyValue('border-top-width')));
var resize = function (t) {
t.style.height = 'auto';
t.style.height = (t.scrollHeight + offset ) + 'px';
}
t.addEventListener && t.addEventListener('input', function (event) {
resize(t);
});
t['attachEvent'] && t.attachEvent('onkeyup', function () {
resize(t);
});
}