Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css |
— | — | @@ -254,7 +254,8 @@ |
255 | 255 | .articleFeedbackv5-hide-link, .articleFeedbackv5-delete-link { |
256 | 256 | cursor: pointer; |
257 | 257 | } |
258 | | -#articleFeedbackv5-show-feedback .articleFeedbackv5-abuse-link.abusive { |
| 258 | +#articleFeedbackv5-show-feedback .articleFeedbackv5-abuse-link.abusive, |
| 259 | +#articleFeedbackv5-show-feedback .articleFeedbackv5-unabuse-link.abusive { |
259 | 260 | color: red; |
260 | 261 | } |
261 | 262 | #articleFeedbackv5-show-feedback .articleFeedbackv5-comment-foot { |
— | — | @@ -585,3 +586,9 @@ |
586 | 587 | float: right; |
587 | 588 | margin-right: 50px; |
588 | 589 | } |
| 590 | +.articleFeedbackv5-activity-more { |
| 591 | + display: block; |
| 592 | + text-align: center; |
| 593 | + padding: 5px; |
| 594 | + background-color: #d2e5f7; |
| 595 | +} |
\ No newline at end of file |
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js |
— | — | @@ -310,10 +310,6 @@ |
311 | 311 | $l.tipsy( 'show' ); |
312 | 312 | $.articleFeedbackv5special.currentPanelHostId = $l.attr( 'id' ); |
313 | 313 | return true; |
314 | | - // load activity if it is an activity log |
315 | | - if( -1 != $l.attr( 'id' ).indexOf( 'articleFeedbackv5-activity-link-' ) ) { |
316 | | - $.articleFeedbackv5special.loadActivityLog( $l.closest( '.articleFeedbackv5-feedback' ).attr( 'rel' ) ); |
317 | | - } |
318 | 314 | } |
319 | 315 | } |
320 | 316 | // }}} |
— | — | @@ -642,21 +638,44 @@ |
643 | 639 | |
644 | 640 | // }}} |
645 | 641 | // {{{ loadActivityLog |
646 | | - |
647 | | - $.articleFeedbackv5special.loadActivityLog = function( id ) { |
| 642 | + /** |
| 643 | + * Load the activity log for a feedback post item |
| 644 | + * |
| 645 | + * @param id feedback post item id |
| 646 | + * @param continueId should be 0 for the first request (first page), then the continue id returned from the last API call |
| 647 | + */ |
| 648 | + $.articleFeedbackv5special.loadActivityLog = function( id, continueId ) { |
| 649 | + var data = { |
| 650 | + 'action': 'query', |
| 651 | + 'list': 'articlefeedbackv5-view-activity', |
| 652 | + 'format': 'json', |
| 653 | + 'affeedbackid': id, |
| 654 | + }; |
| 655 | + if( continueId > 0 ) { |
| 656 | + data['afcontinue'] = continueId; |
| 657 | + } |
648 | 658 | $.ajax( { |
649 | 659 | 'url': $.articleFeedbackv5special.apiUrl, |
650 | 660 | 'type': 'GET', |
651 | 661 | 'dataType': 'json', |
652 | | - 'data': { |
653 | | - 'action': 'query', |
654 | | - 'list': 'articlefeedbackv5-view-activity', |
655 | | - 'format': 'json', |
656 | | - 'affeedbackid': id, |
657 | | - 'continue': 0 |
658 | | - }, |
| 662 | + 'data': data, |
659 | 663 | 'success': function( data ) { |
660 | | - $( '#articlefeedbackv5-activity-log' ).html( data['articlefeedbackv5-view-activity'].activity ); |
| 664 | + if( 0 == continueId ) { |
| 665 | + $( '#articlefeedbackv5-activity-log' ).html( data['articlefeedbackv5-view-activity'].activity ); |
| 666 | + } else { |
| 667 | + console.log(continueId + ' - APPENDING'); |
| 668 | + $( '#articlefeedbackv5-activity-log' ) |
| 669 | + .find( '.articleFeedbackv5-activity-more' ).replaceWith( data['articlefeedbackv5-view-activity'].activity ); |
| 670 | + } |
| 671 | + if( data['articlefeedbackv5-view-activity'].continue ) { |
| 672 | + $( '#articlefeedbackv5-activity-log' ).find( '.articleFeedbackv5-activity-more' ) |
| 673 | + .attr( 'rel', data['articlefeedbackv5-view-activity'].continue ) |
| 674 | + .click( function( e ) { |
| 675 | + $.articleFeedbackv5special.loadActivityLog( |
| 676 | + $( '#' + $.articleFeedbackv5special.currentPanelHostId ).closest( '.articleFeedbackv5-feedback' ).attr( 'rel' ), |
| 677 | + $( e.target ).attr( 'rel') ); |
| 678 | + } ); |
| 679 | + } |
661 | 680 | }, |
662 | 681 | 'error': function( data ) { |
663 | 682 | $( '#articlefeedbackv5-activity-log' ).html( mw.msg( 'articleFeedbackv5-view-activity-error' ) ); |
— | — | @@ -1137,7 +1156,7 @@ |
1138 | 1157 | </div>', |
1139 | 1158 | 'click': function( e ) { |
1140 | 1159 | if( $.articleFeedbackv5special.toggleTipsy( e ) ) { |
1141 | | - $.articleFeedbackv5special.loadActivityLog( $( e.target ).closest( '.articleFeedbackv5-feedback' ).attr( 'rel' ) ); |
| 1160 | + $.articleFeedbackv5special.loadActivityLog( $( e.target ).closest( '.articleFeedbackv5-feedback' ).attr( 'rel' ), 0 ); |
1142 | 1161 | } |
1143 | 1162 | } |
1144 | 1163 | } |