Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php |
— | — | @@ -87,7 +87,7 @@ |
88 | 88 | 'articlefeedbackv5-form-abuse-masked' => 'Flag as abuse', |
89 | 89 | 'articlefeedbackv5-form-delete' => 'Oversight', |
90 | 90 | 'articlefeedbackv5-form-oversight' => 'Request oversight', |
91 | | - 'articlefeedbackv5-form-unoversight' => 'Unmark for oversight', |
| 91 | + 'articlefeedbackv5-form-unoversight' => 'Unrequest oversight', |
92 | 92 | 'articlefeedbackv5-form-undelete' => 'Un-oversight', |
93 | 93 | 'articlefeedbackv5-form-decline' => 'Decline Oversight', |
94 | 94 | 'articlefeedbackv5-form-header' => 'Feedback #$1, at $2', |
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css |
— | — | @@ -465,6 +465,23 @@ |
466 | 466 | /* @embed */ |
467 | 467 | background-image: url(images/bg-close-hov.png); |
468 | 468 | } |
| 469 | +#articlefeedbackv5-noteflyover-helpbutton { |
| 470 | + display: block; |
| 471 | + float: right; |
| 472 | + width: 20px; |
| 473 | + height: 20px; |
| 474 | + margin-top: -18px; |
| 475 | + margin-right: 30px; |
| 476 | + /* @embed */ |
| 477 | + background-image: url(images/bg-tooltip-trigger.png); |
| 478 | + background-repeat: no-repeat; |
| 479 | + background-position: left top; |
| 480 | + background-size: 20px 20px; |
| 481 | +} |
| 482 | +#articlefeedbackv5-noteflyover-helpbutton:hover { |
| 483 | + /* @embed */ |
| 484 | + background-image: url(images/bg-tooltip-trigger-hov.png); |
| 485 | +} |
469 | 486 | .articlefeedbackv5-flyover-button { |
470 | 487 | display: inline-block; |
471 | 488 | float: left; |
— | — | @@ -494,4 +511,15 @@ |
495 | 512 | color: #333; |
496 | 513 | text-decoration: none; |
497 | 514 | } |
498 | | - |
| 515 | +#articlefeedbackv5-activity-log { |
| 516 | + width: 300px; |
| 517 | + height: 360px; |
| 518 | +} |
| 519 | +.articleFeedbackv5-activity-pane { |
| 520 | + height: 60px; |
| 521 | +} |
| 522 | +.articleFeedbackv5-activity-log-items { |
| 523 | + height: 280px; |
| 524 | + overflow: auto; |
| 525 | + padding: 10px; |
| 526 | +} |
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js |
— | — | @@ -86,22 +86,15 @@ |
87 | 87 | */ |
88 | 88 | $.articleFeedbackv5special.notePanelHtmlTemplate = '\ |
89 | 89 | <div class="articlefeedbackv5-flyover-header">\ |
90 | | - <h3 id="articlefeedbackv5-noteflyover-caption">' + mw.msg( 'articlefeedbackv5-noteflyover-hide-caption' ) + '</h3>\ |
| 90 | + <h3 id="articlefeedbackv5-noteflyover-caption"></h3>\ |
91 | 91 | <a id="articlefeedbackv5-noteflyover-close" href="#"></a>\ |
92 | 92 | </div>\ |
93 | 93 | <form class="articlefeedbackv5-form-flyover">\ |
94 | | - <label id="articlefeedbackv5-noteflyover-label" for="articlefeedbackv5-noteflyover-note">' |
95 | | - + mw.msg( 'articlefeedbackv5-noteflyover-hide-label' ) + |
96 | | - '</label>\ |
| 94 | + <label id="articlefeedbackv5-noteflyover-label" for="articlefeedbackv5-noteflyover-note"></label>\ |
97 | 95 | <textarea id="articlefeedbackv5-noteflyover-note" name="articlefeedbackv5-noteflyover-note"></textarea>\ |
98 | 96 | <div class="articlefeedbackv5-flyover-footer">\ |
99 | | - <a id="articlefeedbackv5-noteflyover-submit" class="articlefeedbackv5-flyover-button" href="#">' |
100 | | - + mw.msg( 'articlefeedbackv5-noteflyover-hide-submit' ) + |
101 | | - '</a>\ |
102 | | - <a class="articlefeedbackv5-flyover-help" id="articlefeedbackv5-noteflyover-help" href="' |
103 | | - + mw.msg( 'articlefeedbackv5-noteflyover-hide-help-link' ) + '">' |
104 | | - + mw.msg( 'articlefeedbackv5-noteflyover-hide-help' ) + |
105 | | - '</a>\ |
| 97 | + <a id="articlefeedbackv5-noteflyover-submit" class="articlefeedbackv5-flyover-button" href="#"></a>\ |
| 98 | + <a class="articlefeedbackv5-flyover-help" id="articlefeedbackv5-noteflyover-help" href="#"></a>\ |
106 | 99 | </div>\ |
107 | 100 | </form>'; |
108 | 101 | |
— | — | @@ -128,14 +121,11 @@ |
129 | 122 | $.articleFeedbackv5special.logPanelHtml = '\ |
130 | 123 | <div>\ |
131 | 124 | <div class="articlefeedbackv5-flyover-header">\ |
132 | | - <h3>Activity log</h3>\ |
133 | | - <a>HELP</a>\ |
134 | | - <a>CLOSE</a>\ |
| 125 | + <h3 id="articlefeedbackv5-noteflyover-caption">Activity log</h3>\ |
| 126 | + <a id="articlefeedbackv5-noteflyover-helpbutton" href="#"></a>\ |
| 127 | + <a id="articlefeedbackv5-noteflyover-close" href="#"></a>\ |
135 | 128 | </div>\ |
136 | | - <div>SOME ACTIVITY HERE\ |
137 | | - </div>\ |
138 | | - <div class="articlefeedbackv5-activityflyover-viewactivity">FOOTER HERE\ |
139 | | - </div>\ |
| 129 | + <div id="articlefeedbackv5-activity-log"></div>\ |
140 | 130 | </div>'; |
141 | 131 | |
142 | 132 | // }}} |
— | — | @@ -336,6 +326,10 @@ |
337 | 327 | } |
338 | 328 | $l.tipsy( 'show' ); |
339 | 329 | $.articleFeedbackv5special.currentPanelHostId= $l.attr( 'id' ); |
| 330 | + // load activity if it is an activity log |
| 331 | + if( -1 != $l.attr( 'id' ).indexOf( 'articleFeedbackv5-activity-link-' ) ) { |
| 332 | + $.articleFeedbackv5special.loadActivityLog( $l.closest( '.articleFeedbackv5-feedback' ).attr( 'rel' ) ); |
| 333 | + } |
340 | 334 | } |
341 | 335 | } ); |
342 | 336 | } |
— | — | @@ -416,28 +410,28 @@ |
417 | 411 | var $selector = !id ? $( '#articleFeedbackv5-show-feedback' ) : $( '.articleFeedbackv5-feedback[rel="' + id + '"]' ); |
418 | 412 | |
419 | 413 | // hide/show action |
420 | | - $selector.find( '.articleFeedbackv5-hide-link' ).tipsy( { |
| 414 | + $selector.find( '.articleFeedbackv5-hide-link,.articleFeedbackv5-show-link' ).tipsy( { |
421 | 415 | title: function() { |
422 | 416 | var activity = $.articleFeedbackv5special.getActivity( id ); |
423 | 417 | return ( activity.hide || this.text == mw.msg( 'articlefeedbackv5-form-unhide' ) ) ? |
424 | 418 | $.articleFeedbackv5special.notePanelHtml['show'] : $.articleFeedbackv5special.notePanelHtml['hide']; |
425 | 419 | } |
426 | 420 | } ); |
427 | | - |
| 421 | + |
428 | 422 | // oversight/unoversight action |
429 | | - $selector.find( '.articleFeedbackv5-oversight-link' ).tipsy( { |
| 423 | + $selector.find( '.articleFeedbackv5-oversight-link,.articleFeedbackv5-unoversight-link' ).tipsy( { |
430 | 424 | title: function() { |
431 | 425 | var activity = $.articleFeedbackv5special.getActivity( id ); |
432 | 426 | return ( activity.delete || this.text == mw.msg('articlefeedbackv5-form-undelete') ) ? |
433 | 427 | $.articleFeedbackv5special.notePanelHtml['unoversight'] : $.articleFeedbackv5special.notePanelHtml['oversight']; |
434 | 428 | } |
435 | 429 | } ); |
436 | | - |
| 430 | + |
437 | 431 | // request/unrequest oversight action |
438 | | - $selector.find( '.articleFeedbackv5-requestoversight-link' ).tipsy( { |
| 432 | + $selector.find( '.articleFeedbackv5-requestoversight-link,.articleFeedbackv5-unrequestoversight-link' ).tipsy( { |
439 | 433 | title: function() { |
440 | 434 | var activity = $.articleFeedbackv5special.getActivity( id ); |
441 | | - return ( activity.requestoversight || this.text == mw.msg('articlefeedbackv5-form-unrequestoversight') ) ? |
| 435 | + return ( activity.oversight || this.text == mw.msg('articlefeedbackv5-form-unoversight') ) ? |
442 | 436 | $.articleFeedbackv5special.notePanelHtml['unrequestoversight'] : $.articleFeedbackv5special.notePanelHtml['requestoversight']; |
443 | 437 | } |
444 | 438 | } ); |
— | — | @@ -621,7 +615,7 @@ |
622 | 616 | */ |
623 | 617 | $.articleFeedbackv5special.markHidden = function ( $row ) { |
624 | 618 | if ( $row.data( 'hidden' ) ) { |
625 | | - $.articleFeedbackv5special.unmarkHidden(); |
| 619 | + $.articleFeedbackv5special.unmarkHidden( $row ); |
626 | 620 | } |
627 | 621 | $row.addClass( 'articleFeedbackv5-feedback-hidden' ) |
628 | 622 | .data( 'hidden', true ); |
— | — | @@ -730,6 +724,7 @@ |
731 | 725 | if ( 'result' in data['articlefeedbackv5-flag-feedback'] ) { |
732 | 726 | if ( data['articlefeedbackv5-flag-feedback'].result == 'Success' ) { |
733 | 727 | var $l = $( '#articleFeedbackv5-' + type + '-link-' + id ); |
| 728 | + var $post = $l.closest( '.articleFeedbackv5-feedback' ); |
734 | 729 | // Helpful or unhelpful |
735 | 730 | if ( 'helpful' in data['articlefeedbackv5-flag-feedback'] ) { |
736 | 731 | $( '#articleFeedbackv5-helpful-votes-' + id ).text( data['articlefeedbackv5-flag-feedback'].helpful ); |
— | — | @@ -764,24 +759,46 @@ |
765 | 760 | if ( data['articlefeedbackv5-flag-feedback']['abuse-hidden'] ) { |
766 | 761 | $.articleFeedbackv5special.markHidden( $l.closest( '.articleFeedbackv5-feedback' ) ); |
767 | 762 | } |
768 | | - // Hide |
| 763 | + // Hide/show |
769 | 764 | } else if ( 'hide' == type ) { |
770 | 765 | if ( dir > 0 ) { |
| 766 | + var $l = $( '#articleFeedbackv5-hide-link-' + id ); |
| 767 | + $l.attr( 'id', 'articleFeedbackv5-show-link-' + id ); |
771 | 768 | $l.text( mw.msg( 'articlefeedbackv5-form-unhide' ) ); |
772 | 769 | $.articleFeedbackv5special.markHidden( $l.closest( '.articleFeedbackv5-feedback' ) ); |
773 | 770 | } else { |
| 771 | + var $l = $( '#articleFeedbackv5-show-link-' + id ); |
| 772 | + $l.attr( 'id', 'articleFeedbackv5-hide-link-' + id ); |
774 | 773 | $l.text( mw.msg( 'articlefeedbackv5-form-hide' ) ); |
775 | | - $.articleFeedbackv5special.unmarkHidden( $l.closest( '.articleFeedbackv5-feedback' ) ); |
| 774 | + $.articleFeedbackv5special.unmarkHidden( $l.closest( '.articleFeedbackv5-feedback' )); |
776 | 775 | } |
777 | | - // Delete |
| 776 | + // oversight/unoversight |
778 | 777 | } else if ( 'delete' == type ) { |
779 | 778 | if ( dir > 0 ) { |
| 779 | + var $l = $( '#articleFeedbackv5-oversight-link-' + id ); |
| 780 | + $l.attr( 'id', 'articleFeedbackv5-unoversight-link-' + id ); |
780 | 781 | $l.text( mw.msg( 'articlefeedbackv5-form-undelete' ) ); |
781 | 782 | $.articleFeedbackv5special.markDeleted( $l.closest( '.articleFeedbackv5-feedback' ) ); |
782 | 783 | } else { |
| 784 | + var $l = $( '#articleFeedbackv5-unoversight-link-' + id ); |
| 785 | + $l.attr( 'id', 'articleFeedbackv5-oversight-link-' + id ); |
783 | 786 | $l.text( mw.msg( 'articlefeedbackv5-form-delete' ) ); |
784 | 787 | $.articleFeedbackv5special.unmarkDeleted( $l.closest( '.articleFeedbackv5-feedback' ) ); |
785 | 788 | } |
| 789 | + // decline oversight |
| 790 | + } else if( 'resetoversight' == type ) { |
| 791 | + |
| 792 | + // request/unrequest oversight |
| 793 | + } else if( 'oversight' == type ) { |
| 794 | + if( dir > 0 ) { |
| 795 | + var $l = $( '#articleFeedbackv5-requestoversight-link-' + id ); |
| 796 | + $l.attr( 'id', 'articleFeedbackv5-unrequestoversight-link-' + id ); |
| 797 | + $l.text( mw.msg( 'articlefeedbackv5-form-unoversight' ) ); |
| 798 | + } else { |
| 799 | + var $l = $( '#articleFeedbackv5-unrequestoversight-link-' + id ); |
| 800 | + $l.attr( 'id', 'articleFeedbackv5-requestoversight-link-' + id ); |
| 801 | + $l.text( mw.msg( 'articlefeedbackv5-form-oversight' ) ); |
| 802 | + } |
786 | 803 | } |
787 | 804 | // Save activity |
788 | 805 | if ( !( id in $.articleFeedbackv5special.activity ) ) { |
— | — | @@ -808,6 +825,34 @@ |
809 | 826 | } |
810 | 827 | |
811 | 828 | // }}} |
| 829 | + // {{{ loadActivityLog |
| 830 | + |
| 831 | + $.articleFeedbackv5special.loadActivityLog = function( id ) { |
| 832 | + console.log('loadActivityLog'); |
| 833 | + $.ajax( { |
| 834 | + 'url': $.articleFeedbackv5special.apiUrl, |
| 835 | + 'type': 'GET', |
| 836 | + 'dataType': 'json', |
| 837 | + 'data': { |
| 838 | + 'action': 'query', |
| 839 | + 'list': 'articlefeedbackv5-view-activity', |
| 840 | + 'format': 'json', |
| 841 | + 'affeedbackid': id, |
| 842 | + 'continue': 0 |
| 843 | + }, |
| 844 | + 'success': function( data ) { |
| 845 | + console.log(data['articlefeedbackv5-view-activity'].activity); |
| 846 | + $( '#articlefeedbackv5-activity-log' ).html( data['articlefeedbackv5-view-activity'].activity ); |
| 847 | + }, |
| 848 | + 'error': function( data ) { |
| 849 | + console.log('error'); |
| 850 | + } |
| 851 | + } ); |
| 852 | + |
| 853 | + return false; |
| 854 | + } |
| 855 | + |
| 856 | + // }}} |
812 | 857 | // {{{ loadFeedback |
813 | 858 | |
814 | 859 | /** |
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewActivityArticleFeedbackv5.php |
— | — | @@ -104,7 +104,15 @@ |
105 | 105 | $html .= Html::element( 'div', array('class' => 'articleFeedbackv5-activity-count'),
|
106 | 106 | wfMessage( 'articlefeedbackv5-activity-count',
|
107 | 107 | array( $feedback->af_activity_count ))->text() );
|
| 108 | +
|
| 109 | + // </div> for class="articleFeedbackv5-activity-pane"
|
| 110 | + $html .= Html::closeElement( 'div' );
|
108 | 111 |
|
| 112 | + //<div class="articleFeedbackv5-activity-log-items">
|
| 113 | + $html .= Html::openElement( 'div', array(
|
| 114 | + 'class' => 'articleFeedbackv5-activity-log-items'
|
| 115 | + ) );
|
| 116 | +
|
109 | 117 | // divs of activity items
|
110 | 118 | foreach($activities as $item) {
|
111 | 119 |
|
— | — | @@ -148,9 +156,9 @@ |
149 | 157 | wfMessage( 'articlefeedbackv5-activity-more', array())->text() );
|
150 | 158 | }
|
151 | 159 |
|
152 | | - // </div> for class="articleFeedbackv5-activity-pane"
|
| 160 | + // </div> for class="acticleFeedbackv5-activity-log-items"
|
153 | 161 | $html .= Html::closeElement( 'div' );
|
154 | | -
|
| 162 | +
|
155 | 163 | // finally add our generated html data
|
156 | 164 | $result = $this->getResult();
|
157 | 165 | $result->addValue( $this->getModuleName(), 'limit', $limit );
|