mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
Use ve.targetLinksToNewWindow
Depends-On: I3088e8b95d9032b8e8fd5bff58a8b97ffaa15f98 Change-Id: I07ec10841b62ed1e8c3b3cf82b42653327618cb0
This commit is contained in:
parent
e996d44e72
commit
b756199dc7
|
@ -376,7 +376,7 @@ ve.init.mw.ArticleTarget.prototype.loadSuccess = function ( response ) {
|
||||||
}
|
}
|
||||||
if ( $label ) {
|
if ( $label ) {
|
||||||
title = $label.attr( 'title' );
|
title = $label.attr( 'title' );
|
||||||
$label.find( 'a' ).attr( 'target', '_blank' );
|
ve.targetLinksToNewWindow( $label[ 0 ] );
|
||||||
}
|
}
|
||||||
checkbox = new OO.ui.CheckboxInputWidget( {
|
checkbox = new OO.ui.CheckboxInputWidget( {
|
||||||
value: $this.attr( 'value' ),
|
value: $this.attr( 'value' ),
|
||||||
|
@ -1116,10 +1116,7 @@ ve.init.mw.ArticleTarget.prototype.onSaveDialogPreview = function () {
|
||||||
document.adoptNode( body );
|
document.adoptNode( body );
|
||||||
// TODO: This code is very similar to ve.ui.PreviewElement
|
// TODO: This code is very similar to ve.ui.PreviewElement
|
||||||
ve.resolveAttributes( body, doc, ve.dm.Converter.static.computedAttributes );
|
ve.resolveAttributes( body, doc, ve.dm.Converter.static.computedAttributes );
|
||||||
// Make all links open in a new window (sync view)
|
ve.targetLinksToNewWindow( body );
|
||||||
Array.prototype.forEach.call( body.querySelectorAll( 'a[href]' ), function ( el ) {
|
|
||||||
el.setAttribute( 'target', '_blank' );
|
|
||||||
} );
|
|
||||||
target.saveDialog.showPreview( $( body ).contents() );
|
target.saveDialog.showPreview( $( body ).contents() );
|
||||||
} else {
|
} else {
|
||||||
target.saveDialog.showPreview( $( '<em>' ).text(
|
target.saveDialog.showPreview( $( '<em>' ).text(
|
||||||
|
|
Loading…
Reference in a new issue