| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
ve.ui.AnnotationTool = function VeUiAnnotationTool() { |
| 18 |
|
| 19 |
ve.ui.AnnotationTool.super.apply( this, arguments ); |
| 20 |
}; |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
OO.inheritClass( ve.ui.AnnotationTool, ve.ui.Tool ); |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
ve.ui.AnnotationTool.static.annotation = { name: '' }; |
| 37 |
|
| 38 |
ve.ui.AnnotationTool.static.deactivateOnSelect = false; |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
ve.ui.AnnotationTool.prototype.onUpdateState = function ( fragment ) { |
| 46 |
|
| 47 |
ve.ui.AnnotationTool.super.prototype.onUpdateState.apply( this, arguments ); |
| 48 |
|
| 49 |
this.setActive( |
| 50 |
fragment && fragment.getAnnotations().hasAnnotationWithName( this.constructor.static.annotation.name ) |
| 51 |
); |
| 52 |
}; |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
ve.ui.BoldAnnotationTool = function VeUiBoldAnnotationTool() { |
| 64 |
ve.ui.BoldAnnotationTool.super.apply( this, arguments ); |
| 65 |
}; |
| 66 |
OO.inheritClass( ve.ui.BoldAnnotationTool, ve.ui.AnnotationTool ); |
| 67 |
ve.ui.BoldAnnotationTool.static.name = 'bold'; |
| 68 |
ve.ui.BoldAnnotationTool.static.group = 'textStyle'; |
| 69 |
ve.ui.BoldAnnotationTool.static.icon = 'bold'; |
| 70 |
ve.ui.BoldAnnotationTool.static.title = |
| 71 |
OO.ui.deferMsg( 'visualeditor-annotationbutton-bold-tooltip' ); |
| 72 |
ve.ui.BoldAnnotationTool.static.annotation = { name: 'textStyle/bold' }; |
| 73 |
ve.ui.BoldAnnotationTool.static.commandName = 'bold'; |
| 74 |
ve.ui.toolFactory.register( ve.ui.BoldAnnotationTool ); |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
ve.ui.ItalicAnnotationTool = function VeUiItalicAnnotationTool() { |
| 86 |
ve.ui.ItalicAnnotationTool.super.apply( this, arguments ); |
| 87 |
}; |
| 88 |
OO.inheritClass( ve.ui.ItalicAnnotationTool, ve.ui.AnnotationTool ); |
| 89 |
ve.ui.ItalicAnnotationTool.static.name = 'italic'; |
| 90 |
ve.ui.ItalicAnnotationTool.static.group = 'textStyle'; |
| 91 |
ve.ui.ItalicAnnotationTool.static.icon = 'italic'; |
| 92 |
ve.ui.ItalicAnnotationTool.static.title = |
| 93 |
OO.ui.deferMsg( 'visualeditor-annotationbutton-italic-tooltip' ); |
| 94 |
ve.ui.ItalicAnnotationTool.static.annotation = { name: 'textStyle/italic' }; |
| 95 |
ve.ui.ItalicAnnotationTool.static.commandName = 'italic'; |
| 96 |
ve.ui.toolFactory.register( ve.ui.ItalicAnnotationTool ); |
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
ve.ui.CodeAnnotationTool = function VeUiCodeAnnotationTool() { |
| 108 |
ve.ui.CodeAnnotationTool.super.apply( this, arguments ); |
| 109 |
}; |
| 110 |
OO.inheritClass( ve.ui.CodeAnnotationTool, ve.ui.AnnotationTool ); |
| 111 |
ve.ui.CodeAnnotationTool.static.name = 'code'; |
| 112 |
ve.ui.CodeAnnotationTool.static.group = 'textStyle'; |
| 113 |
ve.ui.CodeAnnotationTool.static.icon = 'code'; |
| 114 |
ve.ui.CodeAnnotationTool.static.title = |
| 115 |
OO.ui.deferMsg( 'visualeditor-annotationbutton-code-tooltip' ); |
| 116 |
ve.ui.CodeAnnotationTool.static.annotation = { name: 'textStyle/code' }; |
| 117 |
ve.ui.CodeAnnotationTool.static.commandName = 'code'; |
| 118 |
ve.ui.toolFactory.register( ve.ui.CodeAnnotationTool ); |
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
ve.ui.StrikethroughAnnotationTool = function VeUiStrikethroughAnnotationTool() { |
| 130 |
ve.ui.StrikethroughAnnotationTool.super.apply( this, arguments ); |
| 131 |
}; |
| 132 |
OO.inheritClass( ve.ui.StrikethroughAnnotationTool, ve.ui.AnnotationTool ); |
| 133 |
ve.ui.StrikethroughAnnotationTool.static.name = 'strikethrough'; |
| 134 |
ve.ui.StrikethroughAnnotationTool.static.group = 'textStyle'; |
| 135 |
ve.ui.StrikethroughAnnotationTool.static.icon = 'strikethrough'; |
| 136 |
ve.ui.StrikethroughAnnotationTool.static.title = |
| 137 |
OO.ui.deferMsg( 'visualeditor-annotationbutton-strikethrough-tooltip' ); |
| 138 |
ve.ui.StrikethroughAnnotationTool.static.annotation = { name: 'textStyle/strikethrough' }; |
| 139 |
ve.ui.StrikethroughAnnotationTool.static.commandName = 'strikethrough'; |
| 140 |
ve.ui.toolFactory.register( ve.ui.StrikethroughAnnotationTool ); |
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
ve.ui.UnderlineAnnotationTool = function VeUiUnderlineAnnotationTool() { |
| 152 |
ve.ui.UnderlineAnnotationTool.super.apply( this, arguments ); |
| 153 |
}; |
| 154 |
OO.inheritClass( ve.ui.UnderlineAnnotationTool, ve.ui.AnnotationTool ); |
| 155 |
ve.ui.UnderlineAnnotationTool.static.name = 'underline'; |
| 156 |
ve.ui.UnderlineAnnotationTool.static.group = 'textStyle'; |
| 157 |
ve.ui.UnderlineAnnotationTool.static.icon = 'underline'; |
| 158 |
ve.ui.UnderlineAnnotationTool.static.title = |
| 159 |
OO.ui.deferMsg( 'visualeditor-annotationbutton-underline-tooltip' ); |
| 160 |
ve.ui.UnderlineAnnotationTool.static.annotation = { name: 'textStyle/underline' }; |
| 161 |
ve.ui.UnderlineAnnotationTool.static.commandName = 'underline'; |
| 162 |
ve.ui.toolFactory.register( ve.ui.UnderlineAnnotationTool ); |
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
ve.ui.SuperscriptAnnotationTool = function VeUiSuperscriptAnnotationTool() { |
| 174 |
ve.ui.SuperscriptAnnotationTool.super.apply( this, arguments ); |
| 175 |
}; |
| 176 |
OO.inheritClass( ve.ui.SuperscriptAnnotationTool, ve.ui.AnnotationTool ); |
| 177 |
ve.ui.SuperscriptAnnotationTool.static.name = 'superscript'; |
| 178 |
ve.ui.SuperscriptAnnotationTool.static.group = 'textStyle'; |
| 179 |
ve.ui.SuperscriptAnnotationTool.static.icon = 'superscript'; |
| 180 |
ve.ui.SuperscriptAnnotationTool.static.title = |
| 181 |
OO.ui.deferMsg( 'visualeditor-annotationbutton-superscript-tooltip' ); |
| 182 |
ve.ui.SuperscriptAnnotationTool.static.annotation = { name: 'textStyle/superscript' }; |
| 183 |
ve.ui.SuperscriptAnnotationTool.static.commandName = 'superscript'; |
| 184 |
ve.ui.toolFactory.register( ve.ui.SuperscriptAnnotationTool ); |
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
ve.ui.SubscriptAnnotationTool = function VeUiSubscriptAnnotationTool() { |
| 196 |
ve.ui.SubscriptAnnotationTool.super.apply( this, arguments ); |
| 197 |
}; |
| 198 |
OO.inheritClass( ve.ui.SubscriptAnnotationTool, ve.ui.AnnotationTool ); |
| 199 |
ve.ui.SubscriptAnnotationTool.static.name = 'subscript'; |
| 200 |
ve.ui.SubscriptAnnotationTool.static.group = 'textStyle'; |
| 201 |
ve.ui.SubscriptAnnotationTool.static.icon = 'subscript'; |
| 202 |
ve.ui.SubscriptAnnotationTool.static.title = |
| 203 |
OO.ui.deferMsg( 'visualeditor-annotationbutton-subscript-tooltip' ); |
| 204 |
ve.ui.SubscriptAnnotationTool.static.annotation = { name: 'textStyle/subscript' }; |
| 205 |
ve.ui.SubscriptAnnotationTool.static.commandName = 'subscript'; |
| 206 |
ve.ui.toolFactory.register( ve.ui.SubscriptAnnotationTool ); |
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
ve.ui.BigAnnotationTool = function VeUiBigAnnotationTool() { |
| 218 |
ve.ui.BigAnnotationTool.super.apply( this, arguments ); |
| 219 |
}; |
| 220 |
OO.inheritClass( ve.ui.BigAnnotationTool, ve.ui.AnnotationTool ); |
| 221 |
ve.ui.BigAnnotationTool.static.name = 'big'; |
| 222 |
ve.ui.BigAnnotationTool.static.group = 'textStyle'; |
| 223 |
ve.ui.BigAnnotationTool.static.icon = 'bigger'; |
| 224 |
ve.ui.BigAnnotationTool.static.title = |
| 225 |
OO.ui.deferMsg( 'visualeditor-annotationbutton-big-tooltip' ); |
| 226 |
ve.ui.BigAnnotationTool.static.annotation = { name: 'textStyle/big' }; |
| 227 |
ve.ui.BigAnnotationTool.static.commandName = 'big'; |
| 228 |
ve.ui.toolFactory.register( ve.ui.BigAnnotationTool ); |
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
ve.ui.SmallAnnotationTool = function VeUiSmallAnnotationTool() { |
| 240 |
ve.ui.SmallAnnotationTool.super.apply( this, arguments ); |
| 241 |
}; |
| 242 |
OO.inheritClass( ve.ui.SmallAnnotationTool, ve.ui.AnnotationTool ); |
| 243 |
ve.ui.SmallAnnotationTool.static.name = 'small'; |
| 244 |
ve.ui.SmallAnnotationTool.static.group = 'textStyle'; |
| 245 |
ve.ui.SmallAnnotationTool.static.icon = 'smaller'; |
| 246 |
ve.ui.SmallAnnotationTool.static.title = |
| 247 |
OO.ui.deferMsg( 'visualeditor-annotationbutton-small-tooltip' ); |
| 248 |
ve.ui.SmallAnnotationTool.static.annotation = { name: 'textStyle/small' }; |
| 249 |
ve.ui.SmallAnnotationTool.static.commandName = 'small'; |
| 250 |
ve.ui.toolFactory.register( ve.ui.SmallAnnotationTool ); |
| 251 |
|
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
ve.ui.MoreTextStyleTool = function VeUiMoreTextStyleTool() { |
| 262 |
ve.ui.MoreTextStyleTool.super.apply( this, arguments ); |
| 263 |
}; |
| 264 |
OO.inheritClass( ve.ui.MoreTextStyleTool, OO.ui.ToolGroupTool ); |
| 265 |
ve.ui.MoreTextStyleTool.static.autoAddToCatchall = false; |
| 266 |
ve.ui.MoreTextStyleTool.static.name = 'moreTextStyle'; |
| 267 |
ve.ui.MoreTextStyleTool.static.group = 'textStyleExpansion'; |
| 268 |
ve.ui.MoreTextStyleTool.static.title = |
| 269 |
OO.ui.deferMsg( 'visualeditor-toolbar-style-tooltip' ); |
| 270 |
ve.ui.MoreTextStyleTool.static.groupConfig = { |
| 271 |
header: OO.ui.deferMsg( 'visualeditor-toolbar-text-style' ), |
| 272 |
icon: 'textStyle', |
| 273 |
indicator: 'down', |
| 274 |
title: OO.ui.deferMsg( 'visualeditor-toolbar-style-tooltip' ), |
| 275 |
label: OO.ui.deferMsg( 'visualeditor-toolbar-style-tooltip' ), |
| 276 |
invisibleLabel: true, |
| 277 |
include: [ { group: 'textStyle' }, 'language', 'clear' ], |
| 278 |
demote: [ 'strikethrough', 'code', 'underline', 'language', 'big', 'small', 'clear' ] |
| 279 |
}; |
| 280 |
ve.ui.toolFactory.register( ve.ui.MoreTextStyleTool ); |