r92264 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92263‎ | r92264 | r92265 >
Date:18:19, 15 July 2011
Author:diebuche
Status:deferred (Comments)
Tags:
Comment:
r92253 : readd useful changes
Modified paths:
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)
  • /trunk/phase3/resources/Resources.php (modified) (history)
  • /trunk/phase3/resources/mediawiki.page/mediawiki.page.ajaxCategories.js (modified) (history)
  • /trunk/phase3/resources/mediawiki/mediawiki.util.js (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -3473,6 +3473,9 @@
34743474 'ajax-add-category-summary',
34753475 'ajax-edit-category-summary',
34763476 'ajax-remove-category-summary',
 3477+ 'ajax-add-category-question',
 3478+ 'ajax-edit-category-question',
 3479+ 'ajax-remove-category-question',
34773480 'ajax-confirm-actionsummary',
34783481 'ajax-error-title',
34793482 'ajax-error-dismiss',
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -4602,6 +4602,9 @@
46034603 'ajax-add-category-summary' => 'Add category "$1"',
46044604 'ajax-edit-category-summary' => 'Change category "$1" to "$2"',
46054605 'ajax-remove-category-summary' => 'Remove category "$1"',
 4606+'ajax-add-category-question' => 'Why do you want to add category "$1"?',
 4607+'ajax-edit-category-question' => 'Why do you want to change category "$1" to "$2"?',
 4608+'ajax-remove-category-question'=> 'Why do you want to remove category "$1"?',
46064609 'ajax-confirm-actionsummary' => 'Action to take:',
46074610 'ajax-error-title' => 'Error',
46084611 'ajax-error-dismiss' => 'OK',
Index: trunk/phase3/resources/mediawiki.page/mediawiki.page.ajaxCategories.js
@@ -85,7 +85,7 @@
8686 // strip out bad characters
8787 cat = _stripIllegals ( cat );
8888
89 - if ( $.isEmpty( cat ) || _containsCat( cat ) ) {
 89+ if ( $.isEmpty( cat ) || this.containsCat( cat ) ) {
9090 return;
9191 }
9292
@@ -157,7 +157,7 @@
158158 *
159159 * @return boolean True for exists
160160 */
161 - _containsCat = function ( cat ) {
 161+ this.containsCat = function ( cat ) {
162162 return _getCats().filter( function() { return $.ucFirst(this) == $.ucFirst(cat); } ).length !== 0;
163163 };
164164
@@ -449,7 +449,7 @@
450450 var category = $( this ).parent().find( '.mw-addcategory-input' ).val();
451451 category = $.ucFirst( category );
452452
453 - if ( _containsCat(category) ) {
 453+ if ( this.containsCat(category) ) {
454454 _showError( mw.msg( 'ajax-category-already-present', category ) );
455455 return;
456456 }
@@ -463,6 +463,7 @@
464464 },
465465 summary,
466466 function() {
 467+ $container.find( '#mw-normal-catlinks>.mw-addcategory-prompt' ).toggle();
467468 _insertCatDOM( category, false );
468469 }
469470 );
@@ -687,8 +688,4 @@
688689 // Now make a new version
689690 mw.ajaxCategories = new ajaxCategories();
690691
691 -// Executing only on doc.ready, so that everyone
692 -// gets a chance to set mw.config.set('disableAJAXCategories')
693 -$( document ).ready( mw.ajaxCategories.setup() );
694 -
695692 } )( jQuery, mediaWiki );
\ No newline at end of file
Index: trunk/phase3/resources/Resources.php
@@ -508,6 +508,9 @@
509509 'ajax-add-category-summary',
510510 'ajax-remove-category-summary',
511511 'ajax-edit-category-summary',
 512+ 'ajax-add-category-question',
 513+ 'ajax-edit-category-question',
 514+ 'ajax-remove-category-question',
512515 'ajax-confirm-actionsummary',
513516 'ajax-error-title',
514517 'ajax-error-dismiss',
Index: trunk/phase3/resources/mediawiki/mediawiki.util.js
@@ -99,6 +99,12 @@
100100 $tocToggleLink.click();
101101 }
102102 }
 103+ /* Ajax Categories */
 104+ if ( mw.ajaxCategories ) {
 105+ // Execute only on doc.ready, so that everyone
 106+ // gets a chance to set mw.config.set('disableAJAXCategories')
 107+ mw.ajaxCategories.setup()
 108+ }
103109 } );
104110
105111 return true;

Follow-up revisions

RevisionCommit summaryAuthorDate
r92288ajaxCategories fixes:...krinkle19:25, 15 July 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r92253Revert r92238: partial addition of broken test cases to qunit test suite; loa...brion17:29, 15 July 2011

Comments

#Comment by Krinkle (talk | contribs)   19:25, 15 July 2011
+					/* Ajax Categories */
+					if ( mw.ajaxCategories ) {
+						// Execute only on doc.ready, so that everyone 
+						// gets a chance to set mw.config.set('disableAJAXCategories')
+						mw.ajaxCategories.setup()
+					}
#Comment by Krinkle (talk | contribs)   19:26, 15 July 2011

Reverted and re-done in r92288.

#Comment by Krinkle (talk | contribs)   20:56, 3 October 2011

AjaxCategories moved out of core. Marking deferred for now.

Status & tagging log