Merge "mediawiki.toolbar: Emit deprecation warnings"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 27 Apr 2017 00:41:25 +0000 (00:41 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 27 Apr 2017 00:41:25 +0000 (00:41 +0000)
RELEASE-NOTES-1.29
docs/hooks.txt
includes/EditPage.php
resources/src/mediawiki.toolbar/toolbar.js

index 75c8b9a..12f9b54 100644 (file)
@@ -330,6 +330,11 @@ changes to languages because of Phabricator reports.
   tooltipAccessKeyRegexp, updateTooltipAccessKeys.
 * The ID of the <li> element containing the login link has changed from
   'pt-login' to 'pt-login-private' in private wikis.
+* The old, neglected "bulletin board style toolbar" in the edit form is now
+  deprecated (T30856). This old code dates from 2006, and was replaced in the
+  MediaWiki release tarball and in Wikimedia production by the WikiEditor
+  extension in 2010. It is only shown to users if no other editor was
+  installed, and leads to confusion.
 
 == Compatibility ==
 
index 060af89..7c09a55 100644 (file)
@@ -1417,7 +1417,8 @@ Allows modifying the edit checks below the textarea in the edit form.
 
 'EditPageBeforeEditToolbar': Allows modifying the edit toolbar above the
 textarea in the edit form.
-&$toolbar: The toolbar HTMl
+&$toolbar: The toolbar HTML
+Hook subscribers can return false to avoid the default toolbar code being loaded.
 
 'EditPageCopyrightWarning': Allow for site and per-namespace customization of
 contribution/copyright notice.
index f09c543..e98dd52 100644 (file)
@@ -4097,11 +4097,14 @@ HTML
                }
 
                $script .= '});';
-               $wgOut->addScript( ResourceLoader::makeInlineScript( $script ) );
 
                $toolbar = '<div id="toolbar"></div>';
 
-               Hooks::run( 'EditPageBeforeEditToolbar', [ &$toolbar ] );
+               if ( Hooks::run( 'EditPageBeforeEditToolbar', [ &$toolbar ] ) ) {
+                       // Only add the old toolbar cruft to the page payload if the toolbar has not
+                       // been over-written by a hook caller
+                       $wgOut->addScript( ResourceLoader::makeInlineScript( $script ) );
+               };
 
                return $toolbar;
        }
index 2af8b2f..576aa4e 100644 (file)
        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 );
+       toolbar.init = $.noop;
 
        // Expose API publicly
-       mw.toolbar = toolbar;
+       // @deprecated since MW 1.30
+       mw.log.deprecate( mw, 'toolbar', toolbar );
 
        $( function () {
                var i, button;