function resizeBox () {if ((wgCanonicalNamespace=="Page" && (wgAction=="edit" || wgAction=="submit"))&& $(".wikiEditor-ui-left").css("width")==$("#wpTextbox1").css("width"))
{$("#wpTextbox1").attr("rows","10")} else {$("#wpTextbox1").attr("rows","31");}
}
$(document).ready(function () {
$("img[rel='toggle-layout']").attr("onclick","resizeBox()");
resizeBox();
}
);
Rough, but running. :-)
Alex