Make sure all links have target=_blank in the save dialog

Anything that uses getParsedMessage could contain a link.

Change-Id: I523edd935c4989e5929fca8891651c2287af973a
This commit is contained in:
Ed Sanders 2013-11-05 16:27:19 +00:00
parent 3ed7bb16a6
commit 2e0d642a11
2 changed files with 10 additions and 5 deletions

View file

@ -506,7 +506,7 @@ ve.init.mw.ViewPageTarget.prototype.onSaveError = function ( jqXHR, status, data
$( '<strong>' ).text( mw.msg( 'captcha-label' ) ), $( '<strong>' ).text( mw.msg( 'captcha-label' ) ),
document.createTextNode( mw.msg( 'colon-separator' ) ), document.createTextNode( mw.msg( 'colon-separator' ) ),
$( $.parseHTML( mw.message( 'fancycaptcha-edit' ).parse() ) ) $( $.parseHTML( mw.message( 'fancycaptcha-edit' ).parse() ) )
.filter( 'a' ).attr( 'target', '_blank ' ).end() .filter( 'a' ).attr( 'target', '_blank' ).end()
), ),
$( '<img>' ).attr( 'src', editApi.captcha.url ), $( '<img>' ).attr( 'src', editApi.captcha.url ),
this.captcha.input.$element this.captcha.input.$element
@ -697,7 +697,7 @@ ve.init.mw.ViewPageTarget.prototype.checkForWikitextWarning = function () {
if ( text.match( /\[\[|\{\{|''|<nowiki|~~~|^==|^\*|^\#/ ) ) { if ( text.match( /\[\[|\{\{|''|<nowiki|~~~|^==|^\*|^\#/ ) ) {
mw.notify( mw.notify(
$( $.parseHTML( ve.init.platform.getParsedMessage( 'visualeditor-wikitext-warning' ) ) ) $( $.parseHTML( ve.init.platform.getParsedMessage( 'visualeditor-wikitext-warning' ) ) )
.filter( 'a' ).attr( 'target', '_blank ' ).end(), .filter( 'a' ).attr( 'target', '_blank' ).end(),
{ {
'title': ve.msg( 'visualeditor-wikitext-warning-title' ), 'title': ve.msg( 'visualeditor-wikitext-warning-title' ),
'tag': 'visualeditor-wikitext-warning', 'tag': 'visualeditor-wikitext-warning',

View file

@ -56,7 +56,8 @@ ve.ui.MWSaveDialog.prototype.initialize = function () {
// Save panel // Save panel
this.$editSummaryLabel = this.$( '<div>' ).addClass( 've-ui-mwSaveDialog-summaryLabel' ) this.$editSummaryLabel = this.$( '<div>' ).addClass( 've-ui-mwSaveDialog-summaryLabel' )
.html( ve.init.platform.getParsedMessage( 'summary' ) ); .html( ve.init.platform.getParsedMessage( 'summary' ) )
.find( 'a' ).attr( 'target', '_blank' ).end();
this.editSummaryInput = new OO.ui.TextInputWidget( this.editSummaryInput = new OO.ui.TextInputWidget(
{ '$': this.$, 'multiline': true, 'placeholder': ve.msg( 'visualeditor-editsummary' ) } { '$': this.$, 'multiline': true, 'placeholder': ve.msg( 'visualeditor-editsummary' ) }
); );
@ -90,7 +91,9 @@ ve.ui.MWSaveDialog.prototype.initialize = function () {
this.$saveFoot = this.$( '<div>' ).addClass( 've-ui-mwSaveDialog-foot' ).append( this.$saveFoot = this.$( '<div>' ).addClass( 've-ui-mwSaveDialog-foot' ).append(
this.$( '<p>' ).addClass( 've-ui-mwSaveDialog-license' ) this.$( '<p>' ).addClass( 've-ui-mwSaveDialog-license' )
.html( ve.init.platform.getParsedMessage( 'copyrightwarning' ) ) .html( ve.init.platform.getParsedMessage( 'copyrightwarning' ) )
.find( 'a' ).attr( 'target', '_blank' ).end()
); );
this.savePanel.$element.append( this.savePanel.$element.append(
this.$editSummaryLabel, this.$editSummaryLabel,
this.editSummaryInput.$element, this.editSummaryInput.$element,
@ -109,13 +112,15 @@ ve.ui.MWSaveDialog.prototype.initialize = function () {
// Conflict panel // Conflict panel
this.conflictPanel = new OO.ui.PanelLayout( { '$': this.$, 'scrollable': true } ); this.conflictPanel = new OO.ui.PanelLayout( { '$': this.$, 'scrollable': true } );
this.$conflict = this.$( '<div>' ).addClass( 've-ui-mwSaveDialog-conflict' ) this.$conflict = this.$( '<div>' ).addClass( 've-ui-mwSaveDialog-conflict' )
.html( ve.init.platform.getParsedMessage( 'visualeditor-editconflict' ) ); .html( ve.init.platform.getParsedMessage( 'visualeditor-editconflict' ) )
.find( 'a' ).attr( 'target', '_blank' ).end();
this.conflictPanel.$element.append( this.$conflict ); this.conflictPanel.$element.append( this.$conflict );
// No changes panel // No changes panel
this.nochangesPanel = new OO.ui.PanelLayout( { '$': this.$, 'scrollable': true } ); this.nochangesPanel = new OO.ui.PanelLayout( { '$': this.$, 'scrollable': true } );
this.$noChanges = this.$( '<div>' ).addClass( 've-ui-mwSaveDialog-nochanges' ) this.$noChanges = this.$( '<div>' ).addClass( 've-ui-mwSaveDialog-nochanges' )
.html( ve.init.platform.getParsedMessage( 'visualeditor-diff-nochanges' ) ); .html( ve.init.platform.getParsedMessage( 'visualeditor-diff-nochanges' ) )
.find( 'a' ).attr( 'target', '_blank' ).end();
this.nochangesPanel.$element.append( this.$noChanges ); this.nochangesPanel.$element.append( this.$noChanges );
// Panel stack // Panel stack