Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php |
— | — | @@ -97,11 +97,7 @@ |
98 | 98 | 'articlefeedbackv5-form5-header' => '{{GENDER:$1|$1}} rated this page:', |
99 | 99 | 'articlefeedbackv5-form-not-shown' => '{{GENDER:$1|$1}} was not shown a feedback form.', |
100 | 100 | 'articlefeedbackv5-form-invalid' => 'Invalid feedback form ID.', |
101 | | - 'articlefeedbackv5-delete-saved' => 'Feedback deleted', |
102 | 101 | 'articlefeedbackv5-abuse-saved' => 'Flagged as abuse', |
103 | | - 'articlefeedbackv5-unhelpful-saved' => 'No', |
104 | | - 'articlefeedbackv5-helpful-saved' => 'Yes', |
105 | | - 'articlefeedbackv5-undelete-saved' => 'Feedback shown', |
106 | 102 | 'articlefeedbackv5-oversight-saved' => 'Marked for oversight', |
107 | 103 | 'articlefeedbackv5-unoversight-saved' => 'Oversight flag removed', |
108 | 104 | 'articlefeedbackv5-error-loading-feedback' => 'Error loading feedback', |
— | — | @@ -354,7 +350,6 @@ |
355 | 351 | 'articlefeedbackv5-form2-header-suggestion' => 'Parameters: |
356 | 352 | * $1 is a user name.', |
357 | 353 | 'articlefeedbackv5-form4-header' => 'Messages in the feedback dashboard to indicate that a user was only presented with a Call To Action form. This is a feedback form that asks a user to do something, rather than provide feedback.', |
358 | | - 'articlefeedbackv5-unhelpful-saved' => '{{Identical|No}}', |
359 | 354 | 'articlefeedbackv5-oversight-saved' => 'Oversight request saved successfully', |
360 | 355 | 'articlefeedbackv5-unoversight-saved' => 'Request for oversight removed successfully', |
361 | 356 | 'articlefeedbackv5-discussion-page' => '{{Identical|Discussion}}', |
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js |
— | — | @@ -178,7 +178,7 @@ |
179 | 179 | } ) |
180 | 180 | } ); |
181 | 181 | |
182 | | - // Flag as abuse |
| 182 | + // Flag/Unflag as abuse |
183 | 183 | $( '.articleFeedbackv5-abuse-link' ).live( 'click', function( e ) { |
184 | 184 | e.preventDefault(); |
185 | 185 | var $l = $( e.target ); |
— | — | @@ -207,11 +207,17 @@ |
208 | 208 | } |
209 | 209 | } ); |
210 | 210 | |
211 | | - $.each( ['undelete', 'oversight', 'delete', 'unoversight'], function ( index, value ) { |
212 | | - $( '.articleFeedbackv5-' + value + '-link' ).live( 'click', function( e ) { |
213 | | - e.preventDefault(); |
214 | | - $.articleFeedbackv5special.flagFeedback( $.articleFeedbackv5special.stripID( this, 'articleFeedbackv5-' + value + '-link-' ), value, 1 ); |
215 | | - } ) |
| 211 | + // Delete/Undelete this post |
| 212 | + $( '.articleFeedbackv5-delete-link' ).live( 'click', function( e ) { |
| 213 | + e.preventDefault(); |
| 214 | + var $l = $( e.target ); |
| 215 | + var id = $l.closest( '.articleFeedbackv5-feedback' ).attr( 'rel' ); |
| 216 | + var activity = $.articleFeedbackv5special.getActivity( id ); |
| 217 | + if ( activity.delete ) { |
| 218 | + $.articleFeedbackv5special.flagFeedback( id, 'delete', -1 ); |
| 219 | + } else { |
| 220 | + $.articleFeedbackv5special.flagFeedback( id, 'delete', 1 ); |
| 221 | + } |
216 | 222 | } ); |
217 | 223 | } |
218 | 224 | |
— | — | @@ -465,9 +471,13 @@ |
466 | 472 | $l.text( mw.msg( 'articlefeedbackv5-form-hide' ) ); |
467 | 473 | $.articleFeedbackv5special.unmarkHidden( $l.closest( '.articleFeedbackv5-feedback' ) ); |
468 | 474 | } |
469 | | - } else { |
470 | | - msg = 'articlefeedbackv5-' + type + '-saved'; |
471 | | - $( '#articleFeedbackv5-' + type + '-link-' + id ).text( mw.msg( msg ) ); |
| 475 | + } else if ( 'delete' == type ) { |
| 476 | + var $l = $( '#articleFeedbackv5-delete-link-' + id ); |
| 477 | + if ( dir > 0 ) { |
| 478 | + $l.text( mw.msg( 'articlefeedbackv5-form-undelete' ) ); |
| 479 | + } else { |
| 480 | + $l.text( mw.msg( 'articlefeedbackv5-form-delete' ) ); |
| 481 | + } |
472 | 482 | } |
473 | 483 | // Save activity |
474 | 484 | if ( !( id in $.articleFeedbackv5special.activity ) ) { |
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php |
— | — | @@ -436,15 +436,15 @@ |
437 | 437 | } |
438 | 438 | |
439 | 439 | if ( $can_delete ) { |
440 | | - # delete |
441 | | - $link = 'delete'; |
442 | 440 | if ( $record[0]->af_is_deleted > 0 ) { |
443 | | - $link = 'undelete'; |
| 441 | + $msg = 'undelete'; |
| 442 | + } else { |
| 443 | + $msg = 'delete'; |
444 | 444 | } |
445 | 445 | $tools .= Html::rawElement( 'li', array(), Html::element( 'a', array( |
446 | | - 'id' => "articleFeedbackv5-$link-link-$id", |
447 | | - 'class' => "articleFeedbackv5-$link-link" |
448 | | - ), wfMessage( "articlefeedbackv5-form-$link", $record[0]->af_is_deleted )->text() ) ); |
| 446 | + 'id' => "articleFeedbackv5-delete-link-$id", |
| 447 | + 'class' => "articleFeedbackv5-delete-link" |
| 448 | + ), wfMessage( "articlefeedbackv5-form-" . $msg )->text() ) ); |
449 | 449 | } |
450 | 450 | |
451 | 451 | /* |
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php |
— | — | @@ -169,11 +169,9 @@ |
170 | 170 | 'articlefeedbackv5-abuse-saved', |
171 | 171 | 'articlefeedbackv5-form-hide', |
172 | 172 | 'articlefeedbackv5-form-unhide', |
| 173 | + 'articlefeedbackv5-form-delete', |
| 174 | + 'articlefeedbackv5-form-undelete', |
173 | 175 | 'articlefeedbackv5-hidden', |
174 | | - 'articlefeedbackv5-delete-saved', |
175 | | - 'articlefeedbackv5-undelete-saved', |
176 | | - 'articlefeedbackv5-oversight-saved', |
177 | | - 'articlefeedbackv5-unoversight-saved', |
178 | 176 | 'articlefeedbackv5-comment-more', |
179 | 177 | 'articlefeedbackv5-comment-less' |
180 | 178 | ), |