「MediaWiki:Gadget-StyleGuide.js」の版間の差分

ナビゲーションに移動 検索に移動
ミス修正、<ref>タグも挿入できるように変更
(一部内容を最新の記述方法に合わせて更新)
(ミス修正、<ref>タグも挿入できるように変更)
35行目: 35行目:
                         'label': '編集用テンプレート',
                         'label': '編集用テンプレート',
                         'characters': [
                         'characters': [
                            {
                                label: '{{注釈}}',
                                action: {
                                    type: 'encapsulate',
                                    options: {
                                        pre: '{{注釈|',
                                        post: '}}'
                                    }
                                }
                            },
                            {
                                label: '&lt;ref&gt;&lt;/ref&gt;',
                                action: {
                                    type: 'encapsulate',
                                    options: {
                                        pre: '&lt;ref&gt;',
                                        post: '&lt;/ref&gt;'
                                    }
                                }
                            },
                            {
                                label: '&lt;ref name=&quot;&quot;&gt;&lt;/ref&gt;',
                                action: {
                                    type: 'encapsulate',
                                    options: {
                                        pre: '&lt;ref name=&quot;&quot;&gt;',
                                        post: '&lt;/ref&gt;'
                                    }
                                }
                            },
                             {
                             {
                                 label: '{{要出典}}',
                                 label: '{{要出典}}',
187行目: 217行目:
                         ],
                         ],
                         rows: [
                         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(\'&lt;ref&gt;\',\'&lt;/ref&gt;\')">&lt;ref&gt;脚注テキスト&lt;/ref&gt;</span>。' },
                            //    result: { html: 'ページ本文<sup class="reference"><a href="#">[1]</a></sup>。' }
                            // },
                             {
                             {
                                 description: { html: '脚注の表示' },
                                 description: { html: '脚注の表示' },
                                 syntax: { html: '<span style="cursor:pointer;" onclick="insertTags(\'== 注釈 ==\\n&lt;references /&gt;\')">== 注釈 ==<br>&lt;references group=&quot;注釈&quot; /&gt;</span><br><span style="cursor:pointer;" onclick="insertTags(\'== 出典 ==\\n&lt;references /&gt;\')">== 出典 ==<br>&lt;references /&gt;</span>' },
                                 syntax: { html: '<span style="cursor:pointer;" onclick="insertTags(\'== 注釈 ==\\n&lt;references group=&quot;注釈&quot; /&gt;\')">== 注釈 ==<br>&lt;references group=&quot;注釈&quot; /&gt;</span><br><span style="cursor:pointer;" onclick="insertTags(\'== 出典 ==\\n&lt;references /&gt;\')">== 出典 ==<br>&lt;references /&gt;</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><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>' }
                                 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><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>' }
                             },
                             },
6,514

回編集

案内メニュー