apps/mediawiki/htdocs/extensions/MobileFrontend/resources/skins.minerva.scripts/init.js
/**
	 * Initialisation function for last modified module.
	 *
	 * Enhances an element representing a time
	 * to show a human friendly date in seconds, minutes, hours, days
	 * months or years
	 * @ignore
	 * @param {JQuery.Object} [$lastModifiedLink]
	 */
Initialisation function for last modified module.
Enhances an element representing a time
to show a human friendly date in seconds, minutes, hours, days
months or years
@ignore
@param {JQuery.Object} [$lastModifiedLink]
Initialisation function for last modified module . Enhances an element representing a time to show a human friendly date in seconds minutes hours days months or years @ignore @param { JQuery . Object } [ $lastModifiedLink ]
function initHistoryLink( $lastModifiedLink ) {
		var delta, historyUrl, msg, $bar,
			ts, username, gender;
		historyUrl = $lastModifiedLink.attr( 'href' );
		ts = $lastModifiedLink.data( 'timestamp' );
		username = $lastModifiedLink.data( 'user-name' ) || false;
		gender = $lastModifiedLink.data( 'user-gender' );
		if ( ts ) {
			delta = time.getTimeAgoDelta( parseInt( ts, 10 ) );
			if ( time.isRecent( delta ) ) {
				$bar = $lastModifiedLink.closest( '.last-modified-bar' );
				$bar.addClass( 'active' );
				$bar.find( '.mw-ui-icon' ).each( function () {
					$( this ).attr( 'class', $( this ).attr( 'class' ).replace( '-gray', '-invert' ) );
				} );
			}
			msg = time.getLastModifiedMessage( ts, username, gender, historyUrl );
			$lastModifiedLink.replaceWith( msg );
		}
	}
function initHistoryLink ( $lastModifiedLink ) { var delta , historyUrl , msg , $bar , ts , username , gender ; historyUrl = $lastModifiedLink . attr ( 'href' ) ; ts = $lastModifiedLink . data ( 'timestamp' ) ; username = $lastModifiedLink . data ( 'user-name' ) || false ; gender = $lastModifiedLink . data ( 'user-gender' ) ; if ( ts ) { delta = time . getTimeAgoDelta ( parseInt ( ts , 10 ) ) ; if ( time . isRecent ( delta ) ) { $bar = $lastModifiedLink . closest ( '.last-modified-bar' ) ; $bar . addClass ( 'active' ) ; $bar . find ( '.mw-ui-icon' ) . each ( function ( ) { $ ( this ) . attr ( 'class' , $ ( this ) . attr ( 'class' ) . replace ( '-gray' , '-invert' ) ) ; } ) ; } msg = time . getLastModifiedMessage ( ts , username , gender , historyUrl ) ; $lastModifiedLink . replaceWith ( msg ) ; } }
Initialisation function for last modified module.
Initialisation function for last modified module .
// in beta update icons to be inverted