| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
ve.ui.MWAlienAnnotationContextItem = function VeUiMWAlienAnnotationContextItem() { |
| 19 |
|
| 20 |
ve.ui.MWAlienAnnotationContextItem.super.apply( this, arguments ); |
| 21 |
}; |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
OO.inheritClass( ve.ui.MWAlienAnnotationContextItem, ve.ui.MWAnnotationContextItem ); |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
ve.ui.MWAlienAnnotationContextItem.static.name = 'mwAlienAnnotation'; |
| 30 |
|
| 31 |
ve.ui.MWAlienAnnotationContextItem.static.modelClasses = [ |
| 32 |
ve.dm.MWAlienAnnotationNode |
| 33 |
]; |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
ve.ui.MWAlienAnnotationContextItem.prototype.getLabelMessage = function () { |
| 38 |
const type = this.model.getAttribute( 'type' ); |
| 39 |
if ( type.indexOf( '/End', type.length - 4 ) !== -1 ) { |
| 40 |
return mw.message( 'visualeditor-annotations-default-end' ).text(); |
| 41 |
} else { |
| 42 |
return mw.message( 'visualeditor-annotations-default-start' ).text(); |
| 43 |
} |
| 44 |
}; |
| 45 |
|
| 46 |
ve.ui.MWAlienAnnotationContextItem.prototype.getDescriptionMessage = function () { |
| 47 |
const type = this.model.getAttribute( 'type' ); |
| 48 |
if ( type.indexOf( '/End', type.length - 4 ) !== -1 ) { |
| 49 |
return ''; |
| 50 |
} |
| 51 |
return mw.message( 'visualeditor-annotations-default-description' ).parseDom(); |
| 52 |
}; |
| 53 |
|
| 54 |
ve.ui.contextItemFactory.register( ve.ui.MWAlienAnnotationContextItem ); |