2 * Exif metadata display for MediaWiki file uploads
4 * Add an expand/collapse link and collapse by default if set to
5 * (with JS disabled, user will see all items)
10 showText
= mw
.msg( 'metadata-expand' ),
11 hideText
= mw
.msg( 'metadata-collapse' ),
12 $table
= $( '#mw_metadata' ),
13 $tbody
= $table
.find( 'tbody' );
15 if ( !$tbody
.length
) {
19 $row
= $( '<tr class="mw-metadata-show-hide-extended"></tr>' );
20 $col
= $( '<td colspan="2"></td>' );
25 }).click(function () {
26 if ( $table
.hasClass( 'collapsed' ) ) {
27 $( this ).text( hideText
);
29 $( this ).text( showText
);
31 $table
.toggleClass( 'expanded collapsed' );
37 $tbody
.append( $row
);
40 $table
.addClass( 'collapsed' );
43 }( mediaWiki
, jQuery
) );