| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var configData = require( './data.json' ), |
| 7 |
fileNamespace = mw.config.get( 'wgFormattedNamespaces' )[ 6 ], |
| 8 |
specialCharacterGroups = require( 'mediawiki.language.specialCharacters' ), |
| 9 |
toolbarConfig; |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
function delink( $message ) { |
| 20 |
|
| 21 |
var $div = $( '<div>' ); |
| 22 |
|
| 23 |
$div.append( $message ); |
| 24 |
$div.find( 'a' ).attr( 'href', '#' ); |
| 25 |
|
| 26 |
return $div.html(); |
| 27 |
} |
| 28 |
|
| 29 |
toolbarConfig = { |
| 30 |
toolbar: { |
| 31 |
|
| 32 |
main: { |
| 33 |
type: 'toolbar', |
| 34 |
groups: { |
| 35 |
format: { |
| 36 |
tools: { |
| 37 |
bold: { |
| 38 |
label: mw.msg( 'wikieditor-toolbar-tool-bold' ), |
| 39 |
type: 'button', |
| 40 |
oouiIcon: 'bold', |
| 41 |
action: { |
| 42 |
type: 'encapsulate', |
| 43 |
options: { |
| 44 |
pre: "'''", |
| 45 |
peri: mw.msg( 'wikieditor-toolbar-tool-bold-example' ), |
| 46 |
post: "'''" |
| 47 |
} |
| 48 |
} |
| 49 |
}, |
| 50 |
italic: { |
| 51 |
section: 'main', |
| 52 |
group: 'format', |
| 53 |
id: 'italic', |
| 54 |
label: mw.msg( 'wikieditor-toolbar-tool-italic' ), |
| 55 |
type: 'button', |
| 56 |
oouiIcon: 'italic', |
| 57 |
action: { |
| 58 |
type: 'encapsulate', |
| 59 |
options: { |
| 60 |
pre: "''", |
| 61 |
peri: mw.msg( 'wikieditor-toolbar-tool-italic-example' ), |
| 62 |
post: "''" |
| 63 |
} |
| 64 |
} |
| 65 |
} |
| 66 |
} |
| 67 |
}, |
| 68 |
insert: { |
| 69 |
tools: { |
| 70 |
signature: { |
| 71 |
label: mw.msg( 'wikieditor-toolbar-tool-signature' ), |
| 72 |
type: 'button', |
| 73 |
oouiIcon: 'signature', |
| 74 |
action: { |
| 75 |
type: 'encapsulate', |
| 76 |
options: { |
| 77 |
pre: configData.signature |
| 78 |
} |
| 79 |
} |
| 80 |
} |
| 81 |
} |
| 82 |
} |
| 83 |
} |
| 84 |
}, |
| 85 |
|
| 86 |
secondary: { |
| 87 |
type: 'toolbar', |
| 88 |
groups: { |
| 89 |
default: { |
| 90 |
tools: {} |
| 91 |
} |
| 92 |
} |
| 93 |
}, |
| 94 |
|
| 95 |
advanced: { |
| 96 |
label: mw.msg( 'wikieditor-toolbar-section-advanced' ), |
| 97 |
type: 'toolbar', |
| 98 |
groups: { |
| 99 |
heading: { |
| 100 |
tools: { |
| 101 |
heading: { |
| 102 |
label: mw.msg( 'wikieditor-toolbar-tool-heading' ), |
| 103 |
type: 'select', |
| 104 |
list: { |
| 105 |
'heading-2': { |
| 106 |
label: mw.msg( 'wikieditor-toolbar-tool-heading-2' ), |
| 107 |
action: { |
| 108 |
type: 'encapsulate', |
| 109 |
options: { |
| 110 |
pre: '== ', |
| 111 |
peri: mw.msg( 'wikieditor-toolbar-tool-heading-example' ), |
| 112 |
post: ' ==', |
| 113 |
regex: /^(\s*)(={1,6})(.*?)\2(\s*)$/, |
| 114 |
regexReplace: '$1==$3==$4', |
| 115 |
ownline: true |
| 116 |
} |
| 117 |
} |
| 118 |
}, |
| 119 |
'heading-3': { |
| 120 |
label: mw.msg( 'wikieditor-toolbar-tool-heading-3' ), |
| 121 |
action: { |
| 122 |
type: 'encapsulate', |
| 123 |
options: { |
| 124 |
pre: '=== ', |
| 125 |
peri: mw.msg( 'wikieditor-toolbar-tool-heading-example' ), |
| 126 |
post: ' ===', |
| 127 |
regex: /^(\s*)(={1,6})(.*?)\2(\s*)$/, |
| 128 |
regexReplace: '$1===$3===$4', |
| 129 |
ownline: true |
| 130 |
} |
| 131 |
} |
| 132 |
}, |
| 133 |
'heading-4': { |
| 134 |
label: mw.msg( 'wikieditor-toolbar-tool-heading-4' ), |
| 135 |
action: { |
| 136 |
type: 'encapsulate', |
| 137 |
options: { |
| 138 |
pre: '==== ', |
| 139 |
peri: mw.msg( 'wikieditor-toolbar-tool-heading-example' ), |
| 140 |
post: ' ====', |
| 141 |
regex: /^(\s*)(={1,6})(.*?)\2(\s*)$/, |
| 142 |
regexReplace: '$1====$3====$4', |
| 143 |
ownline: true |
| 144 |
} |
| 145 |
} |
| 146 |
}, |
| 147 |
'heading-5': { |
| 148 |
label: mw.msg( 'wikieditor-toolbar-tool-heading-5' ), |
| 149 |
action: { |
| 150 |
type: 'encapsulate', |
| 151 |
options: { |
| 152 |
pre: '===== ', |
| 153 |
peri: mw.msg( 'wikieditor-toolbar-tool-heading-example' ), |
| 154 |
post: ' =====', |
| 155 |
regex: /^(\s*)(={1,6})(.*?)\2(\s*)$/, |
| 156 |
regexReplace: '$1=====$3=====$4', |
| 157 |
ownline: true |
| 158 |
} |
| 159 |
} |
| 160 |
} |
| 161 |
} |
| 162 |
} |
| 163 |
} |
| 164 |
}, |
| 165 |
format: { |
| 166 |
label: mw.msg( 'wikieditor-toolbar-group-format' ), |
| 167 |
tools: { |
| 168 |
ulist: { |
| 169 |
label: mw.msg( 'wikieditor-toolbar-tool-ulist' ), |
| 170 |
type: 'button', |
| 171 |
oouiIcon: 'listBullet', |
| 172 |
action: { |
| 173 |
type: 'encapsulate', |
| 174 |
options: { |
| 175 |
pre: '* ', |
| 176 |
peri: mw.msg( 'wikieditor-toolbar-tool-ulist-example' ), |
| 177 |
post: '', |
| 178 |
ownline: true, |
| 179 |
splitlines: true |
| 180 |
} |
| 181 |
} |
| 182 |
}, |
| 183 |
olist: { |
| 184 |
label: mw.msg( 'wikieditor-toolbar-tool-olist' ), |
| 185 |
type: 'button', |
| 186 |
oouiIcon: 'listNumbered', |
| 187 |
action: { |
| 188 |
type: 'encapsulate', |
| 189 |
options: { |
| 190 |
pre: '# ', |
| 191 |
peri: mw.msg( 'wikieditor-toolbar-tool-olist-example' ), |
| 192 |
post: '', |
| 193 |
ownline: true, |
| 194 |
splitlines: true |
| 195 |
} |
| 196 |
} |
| 197 |
}, |
| 198 |
nowiki: { |
| 199 |
label: mw.msg( 'wikieditor-toolbar-tool-nowiki' ), |
| 200 |
type: 'button', |
| 201 |
oouiIcon: 'noWikiText', |
| 202 |
action: { |
| 203 |
type: 'encapsulate', |
| 204 |
options: { |
| 205 |
pre: '<nowiki>', |
| 206 |
peri: mw.msg( 'wikieditor-toolbar-tool-nowiki-example' ), |
| 207 |
post: '</nowiki>' |
| 208 |
} |
| 209 |
} |
| 210 |
}, |
| 211 |
newline: { |
| 212 |
label: mw.msg( 'wikieditor-toolbar-tool-newline' ), |
| 213 |
type: 'button', |
| 214 |
oouiIcon: 'newline', |
| 215 |
action: { |
| 216 |
type: 'encapsulate', |
| 217 |
options: { |
| 218 |
pre: '<br>\n' |
| 219 |
} |
| 220 |
} |
| 221 |
} |
| 222 |
} |
| 223 |
}, |
| 224 |
size: { |
| 225 |
tools: { |
| 226 |
big: { |
| 227 |
label: mw.msg( 'wikieditor-toolbar-tool-big' ), |
| 228 |
type: 'button', |
| 229 |
oouiIcon: 'bigger', |
| 230 |
action: { |
| 231 |
type: 'encapsulate', |
| 232 |
options: { |
| 233 |
pre: '<big>', |
| 234 |
peri: mw.msg( 'wikieditor-toolbar-tool-big-example' ), |
| 235 |
post: '</big>' |
| 236 |
} |
| 237 |
} |
| 238 |
}, |
| 239 |
small: { |
| 240 |
label: mw.msg( 'wikieditor-toolbar-tool-small' ), |
| 241 |
type: 'button', |
| 242 |
oouiIcon: 'smaller', |
| 243 |
action: { |
| 244 |
type: 'encapsulate', |
| 245 |
options: { |
| 246 |
pre: '<small>', |
| 247 |
peri: mw.msg( 'wikieditor-toolbar-tool-small-example' ), |
| 248 |
post: '</small>' |
| 249 |
} |
| 250 |
} |
| 251 |
}, |
| 252 |
superscript: { |
| 253 |
label: mw.msg( 'wikieditor-toolbar-tool-superscript' ), |
| 254 |
type: 'button', |
| 255 |
oouiIcon: 'superscript', |
| 256 |
action: { |
| 257 |
type: 'encapsulate', |
| 258 |
options: { |
| 259 |
pre: '<sup>', |
| 260 |
peri: mw.msg( 'wikieditor-toolbar-tool-superscript-example' ), |
| 261 |
post: '</sup>' |
| 262 |
} |
| 263 |
} |
| 264 |
}, |
| 265 |
subscript: { |
| 266 |
label: mw.msg( 'wikieditor-toolbar-tool-subscript' ), |
| 267 |
type: 'button', |
| 268 |
oouiIcon: 'subscript', |
| 269 |
action: { |
| 270 |
type: 'encapsulate', |
| 271 |
options: { |
| 272 |
pre: '<sub>', |
| 273 |
peri: mw.msg( 'wikieditor-toolbar-tool-subscript-example' ), |
| 274 |
post: '</sub>' |
| 275 |
} |
| 276 |
} |
| 277 |
} |
| 278 |
} |
| 279 |
}, |
| 280 |
insert: { |
| 281 |
label: mw.msg( 'wikieditor-toolbar-group-insert' ), |
| 282 |
tools: { |
| 283 |
gallery: { |
| 284 |
label: mw.msg( 'wikieditor-toolbar-tool-gallery' ), |
| 285 |
type: 'button', |
| 286 |
oouiIcon: 'imageGallery', |
| 287 |
action: { |
| 288 |
type: 'encapsulate', |
| 289 |
options: { |
| 290 |
pre: '<gallery>\n', |
| 291 |
peri: mw.msg( 'wikieditor-toolbar-tool-gallery-example', fileNamespace ), |
| 292 |
post: '\n</gallery>', |
| 293 |
ownline: true |
| 294 |
} |
| 295 |
} |
| 296 |
}, |
| 297 |
redirect: { |
| 298 |
label: mw.msg( 'wikieditor-toolbar-tool-redirect' ), |
| 299 |
type: 'button', |
| 300 |
oouiIcon: 'articleRedirect', |
| 301 |
action: { |
| 302 |
type: 'encapsulate', |
| 303 |
options: { |
| 304 |
pre: configData.magicWords.redirect[ 0 ] + ' [[', |
| 305 |
peri: mw.msg( 'wikieditor-toolbar-tool-redirect-example' ), |
| 306 |
post: ']]', |
| 307 |
ownline: true |
| 308 |
} |
| 309 |
} |
| 310 |
} |
| 311 |
} |
| 312 |
} |
| 313 |
} |
| 314 |
}, |
| 315 |
characters: { |
| 316 |
label: mw.msg( 'wikieditor-toolbar-section-characters' ), |
| 317 |
type: 'booklet', |
| 318 |
deferLoad: true, |
| 319 |
pages: { |
| 320 |
latin: { |
| 321 |
label: mw.msg( 'special-characters-group-latin' ), |
| 322 |
layout: 'characters', |
| 323 |
characters: specialCharacterGroups.latin |
| 324 |
}, |
| 325 |
latinextended: { |
| 326 |
label: mw.msg( 'special-characters-group-latinextended' ), |
| 327 |
layout: 'characters', |
| 328 |
characters: specialCharacterGroups.latinextended |
| 329 |
}, |
| 330 |
ipa: { |
| 331 |
label: mw.msg( 'special-characters-group-ipa' ), |
| 332 |
layout: 'characters', |
| 333 |
characters: specialCharacterGroups.ipa |
| 334 |
}, |
| 335 |
symbols: { |
| 336 |
label: mw.msg( 'special-characters-group-symbols' ), |
| 337 |
layout: 'characters', |
| 338 |
characters: specialCharacterGroups.symbols |
| 339 |
}, |
| 340 |
greek: { |
| 341 |
label: mw.msg( 'special-characters-group-greek' ), |
| 342 |
layout: 'characters', |
| 343 |
language: 'el', |
| 344 |
characters: specialCharacterGroups.greek |
| 345 |
}, |
| 346 |
greekextended: { |
| 347 |
label: mw.msg( 'special-characters-group-greekextended' ), |
| 348 |
layout: 'characters', |
| 349 |
characters: specialCharacterGroups.greekextended |
| 350 |
}, |
| 351 |
cyrillic: { |
| 352 |
label: mw.msg( 'special-characters-group-cyrillic' ), |
| 353 |
layout: 'characters', |
| 354 |
characters: specialCharacterGroups.cyrillic |
| 355 |
}, |
| 356 |
|
| 357 |
|
| 358 |
|
| 359 |
arabic: { |
| 360 |
label: mw.msg( 'special-characters-group-arabic' ), |
| 361 |
layout: 'characters', |
| 362 |
language: 'ar', |
| 363 |
direction: 'rtl', |
| 364 |
characters: specialCharacterGroups.arabic |
| 365 |
}, |
| 366 |
|
| 367 |
arabicextended: { |
| 368 |
label: mw.msg( 'special-characters-group-arabicextended' ), |
| 369 |
layout: 'characters', |
| 370 |
language: 'ar', |
| 371 |
direction: 'rtl', |
| 372 |
characters: specialCharacterGroups.arabicextended |
| 373 |
}, |
| 374 |
hebrew: { |
| 375 |
label: mw.msg( 'special-characters-group-hebrew' ), |
| 376 |
layout: 'characters', |
| 377 |
direction: 'rtl', |
| 378 |
characters: specialCharacterGroups.hebrew |
| 379 |
}, |
| 380 |
bangla: { |
| 381 |
label: mw.msg( 'special-characters-group-bangla' ), |
| 382 |
language: 'bn', |
| 383 |
layout: 'characters', |
| 384 |
characters: specialCharacterGroups.bangla |
| 385 |
}, |
| 386 |
tamil: { |
| 387 |
label: mw.msg( 'special-characters-group-tamil' ), |
| 388 |
language: 'ta', |
| 389 |
layout: 'characters', |
| 390 |
characters: specialCharacterGroups.tamil |
| 391 |
}, |
| 392 |
telugu: { |
| 393 |
label: mw.msg( 'special-characters-group-telugu' ), |
| 394 |
language: 'te', |
| 395 |
layout: 'characters', |
| 396 |
characters: specialCharacterGroups.telugu |
| 397 |
}, |
| 398 |
sinhala: { |
| 399 |
label: mw.msg( 'special-characters-group-sinhala' ), |
| 400 |
language: 'si', |
| 401 |
layout: 'characters', |
| 402 |
characters: specialCharacterGroups.sinhala |
| 403 |
}, |
| 404 |
devanagari: { |
| 405 |
label: mw.msg( 'special-characters-group-devanagari' ), |
| 406 |
layout: 'characters', |
| 407 |
characters: specialCharacterGroups.devanagari |
| 408 |
}, |
| 409 |
gujarati: { |
| 410 |
label: mw.msg( 'special-characters-group-gujarati' ), |
| 411 |
language: 'gu', |
| 412 |
layout: 'characters', |
| 413 |
characters: specialCharacterGroups.gujarati |
| 414 |
}, |
| 415 |
thai: { |
| 416 |
label: mw.msg( 'special-characters-group-thai' ), |
| 417 |
language: 'th', |
| 418 |
layout: 'characters', |
| 419 |
characters: specialCharacterGroups.thai |
| 420 |
}, |
| 421 |
lao: { |
| 422 |
label: mw.msg( 'special-characters-group-lao' ), |
| 423 |
language: 'lo', |
| 424 |
layout: 'characters', |
| 425 |
characters: specialCharacterGroups.lao |
| 426 |
}, |
| 427 |
khmer: { |
| 428 |
label: mw.msg( 'special-characters-group-khmer' ), |
| 429 |
language: 'km', |
| 430 |
layout: 'characters', |
| 431 |
characters: specialCharacterGroups.khmer |
| 432 |
}, |
| 433 |
canadianaboriginal: { |
| 434 |
label: mw.msg( 'special-characters-group-canadianaboriginal' ), |
| 435 |
language: 'cr', |
| 436 |
layout: 'characters', |
| 437 |
characters: specialCharacterGroups.canadianaboriginal |
| 438 |
}, |
| 439 |
runes: { |
| 440 |
label: mw.msg( 'special-characters-group-runes' ), |
| 441 |
layout: 'characters', |
| 442 |
characters: specialCharacterGroups.runes |
| 443 |
} |
| 444 |
} |
| 445 |
}, |
| 446 |
help: { |
| 447 |
label: mw.msg( 'wikieditor-toolbar-section-help' ), |
| 448 |
type: 'booklet', |
| 449 |
deferLoad: true, |
| 450 |
pages: { |
| 451 |
format: { |
| 452 |
label: mw.msg( 'wikieditor-toolbar-help-page-format' ), |
| 453 |
layout: 'table', |
| 454 |
headings: [ |
| 455 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-description' ).parse() }, |
| 456 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-syntax' ).parse() }, |
| 457 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-result' ).parse() } |
| 458 |
], |
| 459 |
rows: [ |
| 460 |
{ |
| 461 |
description: { |
| 462 |
html: mw.message( 'wikieditor-toolbar-help-content-italic-description' ).parse() |
| 463 |
}, |
| 464 |
syntax: { |
| 465 |
html: "''" + mw.message( 'wikieditor-toolbar-help-content-italic-example' ).escaped() + "''" |
| 466 |
}, |
| 467 |
result: { |
| 468 |
html: '<em>' + mw.message( 'wikieditor-toolbar-help-content-italic-example' ).parse() + '</em>' |
| 469 |
} |
| 470 |
}, |
| 471 |
{ |
| 472 |
description: { |
| 473 |
html: mw.message( 'wikieditor-toolbar-help-content-bold-description' ).parse() |
| 474 |
}, |
| 475 |
syntax: { |
| 476 |
html: "'''" + mw.message( 'wikieditor-toolbar-help-content-bold-example' ).escaped() + "'''" |
| 477 |
}, |
| 478 |
result: { |
| 479 |
html: '<strong>' + mw.message( 'wikieditor-toolbar-help-content-bold-example' ).parse() + '</strong>' |
| 480 |
} |
| 481 |
}, |
| 482 |
{ |
| 483 |
description: { |
| 484 |
html: mw.message( 'wikieditor-toolbar-help-content-bolditalic-description' ).parse() |
| 485 |
}, |
| 486 |
syntax: { |
| 487 |
html: "'''''" + mw.message( 'wikieditor-toolbar-help-content-bolditalic-example' ).escaped() + "'''''" |
| 488 |
}, |
| 489 |
result: { |
| 490 |
html: '<strong><em>' + mw.message( 'wikieditor-toolbar-help-content-bolditalic-example' ).parse() + '</em></strong>' |
| 491 |
} |
| 492 |
} |
| 493 |
] |
| 494 |
}, |
| 495 |
link: { |
| 496 |
label: mw.msg( 'wikieditor-toolbar-help-page-link' ), |
| 497 |
layout: 'table', |
| 498 |
headings: [ |
| 499 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-description' ).parse() }, |
| 500 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-syntax' ).parse() }, |
| 501 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-result' ).parse() } |
| 502 |
], |
| 503 |
rows: [ |
| 504 |
{ |
| 505 |
description: { |
| 506 |
html: mw.message( 'wikieditor-toolbar-help-content-ilink-description' ).parse() |
| 507 |
}, |
| 508 |
syntax: { |
| 509 |
html: mw.message( 'wikieditor-toolbar-help-content-ilink-example' ).escaped() |
| 510 |
}, |
| 511 |
result: { |
| 512 |
html: '<span class="pre-wrap">' + delink( mw.message( 'wikieditor-toolbar-help-content-ilink-example' ).parseDom() ) + '</span>' |
| 513 |
} |
| 514 |
}, |
| 515 |
{ |
| 516 |
description: { |
| 517 |
html: mw.message( 'wikieditor-toolbar-help-content-xlink-description' ).parse() |
| 518 |
}, |
| 519 |
syntax: { |
| 520 |
html: mw.message( |
| 521 |
'wikieditor-toolbar-help-content-xlink-example1', |
| 522 |
mw.msg( 'wikieditor-toolbar-help-content-xlink-example-url' ), |
| 523 |
mw.msg( 'wikieditor-toolbar-help-content-xlink-example-label' ) |
| 524 |
).escaped() |
| 525 |
}, |
| 526 |
result: { |
| 527 |
html: '<span class="mw-parser-output pre-wrap">' + |
| 528 |
delink( mw.message( |
| 529 |
'wikieditor-toolbar-help-content-xlink-example2', |
| 530 |
mw.msg( 'wikieditor-toolbar-help-content-xlink-example-url' ), |
| 531 |
mw.msg( 'wikieditor-toolbar-help-content-xlink-example-label' ), |
| 532 |
mw.language.convertNumber( 1 ) |
| 533 |
).parseDom() ) + |
| 534 |
'</span>' |
| 535 |
} |
| 536 |
} |
| 537 |
] |
| 538 |
}, |
| 539 |
heading: { |
| 540 |
label: mw.msg( 'wikieditor-toolbar-help-page-heading' ), |
| 541 |
layout: 'table', |
| 542 |
headings: [ |
| 543 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-description' ).parse() }, |
| 544 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-syntax' ).parse() }, |
| 545 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-result' ).parse() } |
| 546 |
], |
| 547 |
rows: [ |
| 548 |
{ |
| 549 |
description: { |
| 550 |
html: mw.message( 'wikieditor-toolbar-help-content-heading2-description' ).parse() |
| 551 |
}, |
| 552 |
syntax: { |
| 553 |
html: '== ' + mw.message( 'wikieditor-toolbar-help-content-heading2-example' ).escaped() + ' ==' |
| 554 |
}, |
| 555 |
result: { |
| 556 |
html: '<h2>' + mw.message( 'wikieditor-toolbar-help-content-heading2-example' ).parse() + '</h2>' |
| 557 |
} |
| 558 |
}, |
| 559 |
{ |
| 560 |
description: { |
| 561 |
html: mw.message( 'wikieditor-toolbar-help-content-heading3-description' ).parse() |
| 562 |
}, |
| 563 |
syntax: { |
| 564 |
html: '=== ' + mw.message( 'wikieditor-toolbar-help-content-heading3-example' ).escaped() + ' ===' |
| 565 |
}, |
| 566 |
result: { |
| 567 |
html: '<h3>' + mw.message( 'wikieditor-toolbar-help-content-heading3-example' ).parse() + '</h3>' |
| 568 |
} |
| 569 |
}, |
| 570 |
{ |
| 571 |
description: { |
| 572 |
html: mw.message( 'wikieditor-toolbar-help-content-heading4-description' ).parse() |
| 573 |
}, |
| 574 |
syntax: { |
| 575 |
html: '==== ' + mw.message( 'wikieditor-toolbar-help-content-heading4-example' ).escaped() + ' ====' |
| 576 |
}, |
| 577 |
result: { |
| 578 |
html: '<h4>' + mw.message( 'wikieditor-toolbar-help-content-heading4-example' ).parse() + '</h4>' |
| 579 |
} |
| 580 |
}, |
| 581 |
{ |
| 582 |
description: { |
| 583 |
html: mw.message( 'wikieditor-toolbar-help-content-heading5-description' ).parse() |
| 584 |
}, |
| 585 |
syntax: { |
| 586 |
html: '===== ' + mw.message( 'wikieditor-toolbar-help-content-heading5-example' ).escaped() + ' =====' |
| 587 |
}, |
| 588 |
result: { |
| 589 |
html: '<h5>' + mw.message( 'wikieditor-toolbar-help-content-heading5-example' ).parse() + '</h5>' |
| 590 |
} |
| 591 |
} |
| 592 |
] |
| 593 |
}, |
| 594 |
list: { |
| 595 |
label: mw.msg( 'wikieditor-toolbar-help-page-list' ), |
| 596 |
layout: 'table', |
| 597 |
headings: [ |
| 598 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-description' ).parse() }, |
| 599 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-syntax' ).parse() }, |
| 600 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-result' ).parse() } |
| 601 |
], |
| 602 |
rows: [ |
| 603 |
{ |
| 604 |
description: { |
| 605 |
html: mw.message( 'wikieditor-toolbar-help-content-ulist-description' ).parse() |
| 606 |
}, |
| 607 |
syntax: { |
| 608 |
html: '* ' + mw.message( 'wikieditor-toolbar-help-content-ulist-example' ).escaped() + '<br />' + |
| 609 |
'* ' + mw.message( 'wikieditor-toolbar-help-content-ulist-example' ).escaped() |
| 610 |
}, |
| 611 |
result: { |
| 612 |
html: '<ul>' + |
| 613 |
'<li>' + mw.message( 'wikieditor-toolbar-help-content-ulist-example' ).parse() + '</li>' + |
| 614 |
'<li>' + mw.message( 'wikieditor-toolbar-help-content-ulist-example' ).parse() + '</li>' + |
| 615 |
'</ul>' |
| 616 |
} |
| 617 |
}, |
| 618 |
{ |
| 619 |
description: { |
| 620 |
html: mw.message( 'wikieditor-toolbar-help-content-olist-description' ).parse() |
| 621 |
}, |
| 622 |
syntax: { |
| 623 |
html: '# ' + mw.message( 'wikieditor-toolbar-help-content-olist-example' ).escaped() + '<br />' + |
| 624 |
'# ' + mw.message( 'wikieditor-toolbar-help-content-olist-example' ).escaped() |
| 625 |
}, |
| 626 |
result: { |
| 627 |
html: '<ol>' + |
| 628 |
'<li>' + mw.message( 'wikieditor-toolbar-help-content-olist-example' ).parse() + '</li>' + |
| 629 |
'<li>' + mw.message( 'wikieditor-toolbar-help-content-olist-example' ).parse() + '</li>' + |
| 630 |
'</ol>' |
| 631 |
} |
| 632 |
} |
| 633 |
] |
| 634 |
}, |
| 635 |
file: { |
| 636 |
label: mw.msg( 'wikieditor-toolbar-help-page-file' ), |
| 637 |
layout: 'table', |
| 638 |
headings: [ |
| 639 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-description' ).parse() }, |
| 640 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-syntax' ).parse() }, |
| 641 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-result' ).parse() } |
| 642 |
], |
| 643 |
rows: [ |
| 644 |
{ |
| 645 |
description: { |
| 646 |
html: mw.message( 'wikieditor-toolbar-help-content-file-description' ).parse() |
| 647 |
}, |
| 648 |
syntax: { |
| 649 |
html: mw.message( |
| 650 |
'wikieditor-toolbar-help-content-file-syntax', |
| 651 |
fileNamespace, |
| 652 |
configData.magicWords.img_thumbnail[ 0 ], |
| 653 |
mw.msg( 'wikieditor-toolbar-help-content-file-caption' ) |
| 654 |
).escaped() |
| 655 |
}, |
| 656 |
result: { |
| 657 |
html: '<div class="thumbinner" style="width: 102px;">' + |
| 658 |
'<a class="image">' + |
| 659 |
'<img alt="" src="' + $.wikiEditor.imgPath + 'toolbar/example-image.png" width="100" height="50" class="thumbimage"/>' + |
| 660 |
'</a>' + |
| 661 |
'<div class="thumbcaption"><div class="magnify">' + |
| 662 |
'<a title="' + mw.message( 'thumbnail-more' ).escaped() + '" class="internal"></a>' + |
| 663 |
'</div>' + mw.message( 'wikieditor-toolbar-help-content-file-caption' ).escaped() + '</div>' + |
| 664 |
'</div>' |
| 665 |
} |
| 666 |
} |
| 667 |
] |
| 668 |
}, |
| 669 |
discussion: { |
| 670 |
label: mw.msg( 'wikieditor-toolbar-help-page-discussion' ), |
| 671 |
layout: 'table', |
| 672 |
headings: [ |
| 673 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-description' ).parse() }, |
| 674 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-syntax' ).parse() }, |
| 675 |
{ html: mw.message( 'wikieditor-toolbar-help-heading-result' ).parse() } |
| 676 |
], |
| 677 |
rows: [ |
| 678 |
{ |
| 679 |
description: { |
| 680 |
html: mw.message( 'wikieditor-toolbar-help-content-signaturetimestamp-description' ).parse() |
| 681 |
}, |
| 682 |
syntax: { |
| 683 |
html: mw.message( 'wikieditor-toolbar-help-content-signaturetimestamp-syntax' ).escaped() |
| 684 |
}, |
| 685 |
result: { |
| 686 |
html: delink( mw.message( |
| 687 |
'wikieditor-toolbar-help-content-signaturetimestamp-example', |
| 688 |
mw.config.get( 'wgFormattedNamespaces' )[ 2 ], |
| 689 |
mw.config.get( 'wgFormattedNamespaces' )[ 3 ], |
| 690 |
mw.config.get( 'wgUserName' ) || mw.msg( 'wikieditor-toolbar-help-content-signature-username' ) |
| 691 |
).parseDom() ) |
| 692 |
} |
| 693 |
}, |
| 694 |
{ |
| 695 |
description: { |
| 696 |
html: mw.message( 'wikieditor-toolbar-help-content-signature-description' ).parse() |
| 697 |
}, |
| 698 |
syntax: { |
| 699 |
html: mw.message( 'wikieditor-toolbar-help-content-signature-syntax' ).escaped() |
| 700 |
}, |
| 701 |
result: { |
| 702 |
html: delink( mw.message( |
| 703 |
'wikieditor-toolbar-help-content-signature-example', |
| 704 |
mw.config.get( 'wgFormattedNamespaces' )[ 2 ], |
| 705 |
mw.config.get( 'wgFormattedNamespaces' )[ 3 ], |
| 706 |
mw.config.get( 'wgUserName' ) || mw.msg( 'wikieditor-toolbar-help-content-signature-username' ) |
| 707 |
).parseDom() ) |
| 708 |
} |
| 709 |
}, |
| 710 |
{ |
| 711 |
description: { |
| 712 |
html: mw.message( 'wikieditor-toolbar-help-content-indent-description' ).parse() |
| 713 |
}, |
| 714 |
syntax: { |
| 715 |
html: mw.message( 'wikieditor-toolbar-help-content-indent1' ).escaped() + |
| 716 |
'<br />:' + |
| 717 |
mw.message( 'wikieditor-toolbar-help-content-indent2' ).escaped() + |
| 718 |
'<br />::' + |
| 719 |
mw.message( 'wikieditor-toolbar-help-content-indent3' ).escaped() |
| 720 |
}, |
| 721 |
result: { |
| 722 |
html: mw.message( 'wikieditor-toolbar-help-content-indent1' ).parse() + |
| 723 |
'<dl><dd>' + |
| 724 |
mw.message( 'wikieditor-toolbar-help-content-indent2' ).parse() + |
| 725 |
'<dl><dd>' + |
| 726 |
mw.message( 'wikieditor-toolbar-help-content-indent3' ).parse() + |
| 727 |
'</dd></dl></dd></dl>' |
| 728 |
} |
| 729 |
} |
| 730 |
] |
| 731 |
} |
| 732 |
} |
| 733 |
} |
| 734 |
} |
| 735 |
}; |
| 736 |
|
| 737 |
|
| 738 |
if ( !mw.Title.wantSignaturesNamespace( mw.config.get( 'wgNamespaceNumber' ) ) ) { |
| 739 |
delete toolbarConfig.toolbar.main.groups.insert.tools.signature; |
| 740 |
} |
| 741 |
|
| 742 |
module.exports = toolbarConfig; |