Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -390,7 +390,8 @@ |
391 | 391 | 'revreview-submit-reviewed', 'revreview-submit-unreviewed', |
392 | 392 | 'revreview-submitting', 'actioncomplete', 'actionfailed', |
393 | 393 | 'revreview-adv-reviewing-p', 'revreview-adv-reviewing-c', |
394 | | - 'revreview-sadv-reviewing-p', 'revreview-sadv-reviewing-c' |
| 394 | + 'revreview-sadv-reviewing-p', 'revreview-sadv-reviewing-c', |
| 395 | + 'revreview-adv-start-link', 'revreview-adv-stop-link' |
395 | 396 | ), |
396 | 397 | 'dependencies' => array( 'mediawiki.util' ), |
397 | 398 | 'localBasePath' => $localModulePath, |
Index: trunk/extensions/FlaggedRevs/presentation/language/RevisionReview.i18n.php |
— | — | @@ -65,10 +65,12 @@ |
66 | 66 | 'revreview-successful2' => '\'\'\'Revision of [[:$1|$1]] successfully unflagged.\'\'\'', |
67 | 67 | 'revreview-poss-conflict-p' => '\'\'\'Warning: [[User:$1|$1]] started reviewing this page on $2 at $3.\'\'\'', |
68 | 68 | 'revreview-poss-conflict-c' => '\'\'\'Warning: [[User:$1|$1]] started reviewing these changes on $2 at $3.\'\'\'', |
69 | | - 'revreview-adv-reviewing-p' => '<span class="fr-under-review">Notice: Other reviewers can see that you are reviewing this page.</span> (<a id="mw-fr-reviewing-stop" href="javascript:void(0)">de-advertise</a>)', |
70 | | - 'revreview-adv-reviewing-c' => '<span class="fr-under-review">Notice: Other reviewers can see that you are reviewing these changes.</span> (<a id="mw-fr-reviewing-stop" href="javascript:void(0)">de-advertise</a>)', |
71 | | - 'revreview-sadv-reviewing-p' => 'You can <a id="mw-fr-reviewing-start" href="javascript:void(0)">advertise</a> yourself as reviewing this page to other users.', |
72 | | - 'revreview-sadv-reviewing-c' => 'You can <a id="mw-fr-reviewing-start" href="javascript:void(0)">advertise</a> yourself as reviewing these changes to other users.', |
| 69 | + 'revreview-adv-reviewing-p' => 'Notice: Other reviewers can see that you are reviewing this page.', |
| 70 | + 'revreview-adv-reviewing-c' => 'Notice: Other reviewers can see that you are reviewing these changes.', |
| 71 | + 'revreview-sadv-reviewing-p' => 'You can $1 yourself as reviewing this page to other users.', |
| 72 | + 'revreview-sadv-reviewing-c' => 'You can $1 yourself as reviewing these changes to other users.', |
| 73 | + 'revreview-adv-start-link' => 'advertise', |
| 74 | + 'revreview-adv-stop-link' => 'de-advertise', |
73 | 75 | 'revreview-toolow' => '\'\'\'You must rate each of the attributes higher than "inadequate" in order for a revision to be considered reviewed.\'\'\' |
74 | 76 | |
75 | 77 | To remove the review status of a revision, click "unaccept". |
Index: trunk/extensions/FlaggedRevs/presentation/RevisionReviewFormUI.php |
— | — | @@ -143,25 +143,18 @@ |
144 | 144 | list( $u, $ts ) = FRUserActivity::getUserReviewingPage( $this->rev->getPage() ); |
145 | 145 | } |
146 | 146 | $form .= "<p>"; |
147 | | - if ( $u !== null ) { // page under review... |
148 | | - if ( $u != $this->user->getName() ) { // by another user... |
149 | | - $form .= '<span class="fr-under-review">'; |
150 | | - $msg = $priorRevId |
151 | | - ? 'revreview-poss-conflict-c' |
152 | | - : 'revreview-poss-conflict-p'; |
153 | | - $form .= wfMsgExt( $msg, 'parseinline', |
154 | | - $u, $wgLang->date( $ts, true ), $wgLang->time( $ts, true ) ); |
155 | | - $form .= "</span>"; |
156 | | - } else { // by this user... |
157 | | - $form .= '<span id="mw-fr-reviewing-status">'; // JS widget |
158 | | - $msg = $priorRevId |
159 | | - ? 'revreview-adv-reviewing-c' |
160 | | - : 'revreview-adv-reviewing-p'; |
161 | | - $form .= wfMsg( $msg ); // don't escape |
162 | | - $form .= "</span>"; |
163 | | - } |
164 | | - } else { // page not under review; add JS widget |
165 | | - $form .= '<span id="mw-fr-reviewing-status" style="display:none;"></span>'; |
| 147 | + // Page under review (and not by this user)... |
| 148 | + if ( $u !== null && $u != $this->user->getName() ) { |
| 149 | + $form .= '<span class="fr-under-review">'; |
| 150 | + $msg = $priorRevId |
| 151 | + ? 'revreview-poss-conflict-c' |
| 152 | + : 'revreview-poss-conflict-p'; |
| 153 | + $form .= wfMsgExt( $msg, 'parseinline', |
| 154 | + $u, $wgLang->date( $ts, true ), $wgLang->time( $ts, true ) ); |
| 155 | + $form .= "</span>"; |
| 156 | + // Page not under review or under review by this user... |
| 157 | + } else { |
| 158 | + $form .= '<span id="mw-fr-reviewing-status" style="display:none;"></span>'; // JS widget |
166 | 159 | } |
167 | 160 | $form .= "</p>\n"; |
168 | 161 | |
Index: trunk/extensions/FlaggedRevs/presentation/modules/review.js |
— | — | @@ -346,12 +346,21 @@ |
347 | 347 | return; // failed |
348 | 348 | } |
349 | 349 | } |
350 | | - // Update notice to say that user is advertising... |
351 | | - var msgkey = $('#mw-fr-input-refid') |
| 350 | + // Build notice to say that user is advertising... |
| 351 | + var msgkey = $('#mw-fr-input-refid').length |
352 | 352 | ? 'revreview-adv-reviewing-c' // diff |
353 | 353 | : 'revreview-adv-reviewing-p' // page |
354 | | - $('#mw-fr-reviewing-status').html( mw.msg( msgkey, [mw.config.get('wgUserName')] ) ); |
355 | | - $('#mw-fr-reviewing-stop').click( FlaggedRevsReview.deadvertiseReviewing ); |
| 354 | + var $underReview = $( |
| 355 | + '<span class="fr-under-review">' + mw.message( msgkey ).escaped() + '</span>' ); |
| 356 | + // Update notice to say that user is advertising... |
| 357 | + $('#mw-fr-reviewing-status') |
| 358 | + .empty() |
| 359 | + .append( $underReview ) |
| 360 | + .append( ' (' + mw.html.element( 'a', |
| 361 | + { id: 'mw-fr-reviewing-stop' }, mw.msg( 'revreview-adv-stop-link' ) ) + ')' ) |
| 362 | + .find( '#mw-fr-reviewing-stop') |
| 363 | + .css( 'cursor', 'pointer' ) |
| 364 | + .click( FlaggedRevsReview.deadvertiseReviewing ); |
356 | 365 | }, |
357 | 366 | |
358 | 367 | /* |
— | — | @@ -363,12 +372,23 @@ |
364 | 373 | return; // failed |
365 | 374 | } |
366 | 375 | } |
367 | | - // Update notice to say that user is not advertising... |
368 | | - var msgkey = $('#mw-fr-input-refid') |
| 376 | + // Build notice to say that user is not advertising... |
| 377 | + var msgkey = $('#mw-fr-input-refid').length |
369 | 378 | ? 'revreview-sadv-reviewing-c' // diff |
370 | 379 | : 'revreview-sadv-reviewing-p' // page |
371 | | - $('#mw-fr-reviewing-status').html( mw.msg( msgkey, [mw.config.get('wgUserName')] ) ); |
372 | | - $('#mw-fr-reviewing-start').click( FlaggedRevsReview.advertiseReviewing ); |
| 380 | + var $underReview = $( |
| 381 | + '<span class="fr-make-under-review">' + |
| 382 | + mw.message( msgkey ) |
| 383 | + .escaped() |
| 384 | + .replace( /\$1/, mw.html.element( 'a', |
| 385 | + { id: 'mw-fr-reviewing-start' }, mw.msg( 'revreview-adv-start-link' ) ) ) + |
| 386 | + '</span>' |
| 387 | + ); |
| 388 | + $underReview.find( '#mw-fr-reviewing-start') |
| 389 | + .css( 'cursor', 'pointer' ) |
| 390 | + .click( FlaggedRevsReview.advertiseReviewing ); |
| 391 | + // Update notice to say that user is not advertising... |
| 392 | + $('#mw-fr-reviewing-status').empty().append( $underReview ); |
373 | 393 | }, |
374 | 394 | |
375 | 395 | /* |
— | — | @@ -415,8 +435,8 @@ |
416 | 436 | FlaggedRevsReview.enableAjaxReviewActivity(); |
417 | 437 | |
418 | 438 | // Flag users as "no longer reviewing" on navigate-away |
419 | | -window.onbeforeunload = function( e ) { |
| 439 | +$( window ).bind( 'beforeunload', function( e ) { |
420 | 440 | if ( FlaggedRevsReview.isUserReviewing == 1 ) { |
421 | 441 | FlaggedRevsReview.deadvertiseReviewing(); |
422 | 442 | } |
423 | | -}; |
| 443 | +} ); |