Merge "If a user logs in while not on https, then the user should be sent back to...
[mediawiki.git] / resources / src / mediawiki.action / mediawiki.action.edit.js
blobf88b83667d248962c9650c2b4f09677dcb9d0235
1 /*!
2 * Scripts for action=edit
3 */
4 ( function ( mw, $ ) {
6 $( function () {
7 var editBox, scrollTop, $editForm;
9 // Make sure edit summary does not exceed byte limit
10 $( '#wpSummary' ).byteLimit( 255 );
12 // Restore the edit box scroll state following a preview operation,
13 // and set up a form submission handler to remember this state.
14 editBox = document.getElementById( 'wpTextbox1' );
15 scrollTop = document.getElementById( 'wpScrolltop' );
16 $editForm = $( '#editform' );
17 if ( $editForm.length && editBox && scrollTop ) {
18 if ( scrollTop.value ) {
19 editBox.scrollTop = scrollTop.value;
21 $editForm.submit( function () {
22 scrollTop.value = editBox.scrollTop;
23 } );
25 } );
27 }( mediaWiki, jQuery ) );