| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
ve.ui.FragmentDialog = function VeUiFragmentDialog( config ) { |
| 19 |
|
| 20 |
ve.ui.FragmentDialog.super.call( this, config ); |
| 21 |
|
| 22 |
|
| 23 |
ve.ui.FragmentWindow.call( this, config ); |
| 24 |
}; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
OO.inheritClass( ve.ui.FragmentDialog, OO.ui.ProcessDialog ); |
| 29 |
|
| 30 |
OO.mixinClass( ve.ui.FragmentDialog, ve.ui.FragmentWindow ); |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
ve.ui.FragmentDialog.static.actions = [ |
| 35 |
{ |
| 36 |
label: OO.ui.deferMsg( 'visualeditor-dialog-action-cancel' ), |
| 37 |
flags: [ 'safe', 'close' ], |
| 38 |
modes: [ 'readonly', 'edit', 'insert' ] |
| 39 |
}, |
| 40 |
{ |
| 41 |
action: 'done', |
| 42 |
label: OO.ui.deferMsg( 'visualeditor-dialog-action-apply' ), |
| 43 |
flags: [ 'progressive', 'primary' ], |
| 44 |
modes: 'edit' |
| 45 |
}, |
| 46 |
{ |
| 47 |
action: 'done', |
| 48 |
label: OO.ui.deferMsg( 'visualeditor-dialog-action-insert' ), |
| 49 |
flags: [ 'progressive', 'primary' ], |
| 50 |
modes: 'insert' |
| 51 |
} |
| 52 |
|
| 53 |
|
| 54 |
]; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
ve.ui.FragmentDialog.prototype.initialize = function ( data ) { |
| 62 |
|
| 63 |
ve.ui.FragmentDialog.super.prototype.initialize.call( this, data ); |
| 64 |
|
| 65 |
this.tabIndexScope = new ve.ui.TabIndexScope( { |
| 66 |
root: this.$content |
| 67 |
} ); |
| 68 |
}; |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
ve.ui.FragmentDialog.prototype.getActionWidgetConfig = function ( config ) { |
| 74 |
|
| 75 |
config = ve.ui.FragmentWindow.prototype.getActionWidgetConfig.call( this, config ); |
| 76 |
|
| 77 |
return ve.ui.FragmentDialog.super.prototype.getActionWidgetConfig.call( this, config ); |
| 78 |
}; |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
ve.ui.FragmentDialog.prototype.getSetupProcess = function ( data ) { |
| 84 |
|
| 85 |
const process = ve.ui.FragmentDialog.super.prototype.getSetupProcess.call( this, data ); |
| 86 |
|
| 87 |
return ve.ui.FragmentWindow.prototype.getSetupProcess.call( this, data, process ); |
| 88 |
}; |
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
ve.ui.FragmentDialog.prototype.getTeardownProcess = function ( data ) { |
| 94 |
|
| 95 |
const process = ve.ui.FragmentDialog.super.prototype.getTeardownProcess.call( this, data ) |
| 96 |
.first( () => { |
| 97 |
if ( this.selectFragmentOnClose ) { |
| 98 |
this.fragment.select(); |
| 99 |
} |
| 100 |
} ); |
| 101 |
|
| 102 |
return ve.ui.FragmentWindow.prototype.getTeardownProcess.call( this, data, process ); |
| 103 |
}; |