r112570 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112569‎ | r112570 | r112571 >
Date:02:55, 28 February 2012
Author:catrope
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.19wmf1/extensions/CheckUser/SpecialCheckUserLog.php (modified) (history)
  • /branches/wmf/1.19wmf1/includes/logging/LogFormatter.php (modified) (history)
  • /branches/wmf/1.19wmf1/resources/jquery.ui/themes/vector/jquery.ui.datepicker.css (modified) (history)
  • /branches/wmf/1.19wmf1/resources/mediawiki.action/mediawiki.action.edit.js (modified) (history)
  • /branches/wmf/1.19wmf1/resources/mediawiki/mediawiki.js (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/extensions/CheckUser/SpecialCheckUserLog.php
@@ -60,6 +60,10 @@
6161 }
6262 }
6363 }
 64+
 65+ $out->addHTML( $this->getSkin()->makeKnownLinkObj(
 66+ Title::makeTitle( NS_SPECIAL, 'CheckUser' ),
 67+ wfMsgHtml( 'checkuser-log-return' ) ) );
6468
6569 $searchTypes = array( 'initiator', 'target' );
6670 $select = "<select name=\"cuSearchType\" style='margin-top:.2em;'>\n";
Index: branches/wmf/1.19wmf1/includes/logging/LogFormatter.php
@@ -226,6 +226,20 @@
227227 }
228228 break;
229229
 230+ case 'protect':
 231+ switch( $entry->getSubtype() ) {
 232+ case 'protect':
 233+ $text = wfMsgExt( 'protectedarticle', $msgOpts, $target . ' ' . $parameters[0] );
 234+ break;
 235+ case 'unprotect':
 236+ $text = wfMsgExt( 'unprotectedarticle', $msgOpts, $target );
 237+ break;
 238+ case 'modify':
 239+ $text = wfMsgExt( 'modifiedarticleprotection', $msgOpts, $target . ' ' . $parameters[0] );
 240+ break;
 241+ }
 242+ break;
 243+
230244 case 'newusers':
231245 switch( $entry->getSubtype() ) {
232246 case 'newusers':
Index: branches/wmf/1.19wmf1/resources/mediawiki.action/mediawiki.action.edit.js
@@ -3,12 +3,17 @@
44 var currentFocused = $( '#wpTextbox1' );
55
66 mw.toolbar = {
7 - $toolbar : $( '#toolbar' ),
 7+ $toolbar : false,
88 buttons : [],
 9+ isReady : false,
910 // If you want to add buttons, use
1011 // mw.toolbar.addButton( imageFile, speedTip, tagOpen, tagClose, sampleText, imageId, selectText );
1112 addButton : function() {
12 - this.buttons.push( [].slice.call( arguments ) );
 13+ if ( this.isReady ) {
 14+ this.insertButton.apply( this, arguments );
 15+ } else {
 16+ this.buttons.push( [].slice.call( arguments ) );
 17+ }
1318 },
1419 insertButton : function( imageFile, speedTip, tagOpen, tagClose, sampleText, imageId, selectText ) {
1520 var image = $('<img>', {
@@ -37,18 +42,25 @@
3843 );
3944 }
4045 },
41 - init : function() {
 46+
 47+ // For backwards compatibility
 48+ init : function() {},
 49+
 50+ onReady : function() {
 51+ this.$toolbar = $( '#toolbar' );
 52+ this.isReady = true;
4253 // Legacy
4354 // Merge buttons from mwCustomEditButtons
4455 var buttons = [].concat( this.buttons, window.mwCustomEditButtons );
4556 for ( var i = 0; i < buttons.length; i++ ) {
4657 if ( $.isArray( buttons[i] ) ) {
4758 // Passes our button array as arguments
48 - mw.toolbar.insertButton.apply( this, buttons[i] );
 59+ this.insertButton.apply( this, buttons[i] );
4960 } else {
5061 // Legacy mwCustomEditButtons is an object
5162 var c = buttons[i];
52 - mw.toolbar.insertButton( c.imageFile, c.speedTip, c.tagOpen, c.tagClose, c.sampleText, c.imageId, c.selectText );
 63+ this.insertButton( c.imageFile, c.speedTip, c.tagOpen,
 64+ c.tagClose, c.sampleText, c.imageId, c.selectText );
5365 }
5466 }
5567 return true;
@@ -59,10 +71,12 @@
6072 window.addButton = mw.toolbar.addButton;
6173 window.insertTags = mw.toolbar.insertTags;
6274
63 - //make sure edit summary does not exceed byte limit
64 - $( '#wpSummary' ).byteLimit( 250 );
 75+ $( document ).ready( function() {
 76+ mw.toolbar.onReady();
6577
66 - $( document ).ready( function() {
 78+ // Make sure edit summary does not exceed byte limit
 79+ $( '#wpSummary' ).byteLimit( 250 );
 80+
6781 /**
6882 * Restore the edit box scroll state following a preview operation,
6983 * and set up a form submission handler to remember this state
Index: branches/wmf/1.19wmf1/resources/mediawiki/mediawiki.js
@@ -615,6 +615,7 @@
616616 j -= 1;
617617 }
618618 }
 619+ throw e;
619620 }
620621 }
621622
@@ -770,7 +771,6 @@
771772 console.log( 'mw.loader::execute> Exception thrown by ' + module + ': ' + e.message );
772773 }
773774 registry[module].state = 'error';
774 - throw e;
775775 }
776776 }
777777
Index: branches/wmf/1.19wmf1/resources/jquery.ui/themes/vector/jquery.ui.datepicker.css
@@ -1,6 +1,6 @@
22 /* Datepicker
33 ----------------------------------*/
4 -.ui-datepicker { width: 17em; padding: .2em .2em 0; }
 4+.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
55 .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
66 .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
77 .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111983* Fixed failure of the edit toolbar to load when $wgResourceLoaderExperimenta...tstarling23:29, 20 February 2012
r112384fixing bug 34609 - datepicker should always be set to display:none by defaultkaldari03:02, 25 February 2012
r112451* Fix r111983 (bug 34662): make mw.toolbar.addButton() work even after DOM ready...tstarling22:46, 26 February 2012
r112561[IRC Log Message] Fix for protect/protect and protect/modify...krinkle01:56, 28 February 2012
r112562Restore "checkuser-log-return" ("Return to CheckUser main form") link to the ...saper01:57, 28 February 2012
r112567Fix scoping in r112451: isReady was accidentally used as a global variablecatrope02:36, 28 February 2012

Status & tagging log