「MediaWiki:Gadget-StyleGuide.js」の版間の差分
ナビゲーションに移動
検索に移動
細 (<references/>が正しく挿入できるよう修正) |
(コード修正。要出典のガイドを追加) |
||
17行目: | 17行目: | ||
'rows': [ | 'rows': [ | ||
{ | { | ||
description: { text: ' | description: { text: '要出典' }, | ||
syntax: { html: '<span style="cursor:pointer;" onclick="insertTags(\'= | syntax: { html: '<span style="cursor:pointer;" onclick="insertTags(\'{[要出典|範囲=\',\'}}\',\'\')">{{要出典|範囲=ページ本文}}</span>。' }, | ||
result: { html: '< | result: { html: '<span class="fix-domain">ページ本文</span><sup>[<i><a href="#">要出典</a></i>]</sup>。' } | ||
}, | }, | ||
{ | { | ||
description: { text: ' | description: { text: '注釈' }, | ||
syntax: { html: '<a href="#" onclick="insertTags(\'{{DEFAULTSORT:\',\'}}\\n\',\'\') | syntax: { html: 'ページ本文<span style="cursor:pointer;" onclick="insertTags(\'<ref>\',\'</ref>\',\'\')"><ref>脚注テキスト</ref></span>。' }, | ||
result: { html: '' } | 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>' } | |||
}, | }, | ||
] | ] | ||
39行目: | 54行目: | ||
{ | { | ||
description: { html: '開始 / 終了<br>' }, | description: { html: '開始 / 終了<br>' }, | ||
syntax: { html: '<span style="cursor:pointer;" onclick="insertTags(\'<div class="setlist with-overture">\\n\',\'\\n</div>\',\'<!--ここにセットリストを記述-->\') | 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: '' } | result: { html: '' } | ||
}, | }, | ||
54行目: | 69行目: | ||
{ | { | ||
description: { text: 'メドレー' }, | description: { text: 'メドレー' }, | ||
syntax: { html: "# '''AKB48グループメドレー'''<br>## UZA<br>## GAGAGA<br># 美しい稲妻" }, | 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>' } | 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: 'アンコール' }, | description: { text: 'アンコール' }, | ||
syntax: { html: '<span style="cursor:pointer;" onclick="insertTags(\'<div class="setlist encore">\\n\',\'\\n</div>\',\'<!--ここにセットリストを記述-->\') | 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>' } | result: { html: '<div class="setlist encore"><ol><li><b>ラブラドール・レトリバー</b></li><li><b>少女たちよ</b></li><li><b>After rain</b></li></ol></div>' } | ||
}, | }, |
2014年5月6日 (火) 22:05時点における版
function customizeToolbar() {
$('#wpTextbox1').wikiEditor('addToToolbar', {
'sections': {
'cheatsheet': {
'type': 'booklet',
'label': '記述ガイド',
'deferLoad': true,
'pages': {
'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 );
}
} );
}
// Add the customizations to LiquidThreads' edit toolbar, if available
mw.hook( 'ext.lqt.textareaCreated' ).add( customizeToolbar );