| 1 |
'use strict'; |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
ve.ui.MWUseExistingReferenceCommand = function VeUiMWUseExistingReferenceCommand() { |
| 17 |
|
| 18 |
ve.ui.MWUseExistingReferenceCommand.super.call( |
| 19 |
this, 'reference/existing', 'window', 'open', |
| 20 |
{ args: [ 'reference', { reuseReference: true } ], supportedSelections: [ 'linear' ] } |
| 21 |
); |
| 22 |
}; |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
OO.inheritClass( ve.ui.MWUseExistingReferenceCommand, ve.ui.Command ); |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
ve.ui.MWUseExistingReferenceCommand.prototype.isExecutable = function ( fragment ) { |
| 34 |
return ve.ui.MWUseExistingReferenceCommand.super.prototype.isExecutable.apply( this, arguments ) && |
| 35 |
ve.dm.MWDocumentReferences.static.refsForDoc( fragment.getDocument() ).hasRefs(); |
| 36 |
}; |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
ve.ui.commandRegistry.register( new ve.ui.MWUseExistingReferenceCommand() ); |