1 // Exif metadata display for MediaWiki file uploads
3 // Add an expand/collapse link and collapse by default if set to
4 // (with JS disabled, user will see all items)
7 jQuery( document
).ready( function( $ ) {
8 var showText
= mw
.msg( 'metadata-expand' );
9 var hideText
= mw
.msg( 'metadata-collapse' );
11 var $table
= $( '#mw_metadata' );
12 var $tbody
= $table
.find( 'tbody' );
13 if ( !$tbody
.length
) {
17 var $row
= $( '<tr></tr>' );
18 var $col
= $( '<td colspan="2"></td>' );
20 var $link
= $( '<a></a>', {
24 if ( $table
.is( '.collapsed' ) ) {
25 $( this ).text( hideText
);
27 $( this ).text( showText
);
29 $table
.toggleClass( 'expanded, collapsed' );
35 $tbody
.append( $row
);
38 $table
.addClass( 'collapsed' );