mediawiki.action.edit.js: Remove WikiEditor iframe hack from 2010
authorBartosz Dziewoński <matma.rex@gmail.com>
Thu, 3 Apr 2014 20:34:08 +0000 (22:34 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Thu, 3 Apr 2014 20:34:08 +0000 (22:34 +0200)
Introduced in aa69029e2 (r62242) by Roan.

The iframe this refers to is going away for good in I2d736911.

Change-Id: If2f225c51791b46e25468deb4081ecac67db409a

resources/mediawiki.action/mediawiki.action.edit.js

index bbffe79..bcf2c40 100644 (file)
        mw.toolbar = toolbar;
 
        $( function () {
-               var i, b, $iframe, editBox, scrollTop, $editForm;
+               var i, b, editBox, scrollTop, $editForm;
 
-               // currentFocus is used to determine where to insert tags
+               // Used to determine where to insert tags
                $currentFocused = $( '#wpTextbox1' );
 
                // Populate the selector cache for $toolbar
                $( document ).on( 'focus', 'textarea, input:text', function () {
                        $currentFocused = $( this );
                } );
-
-               // HACK: make $currentFocused work with the usability iframe
-               // With proper focus detection support (HTML 5!) this'll be much cleaner
-               // TODO: Get rid of this WikiEditor code from MediaWiki core!
-               $iframe = $( '.wikiEditor-ui-text iframe' );
-               if ( $iframe.length > 0 ) {
-                       $( $iframe.get( 0 ).contentWindow.document )
-                               // for IE
-                               .add( $iframe.get( 0 ).contentWindow.document.body )
-                               .focus( function () {
-                                       $currentFocused = $iframe;
-                               } );
-               }
        });
 
 }( mediaWiki, jQuery ) );