Matmarex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/53029


Change subject: mediawiki.action.edit.js: remove a weird hack from 2010
......................................................................

mediawiki.action.edit.js: remove a weird hack from 2010

Introduced in aa69029e2 by Roan. No idea what is was supposed to do,
but it clearly didn't do anything.

Also some code conventions and comments fixes. "Explose API", heh.

Change-Id: If2f225c51791b46e25468deb4081ecac67db409a
---
M resources/mediawiki.action/mediawiki.action.edit.js
1 file changed, 7 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/29/53029/1

diff --git a/resources/mediawiki.action/mediawiki.action.edit.js 
b/resources/mediawiki.action/mediawiki.action.edit.js
index 2835c9c..c44c32a 100644
--- a/resources/mediawiki.action/mediawiki.action.edit.js
+++ b/resources/mediawiki.action/mediawiki.action.edit.js
@@ -1,5 +1,5 @@
 ( function ( mw, $ ) {
-       var isReady, toolbar, currentFocused, queue, $toolbar, slice;
+       var isReady, toolbar, $currentFocused, queue, $toolbar, slice;
 
        isReady = false;
        queue = [];
@@ -72,8 +72,8 @@
                 * use sampleText instead of selection if there is none.
                 */
                insertTags: function ( tagOpen, tagClose, sampleText ) {
-                       if ( currentFocused && currentFocused.length ) {
-                               currentFocused.textSelection(
+                       if ( $currentFocused && $currentFocused.length ) {
+                               $currentFocused.textSelection(
                                        'encapsulateSelection', {
                                                'pre': tagOpen,
                                                'peri': sampleText,
@@ -92,16 +92,15 @@
        window.addButton = toolbar.addButton;
        window.insertTags = toolbar.insertTags;
 
-       // Explose API publicly
+       // Expose API publicly
        mw.toolbar = toolbar;
 
        $( document ).ready( function () {
                var buttons, i, b, $iframe;
 
-               // currentFocus is used to determine where to insert tags
-               currentFocused = $( '#wpTextbox1' );
+               // Used to determine where to insert tags
+               $currentFocused = $( '#wpTextbox1' );
 
-               // Populate the selector cache for $toolbar
                $toolbar = $( '#toolbar' );
 
                // Legacy: Merge buttons from mwCustomEditButtons
@@ -149,21 +148,8 @@
                }() );
 
                $( 'textarea, input:text' ).focus( function () {
-                       currentFocused = $(this);
+                       $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 ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/53029
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If2f225c51791b46e25468deb4081ecac67db409a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Matmarex <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to