Make username in the toolip a link, another approach

This makes Mediawiki render the link. Unfortunately, it is
not rendering redlinks for not exisiting pages.

Also updates qqq.json i18n file which was missing in
Ifb2f33febbdf0f7c9584941b71596abb47fb8088

Bug: T138944
Change-Id: If336984362358193a6c43144ace2f818dbe0633d
This commit is contained in:
Leszek Manicki 2016-06-30 14:27:16 +02:00
parent 22dc00571f
commit 946c7656f3
3 changed files with 11 additions and 10 deletions

View file

@ -12,7 +12,7 @@
"revisionslider-label-page-size": "<strong>Page size:</strong> $1 {{PLURAL:$2|byte|bytes}}",
"revisionslider-label-change-size": "<strong>Change size:</strong> $1 {{PLURAL:$2|byte|bytes}}",
"revisionslider-label-comment": "Comment: ",
"revisionslider-label-username": "<strong>Username:</strong> $1",
"revisionslider-label-username": "<strong>Username:</strong> [[$2|$1]]",
"revisionslider-minoredit": "This is a minor edit",
"revisionslider-loading-placeholder": "The revision slider is loading.",
"revisionslider-loading-failed": "The revision slider failed to load.",

View file

@ -13,7 +13,7 @@
"revisionslider-label-page-size": "Label describing the size of this revision.\nParameters:\n* $1 - Formatted page size.\n* $2 - Page size as raw number.\n{{Identical|Page size}}",
"revisionslider-label-change-size": "Label describing the size of the change compared to the revision before.\nParameters:\n* $1 - Formatted change size colored with markup.\n* $2 - Change size as raw number.",
"revisionslider-label-comment": "Label showing the edit summary of a revision.\n{{Identical|Comment}}",
"revisionslider-label-username": "Label for the revision's author's username.\n{{doc-important|<nowiki>{{</nowiki>[[Gender|GENDER]]<nowiki>}}</nowiki> is '''NOT''' supported.}}\n\nParameters:\n* $1 - Username.\n\n{{Identical|Username}}",
"revisionslider-label-username": "Label for the revision's author's username.\n{{doc-important|<nowiki>{{</nowiki>[[Gender|GENDER]]<nowiki>}}</nowiki> is '''NOT''' supported.}}\n\nParameters:\n* $1 - Username, $2 - user page or Special:Contributors subpage for IP addresses.\n\n{{Identical|Username}}",
"revisionslider-minoredit": "Text labeling a minor edit.",
"revisionslider-loading-placeholder": "Message shown while the RevisionSlider is still loading on a diff page. Once loaded the message is removed.",
"revisionslider-loading-failed": "Message shown if the RevisionSlider fails to initially load.",

View file

@ -143,7 +143,7 @@
),
rev.getUser() ?
$( '<bdi>' ).append( $( '<p>' ).append(
mw.message( 'revisionslider-label-username', this.getUserLink( mw.html.escape( rev.getUser() ) ) ).parseDom()
mw.message( 'revisionslider-label-username', mw.html.escape( rev.getUser() ), this.getUserPage( rev.getUser() ) ).parseDom()
) )
: '',
this.makeCommentLine( rev ),
@ -156,13 +156,14 @@
return $tooltip.html();
},
getUserLink: function ( user ) {
return $( '<a>' )
.attr( 'href', mw.util.getUrl(
( mw.util.isIPAddress( user, false ) ? 'Special:Contributions/' : 'User:' ) + user
) )
.addClass( 'mw-userlink' )
.text( user );
/**
* Generates a link to user page or to contributions page for IP addresses
*
* @param {string} user
* @return {string}
*/
getUserPage: function ( user ) {
return ( mw.util.isIPAddress( user, false ) ? 'Special:Contributions/' : 'User:' ) + mw.html.escape( user );
},
/**