| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
ve.ui.MWWikitextWarningCommand = function VeUiMWWikitextWarningCommand() { |
| 16 |
|
| 17 |
ve.ui.MWWikitextWarningCommand.super.call( |
| 18 |
this, 'mwWikitextWarning' |
| 19 |
); |
| 20 |
this.warning = null; |
| 21 |
}; |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
OO.inheritClass( ve.ui.MWWikitextWarningCommand, ve.ui.Command ); |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
ve.ui.MWWikitextWarningCommand.prototype.execute = function () { |
| 33 |
if ( this.warning && this.warning.isOpen ) { |
| 34 |
return false; |
| 35 |
} |
| 36 |
|
| 37 |
const $message = $( '<div>' ).html( ve.init.platform.getParsedMessage( 'visualeditor-wikitext-warning' ) ); |
| 38 |
ve.targetLinksToNewWindow( $message[ 0 ] ); |
| 39 |
ve.init.platform.notify( |
| 40 |
$message.contents(), |
| 41 |
ve.msg( 'visualeditor-wikitext-warning-title' ), |
| 42 |
{ tag: 'visualeditor-wikitext-warning' } |
| 43 |
).then( ( message ) => { |
| 44 |
this.warning = message; |
| 45 |
} ); |
| 46 |
return true; |
| 47 |
}; |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
ve.ui.commandRegistry.register( new ve.ui.MWWikitextWarningCommand() ); |