Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -3473,6 +3473,9 @@ |
3474 | 3474 | 'ajax-add-category-summary', |
3475 | 3475 | 'ajax-edit-category-summary', |
3476 | 3476 | 'ajax-remove-category-summary', |
| 3477 | + 'ajax-add-category-question', |
| 3478 | + 'ajax-edit-category-question', |
| 3479 | + 'ajax-remove-category-question', |
3477 | 3480 | 'ajax-confirm-actionsummary', |
3478 | 3481 | 'ajax-error-title', |
3479 | 3482 | 'ajax-error-dismiss', |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -4602,6 +4602,9 @@ |
4603 | 4603 | 'ajax-add-category-summary' => 'Add category "$1"', |
4604 | 4604 | 'ajax-edit-category-summary' => 'Change category "$1" to "$2"', |
4605 | 4605 | '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"?', |
4606 | 4609 | 'ajax-confirm-actionsummary' => 'Action to take:', |
4607 | 4610 | 'ajax-error-title' => 'Error', |
4608 | 4611 | 'ajax-error-dismiss' => 'OK', |
Index: trunk/phase3/resources/mediawiki.page/mediawiki.page.ajaxCategories.js |
— | — | @@ -85,7 +85,7 @@ |
86 | 86 | // strip out bad characters |
87 | 87 | cat = _stripIllegals ( cat ); |
88 | 88 | |
89 | | - if ( $.isEmpty( cat ) || _containsCat( cat ) ) { |
| 89 | + if ( $.isEmpty( cat ) || this.containsCat( cat ) ) { |
90 | 90 | return; |
91 | 91 | } |
92 | 92 | |
— | — | @@ -157,7 +157,7 @@ |
158 | 158 | * |
159 | 159 | * @return boolean True for exists |
160 | 160 | */ |
161 | | - _containsCat = function ( cat ) { |
| 161 | + this.containsCat = function ( cat ) { |
162 | 162 | return _getCats().filter( function() { return $.ucFirst(this) == $.ucFirst(cat); } ).length !== 0; |
163 | 163 | }; |
164 | 164 | |
— | — | @@ -449,7 +449,7 @@ |
450 | 450 | var category = $( this ).parent().find( '.mw-addcategory-input' ).val(); |
451 | 451 | category = $.ucFirst( category ); |
452 | 452 | |
453 | | - if ( _containsCat(category) ) { |
| 453 | + if ( this.containsCat(category) ) { |
454 | 454 | _showError( mw.msg( 'ajax-category-already-present', category ) ); |
455 | 455 | return; |
456 | 456 | } |
— | — | @@ -463,6 +463,7 @@ |
464 | 464 | }, |
465 | 465 | summary, |
466 | 466 | function() { |
| 467 | + $container.find( '#mw-normal-catlinks>.mw-addcategory-prompt' ).toggle(); |
467 | 468 | _insertCatDOM( category, false ); |
468 | 469 | } |
469 | 470 | ); |
— | — | @@ -687,8 +688,4 @@ |
688 | 689 | // Now make a new version |
689 | 690 | mw.ajaxCategories = new ajaxCategories(); |
690 | 691 | |
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 | | - |
695 | 692 | } )( jQuery, mediaWiki ); |
\ No newline at end of file |
Index: trunk/phase3/resources/Resources.php |
— | — | @@ -508,6 +508,9 @@ |
509 | 509 | 'ajax-add-category-summary', |
510 | 510 | 'ajax-remove-category-summary', |
511 | 511 | 'ajax-edit-category-summary', |
| 512 | + 'ajax-add-category-question', |
| 513 | + 'ajax-edit-category-question', |
| 514 | + 'ajax-remove-category-question', |
512 | 515 | 'ajax-confirm-actionsummary', |
513 | 516 | 'ajax-error-title', |
514 | 517 | 'ajax-error-dismiss', |
Index: trunk/phase3/resources/mediawiki/mediawiki.util.js |
— | — | @@ -99,6 +99,12 @@ |
100 | 100 | $tocToggleLink.click(); |
101 | 101 | } |
102 | 102 | } |
| 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 | + } |
103 | 109 | } ); |
104 | 110 | |
105 | 111 | return true; |