User:Gryllida/js/editBoxResize.js

var editform = document.querySelector('#editform'); if ( editform ) { mw.loader.using(['mediawiki.api'], function {	// hide bulky (C) notice	$('#editpage-copywarn').hide;	// scroll to the beginning of the edit box	var yForm = editform.getBoundingClientRect.y;	var yBody = document.body.getBoundingClientRect.y;	window.scrollTo(0, yForm - yBody);	// resize the edit box for the 'save changes' button to fit screen	var dy = document.querySelector('#wpSave').getBoundingClientRect.y - $(window).height + document.querySelector('#wpSave').offsetHeight + 32;	var dRows = $('#wpTextbox1').attr('rows') * dy / document.querySelector('#wpTextbox1').offsetHeight;	$('#wpTextbox1').attr('rows', $('#wpTextbox1').attr('rows') - dRows); }); }