r112214 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112213‎ | r112214 | r112215 >
Date:16:14, 23 February 2012
Author:yonishostak
Status:resolved
Tags:
Comment:
AFTv5: commit for today's push to prototype
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css
@@ -254,7 +254,8 @@
255255 .articleFeedbackv5-hide-link, .articleFeedbackv5-delete-link {
256256 cursor: pointer;
257257 }
258 -#articleFeedbackv5-show-feedback .articleFeedbackv5-abuse-link.abusive {
 258+#articleFeedbackv5-show-feedback .articleFeedbackv5-abuse-link.abusive,
 259+#articleFeedbackv5-show-feedback .articleFeedbackv5-unabuse-link.abusive {
259260 color: red;
260261 }
261262 #articleFeedbackv5-show-feedback .articleFeedbackv5-comment-foot {
@@ -585,3 +586,9 @@
586587 float: right;
587588 margin-right: 50px;
588589 }
 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 @@
311311 $l.tipsy( 'show' );
312312 $.articleFeedbackv5special.currentPanelHostId = $l.attr( 'id' );
313313 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 - }
318314 }
319315 }
320316 // }}}
@@ -642,21 +638,44 @@
643639
644640 // }}}
645641 // {{{ 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+ }
648658 $.ajax( {
649659 'url': $.articleFeedbackv5special.apiUrl,
650660 'type': 'GET',
651661 '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,
659663 '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+ }
661680 },
662681 'error': function( data ) {
663682 $( '#articlefeedbackv5-activity-log' ).html( mw.msg( 'articleFeedbackv5-view-activity-error' ) );
@@ -1137,7 +1156,7 @@
11381157 </div>',
11391158 'click': function( e ) {
11401159 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 );
11421161 }
11431162 }
11441163 }

Status & tagging log