MediaWiki:Gadget-Emoji.js:修订间差异

来自Limbo Wiki
无编辑摘要
(排版)
第2行: 第2行:
$textarea.wikiEditor( 'addToToolbar',{
$textarea.wikiEditor( 'addToToolbar',{
section: 'advanced',
section: 'advanced',
        group: 'format',
group: 'format',
        tools: {
tools: {
            buttonId: {
buttonId: {
                label: 'Comment visible only for editors',
label: 'Comment visible only for editors',
                type: 'button',
type: 'button',
                action: {
action: {
                    type: 'encapsulate',
type: 'encapsulate',
                    options: {
options: {
                        pre: '<!-- ',
pre: '<!-- ',
                        peri: 'Insert comment here',
peri: 'Insert comment here',
                        post: ' -->'
post: ' -->'
                    }
}
                }
}
            }
}
        }
}
    });
});
});});
});});

2022年3月28日 (一) 14:32的版本

$(function() {mw.hook( 'wikiEditor.toolbarReady' ).add( function ( $textarea ) {
	$textarea.wikiEditor( 'addToToolbar',{
		section: 'advanced',
		group: 'format',
		tools: {
			buttonId: {
				label: 'Comment visible only for editors',
				type: 'button',
				action: {
					type: 'encapsulate',
					options: {
						pre: '<!-- ',
						peri: 'Insert comment here',
						post: ' -->'
					}
				}
			}
		}
	});
});});