| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
ve.ui.MWAnnotationContextItem = function VeUiMWAnnotationContextItem() { |
| 19 |
|
| 20 |
ve.ui.MWAnnotationContextItem.super.apply( this, arguments ); |
| 21 |
|
| 22 |
|
| 23 |
this.$element.addClass( 've-ui-mwAnnotationContextItem' ); |
| 24 |
|
| 25 |
this.setLabel( this.getLabelMessage() ); |
| 26 |
|
| 27 |
this.$actions.remove(); |
| 28 |
}; |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
OO.inheritClass( ve.ui.MWAnnotationContextItem, ve.ui.LinearContextItem ); |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
ve.ui.MWAnnotationContextItem.static.editable = false; |
| 37 |
|
| 38 |
ve.ui.MWAnnotationContextItem.static.name = 'mwAnnotation'; |
| 39 |
|
| 40 |
ve.ui.MWAnnotationContextItem.static.icon = 'markup'; |
| 41 |
|
| 42 |
ve.ui.MWAnnotationContextItem.static.modelClasses = [ |
| 43 |
ve.dm.MWAnnotationNode |
| 44 |
]; |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
ve.ui.MWAnnotationContextItem.prototype.renderBody = function () { |
| 52 |
this.$body.empty(); |
| 53 |
|
| 54 |
const $desc = this.getDescriptionMessage(); |
| 55 |
if ( $desc ) { |
| 56 |
this.$body.append( $desc, $( document.createTextNode( mw.msg( 'word-separator' ) ) ) ); |
| 57 |
} |
| 58 |
|
| 59 |
if ( this.model.getAttribute( 'mw' ) ) { |
| 60 |
if ( this.model.getAttribute( 'mw' ).extendedRange ) { |
| 61 |
|
| 62 |
this.$body.append( mw.message( 'visualeditor-annotations-extended-documentation' ).parseDom() ); |
| 63 |
} |
| 64 |
} |
| 65 |
}; |