Use visibleByteLimit on Special:MovePage
[lhc/web/wiklou.git] / resources / src / mediawiki.special / mediawiki.special.movePage.js
index 9af81b8..2e980ac 100644 (file)
@@ -1,11 +1,15 @@
 /*!
  * JavaScript for Special:MovePage
  */
-jQuery( function () {
-       // Infuse for pretty dropdown
-       OO.ui.infuse( 'wpNewTitle' );
-       // Limit to 255 bytes, not characters
-       OO.ui.infuse( 'wpReason' ).$input.byteLimit();
-       // Infuse for nicer "help" popup
-       OO.ui.infuse( 'wpMovetalk-field' );
-} );
+( function ( mw, $ ) {
+       $( function () {
+               // Infuse for pretty dropdown
+               OO.ui.infuse( $( '#wpNewTitle' ) );
+               // Limit to bytes, not characters
+               mw.widgets.visibleByteLimit( OO.ui.infuse( $( '#wpReason' ) ) );
+               // Infuse for nicer "help" popup
+               if ( $( '#wpMovetalk-field' ).length ) {
+                       OO.ui.infuse( $( '#wpMovetalk-field' ) );
+               }
+       } );
+}( mediaWiki, jQuery ) );