r112637 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112636‎ | r112637 | r112638 >
Date:21:02, 28 February 2012
Author:reedy
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/REL1_19/phase3 (modified) (history)
  • /branches/REL1_19/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /branches/REL1_19/phase3/includes (modified) (history)
  • /branches/REL1_19/phase3/includes/SkinTemplate.php (modified) (history)
  • /branches/REL1_19/phase3/includes/debug/Debug.php (modified) (history)
  • /branches/REL1_19/phase3/resources/Resources.php (modified) (history)
  • /branches/REL1_19/phase3/resources/mediawiki.action/mediawiki.action.edit.js (modified) (history)
  • /branches/REL1_19/phase3/resources/mediawiki/mediawiki.debug.init.js (added) (history)
  • /branches/REL1_19/phase3/resources/mediawiki/mediawiki.debug.js (modified) (history)
  • /branches/REL1_19/phase3/skins/common/shared.css (modified) (history)

Diff [purge]

Index: branches/REL1_19/phase3/skins/common/shared.css
@@ -1023,7 +1023,8 @@
10241024 }
10251025
10261026 /* Accessibility */
1027 -.mw-jump {
 1027+.mw-jump,
 1028+#jump-to-nav {
10281029 overflow: hidden;
10291030 height: 0;
10301031 zoom: 1; /* http://webaim.org/techniques/skipnav/#iequirk */
Index: branches/REL1_19/phase3/RELEASE-NOTES-1.19
@@ -246,8 +246,8 @@
247247 getText() on a non-object
248248 * (bug 31676) Group dynamically inserted CSS into a single <style> tag, to work
249249 around a bug where not all styles were applied in Internet Explorer
250 -* (bug 28936, bug 5280) Broken or invalid titles can't be removed from watchlist.
251 -* (Bug 33087) Exchange server rejected mail sent by MediaWiki
 250+* (bug 28936, bug 5280) Broken or invalid titles can't be removed from watchlist.* (Bug 33087) Exchange server rejected mail sent by MediaWiki
 251+* (bug 34600) Older skins using useHeadElement=false were broken in 1.18
252252
253253 === API changes in 1.19 ===
254254 * Made action=edit less likely to return "unknownerror", by returning the actual error
Index: branches/REL1_19/phase3/includes/debug/Debug.php
@@ -62,7 +62,7 @@
6363 */
6464 public static function addModules( OutputPage $out ) {
6565 if ( self::$enabled ) {
66 - $out->addModules( 'mediawiki.debug' );
 66+ $out->addModules( 'mediawiki.debug.init' );
6767 }
6868 }
6969
@@ -271,12 +271,15 @@
272272 'memoryPeak' => $context->getLanguage()->formatSize( memory_get_peak_usage() ),
273273 'includes' => self::getFilesIncluded( $context ),
274274 );
275 - // TODO: Clean this up
276 - $html = Html::openElement( 'script' );
277 - $html .= 'var debugInfo = ' . Xml::encodeJsVar( $debugInfo ) . ';';
278 - $html .= " $(function() { mw.loader.using( 'mediawiki.debug', function() { mw.Debug.init( debugInfo ) } ); }); ";
279 - $html .= Html::closeElement( 'script' );
280275
 276+ // Cannot use OutputPage::addJsConfigVars because those are already outputted
 277+ // by the time this method is called.
 278+ $html = Html::inlineScript(
 279+ ResourceLoader::makeLoaderConditionalScript(
 280+ ResourceLoader::makeConfigSetScript( array( 'debugInfo' => $debugInfo ) )
 281+ )
 282+ );
 283+
281284 return $html;
282285 }
283286 }
Index: branches/REL1_19/phase3/includes/SkinTemplate.php
@@ -455,7 +455,7 @@
456456 if ( $this->useHeadElement ) {
457457 $tpl->set( 'headelement', $out->headElement( $this ) );
458458 } else {
459 - $tpl->set( 'headscripts', $out->getScript() );
 459+ $tpl->set( 'headscripts', $out->getHeadScripts() . $out->getHeadItems() );
460460 }
461461
462462 $tpl->set( 'debughtml', $this->generateDebugHTML() );
Property changes on: branches/REL1_19/phase3/includes
___________________________________________________________________
Modified: svn:mergeinfo
463463 Merged /trunk/phase3/includes:r111380,111809,111983,112034,112037,112152
Index: branches/REL1_19/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
Index: branches/REL1_19/phase3/resources/Resources.php
@@ -537,13 +537,21 @@
538538 ),
539539 'mediawiki.api.watch' => array(
540540 'scripts' => 'resources/mediawiki.api/mediawiki.api.watch.js',
541 - 'dependencies' => 'mediawiki.api',
 541+ 'dependencies' => array('mediawiki.api', 'mediawiki.user'),
542542 ),
543543 'mediawiki.debug' => array(
544544 'scripts' => 'resources/mediawiki/mediawiki.debug.js',
545545 'styles' => 'resources/mediawiki/mediawiki.debug.css',
546546 'dependencies' => 'jquery.footHovzer',
 547+ 'position' => 'bottom',
547548 ),
 549+ 'mediawiki.debug.init' => array(
 550+ 'scripts' => 'resources/mediawiki/mediawiki.debug.init.js',
 551+ 'dependencies' => 'mediawiki.debug',
 552+ // Uses a custom mw.config variable that is set in debughtml,
 553+ // must be loaded on the bottom
 554+ 'position' => 'bottom',
 555+ ),
548556 'mediawiki.feedback' => array(
549557 'scripts' => 'resources/mediawiki/mediawiki.feedback.js',
550558 'dependencies' => array(
Index: branches/REL1_19/phase3/resources/mediawiki/mediawiki.debug.js
@@ -1,5 +1,5 @@
22 /**
3 - * JavaScript for the new debug toolbar, enabled with $wgDebugToolbar
 3+ * JavaScript for the new debug toolbar, enabled through $wgDebugToolbar.
44 *
55 * @author John Du Hart
66 * @since 1.19
@@ -26,13 +26,15 @@
2727 data: {},
2828
2929 /**
30 - * Initializes the debugging pane
 30+ * Initializes the debugging pane.
 31+ * Shouldn't be called before the document is ready
 32+ * (since it binds to elements on the page).
3133 *
32 - * @param {Object} data
 34+ * @param {Object} data, defaults to 'debugInfo' from mw.config
3335 */
3436 init: function ( data ) {
3537
36 - this.data = data;
 38+ this.data = data || mw.config.get( 'debugInfo' );
3739 this.buildHtml();
3840
3941 // Insert the container into the DOM
Index: branches/REL1_19/phase3/resources/mediawiki/mediawiki.debug.init.js
@@ -0,0 +1,3 @@
 2+jQuery( function () {
 3+ mediaWiki.Debug.init();
 4+} );
Property changes on: branches/REL1_19/phase3/resources/mediawiki/mediawiki.debug.init.js
___________________________________________________________________
Added: svn:eol-style
15 + native
Property changes on: branches/REL1_19/phase3
___________________________________________________________________
Modified: svn:mergeinfo
26 Merged /trunk/phase3:r111380,111809,111983,112034,112037,112152

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111380[mw.debug] Clean up...krinkle15:25, 13 February 2012
r111809Add missing dependency of mediawiki.user to mediawiki.api.watch. May resolve ...werdna00:42, 18 February 2012
r111983* Fixed failure of the edit toolbar to load when $wgResourceLoaderExperimenta...tstarling23:29, 20 February 2012
r112034Followup r98045: fix bug 34504 wrt "Jump to" links in cached pages showing un...brion19:25, 21 February 2012
r112037Followup r112034, use both selectors not just one, don't break cached pages o...dantman20:23, 21 February 2012
r112152(bug 34600) Older skins using useHeadElement=false were broken in 1.18 . Modi...catrope21:43, 22 February 2012

Status & tagging log