| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
ve.ui.MWSyntaxHighlightInspector = function VeUiMWSyntaxHighlightInspector() { |
| 19 |
|
| 20 |
ve.ui.MWSyntaxHighlightInspector.super.apply( this, arguments ); |
| 21 |
|
| 22 |
|
| 23 |
ve.ui.MWSyntaxHighlightWindow.call( this ); |
| 24 |
}; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
OO.inheritClass( ve.ui.MWSyntaxHighlightInspector, ve.ui.MWLiveExtensionInspector ); |
| 29 |
|
| 30 |
OO.mixinClass( ve.ui.MWSyntaxHighlightInspector, ve.ui.MWSyntaxHighlightWindow ); |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
ve.ui.MWSyntaxHighlightInspector.static.name = 'syntaxhighlightInspector'; |
| 35 |
|
| 36 |
ve.ui.MWSyntaxHighlightInspector.static.modelClasses = [ ve.dm.MWInlineSyntaxHighlightNode ]; |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
ve.ui.MWSyntaxHighlightInspector.prototype.initialize = function () { |
| 44 |
|
| 45 |
ve.ui.MWSyntaxHighlightInspector.super.prototype.initialize.call( this ); |
| 46 |
|
| 47 |
|
| 48 |
ve.ui.MWSyntaxHighlightWindow.prototype.initialize.call( this ); |
| 49 |
|
| 50 |
|
| 51 |
this.$content.addClass( 've-ui-mwSyntaxHighlightInspector-content' ); |
| 52 |
this.form.$element.prepend( |
| 53 |
this.languageField.$element, |
| 54 |
this.codeField.$element |
| 55 |
); |
| 56 |
}; |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
ve.ui.MWSyntaxHighlightInspector.prototype.getReadyProcess = function ( data ) { |
| 62 |
|
| 63 |
const process = ve.ui.MWSyntaxHighlightInspector.super.prototype.getReadyProcess.call( this, data ); |
| 64 |
|
| 65 |
return ve.ui.MWSyntaxHighlightWindow.prototype.getReadyProcess.call( this, data, process ); |
| 66 |
}; |
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
ve.ui.MWSyntaxHighlightInspector.prototype.getSetupProcess = function ( data ) { |
| 72 |
|
| 73 |
const process = ve.ui.MWSyntaxHighlightInspector.super.prototype.getSetupProcess.call( this, data ); |
| 74 |
|
| 75 |
return ve.ui.MWSyntaxHighlightWindow.prototype.getSetupProcess.call( this, data, process ).next( () => { |
| 76 |
this.language.on( 'change', this.onChangeHandler ); |
| 77 |
} ); |
| 78 |
}; |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
ve.ui.MWSyntaxHighlightInspector.prototype.getTeardownProcess = function ( data ) { |
| 84 |
|
| 85 |
const process = ve.ui.MWSyntaxHighlightInspector.super.prototype.getTeardownProcess.call( this, data ); |
| 86 |
|
| 87 |
return ve.ui.MWSyntaxHighlightWindow.prototype.getTeardownProcess.call( this, data, process ).first( () => { |
| 88 |
this.language.off( 'change', this.onChangeHandler ); |
| 89 |
} ); |
| 90 |
}; |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
ve.ui.MWSyntaxHighlightInspector.prototype.updateMwData = function () { |
| 96 |
|
| 97 |
ve.ui.MWSyntaxHighlightInspector.super.prototype.updateMwData.apply( this, arguments ); |
| 98 |
|
| 99 |
ve.ui.MWSyntaxHighlightWindow.prototype.updateMwData.apply( this, arguments ); |
| 100 |
}; |
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
ve.ui.windowFactory.register( ve.ui.MWSyntaxHighlightInspector ); |