From: Bartosz DziewoƄski Date: Sun, 21 Sep 2014 13:26:07 +0000 (+0200) Subject: mediawiki.toolbar: Properly deprecate #init X-Git-Tag: 1.31.0-rc.0~13701^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=d3c0ef7e136d21130482f9d6bef005700d59c377;p=lhc%2Fweb%2Fwiklou.git mediawiki.toolbar: Properly deprecate #init Change-Id: I0271258e5f33b21c68b6224ca74123a3723c9788 --- diff --git a/includes/EditPage.php b/includes/EditPage.php index c330231bfd..edc2087b41 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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 ) ) ); diff --git a/resources/src/mediawiki.toolbar/toolbar.js b/resources/src/mediawiki.toolbar/toolbar.js index 57f780ce52..f9944b48d1 100644 --- a/resources/src/mediawiki.toolbar/toolbar.js +++ b/resources/src/mediawiki.toolbar/toolbar.js @@ -151,17 +151,16 @@ } ); } - }, - - // 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;