「MediaWiki:Gadget-StyleGuide.js」の版間の差分
ナビゲーションに移動
検索に移動
(コード修正。要出典のガイドを追加) |
(グループ名などの追加) |
||
7行目: | 7行目: | ||
'deferLoad': true, | 'deferLoad': true, | ||
'pages': { | 'pages': { | ||
'style': { | |||
'layout': 'table', | |||
'label': '推奨表記', | |||
'headings': [ | |||
{ text: 'カテゴリ' }, | |||
{ text: '推奨表記' }, | |||
], | |||
'rows': [ | |||
{ | |||
'カテゴリ': { text: 'グループ全体' }, | |||
'推奨表記': { html: '<span style="cursor:pointer;" onclick="insertTags(\'48グループ\',\'\',\'\')">48グループ</span>' }, | |||
}, | |||
{ | |||
'カテゴリ': { text: 'グループ名' }, | |||
'推奨表記': { html: '<span style="cursor:pointer;" onclick="insertTags(\'AKB48\',\'\',\'\')">AKB48</span>、<span style="cursor:pointer;" onclick="insertTags(\'SKE48\',\'\',\'\')">SKE48</span>、<span style="cursor:pointer;" onclick="insertTags(\'NMB48\',\'\',\'\')">NMB48</span>、<span style="cursor:pointer;" onclick="insertTags(\'HKT48\',\'\',\'\')">HKT48</span>、<span style="cursor:pointer;" onclick="insertTags(\'JKT48\',\'\',\'\')">JKT48</span>、<span style="cursor:pointer;" onclick="insertTags(\'SNH48\',\'\',\'\')">SNH48</span>、<span style="cursor:pointer;" onclick="insertTags(\'SDN48\',\'\',\'\')">SDN48</span>、<span style="cursor:pointer;" onclick="insertTags(\'乃木坂46\',\'\',\'\')">乃木坂46</span>' }, | |||
}, | |||
{ | |||
'カテゴリ': { text: 'チーム名' }, | |||
'推奨表記': { html: '<span style="cursor:pointer;" onclick="insertTags(\'チームA\',\'\',\'\')">チームA</span>、<span style="cursor:pointer;" onclick="insertTags(\'チームK\',\'\',\'\')">チームK</span>、<span style="cursor:pointer;" onclick="insertTags(\'チームB\',\'\',\'\')">チームB</span>、<span style="cursor:pointer;" onclick="insertTags(\'チーム4\',\'\',\'\')">チーム4</span>、<span style="cursor:pointer;" onclick="insertTags(\'チーム8\',\'\',\'\')">チーム8</span>、<span style="cursor:pointer;" onclick="insertTags(\'研究生\',\'\',\'\')">研究生</span><br><span style="cursor:pointer;" onclick="insertTags(\'チームS\',\'\',\'\')">チームS</span>、<span style="cursor:pointer;" onclick="insertTags(\'チームKII\',\'\',\'\')">チームKII</span>、<span style="cursor:pointer;" onclick="insertTags(\'チームE\',\'\',\'\')">チームE</span><br><span style="cursor:pointer;" onclick="insertTags(\'チームN\',\'\',\'\')">チームN</span>、<span style="cursor:pointer;" onclick="insertTags(\'チームM\',\'\',\'\')">チームM</span>、<span style="cursor:pointer;" onclick="insertTags(\'チームBII\',\'\',\'\')">チームBII</span><br><span style="cursor:pointer;" onclick="insertTags(\'チームH\',\'\',\'\')">チームH</span>、<span style="cursor:pointer;" onclick="insertTags(\'チームKIV\',\'\',\'\')">チームKIV</span>' }, | |||
}, | |||
] | |||
}, | |||
'basic': { | 'basic': { | ||
'layout': 'table', | 'layout': 'table', | ||
93行目: | 115行目: | ||
} ); | } ); | ||
} | } | ||
2014年5月8日 (木) 21:23時点における版
function customizeToolbar() {
$('#wpTextbox1').wikiEditor('addToToolbar', {
'sections': {
'cheatsheet': {
'type': 'booklet',
'label': '記述ガイド',
'deferLoad': true,
'pages': {
'style': {
'layout': 'table',
'label': '推奨表記',
'headings': [
{ text: 'カテゴリ' },
{ text: '推奨表記' },
],
'rows': [
{
'カテゴリ': { text: 'グループ全体' },
'推奨表記': { html: '<span style="cursor:pointer;" onclick="insertTags(\'48グループ\',\'\',\'\')">48グループ</span>' },
},
{
'カテゴリ': { text: 'グループ名' },
'推奨表記': { html: '<span style="cursor:pointer;" onclick="insertTags(\'AKB48\',\'\',\'\')">AKB48</span>、<span style="cursor:pointer;" onclick="insertTags(\'SKE48\',\'\',\'\')">SKE48</span>、<span style="cursor:pointer;" onclick="insertTags(\'NMB48\',\'\',\'\')">NMB48</span>、<span style="cursor:pointer;" onclick="insertTags(\'HKT48\',\'\',\'\')">HKT48</span>、<span style="cursor:pointer;" onclick="insertTags(\'JKT48\',\'\',\'\')">JKT48</span>、<span style="cursor:pointer;" onclick="insertTags(\'SNH48\',\'\',\'\')">SNH48</span>、<span style="cursor:pointer;" onclick="insertTags(\'SDN48\',\'\',\'\')">SDN48</span>、<span style="cursor:pointer;" onclick="insertTags(\'乃木坂46\',\'\',\'\')">乃木坂46</span>' },
},
{
'カテゴリ': { text: 'チーム名' },
'推奨表記': { html: '<span style="cursor:pointer;" onclick="insertTags(\'チームA\',\'\',\'\')">チームA</span>、<span style="cursor:pointer;" onclick="insertTags(\'チームK\',\'\',\'\')">チームK</span>、<span style="cursor:pointer;" onclick="insertTags(\'チームB\',\'\',\'\')">チームB</span>、<span style="cursor:pointer;" onclick="insertTags(\'チーム4\',\'\',\'\')">チーム4</span>、<span style="cursor:pointer;" onclick="insertTags(\'チーム8\',\'\',\'\')">チーム8</span>、<span style="cursor:pointer;" onclick="insertTags(\'研究生\',\'\',\'\')">研究生</span><br><span style="cursor:pointer;" onclick="insertTags(\'チームS\',\'\',\'\')">チームS</span>、<span style="cursor:pointer;" onclick="insertTags(\'チームKII\',\'\',\'\')">チームKII</span>、<span style="cursor:pointer;" onclick="insertTags(\'チームE\',\'\',\'\')">チームE</span><br><span style="cursor:pointer;" onclick="insertTags(\'チームN\',\'\',\'\')">チームN</span>、<span style="cursor:pointer;" onclick="insertTags(\'チームM\',\'\',\'\')">チームM</span>、<span style="cursor:pointer;" onclick="insertTags(\'チームBII\',\'\',\'\')">チームBII</span><br><span style="cursor:pointer;" onclick="insertTags(\'チームH\',\'\',\'\')">チームH</span>、<span style="cursor:pointer;" onclick="insertTags(\'チームKIV\',\'\',\'\')">チームKIV</span>' },
},
]
},
'basic': {
'layout': 'table',
'label': '基本要素',
'headings': [
{ textMsg: 'wikieditor-toolbar-help-heading-description' },
{ textMsg: 'wikieditor-toolbar-help-heading-syntax' },
{ textMsg: 'wikieditor-toolbar-help-heading-result' }
],
'rows': [
{
description: { text: '要出典' },
syntax: { html: '<span style="cursor:pointer;" onclick="insertTags(\'{[要出典|範囲=\',\'}}\',\'\')">{{要出典|範囲=ページ本文}}</span>。' },
result: { html: '<span class="fix-domain">ページ本文</span><sup>[<i><a href="#">要出典</a></i>]</sup>。' }
},
{
description: { text: '注釈' },
syntax: { html: 'ページ本文<span style="cursor:pointer;" onclick="insertTags(\'<ref>\',\'</ref>\',\'\')"><ref>脚注テキスト</ref></span>。' },
result: { html: 'ページ本文<sup class="reference"><a href="#">[1]</a></sup>。' }
},
{
description: { text: '脚注の表示' },
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: { text: 'DEFAULTSORT' },
syntax: { html: '<span style="cursor:pointer;" onclick="insertTags(\'{{DEFAULTSORT:\',\'}}\\n\',\'\')">{{DEFAULTSORT:まついしゆりな}}</span>' },
result: { html: '<span style="color:#999;">DEFUALTSORTは、表示されません</span>' }
},
{
description: { text: '言語間リンク' },
syntax: { html: '<span style="cursor:pointer;" onclick="insertTags(\'[[jawp:\',\']]\\n\',\'\')">[[jawp: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>' }
},
]
},
'setlist': {
'layout': 'table',
'label': 'セットリスト',
'headings': [
{ textMsg: 'wikieditor-toolbar-help-heading-description' },
{ textMsg: 'wikieditor-toolbar-help-heading-syntax' },
{ textMsg: 'wikieditor-toolbar-help-heading-result' }
],
'rows': [
{
description: { html: '開始 / 終了<br>' },
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: { text: '曲目' },
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: { text: '歌唱メンバー' },
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: { text: 'メドレー' },
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: { text: 'アンコール' },
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 );
}
} );
}