Merge "Include license in title attribute of link in FileUsageDialog"

This commit is contained in:
jenkins-bot 2013-12-20 00:56:39 +00:00 committed by Gerrit Code Review
commit ea7ba8faaf
2 changed files with 8 additions and 1 deletions

View file

@ -631,6 +631,9 @@
// Cannot display, fallback or fail
license = 'default';
msgname = 'multimediaviewer-license-default';
} else {
// License found, store the license data
ui.$license.data( 'license', mw.message( msgname ).text() );
}
if ( license ) {

View file

@ -327,6 +327,10 @@
pattern = /^\/[^\/]/,
finalLink = pattern.test(link) ? linkPrefix +link: link,
license = this.$license.data( 'license' ) || '',
author = this.$author.text(),
linkTitle = ( license + ( author ? ' (' + author + ')' : '' ) ).trim(),
owtId = 'mw-mlb-use-file-onwiki-thumb',
ownId = 'mw-mlb-use-file-onwiki-normal',
owId = 'mw-mlb-use-file-offwiki',
@ -373,7 +377,7 @@
.prop( 'id', owId )
.prop( 'readonly', true )
.focus( selectAllOnEvent )
.val( '<a href="' + finalLink + '"><img src="' + src + '" /></a>' ),
.val( '<a href="' + finalLink + ( linkTitle ? '" title="' + linkTitle : '' ) + '" ><img src="' + src + '" /></a>' ),
$offWiki = $( '<div>' )