mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-14 11:16:44 +00:00
Merge "Make embed text short URL into a link in HTML mode"
This commit is contained in:
commit
0716876c6d
|
@ -163,11 +163,12 @@
|
|||
EFFP.getCreditHtml = function ( info ) {
|
||||
var creditText, creditParams,
|
||||
shortURL = info.imageInfo.descriptionShortUrl,
|
||||
shortLink = this.htmlUtils.makeLinkText( shortURL, { href: shortURL } ),
|
||||
license = info.imageInfo.license,
|
||||
byline = this.getByline( info.imageInfo.author, info.imageInfo.source, info.imageInfo.attribution );
|
||||
|
||||
if ( !byline && !license ) {
|
||||
return shortURL;
|
||||
return shortLink;
|
||||
}
|
||||
|
||||
creditParams = [
|
||||
|
@ -183,7 +184,7 @@
|
|||
creditParams.push( license.getShortLink() );
|
||||
}
|
||||
|
||||
creditParams.push( shortURL );
|
||||
creditParams.push( shortLink );
|
||||
creditText = mw.message.apply( mw, creditParams ).plain();
|
||||
|
||||
return creditText;
|
||||
|
|
|
@ -265,7 +265,7 @@
|
|||
}
|
||||
} );
|
||||
|
||||
assert.strictEqual( html, 'By Author - Source, link', 'Sanity check' );
|
||||
assert.strictEqual( html, 'By Author - Source, <a href="link">link</a>', 'Sanity check' );
|
||||
|
||||
html = formatter.getCreditHtml( {
|
||||
repoInfo: {
|
||||
|
@ -288,6 +288,6 @@
|
|||
}
|
||||
} );
|
||||
|
||||
assert.strictEqual( html, 'By Author - Source, <a href="http://www.wtfpl.net/">WTFPL v2</a>, link', 'Sanity check' );
|
||||
assert.strictEqual( html, 'By Author - Source, <a href="http://www.wtfpl.net/">WTFPL v2</a>, <a href="link">link</a>', 'Sanity check' );
|
||||
} );
|
||||
}( mediaWiki ) );
|
||||
|
|
Loading…
Reference in a new issue