| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
ve.ui.ListTool = function VeUiListTool() { |
| 18 |
|
| 19 |
ve.ui.ListTool.super.apply( this, arguments ); |
| 20 |
|
| 21 |
|
| 22 |
this.method = null; |
| 23 |
}; |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
OO.inheritClass( ve.ui.ListTool, ve.ui.Tool ); |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
ve.ui.ListTool.static.style = ''; |
| 40 |
|
| 41 |
ve.ui.ListTool.static.deactivateOnSelect = false; |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
ve.ui.ListTool.prototype.onUpdateState = function ( fragment ) { |
| 49 |
|
| 50 |
ve.ui.ListTool.super.prototype.onUpdateState.apply( this, arguments ); |
| 51 |
|
| 52 |
const style = this.constructor.static.style; |
| 53 |
const isMatching = fragment.hasMatchingAncestor( 'list', { style: style }, true ); |
| 54 |
this.setActive( isMatching ); |
| 55 |
}; |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
ve.ui.BulletListTool = function VeUiBulletListTool() { |
| 67 |
ve.ui.BulletListTool.super.apply( this, arguments ); |
| 68 |
}; |
| 69 |
OO.inheritClass( ve.ui.BulletListTool, ve.ui.ListTool ); |
| 70 |
ve.ui.BulletListTool.static.name = 'bullet'; |
| 71 |
ve.ui.BulletListTool.static.group = 'structure'; |
| 72 |
ve.ui.BulletListTool.static.icon = 'listBullet'; |
| 73 |
ve.ui.BulletListTool.static.title = |
| 74 |
OO.ui.deferMsg( 'visualeditor-listbutton-bullet-tooltip' ); |
| 75 |
ve.ui.BulletListTool.static.style = 'bullet'; |
| 76 |
ve.ui.BulletListTool.static.commandName = 'bullet'; |
| 77 |
ve.ui.toolFactory.register( ve.ui.BulletListTool ); |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
ve.ui.NumberListTool = function VeUiNumberListTool() { |
| 89 |
ve.ui.NumberListTool.super.apply( this, arguments ); |
| 90 |
}; |
| 91 |
OO.inheritClass( ve.ui.NumberListTool, ve.ui.ListTool ); |
| 92 |
ve.ui.NumberListTool.static.name = 'number'; |
| 93 |
ve.ui.NumberListTool.static.group = 'structure'; |
| 94 |
ve.ui.NumberListTool.static.icon = 'listNumbered'; |
| 95 |
ve.ui.NumberListTool.static.title = |
| 96 |
OO.ui.deferMsg( 'visualeditor-listbutton-number-tooltip' ); |
| 97 |
ve.ui.NumberListTool.static.style = 'number'; |
| 98 |
ve.ui.NumberListTool.static.commandName = 'number'; |
| 99 |
ve.ui.toolFactory.register( ve.ui.NumberListTool ); |