MediaWiki:Gadget-StyleGuide.js
ナビゲーションに移動
検索に移動
注意: 保存後、変更を確認するにはブラウザーのキャッシュを消去する必要がある場合があります。
- Firefox / Safari: Shift を押しながら 再読み込み をクリックするか、Ctrl-F5 または Ctrl-R を押してください (Mac では ⌘-R)
- Google Chrome: Ctrl-Shift-R を押してください (Mac では ⌘-Shift-R)
- Internet Explore/Edger: Ctrl を押しながら 最新の情報に更新 をクリックするか、Ctrl-F5 を押してください
- Opera: Ctrl-F5を押してください
function customizeToolbar() {
$('#wpTextbox1').wikiEditor('addToToolbar', {
sections: {
cheatsheet: {
type: 'booklet',
label: '記述ガイド',
deferLoad: true,
pages: {
'style': {
'layout': 'characters',
'label': '表記ガイドの推奨表記',
'characters': [
'48グループ',
'AKB48', 'SKE48', 'NMB48', 'HKT48',
'JKT48', 'SNH48', 'SDN48', '乃木坂46',
'チームA', 'チームK', 'チームB', 'チーム4', 'チーム8', '研究生',
'チームS', 'チームKII', 'チームE',
'チームN', 'チームM', 'チームBII',
'チームH', 'チームKIV',
]
},
'templates': {
'layout': 'characters',
'label': '編集用テンプレート',
'characters': [
{
label: '{{要出典}}',
action: {
type: 'encapsulate',
options: {
pre: '{{要出典|範囲=',
post: '}}'
}
}
},
{
label: '{{出典 Google+}}',
action: {
type: 'encapsulate',
options: {
pre: '{{出典 Google+|url=',
post: '|by=|date=}}'
}
}
},
{
label: '{{MSG WRITERWANTED}}',
action: {
type: 'encapsulate',
options: {
pre: '{{MSG WRITERWANTED|text=',
post: '}}',
ownline: true
}
}
},
]
},
footer: {
layout: 'table',
label: 'フッタ要素',
headings: [
{ text: '解説' },
{ text: '入力例' },
{ text: '出力結果' }
],
rows: [
// {
// description: { html: '要出典' },
// syntax: { html: '<span style="cursor:pointer;" onclick="insertTags(\'{[要出典|範囲=\',\'}}\')">{{要出典|範囲=ページ本文}}</span>。' },
// result: { html: '<span class="fix-domain">ページ本文</span><sup>[<i><a href="#">要出典</a></i>]</sup>。' }
// },
// {
// description: { html: '注釈' },
// syntax: { html: 'ページ本文<span style="cursor:pointer;" onclick="insertTags(\'<ref>\',\'</ref>\')"><ref>脚注テキスト</ref></span>。' },
// result: { html: 'ページ本文<sup class="reference"><a href="#">[1]</a></sup>。' }
// },
{
description: { html: '脚注の表示' },
syntax: { html: '<span style="cursor:pointer;" onclick="insertTags(\'== 脚注・出典==\\n<references />\')">== 脚注・出典 ==<br><references /></span>' },
result: { html: '<h2>脚注・出典</h2><ol class="references"><li id="cite_note-test-0"><span class="mw-cite-backlink"><a href="#">^</a></span> <span class="reference-text">脚注テキスト</span></li></ol>' }
},
{
description: { html: 'DEFAULTSORT' },
syntax: { html: '<span style="cursor:pointer;" onclick="insertTags(\'{{DEFAULTSORT:\',\'}}\\n\')">{{DEFAULTSORT:まついしゆりな}}</span>' },
result: { html: '<span style="color:#999;">DEFUALTSORTは、表示されません</span>' }
},
{
description: { html: '言語間リンク' },
syntax: { html: '<span style="cursor:pointer;" onclick="insertTags(\'[[jawp:\',\']]\\n\')">[[jawp:AKB48]]</span><br><span style="cursor:pointer;" onclick="insertTags(\'[[akb49:\',\']]\\n\')">[[akb49:AKB48]]</span><br><span style="cursor:pointer;" onclick="insertTags(\'[[stage48:\',\']]\\n\')">[[stage48:AKB48]]</span><br><span style="cursor:pointer;" onclick="insertTags(\'[[akb48wikia:\',\']]\\n\')">[[akb48wikia:AKB48]]</span>' },
result: { html: '<span style="color:#999;">言語間リンクは、表示されません</span>' }
},
]
},
memberInfo: {
layout: 'table',
label: 'メンバー情報テンプレート',
headings: [
{ text: '引数' },
{ text: '入力例' },
{ text: '解説' }
],
rows: [
{
name: { html: 'グループ<br>グループ<i>n</i>' },
example: { html: 'AKB48' },
description: { html: '所属グループ、もしくは過去の所属グループ' }
},
{
name: { html: 'チーム<br>チーム<i>n</i>' },
example: { html: 'チームA、研究生、<br>卒業生、元メンバー、兼任終了' },
description: { html: '「グループ」に対応する所属チーム<br>過去の所属は入力せず「卒業生」などとする' }
},
{
name: { html: '新グループ' },
example: { html: '' },
description: { html: '組閣などで異動予定のグループ' }
},
{
name: { html: '新チーム' },
example: { html: '' },
description: { html: '組閣などで異動予定のチーム' }
},
{
name: { html: '名前' },
example: { html: '松井 珠理奈' },
description: { html: '姓と名の間には半角スペースを入れる' }
},
{
name: { html: '読み' },
example: { html: 'まつい じゅりな' },
description: { html: 'ひらがなで、姓と名の間には半角スペースを入れる' }
},
{
name: { html: '画像' },
example: { html: '[[ファイル:example.jpg|250px]]' },
description: { html: '公式のプロフィール画像を指定' }
},
{
name: { html: 'ニックネーム' },
example: { html: '' },
description: { html: '公式プロフィールによるニックネーム' }
},
{
name: { html: '所属事務所' },
example: { html: '' },
description: { html: '' }
},
{
name: { html: '生年月日' },
example: { html: '{{生年月日|1997|3|8}}' },
description: { html: '' }
},
{
name: { html: '出身地' },
example: { html: '愛知県' },
description: { html: '' }
},
{
name: { html: '血液型' },
example: { html: 'A型、B型、O型、AB型、不明' },
description: { html: '' }
},
{
name: { html: '身長' },
example: { html: '163cm' },
description: { html: '' }
},
{
name: { html: '体重' },
example: { html: '' },
description: { html: '' }
},
{
name: { html: 'スリーサイズ' },
example: { html: 'B78 W60 H85' },
description: { html: '' }
},
{
name: { html: '靴のサイズ' },
example: { html: '24.5cm' },
description: { html: '' }
},
{
name: { html: '合格期' },
example: { html: '1期生、<br>SKE48 1期生' },
description: { html: '' }
},
{
name: { html: 'ユニット' },
example: { html: '' },
description: { html: '' }
},
{
name: { html: '選抜回数' },
example: { html: '' },
description: { html: '' }
},
{
name: { html: 'サイリウム' },
example: { html: '{{サイリウム|オレンジ|緑}}' },
description: { html: '' }
},
{
name: { html: '選抜総選挙' },
example: { html: '{{総選挙|19位|10位|14位|9位|6位|4位}}' },
description: { html: '' }
},
{
name: { html: 'じゃんけん大会' },
example: { html: '{{じゃんけん大会||SKE48予備戦→3回戦敗退|1回戦敗退|1位}}' },
description: { html: '' }
},
]
},
setlist: {
layout: 'table',
label: 'セットリストの記述',
headings: [
{ text: '解説' },
{ text: '入力例' },
{ text: '出力結果' }
],
rows: [
{
description: { html: '開始 / 終了' },
syntax: { html: '<span style="cursor:pointer;" onclick="insertTags(\'<div class="setlist with-overture">\\n\',\'\\n</div>\',\'<!--ここにセットリストを記述-->\')"><div class="setlist with-overture"><br><span style="color:#999;"><!--ここにセットリストを記述--></span><br></div></span>' },
result: { html: '' }
},
{
description: { html: '曲目' },
syntax: { html: "# '''overture'''<br># '''Jane Doe'''/高橋みなみ<br># '''ギンガムチェック'''<br># '''チョコの奴隷'''" },
result: { html: '<div class="setlist with-overture"><ol><li><b>overture</b></li><li><b>Jane Doe</b>/高橋みなみ</li><li><b>ギンガムチェック</b></li><li><b>チョコの奴隷</b></li></ol></div>' }
},
{
description: { html: '歌唱メンバー' },
syntax: { html: "# '''キリギリス人'''/ノースリーブス<br>#: 高橋みなみ・小嶋陽菜・峯岸みなみ " },
result: { html: '<div class="setlist" style="counter-reset: setlist-item 3;"><ol><li><b>キリギリス人</b>/ノースリーブス<dl><dd>高橋みなみ・小嶋陽菜・峯岸みなみ </dd></dl></li></ol></div>' }
},
{
description: { html: 'メドレー' },
syntax: { html: "# '''AKB48グループメドレー'''<br>## UZA<br>## GAGAGA<br>## 美しい稲妻" },
result: { html: '<div class="setlist" style="counter-reset: setlist-item 4;"><ol><li><b>AKB48グループメドレー</b><ol><li>UZA</li><li>GAGAGA</li><li>美しい稲妻</li></ol></li></ol></div>' }
},
{
description: { html: 'アンコール' },
syntax: { html: '<span style="cursor:pointer;" onclick="insertTags(\'<div class="setlist encore">\\n\',\'\\n</div>\',\'<!--ここにセットリストを記述-->\')"><div class=\"setlist encore\"><br># \'\'\'ラブラドール・レトリバー\'\'\'<br># \'\'\'少女たちよ\'\'\'<br># \'\'\'After rain\'\'\'<br></div></span>' },
result: { html: '<div class="setlist encore"><ol><li><b>ラブラドール・レトリバー</b></li><li><b>少女たちよ</b></li><li><b>After rain</b></li></ol></div>' }
},
]
}
}
}
}
});
}
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar . . . */
if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) {
mw.loader.using( 'user.options', function () {
if ( mw.user.options.get('usebetatoolbar') && mw.user.options.get( 'showtoolbar' ) ) {
mw.loader.using( 'ext.wikiEditor.toolbar', customizeToolbar );
}
} );
}