MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 8: Line 8:
//Begin all the $textarea.wikiEditor stuff
//Begin all the $textarea.wikiEditor stuff
$textarea.wikiEditor( 'addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
comment: {
label: 'Comment',
type: 'button',
icon: 'https://upload.wikimedia.org/wikipedia/commons/3/37/Btn_toolbar_commentaire.png',
action: {
type: 'encapsulate',
options: {
pre: '<!-- ',
post: ' -->'
}
}
}
}
} );
$textarea.wikiEditor( 'addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
hline: {
label: 'Horizontal line',
type: 'button',
icon: 'https://upload.wikimedia.org/wikipedia/commons/a/a4/H-line_icon.png',
action: {
type: 'encapsulate',
options: {
pre: '----',
ownline: true
}
}
}
}
} );


$textarea.wikiEditor( 'addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
pb: {
label: '{{Ping}}',
action: {
type: 'encapsulate',
options: {
pre: '{{Ping|',
post: '}}'
}
}
}
}
} );
$textarea.wikiEditor( 'addToToolbar', {
$textarea.wikiEditor( 'addToToolbar', {
Line 72: Line 19:
}
}
} );
} );
$textarea.wikiEditor( 'addToToolbar', {
$textarea.wikiEditor( 'addToToolbar', {
section: 'extended',
section: 'extended',
groups: {
groups: {
a: {
list: {
label: 'a' // or use labelMsg for a localized label, see above
tools: {
},
ttemplates: {
b: {
label: 'Time Templates',
label: 'b' // or use labelMsg for a localized label, see above
type: 'select',
},
list: {
c: {
'dsa1': {
label: 'c' // or use labelMsg for a localized label, see above
label: '{{dsa|birth=|death=}}',
}
action: {
}
type: 'encapsulate',
} );
options: {
$textarea.wikiEditor( 'addToToolbar', {
pre: '{{dsa|birth=',
section: 'templates',
post: '|death=}}'
group: 'mfaces',
}
pages: {
}
katakana: {
},
layout: 'characters',
'dsa2': {
label: 'Katakana',
label: '{{dsa|birth=|birthphrase=|death=|deathphrase=}}',
characters: '{{dsa|birth=|death=}}', '{{dsa|birth=|birthphrase=|death=|deathphrase=}}', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'グ', 'ケ', 'ゲ', 'コ', 'ゴ', 'サ', 'ザ', 'シ', 'ジ', 'ス', 'ズ', 'セ', 'ゼ', 'ソ', 'ゾ', 'タ', 'ダ', 'チ', 'ヂ', 'ッ', 'ツ', 'ヅ', 'テ', 'デ', 'ト', 'ド', 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'バ', 'パ', 'ヒ', 'ビ', 'ピ', 'フ', 'ブ', 'プ', 'ヘ', 'ベ', 'ペ', 'ホ', 'ボ', 'ポ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ャ', 'ヤ', 'ュ', 'ユ', 'ョ', 'ヨ', 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ヮ', 'ワ', 'ヰ', 'ヱ', 'ヲ', 'ン', 'ヴ', 'ヵ', 'ヶ', '゛', '゜', 'ー' ]
action: {
type: 'encapsulate',
options: {
pre: '{{dsa|birth=',
post: '|birthphrase=|death=|deathphrase=}}'
}
}
},
'aidh': {
label: '{{aidh||}}',
action: {
type: 'encapsulate',
options: {
pre: '{{aidh|',
post: '|}}'
}
}
},
'yyyymmddlink': {
label: '{{YYYYMMDDtoLinks|}}',
action: {
type: 'encapsulate',
options: {
pre: '{{YYYYMMDDtoLinks|',
post: '}}'
}
}
},
'yyyymmddfjylink': {
label: '{{YYYYMMDDtoFjYLinks|}}',
action: {
type: 'encapsulate',
options: {
pre: '{{YYYYMMDDtoFjYLinks|',
post: '}}'
}
}
},
}
}
}
}
}
}
}
Line 99: Line 88:


$textarea.wikiEditor( 'addToToolbar', {
$textarea.wikiEditor( 'addToToolbar', {
section: 'advanced',
section: 'extended',
groups: {
groups: {
list: {
list: {
tools: {
tools: {
templates: {
templates: {
label: 'Templates',
label: 'Categories',
type: 'select',
type: 'select',
list: {
list: {
'Ping-button': {
'cPeople': {
label: '{{Ping}}',
label: 'People',
action: {
type: 'encapsulate',
options: {
pre: '[[Category:People]]'
}
}
},
'cFPeople': {
label: 'Fictional People',
action: {
type: 'encapsulate',
options: {
pre: '[[Category:Fictional People]]',
}
}
},
'cTVShows': {
label: 'Television Shows',
action: {
action: {
type: 'encapsulate',
type: 'encapsulate',
options: {
options: {
pre: '{{Ping|',
pre: '[[Category:Television Shows]]',
post: '}}'
}
}
},
'cTVSeasons': {
label: 'Television Seasons',
action: {
type: 'encapsulate',
options: {
pre: '[[Category:Television Seasons]]',
}
}
},
'cMovies': {
label: 'Movies',
action: {
type: 'encapsulate',
options: {
pre: '[[Category:Movies]]',
}
}
}
}
},
},
'Clear-button': {
'cBooks': {
label: 'Clear',
label: 'Books',
action: {
action: {
type: 'encapsulate',
type: 'encapsulate',
options: {
options: {
pre: '{{Clear}}'
pre: '[[Category:Books]]',
}
}
}
}
},
},
'Done-button': {
'cVGs': {
label: 'Done',
label: 'Video Games',
action: {
action: {
type: 'encapsulate',
type: 'encapsulate',
options: {
options: {
pre: '{{Done}}'
pre: '[[Category:Video Games]]',
}
}
}
}
}
},
}
}
}
}
Line 147: Line 171:
list: {
list: {
tools: {
tools: {
templates2: {
misc: {
label: 'Templates2',
label: 'Misc',
type: 'select',
type: 'select',
list: {
list: {
'Ping-button': {
'comments': {
label: '{{dsa|birth=|death=}}',
label: 'Comment',
action: {
type: 'encapsulate',
options: {
pre: '<!-- ',
post: ' -->'
}
}
},
'nowiki': {
label: 'Nowiki',
action: {
type: 'encapsulate',
options: {
pre: '<nowiki>',
post: '</nowiki>'
}
}
},
'horline': {
label: 'Horizontal Line',
action: {
type: 'encapsulate',
options: {
pre: '----',
ownline: true
}
}
},
'defsort': {
label: 'Default Sort',
action: {
action: {
type: 'encapsulate',
type: 'encapsulate',
options: {
options: {
pre: '{{dsa|birth=',
pre: '{{DEFAULTSORT:',
post: '|death=}}'
post: '}}'
}
}
}
}
},
},
'Clear-button': {
'lcasetitle': {
label: '{{dsa|birth=|birthphrase=|death=|deathphrase=}}',
label: 'Lowercase title',
action: {
action: {
type: 'encapsulate',
type: 'encapsulate',
options: {
options: {
pre: '{{dsa|birth=',
pre: '{{lowercase title}}',
post: '|birthphrase=|death=|deathphrase=}}'
}
}
}
}
Line 178: Line 231:
} );
} );


$textarea.wikiEditor( 'addToToolbar', {
section: 'characters',
pages: {
emoticons: {
layout: 'characters',
label: 'Emoticons',
characters: [ ':)', ':))', ':(', '<3', ';)' ]
}
}
} );


$textarea.wikiEditor( 'addToToolbar', {
$textarea.wikiEditor( 'addToToolbar', {
Line 211: Line 254:
} );
} );


$textarea.wikiEditor( 'addToToolbar', {
section: 'templatessection',
pages: {
katakana: {
layout: 'characters',
label: 'Katakana',
characters: [  'ァ', 'ア', 'ィ', 'イ', 'ゥ', 'ウ', 'ェ', 'エ', 'ォ', 'オ', 'カ', 'ガ', 'キ', 'ギ', 'ク', 'グ', 'ケ', 'ゲ', 'コ', 'ゴ', 'サ', 'ザ', 'シ', 'ジ', 'ス', 'ズ', 'セ', 'ゼ', 'ソ', 'ゾ', 'タ', 'ダ', 'チ', 'ヂ', 'ッ', 'ツ', 'ヅ', 'テ', 'デ', 'ト', 'ド', 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'バ', 'パ', 'ヒ', 'ビ', 'ピ', 'フ', 'ブ', 'プ', 'ヘ', 'ベ', 'ペ', 'ホ', 'ボ', 'ポ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ャ', 'ヤ', 'ュ', 'ユ', 'ョ', 'ヨ', 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ヮ', 'ワ', 'ヰ', 'ヱ', 'ヲ', 'ン', 'ヴ', 'ヵ', 'ヶ', '゛', '゜', 'ー' ]
}
}
} );