Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php |
— | — | @@ -77,6 +77,7 @@ |
78 | 78 | 'articlefeedbackv5-special-pagetitle' => 'Feedback: $1', |
79 | 79 | 'articlefeedbackv5-form-optionid' => 'Option $1', |
80 | 80 | 'articlefeedbackv5-hidden' => 'Hidden', |
| 81 | + 'articlefeedbackv5-deleted' => 'Deleted (oversight)', |
81 | 82 | 'articlefeedbackv5-form-hide' => 'Hide this post', |
82 | 83 | 'articlefeedbackv5-form-unhide' => 'Show this post', |
83 | 84 | 'articlefeedbackv5-form-helpful' => 'Mark as helpful ($1)', |
— | — | @@ -97,7 +98,7 @@ |
98 | 99 | 'articlefeedbackv5-form5-header' => '{{GENDER:$1|$1}} rated this page:', |
99 | 100 | 'articlefeedbackv5-form-not-shown' => '{{GENDER:$1|$1}} was not shown a feedback form.', |
100 | 101 | 'articlefeedbackv5-form-invalid' => 'Invalid feedback form ID.', |
101 | | - 'articlefeedbackv5-abuse-saved' => 'Flagged as abuse', |
| 102 | + 'articlefeedbackv5-abuse-saved' => 'Flagged as abuse ($1)', |
102 | 103 | 'articlefeedbackv5-oversight-saved' => 'Marked for oversight', |
103 | 104 | 'articlefeedbackv5-unoversight-saved' => 'Oversight flag removed', |
104 | 105 | 'articlefeedbackv5-error-loading-feedback' => 'Error loading feedback', |
— | — | @@ -332,6 +333,7 @@ |
333 | 334 | 'articlefeedbackv5-special-pagetitle' => 'Page title for [[Special:ArticleFeedbackv5]]. Parameters: |
334 | 335 | * $1 is the title of the article for which we show the feedback', |
335 | 336 | 'articlefeedbackv5-hidden' => '{{Identical|Hidden}}', |
| 337 | + 'articlefeedbackv5-deleted' => 'The marker that appears on a comment if it has been deleted by an oversighter.', |
336 | 338 | 'articlefeedbackv5-form-delete' => '{{Identical|Delete}}', |
337 | 339 | 'articlefeedbackv5-form-oversight' => 'Request that an oversighter review this feedback', |
338 | 340 | 'articlefeedbackv5-form-unoversight' => 'Remove request for oversight', |
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.css |
— | — | @@ -185,13 +185,13 @@ |
186 | 186 | margin-right: 10px; |
187 | 187 | } |
188 | 188 | .articleFeedbackv5-comment-details-date { |
189 | | - float: left; |
190 | | - clear: right; |
191 | | - display: block; |
192 | | - line-height: 24px; |
193 | | - margin: 0 5px 0 0; |
194 | | - position: relative; |
195 | | - top: 18px; |
| 189 | + float: left; |
| 190 | + clear: right; |
| 191 | + display: block; |
| 192 | + line-height: 24px; |
| 193 | + margin: 0 5px 0 0; |
| 194 | + position: relative; |
| 195 | + top: 18px; |
196 | 196 | } |
197 | 197 | #articleFeedbackv5-special-add-feedback { |
198 | 198 | /*color:white; |
— | — | @@ -230,16 +230,15 @@ |
231 | 231 | width: 520px; |
232 | 232 | } |
233 | 233 | .articleFeedbackv5-vote-wrapper { |
234 | | - float: left; |
235 | | - width: 100%; |
236 | | - margin-bottom: 8px; |
| 234 | + float: left; |
| 235 | + width: 100%; |
| 236 | + margin-bottom: 8px; |
237 | 237 | } |
238 | 238 | #articleFeedbackv5-show-feedback .articleFeedbackv5-comment-foot .articleFeedbackv5-helpful-caption { |
239 | 239 | margin: 0 15px 0 0; |
240 | 240 | } |
241 | 241 | #articleFeedbackv5-show-feedback .articleFeedbackv5-comment-foot .articleFeedbackv5-helpful-link, |
242 | | -#articleFeedbackv5-show-feedback .articleFeedbackv5-comment-foot .articleFeedbackv5-unhelpful-link, |
243 | | -#articleFeedbackv5-show-feedback .articleFeedbackv5-feedback-hidden .articleFeedbackv5-feedback-hidden-marker { |
| 242 | +#articleFeedbackv5-show-feedback .articleFeedbackv5-comment-foot .articleFeedbackv5-unhelpful-link { |
244 | 243 | display: inline-block; |
245 | 244 | height: 22px; |
246 | 245 | line-height: 22px; |
— | — | @@ -273,8 +272,7 @@ |
274 | 273 | #articleFeedbackv5-show-feedback .articleFeedbackv5-comment-foot .articleFeedbackv5-helpful-link.active, |
275 | 274 | #articleFeedbackv5-show-feedback .articleFeedbackv5-comment-foot .articleFeedbackv5-unhelpful-link.active, |
276 | 275 | #articleFeedbackv5-show-feedback .articleFeedbackv5-comment-foot .articleFeedbackv5-helpful-link.active:hover, |
277 | | -#articleFeedbackv5-show-feedback .articleFeedbackv5-comment-foot .articleFeedbackv5-unhelpful-link.active:hover, |
278 | | -#articleFeedbackv5-show-feedback .articleFeedbackv5-feedback-hidden .articleFeedbackv5-feedback-hidden-marker { |
| 276 | +#articleFeedbackv5-show-feedback .articleFeedbackv5-comment-foot .articleFeedbackv5-unhelpful-link.active:hover { |
279 | 277 | /* @embed */ |
280 | 278 | background: url(images/bg-button.png) repeat-x; |
281 | 279 | color: #fff; |
— | — | @@ -283,10 +281,10 @@ |
284 | 282 | color: #888; |
285 | 283 | } |
286 | 284 | .articleFeedbackv5-feedback .articleFeedbackv5-comment-wrap h3 { |
287 | | - display: block; |
288 | | - float: left; |
289 | | - width: 520px; |
290 | | - line-height: 24px; |
| 285 | + display: block; |
| 286 | + float: left; |
| 287 | + width: 520px; |
| 288 | + line-height: 24px; |
291 | 289 | } |
292 | 290 | .articleFeedbackv5-feedback .articleFeedbackv5-comment-wrap h3 .icon { |
293 | 291 | display: inline-block; |
— | — | @@ -349,13 +347,18 @@ |
350 | 348 | color: white !important; |
351 | 349 | } |
352 | 350 | .articleFeedbackv5-comment-wrap { |
353 | | - width: 100%; |
| 351 | + width: 100%; |
354 | 352 | } |
355 | | -.articleFeedbackv5-feedback-hidden .articleFeedbackv5-comment-wrap { |
| 353 | +.articleFeedbackv5-feedback-hidden .articleFeedbackv5-comment-wrap, |
| 354 | +.articleFeedbackv5-feedback-deleted .articleFeedbackv5-comment-wrap { |
356 | 355 | opacity : 0.4; |
357 | 356 | filter: alpha(opacity=40); // msie |
358 | 357 | background-color: #000; |
359 | 358 | } |
360 | | -#articleFeedbackv5-show-feedback .articleFeedbackv5-feedback-hidden .articleFeedbackv5-feedback-hidden-marker { |
| 359 | +#articleFeedbackv5-show-feedback .articleFeedbackv5-feedback-hidden .articleFeedbackv5-feedback-hidden-marker, |
| 360 | +#articleFeedbackv5-show-feedback .articleFeedbackv5-feedback-deleted .articleFeedbackv5-feedback-deleted-marker { |
| 361 | + font-weight: bold; |
| 362 | + color: red; |
| 363 | + text-transform: uppercase; |
361 | 364 | margin-left: 20px; |
362 | 365 | } |
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js |
— | — | @@ -161,15 +161,15 @@ |
162 | 162 | $( '.articleFeedbackv5-' + value + '-link' ).live( 'click', function( e ) { |
163 | 163 | e.preventDefault(); |
164 | 164 | var $l = $( e.target ); |
165 | | - if ( $l.closest( '.articleFeedbackv5-feedback' ).data( 'hidden' ) ) { |
| 165 | + if ( $l.closest( '.articleFeedbackv5-feedback' ).data( 'hidden' ) |
| 166 | + || $l.closest( '.articleFeedbackv5-feedback' ).data( 'deleted' ) ) { |
166 | 167 | return false; |
167 | 168 | } |
168 | 169 | var id = $l.closest( '.articleFeedbackv5-feedback' ).attr( 'rel' ); |
169 | 170 | var activity = $.articleFeedbackv5special.getActivity( id ); |
170 | 171 | if ( activity[value] ) { |
171 | | - return false; |
172 | | - } |
173 | | - if ( 'helpful' == value && activity.unhelpful ) { |
| 172 | + $.articleFeedbackv5special.flagFeedback( id, value, -1 ); |
| 173 | + } else if ( 'helpful' == value && activity.unhelpful ) { |
174 | 174 | $.articleFeedbackv5special.flagFeedback( id, 'unhelpful', -1 ); |
175 | 175 | $.articleFeedbackv5special.flagFeedback( id, 'helpful', 1 ); |
176 | 176 | } else if ( 'unhelpful' == value && activity.helpful ) { |
— | — | @@ -185,7 +185,8 @@ |
186 | 186 | $( '.articleFeedbackv5-abuse-link' ).live( 'click', function( e ) { |
187 | 187 | e.preventDefault(); |
188 | 188 | var $l = $( e.target ); |
189 | | - if ( $l.closest( '.articleFeedbackv5-feedback' ).data( 'hidden' ) ) { |
| 189 | + if ( $l.closest( '.articleFeedbackv5-feedback' ).data( 'hidden' ) |
| 190 | + || $l.closest( '.articleFeedbackv5-feedback' ).data( 'deleted' ) ) { |
190 | 191 | return false; |
191 | 192 | } |
192 | 193 | var id = $l.closest( '.articleFeedbackv5-feedback' ).attr( 'rel' ); |
— | — | @@ -387,11 +388,14 @@ |
388 | 389 | * @param $row element the feedback row |
389 | 390 | */ |
390 | 391 | $.articleFeedbackv5special.markHidden = function ( $row ) { |
| 392 | + if ( $row.data( 'hidden' ) ) { |
| 393 | + $.articleFeedbackv5special.unmarkHidden(); |
| 394 | + } |
391 | 395 | $row.addClass( 'articleFeedbackv5-feedback-hidden' ) |
392 | 396 | .data( 'hidden', true ); |
393 | 397 | $( '<span class="articleFeedbackv5-feedback-hidden-marker"></span>' ) |
394 | 398 | .text( mw.msg( 'articlefeedbackv5-hidden' ) ) |
395 | | - .insertAfter( $row.find( '.articleFeedbackv5-comment-wrap h3 span.result' ) ); |
| 399 | + .insertAfter( $row.find( '.articleFeedbackv5-comment-details-date a' ) ); |
396 | 400 | }; |
397 | 401 | |
398 | 402 | // }}} |
— | — | @@ -409,8 +413,45 @@ |
410 | 414 | }; |
411 | 415 | |
412 | 416 | // }}} |
| 417 | + // {{{ markDeleted |
413 | 418 | |
| 419 | + /** |
| 420 | + * Utility method: Marks a feedback row deleted |
| 421 | + * |
| 422 | + * @param $row element the feedback row |
| 423 | + */ |
| 424 | + $.articleFeedbackv5special.markDeleted = function ( $row ) { |
| 425 | + if ( $row.data( 'deleted' ) ) { |
| 426 | + $.articleFeedbackv5special.unmarkDeleted(); |
| 427 | + } |
| 428 | + $row.addClass( 'articleFeedbackv5-feedback-deleted' ) |
| 429 | + .data( 'deleted', true ); |
| 430 | + var $marker = $( '<span class="articleFeedbackv5-feedback-deleted-marker"></span>' ) |
| 431 | + .text( mw.msg( 'articlefeedbackv5-deleted' ) ); |
| 432 | + if ( $row.data( 'hidden' ) ) { |
| 433 | + $marker.insertAfter( $row.find( '.articleFeedbackv5-feedback-hidden-marker' ) ); |
| 434 | + } else { |
| 435 | + $marker.insertAfter( $row.find( '.articleFeedbackv5-comment-details-date a' ) ); |
| 436 | + } |
| 437 | + }; |
| 438 | + |
414 | 439 | // }}} |
| 440 | + // {{{ unmarkDeleted |
| 441 | + |
| 442 | + /** |
| 443 | + * Utility method: Unmarks as deleted a feedback row |
| 444 | + * |
| 445 | + * @param $row element the feedback row |
| 446 | + */ |
| 447 | + $.articleFeedbackv5special.unmarkDeleted = function ( $row ) { |
| 448 | + $row.removeClass( 'articleFeedbackv5-feedback-deleted' ) |
| 449 | + .data( 'deleted', false ); |
| 450 | + $row.find( '.articleFeedbackv5-feedback-deleted-marker' ).remove(); |
| 451 | + }; |
| 452 | + |
| 453 | + // }}} |
| 454 | + |
| 455 | + // }}} |
415 | 456 | // {{{ Process methods |
416 | 457 | |
417 | 458 | // {{{ flagFeedback |
— | — | @@ -440,23 +481,25 @@ |
441 | 482 | if ( 'articlefeedbackv5-flag-feedback' in data ) { |
442 | 483 | if ( 'result' in data['articlefeedbackv5-flag-feedback'] ) { |
443 | 484 | if ( data['articlefeedbackv5-flag-feedback'].result == 'Success' ) { |
| 485 | + var $l = $( '#articleFeedbackv5-' + type + '-link-' + id ); |
| 486 | + // Helpful or unhelpful |
444 | 487 | if ( 'helpful' in data['articlefeedbackv5-flag-feedback'] ) { |
445 | 488 | $( '#articleFeedbackv5-helpful-votes-' + id ).text( data['articlefeedbackv5-flag-feedback'].helpful ); |
446 | 489 | } |
447 | 490 | if ( 'helpful' == type || 'unhelpful' == type ) { |
448 | | - var $l = $( '#articleFeedbackv5-' + type + '-link-' + id ); |
449 | 491 | if ( dir > 0 ) { |
450 | 492 | $l.addClass( 'helpful-active' ); |
451 | 493 | } else { |
452 | 494 | $l.removeClass( 'helpful-active' ); |
453 | 495 | } |
| 496 | + // Abusive |
454 | 497 | } else if ( 'abuse' == type ) { |
455 | | - var $l = $( '#articleFeedbackv5-abuse-link-' + id ); |
456 | 498 | if ( dir > 0 ) { |
457 | | - $l.text( mw.msg( 'articlefeedbackv5-abuse-saved' ) ); |
| 499 | + $l.text( mw.msg( 'articlefeedbackv5-abuse-saved', data['articlefeedbackv5-flag-feedback'].abuse_count ) ); |
458 | 500 | } else { |
459 | 501 | $l.text( mw.msg( 'articlefeedbackv5-form-abuse', data['articlefeedbackv5-flag-feedback'].abuse_count ) ); |
460 | 502 | } |
| 503 | + $l.attr( 'rel', data['articlefeedbackv5-flag-feedback'].abuse_count ); |
461 | 504 | if ( data['articlefeedbackv5-flag-feedback'].abusive ) { |
462 | 505 | $l.addClass( 'abusive' ); |
463 | 506 | } else { |
— | — | @@ -465,8 +508,8 @@ |
466 | 509 | if ( data['articlefeedbackv5-flag-feedback']['abuse-hidden'] ) { |
467 | 510 | $.articleFeedbackv5special.markHidden( $l.closest( '.articleFeedbackv5-feedback' ) ); |
468 | 511 | } |
| 512 | + // Hide |
469 | 513 | } else if ( 'hide' == type ) { |
470 | | - var $l = $( '#articleFeedbackv5-hide-link-' + id ); |
471 | 514 | if ( dir > 0 ) { |
472 | 515 | $l.text( mw.msg( 'articlefeedbackv5-form-unhide' ) ); |
473 | 516 | $.articleFeedbackv5special.markHidden( $l.closest( '.articleFeedbackv5-feedback' ) ); |
— | — | @@ -474,12 +517,14 @@ |
475 | 518 | $l.text( mw.msg( 'articlefeedbackv5-form-hide' ) ); |
476 | 519 | $.articleFeedbackv5special.unmarkHidden( $l.closest( '.articleFeedbackv5-feedback' ) ); |
477 | 520 | } |
| 521 | + // Delete |
478 | 522 | } else if ( 'delete' == type ) { |
479 | | - var $l = $( '#articleFeedbackv5-delete-link-' + id ); |
480 | 523 | if ( dir > 0 ) { |
481 | 524 | $l.text( mw.msg( 'articlefeedbackv5-form-undelete' ) ); |
| 525 | + $.articleFeedbackv5special.markDeleted( $l.closest( '.articleFeedbackv5-feedback' ) ); |
482 | 526 | } else { |
483 | 527 | $l.text( mw.msg( 'articlefeedbackv5-form-delete' ) ); |
| 528 | + $.articleFeedbackv5special.unmarkDeleted( $l.closest( '.articleFeedbackv5-feedback' ) ); |
484 | 529 | } |
485 | 530 | } |
486 | 531 | // Save activity |
— | — | @@ -489,7 +534,7 @@ |
490 | 535 | $.articleFeedbackv5special.activity[id][type] = dir > 0 ? true : false; |
491 | 536 | $.articleFeedbackv5special.storeActivity(); |
492 | 537 | } else if ( data['articlefeedbackv5-flag-feedback'].result == 'Error' ) { |
493 | | - msg = data['articlefeedbackv5-flag-feedback'].reason; |
| 538 | + mw.log( mw.msg( data['articlefeedbackv5-flag-feedback'].reason ) ); |
494 | 539 | } |
495 | 540 | } |
496 | 541 | } |
— | — | @@ -549,12 +594,15 @@ |
550 | 595 | } |
551 | 596 | if ( activity.abuse ) { |
552 | 597 | var $l = $( this ).find( '#articleFeedbackv5-abuse-link-' + id ); |
553 | | - $l.text( mw.msg( 'articlefeedbackv5-abuse-saved' ) ); |
| 598 | + $l.text( mw.msg( 'articlefeedbackv5-abuse-saved', $l.attr( 'rel' ) ) ); |
554 | 599 | } |
555 | 600 | } |
556 | 601 | if ( $( this ).hasClass( 'articleFeedbackv5-feedback-hidden' ) ) { |
557 | 602 | $.articleFeedbackv5special.markHidden( $( this ) ); |
558 | 603 | } |
| 604 | + if ( $( this ).hasClass( 'articleFeedbackv5-feedback-deleted' ) ) { |
| 605 | + $.articleFeedbackv5special.markDeleted( $( this ) ); |
| 606 | + } |
559 | 607 | } ); |
560 | 608 | $( '#articleFeedbackv5-feedback-count-total' ).text( data['articlefeedbackv5-view-feedback'].count ); |
561 | 609 | $.articleFeedbackv5special.listControls.continue = data['articlefeedbackv5-view-feedback'].continue; |
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php |
— | — | @@ -363,7 +363,8 @@ |
364 | 364 | } |
365 | 365 | $footer_links .= Html::element( 'a', array( |
366 | 366 | 'id' => "articleFeedbackv5-abuse-link-$id", |
367 | | - 'class' => $aclass |
| 367 | + 'class' => $aclass, |
| 368 | + 'rel' => $record[0]->af_abuse_count |
368 | 369 | ), wfMessage( 'articlefeedbackv5-form-abuse', $record[0]->af_abuse_count )->text() ); |
369 | 370 | } |
370 | 371 | $footer_links .= $details . Html::closeElement( 'div' ); |
— | — | @@ -446,6 +447,9 @@ |
447 | 448 | if ( $record[0]->af_is_hidden ) { |
448 | 449 | $topClass .= ' articleFeedbackv5-feedback-hidden'; |
449 | 450 | } |
| 451 | + if ( $record[0]->af_is_deleted ) { |
| 452 | + $topClass .= ' articleFeedbackv5-feedback-deleted'; |
| 453 | + } |
450 | 454 | return Html::openElement( 'div', array( |
451 | 455 | 'class' => $topClass, |
452 | 456 | 'rel' => $id |
— | — | @@ -460,12 +464,12 @@ |
461 | 465 | . $tools |
462 | 466 | . Html::closeElement( 'div' ); |
463 | 467 | } |
464 | | - |
| 468 | + |
465 | 469 | private function renderPermalinkTimestamp( $record ) { |
466 | 470 | global $wgLang; |
467 | 471 | $id = $record->af_id; |
468 | 472 | $title = $record->page_title; |
469 | | - |
| 473 | + |
470 | 474 | // Taken from the Moodbar extension. |
471 | 475 | $now = wfTimestamp( TS_UNIX ); |
472 | 476 | $timestamp = wfTimestamp( TS_UNIX, $record->af_created ); |
— | — | @@ -480,16 +484,16 @@ |
481 | 485 | } elseif( $timestamp ) { |
482 | 486 | $date = $wgLang->timeanddate($record->af_created ); |
483 | 487 | } |
484 | | - |
| 488 | + |
485 | 489 | // format the element |
486 | 490 | return Html::openElement( 'span', array( |
487 | 491 | 'class' => 'articleFeedbackv5-comment-details-date' |
488 | 492 | ) ) |
489 | | - . Linker::link( |
490 | | - Title::newFromText( |
491 | | - "Special:ArticleFeedbackv5/$title/$id" |
492 | | - ), |
493 | | - $date |
| 493 | + . Linker::link( |
| 494 | + Title::newFromText( |
| 495 | + "Special:ArticleFeedbackv5/$title/$id" |
| 496 | + ), |
| 497 | + $date |
494 | 498 | ) |
495 | 499 | . Html::closeElement( 'span' ); |
496 | 500 | } |
— | — | @@ -593,11 +597,11 @@ |
594 | 598 | $short = $wgLang->truncate( $text, 500 ); |
595 | 599 | |
596 | 600 | $rv = Html::openElement( 'blockquote' ) |
597 | | - . Html::element( 'span', |
| 601 | + . Html::element( 'span', |
598 | 602 | array( |
599 | 603 | 'class' => 'articleFeedbackv5-comment-short', |
600 | 604 | 'id' => "articleFeedbackv5-comment-short-$feedbackId" |
601 | | - ), |
| 605 | + ), |
602 | 606 | htmlspecialchars( $short ) |
603 | 607 | ); |
604 | 608 | |
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php |
— | — | @@ -173,6 +173,7 @@ |
174 | 174 | 'articlefeedbackv5-form-delete', |
175 | 175 | 'articlefeedbackv5-form-undelete', |
176 | 176 | 'articlefeedbackv5-hidden', |
| 177 | + 'articlefeedbackv5-deleted', |
177 | 178 | 'articlefeedbackv5-comment-more', |
178 | 179 | 'articlefeedbackv5-comment-less', |
179 | 180 | 'articlefeedbackv5-error-loading-feedback' |