mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-09-25 03:09:40 +00:00
Include license in title attribute of link in FileUsageDialog
The title attribute of the link that wraps the image in "Use this file on another website" will be set to the license and/or author of the image, if available. Bug: 56588 Change-Id: I5f504964ec3a63e4927385cb68e90856eb4cfe37
This commit is contained in:
parent
d98824f0a8
commit
343e82cc8c
|
@ -627,6 +627,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 ) {
|
||||
|
|
|
@ -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>' )
|
||||
|
|
Loading…
Reference in a new issue