* Add a 'title' attribute like for wikitext links
* Add a 'missing' property to make it easy to check for redlinks
in the input programatically
Change-Id: I647af4dee947a6572f0202cf6b8b28777bbdc17e
'mediawiki.ForeignApi',
'mediawiki.Title',
),
+ 'messages' => array(
+ 'red-link-title',
+ ),
'targets' => array( 'desktop', 'mobile' ),
),
'mediawiki.widgets.UserInputWidget' => array(
title = new ForeignTitle( this.title.getPrefixedText() ), // HACK
prefix = this.apiUrl.replace( '/w/api.php', '' ); // HACK
+ this.missing = missing;
+
if ( !missing ) {
this.$link
.attr( 'href', prefix + title.getUrl() )
+ .attr( 'title', title.getPrefixedText() )
.removeClass( 'new' );
} else {
this.$link
.attr( 'href', prefix + title.getUrl( { action: 'edit', redlink: 1 } ) )
+ .attr( 'title', mw.message( 'red-link-title', title.getPrefixedText() ) )
.addClass( 'new' );
}
};