User:Minisarm/common.js

From translatewiki.net
Jump to: navigation, search
$( function () {
	// Add a "Remove apihelp" link to the top personal bar
	var $link, $li;
 
	$link = $( '<a>' )
		.prop( 'href', '#' )
		.text( 'Remove apihelp' )
		.on( 'click', function () {
			$( '.tux-message' ).each( function ( i, row ) {
				var $row = $( row );
 
				if ( $row.data().translateeditor.message.key.match( /^apihelp/ ) ) {
					$row.css( 'display', 'none' );
				}
			} );
		} );
 
	$li = $( '<li>' )
		.append( $link )
		.insertAfter( $( '#pt-mytalk' ) );
} );