| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
ve.ui.MWTransclusionContentPage = function VeUiMWTransclusionContentPage( content, name, config ) { |
| 22 |
|
| 23 |
config = ve.extendObject( { |
| 24 |
scrollable: false |
| 25 |
}, config ); |
| 26 |
|
| 27 |
|
| 28 |
ve.ui.MWTransclusionContentPage.super.call( this, name, config ); |
| 29 |
|
| 30 |
|
| 31 |
this.content = content; |
| 32 |
this.textInput = new ve.ui.MWLazyMultilineTextInputWidget( { |
| 33 |
autosize: true, |
| 34 |
classes: [ 've-ui-mwTransclusionDialog-input' ] |
| 35 |
} ) |
| 36 |
.setValue( this.content.serialize() ) |
| 37 |
.setReadOnly( config.isReadOnly ) |
| 38 |
.connect( this, { change: 'onTextInputChange' } ); |
| 39 |
this.valueFieldset = new OO.ui.FieldsetLayout( { |
| 40 |
label: ve.msg( 'visualeditor-dialog-transclusion-wikitext' ), |
| 41 |
icon: 'wikiText', |
| 42 |
$content: this.textInput.$element |
| 43 |
} ); |
| 44 |
|
| 45 |
|
| 46 |
this.$element |
| 47 |
.addClass( 've-ui-mwTransclusionContentPage' ) |
| 48 |
.append( this.valueFieldset.$element ); |
| 49 |
}; |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
OO.inheritClass( ve.ui.MWTransclusionContentPage, OO.ui.PageLayout ); |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
ve.ui.MWTransclusionContentPage.prototype.onTextInputChange = function () { |
| 61 |
this.content.setWikitext( this.textInput.getValue() ); |
| 62 |
}; |