mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-26 19:56:49 +00:00
MediaContext: Link filename to file page
Change-Id: Ice3fdd40cd1f7b8ba2841ac326babc7f24a2635e
This commit is contained in:
parent
c245dd9ca0
commit
10792e179f
|
@ -65,6 +65,21 @@ ve.ui.MWMediaContextItem.prototype.getDescription = function () {
|
||||||
return ve.ce.nodeFactory.getDescription( this.model );
|
return ve.ce.nodeFactory.getDescription( this.model );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
ve.ui.MWMediaContextItem.prototype.renderBody = function () {
|
||||||
|
this.$body.append(
|
||||||
|
$( '<a>' )
|
||||||
|
.text( this.getDescription() )
|
||||||
|
.attr( {
|
||||||
|
href: mw.util.getUrl( this.model.getAttribute( 'resource' ) ),
|
||||||
|
target: '_blank',
|
||||||
|
rel: 'noopener'
|
||||||
|
} )
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
/* Registration */
|
/* Registration */
|
||||||
|
|
||||||
ve.ui.contextItemFactory.register( ve.ui.MWMediaContextItem );
|
ve.ui.contextItemFactory.register( ve.ui.MWMediaContextItem );
|
||||||
|
|
Loading…
Reference in a new issue