r75796 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75795‎ | r75796 | r75797 >
Date:15:52, 1 November 2010
Author:catrope
Status:ok
Tags:
Comment:
(bug 25717) Fix "Hide/show extended details" toggle in image metadata table
Modified paths:
  • /trunk/phase3/includes/ImagePage.php (modified) (history)
  • /trunk/phase3/resources/Resources.php (modified) (history)
  • /trunk/phase3/skins/common/metadata.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/metadata.js
@@ -47,3 +47,7 @@
4848 }
4949 return false;
5050 }
 51+
 52+$( document ).ready( function() {
 53+ attachMetadataToggle( 'mw_metadata', mediaWiki.msg( 'metadata-expand' ), mediaWiki.msg( 'metadata-collapse' ) );
 54+} );
Index: trunk/phase3/includes/ImagePage.php
@@ -143,13 +143,9 @@
144144 $wgOut->addHTML( $html );
145145
146146 if ( $showmeta ) {
147 - $expand = htmlspecialchars( Xml::escapeJsString( wfMsg( 'metadata-expand' ) ) );
148 - $collapse = htmlspecialchars( Xml::escapeJsString( wfMsg( 'metadata-collapse' ) ) );
149147 $wgOut->addHTML( Xml::element( 'h2', array( 'id' => 'metadata' ), wfMsg( 'metadata' ) ) . "\n" );
150148 $wgOut->addWikiText( $this->makeMetadataTable( $formattedMetadata ) );
151149 $wgOut->addModules( array( 'mediawiki.legacy.metadata' ) );
152 - $wgOut->addHTML(
153 - "<script type=\"text/javascript\">attachMetadataToggle('mw_metadata', '$expand', '$collapse');</script>\n" );
154150 }
155151
156152 $css = $this->repo->getDescriptionStylesheetUrl();
Index: trunk/phase3/resources/Resources.php
@@ -444,6 +444,7 @@
445445 'mediawiki.legacy.metadata' => new ResourceLoaderFileModule( array(
446446 'scripts' => 'skins/common/metadata.js',
447447 'dependencies' => 'mediawiki.legacy.wikibits',
 448+ 'messages' => array( 'metadata-expand', 'metadata-collapse' ),
448449 ) ),
449450 'mediawiki.legacy.mwsuggest' => new ResourceLoaderFileModule( array(
450451 'scripts' => 'skins/common/mwsuggest.js',

Status & tagging log