| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
ve.ui.MWCommentInspector = function VeUiMWCommentInspector() { |
| 18 |
|
| 19 |
ve.ui.MWCommentInspector.super.apply( this, arguments ); |
| 20 |
}; |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
OO.inheritClass( ve.ui.MWCommentInspector, ve.ui.CommentInspector ); |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
ve.ui.MWCommentInspector.static.name = 'comment'; |
| 29 |
|
| 30 |
ve.ui.MWCommentInspector.static.modelClasses = [ ve.dm.CommentNode ]; |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
ve.ui.MWCommentInspector.prototype.initialize = function () { |
| 38 |
|
| 39 |
ve.ui.MWCommentInspector.super.prototype.initialize.apply( this, arguments ); |
| 40 |
|
| 41 |
this.textWidget.$input.on( 'copy', this.onCopy.bind( this ) ); |
| 42 |
}; |
| 43 |
|
| 44 |
ve.ui.MWCommentInspector.prototype.onCopy = function ( e ) { |
| 45 |
const clipboardData = e.originalEvent.clipboardData, |
| 46 |
selection = ( e.target.value ).slice( e.target.selectionStart, e.target.selectionEnd ); |
| 47 |
if ( ve.isClipboardDataFormatsSupported( e, true ) ) { |
| 48 |
|
| 49 |
e.preventDefault(); |
| 50 |
|
| 51 |
clipboardData.setData( 'text/x-wiki', selection ); |
| 52 |
clipboardData.setData( 'text/plain', selection ); |
| 53 |
} |
| 54 |
}; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
ve.ui.windowFactory.register( ve.ui.MWCommentInspector ); |