mediawiki.toolbar: Properly deprecate #init
authorBartosz Dziewoński <matma.rex@gmail.com>
Sun, 21 Sep 2014 13:26:07 +0000 (15:26 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Fri, 3 Oct 2014 11:45:04 +0000 (13:45 +0200)
Change-Id: I0271258e5f33b21c68b6224ca74123a3723c9788

includes/EditPage.php
resources/src/mediawiki.toolbar/toolbar.js

index c330231..edc2087 100644 (file)
@@ -3653,12 +3653,6 @@ HTML
                        $script .= Xml::encodeJsCall( 'mw.toolbar.addButton', $params );
                }
 
-               // This used to be called on DOMReady from mediawiki.action.edit, which
-               // ended up causing race conditions with the setup code above.
-               $script .= "\n" .
-                       "// Create button bar\n" .
-                       "$(function() { mw.toolbar.init(); } );\n";
-
                $script .= '});';
                $wgOut->addScript( Html::inlineScript( ResourceLoader::makeLoaderConditionalScript( $script ) ) );
 
index 57f780c..f9944b4 100644 (file)
                                        }
                                );
                        }
-               },
-
-               // For backwards compatibility,
-               // Called from EditPage.php, maybe in other places as well.
-               init: function () {}
+               }
        };
 
        // Legacy (for compatibility with the code previously in skins/common.edit.js)
        mw.log.deprecate( window, 'addButton', toolbar.addButton, 'Use mw.toolbar.addButton instead.' );
        mw.log.deprecate( window, 'insertTags', toolbar.insertTags, 'Use mw.toolbar.insertTags instead.' );
 
+       // For backwards compatibility. Used to be called from EditPage.php, maybe other places as well.
+       mw.log.deprecate( toolbar, 'init', $.noop );
+
        // Expose API publicly
        mw.toolbar = toolbar;