| 1 |
( function () { |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
function addDaysLeftMessages( event ) { |
| 11 |
const $clock = $( event.target ); |
| 12 |
const timeLeft = $clock.data( 'days-left' ); |
| 13 |
if ( timeLeft === undefined ) { |
| 14 |
|
| 15 |
return; |
| 16 |
} |
| 17 |
const msg = timeLeft > 0 ? |
| 18 |
mw.msg( 'watchlist-expiry-days-left', timeLeft ) : |
| 19 |
mw.msg( 'watchlist-expiry-hours-left' ); |
| 20 |
$clock.after( $( '<span>' ) |
| 21 |
.addClass( 'mw-watchlistexpiry-msg' ) |
| 22 |
.text( mw.msg( 'parentheses', msg ) ) ); |
| 23 |
} |
| 24 |
|
| 25 |
$( () => { |
| 26 |
if ( 'ontouchstart' in document.documentElement ) { |
| 27 |
$( '.mw-changesList-watchlistExpiry' ).one( 'click', addDaysLeftMessages ); |
| 28 |
} |
| 29 |
} ); |
| 30 |
|
| 31 |
}() ); |