2 * Scripts for action=edit at domready
4 jQuery( function ( $ ) {
5 var editBox, scrollTop, $editForm;
7 // Make sure edit summary does not exceed byte limit
8 $( '#wpSummary' ).byteLimit( 255 );
10 // Restore the edit box scroll state following a preview operation,
11 // and set up a form submission handler to remember this state.
12 editBox = document.getElementById( 'wpTextbox1' );
13 scrollTop = document.getElementById( 'wpScrolltop' );
14 $editForm = $( '#editform' );
15 if ( $editForm.length && editBox && scrollTop ) {
16 if ( scrollTop.value ) {
17 editBox.scrollTop = scrollTop.value;
19 $editForm.submit( function () {
20 scrollTop.value = editBox.scrollTop;