Added 'Learn more' message

Message was added to replace 'multimediaviewer-repository' when the file was local

Bug: 56121
Change-Id: I2c6cef2cb21f88159dc56ca7c94c4be21e553db9
This commit is contained in:
apsdehal 2013-12-19 12:21:57 +05:30 committed by apsdehal
parent f18208025c
commit fb4367f24c
3 changed files with 17 additions and 12 deletions

View file

@ -31,6 +31,7 @@ $messages['en'] = array(
'multimediaviewer-pref-desc' => 'Improve your multimedia viewing experience with this new tool. It displays images in larger size on pages that have thumbnails. Images are shown in a nicer Lightbox overlay, and can also be viewed in full-size.', 'multimediaviewer-pref-desc' => 'Improve your multimedia viewing experience with this new tool. It displays images in larger size on pages that have thumbnails. Images are shown in a nicer Lightbox overlay, and can also be viewed in full-size.',
'multimediaviewer-file-page' => 'Go to corresponding file page', 'multimediaviewer-file-page' => 'Go to corresponding file page',
'multimediaviewer-repository' => 'Learn more on $1', 'multimediaviewer-repository' => 'Learn more on $1',
'multimediaviewer-repository-local' => 'Learn more',
'multimediaviewer-datetime-created' => 'Created on $1', 'multimediaviewer-datetime-created' => 'Created on $1',
'multimediaviewer-datetime-uploaded' => 'Uploaded on $1', 'multimediaviewer-datetime-uploaded' => 'Uploaded on $1',
'multimediaviewer-userpage-link' => '{{GENDER:$2|Uploaded}} by $1', 'multimediaviewer-userpage-link' => '{{GENDER:$2|Uploaded}} by $1',
@ -71,7 +72,13 @@ $messages['qqq'] = array(
'multimediaviewer-pref-desc' => 'Description of preference', 'multimediaviewer-pref-desc' => 'Description of preference',
'multimediaviewer-file-page' => 'Text for a link to the file page for an image.', 'multimediaviewer-file-page' => 'Text for a link to the file page for an image.',
'multimediaviewer-repository' => 'Link to the repository where the image is hosted. Parameters: 'multimediaviewer-repository' => 'Link to the repository where the image is hosted. Parameters:
* $1 - the display name of that site', * $1 - the display name of that site
See also:
* {{msg-mw|multimediaviewer-repository-local}}',
'multimediaviewer-repository-local' => 'Link to repository where the image is locally hosted.
{{Identical|Learn more}}
See also:
* {{msg-mw|multimediaviewer-repository}}',
'multimediaviewer-datetime-created' => 'Used in JavaScript code. Parameters: 'multimediaviewer-datetime-created' => 'Used in JavaScript code. Parameters:
* $1 - time and date (formatted) * $1 - time and date (formatted)
See also: See also:

View file

@ -108,6 +108,7 @@ $wgResourceModules['ext.multimediaViewer'] = array_merge( array(
'messages' => array( 'messages' => array(
'multimediaviewer-file-page', 'multimediaviewer-file-page',
'multimediaviewer-repository', 'multimediaviewer-repository',
'multimediaviewer-repository-local',
'multimediaviewer-datetime-created', 'multimediaviewer-datetime-created',
'multimediaviewer-datetime-uploaded', 'multimediaviewer-datetime-uploaded',
'multimediaviewer-userpage-link', 'multimediaviewer-userpage-link',

View file

@ -493,16 +493,6 @@
} }
if ( repoInfo ) { if ( repoInfo ) {
if ( repoInfo.displayname ) {
ui.$repo.text(
mw.message( 'multimediaviewer-repository', repoInfo.displayname ).text()
);
} else {
ui.$repo.text(
mw.message( 'multimediaviewer-repository', mw.config.get( 'wgSiteName' ) ).text()
);
}
if ( repoInfo.server && repoInfo.articlepath ) { if ( repoInfo.server && repoInfo.articlepath ) {
articlePath = repoInfo.server + repoInfo.articlepath; articlePath = repoInfo.server + repoInfo.articlepath;
} else { } else {
@ -515,9 +505,16 @@
linkToRepo = articlePath.replace( '$1', fileTitle.getPrefixedText() ); linkToRepo = articlePath.replace( '$1', fileTitle.getPrefixedText() );
} }
if ( repoInfo.local ) { if( repoInfo.local ) {
ui.$repo.text(
mw.message( 'multimediaviewer-repository-local' ).text()
);
linkToRepo = mw.config.get( 'wgServer' ) + linkToRepo; linkToRepo = mw.config.get( 'wgServer' ) + linkToRepo;
ui.$useFile.data( 'isLocal' ,repoInfo.local ); ui.$useFile.data( 'isLocal' ,repoInfo.local );
} else {
ui.$repo.text(
mw.message( 'multimediaviewer-repository', repoInfo.displayname ).text()
);
} }
ui.$repo.prop( 'href', linkToRepo ); ui.$repo.prop( 'href', linkToRepo );