Make mwCustomEditButtons a no-op and mark it as deprecated
authorAlex Monk <krenair@gmail.com>
Sat, 29 Jun 2013 15:48:09 +0000 (16:48 +0100)
committerAlex Monk <krenair@gmail.com>
Tue, 3 Sep 2013 10:24:47 +0000 (11:24 +0100)
Bug: 50310
Change-Id: I59d081b4f2581cea25485c69ef2933b94681e82a

RELEASE-NOTES-1.22
resources/Resources.php
resources/mediawiki.action/mediawiki.action.edit.js
skins/common/wikibits.js

index b88e323..b50666b 100644 (file)
@@ -426,6 +426,8 @@ changes to languages because of Bugzilla reports.
 * SpecialPrefixindex methods namespacePrefixForm() and showPrefixChunk() have
   been made protected. They were accepting form variance arguments, this is now
   using properties in the SpecialPrefixindex class.
+* (bug 50310) BREAKING CHANGE: wikibits: Drop support for mwCustomEditButtons.
+  It defaults to an empty array and emits mw.log.warn when accessed.
 
 == Compatibility ==
 
index e09f2d7..8648b70 100644 (file)
@@ -720,7 +720,6 @@ return array(
                'scripts' => 'resources/mediawiki.action/mediawiki.action.edit.js',
                'dependencies' => array(
                        'mediawiki.action.edit.styles',
-                       'mediawiki.legacy.wikibits',
                        'jquery.textSelection',
                        'jquery.byteLimit',
                ),
index 38d4bb8..ba711aa 100644 (file)
        mw.toolbar = toolbar;
 
        $( function () {
-               var buttons, i, b, $iframe, editBox, scrollTop, $editForm;
+               var i, b, $iframe, editBox, scrollTop, $editForm;
 
                // currentFocus is used to determine where to insert tags
                $currentFocused = $( '#wpTextbox1' );
                // Populate the selector cache for $toolbar
                $toolbar = $( '#toolbar' );
 
-               // Legacy: Merge buttons from mwCustomEditButtons
-               buttons = [].concat( queue, window.mwCustomEditButtons );
-               // Clear queue
-               queue.length = 0;
-
-               for ( i = 0; i < buttons.length; i++ ) {
-                       b = buttons[i];
+               for ( i = 0; i < queue.length; i++ ) {
+                       b = queue[i];
                        if ( $.isArray( b ) ) {
                                // Forwarded arguments array from mw.toolbar.addButton
                                insertButton.apply( toolbar, b );
                        } else {
-                               // Raw object from mw.toolbar.addButtons or mwCustomEditButtons
+                               // Raw object from mw.toolbar.addButtons
                                insertButton( b );
                        }
                }
 
+               // Clear queue
+               queue.length = 0;
+
                // This causes further calls to addButton to go to insertion directly
                // instead of to the queue.
                // It is important that this is after the one and only loop through
index 488c37d..7dc4a95 100644 (file)
@@ -137,7 +137,7 @@ window.killEvt = function( evt ) {
 };
 
 window.mwEditButtons = [];
-window.mwCustomEditButtons = []; // eg to add in MediaWiki:Common.js
+mw.log.deprecate( window, 'mwCustomEditButtons', [], 'Use mw.toolbar.addButton instead.' );
 
 window.escapeQuotes = function( text ) {
        var re = new RegExp( "'", "g" );