Vector: Move 'editwarning' feature from Vector extension
[lhc/web/wiklou.git] / resources / mediawiki.action / mediawiki.action.edit.js
index bd07cd0..2835c9c 100644 (file)
@@ -24,7 +24,7 @@
                                selectText: selectText
                        };
                }
-               var $image = $('<img>', {
+               var $image = $( '<img>', {
                        width : 23,
                        height: 22,
                        src   : b.imageFile,
@@ -71,7 +71,7 @@
                 * Apply tagOpen/tagClose to selection in textarea,
                 * use sampleText instead of selection if there is none.
                 */
-               insertTags: function ( tagOpen, tagClose, sampleText, selectText ) {
+               insertTags: function ( tagOpen, tagClose, sampleText ) {
                        if ( currentFocused && currentFocused.length ) {
                                currentFocused.textSelection(
                                        'encapsulateSelection', {
@@ -96,7 +96,7 @@
        mw.toolbar = toolbar;
 
        $( document ).ready( function () {
-               var buttons, i, b, iframe;
+               var buttons, i, b, $iframe;
 
                // currentFocus is used to determine where to insert tags
                currentFocused = $( '#wpTextbox1' );
 
                // HACK: make currentFocused work with the usability iframe
                // With proper focus detection support (HTML 5!) this'll be much cleaner
-               iframe = $( '.wikiEditor-ui-text iframe' );
-               if ( iframe.length > 0 ) {
-                       $( iframe.get( 0 ).contentWindow.document )
+               // 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 )
+                               .add( $iframe.get( 0 ).contentWindow.document.body )
                                .focus( function () {
-                                       currentFocused = iframe;
+                                       currentFocused = $iframe;
                                } );
                }
        });