From fb4367f24c1f5586e4279905e05d4f116b5a4e56 Mon Sep 17 00:00:00 2001 From: apsdehal Date: Thu, 19 Dec 2013 12:21:57 +0530 Subject: [PATCH] Added 'Learn more' message Message was added to replace 'multimediaviewer-repository' when the file was local Bug: 56121 Change-Id: I2c6cef2cb21f88159dc56ca7c94c4be21e553db9 --- MultimediaViewer.i18n.php | 9 ++++++++- MultimediaViewer.php | 1 + .../ext.multimediaViewer.js | 19 ++++++++----------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/MultimediaViewer.i18n.php b/MultimediaViewer.i18n.php index d063e8a78..94b29c331 100644 --- a/MultimediaViewer.i18n.php +++ b/MultimediaViewer.i18n.php @@ -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-file-page' => 'Go to corresponding file page', 'multimediaviewer-repository' => 'Learn more on $1', + 'multimediaviewer-repository-local' => 'Learn more', 'multimediaviewer-datetime-created' => 'Created on $1', 'multimediaviewer-datetime-uploaded' => 'Uploaded on $1', 'multimediaviewer-userpage-link' => '{{GENDER:$2|Uploaded}} by $1', @@ -71,7 +72,13 @@ $messages['qqq'] = array( 'multimediaviewer-pref-desc' => 'Description of preference', '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: -* $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: * $1 - time and date (formatted) See also: diff --git a/MultimediaViewer.php b/MultimediaViewer.php index 73afbcc38..9f91c7a3e 100644 --- a/MultimediaViewer.php +++ b/MultimediaViewer.php @@ -108,6 +108,7 @@ $wgResourceModules['ext.multimediaViewer'] = array_merge( array( 'messages' => array( 'multimediaviewer-file-page', 'multimediaviewer-repository', + 'multimediaviewer-repository-local', 'multimediaviewer-datetime-created', 'multimediaviewer-datetime-uploaded', 'multimediaviewer-userpage-link', diff --git a/resources/ext.multimediaViewer/ext.multimediaViewer.js b/resources/ext.multimediaViewer/ext.multimediaViewer.js index 1cd4b114e..469b6b03b 100755 --- a/resources/ext.multimediaViewer/ext.multimediaViewer.js +++ b/resources/ext.multimediaViewer/ext.multimediaViewer.js @@ -493,16 +493,6 @@ } 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 ) { articlePath = repoInfo.server + repoInfo.articlepath; } else { @@ -515,9 +505,16 @@ 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; ui.$useFile.data( 'isLocal' ,repoInfo.local ); + } else { + ui.$repo.text( + mw.message( 'multimediaviewer-repository', repoInfo.displayname ).text() + ); } ui.$repo.prop( 'href', linkToRepo );