r111983 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111982‎ | r111983 | r111984 >
Date:23:29, 20 February 2012
Author:tstarling
Status:resolved (Comments)
Tags:
Comment:
* Fixed failure of the edit toolbar to load when $wgResourceLoaderExperimentalAsyncLoading is enabled and module execution occurs before the edit box appears in the DOM. Similar to bug 34538.
* Also fixed breakage of byteLimit on edit in the same scenario.
* For 1.19 backport so no release notes.
Modified paths:
  • /trunk/phase3/resources/mediawiki.action/mediawiki.action.edit.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki.action/mediawiki.action.edit.js
@@ -3,7 +3,7 @@
44 var currentFocused = $( '#wpTextbox1' );
55
66 mw.toolbar = {
7 - $toolbar : $( '#toolbar' ),
 7+ $toolbar : [],
88 buttons : [],
99 // If you want to add buttons, use
1010 // mw.toolbar.addButton( imageFile, speedTip, tagOpen, tagClose, sampleText, imageId, selectText );
@@ -37,7 +37,12 @@
3838 );
3939 }
4040 },
41 - init : function() {
 41+
 42+ // For backwards compatibility
 43+ init : function() {},
 44+
 45+ onReady : function() {
 46+ mw.toolbar.$toolbar = $( '#toolbar' );
4247 // Legacy
4348 // Merge buttons from mwCustomEditButtons
4449 var buttons = [].concat( this.buttons, window.mwCustomEditButtons );
@@ -59,10 +64,12 @@
6065 window.addButton = mw.toolbar.addButton;
6166 window.insertTags = mw.toolbar.insertTags;
6267
63 - //make sure edit summary does not exceed byte limit
64 - $( '#wpSummary' ).byteLimit( 250 );
 68+ $( document ).ready( function() {
 69+ mw.toolbar.onReady();
6570
66 - $( document ).ready( function() {
 71+ // Make sure edit summary does not exceed byte limit
 72+ $( '#wpSummary' ).byteLimit( 250 );
 73+
6774 /**
6875 * Restore the edit box scroll state following a preview operation,
6976 * and set up a form submission handler to remember this state

Sign-offs

UserFlagDate
Nikerabbitinspected09:13, 21 February 2012
Krinkleinspected23:44, 26 February 2012

Follow-up revisions

RevisionCommit summaryAuthorDate
r111984Bug 34538 again. Bug reproduced and fix tested.tstarling23:47, 20 February 2012
r111985* Fixed load order like bug 34538...tstarling00:00, 21 February 2012
r111989* (bug 34538) Fixed compatibility with $wgResourceLoaderExperimentalAsyncLoad...tstarling04:03, 21 February 2012
r112451* Fix r111983 (bug 34662): make mw.toolbar.addButton() work even after DOM ready...tstarling22:46, 26 February 2012
r112462(bug 34538) Fixed compatibility with $wgResourceLoaderExperimentalAsyncLoadin...tstarling00:56, 27 February 2012
r1125701.19wmf1: MFT r111983, r112384, r112451, r112561, r112562, r112567catrope02:55, 28 February 2012
r112573[mediawiki.action.edit] Clean up and bug fixes...krinkle03:17, 28 February 2012
r112637MFT r111380, r111809, r111983, r112034, r112037, r112152reedy21:02, 28 February 2012

Comments

#Comment by Krinkle (talk | contribs)   21:31, 22 February 2012

Same as in r111989 cr, $toolbar : [],

#Comment by Hashar (talk | contribs)   13:32, 24 February 2012

cause bug 34662 : classic toolbar does not load :-/

#Comment by Wikinaut (talk | contribs)   20:17, 26 February 2012

this should be reverted, as it breaks -at least- editbar (toolbar) loading (see bug34662 ), perhaps other things.

#Comment by Tim Starling (talk | contribs)   01:11, 27 February 2012

Fixed in r112451.

Status & tagging log