16,874
个编辑
LLWiki正在建设中,欢迎加入我们!
小 |
小 |
||
*/
if (['edit', 'submit'].includes( action ) && mw.config.get( 'wgIsProbablyEditable' )) {
// #editform可能会重建
$('#editform').on('click', 'span.mw-charinsert-item', function() {▼
mw.hook( 'wikipage.editform' ).add(function($form) {
const $this = $(this);▼
console.log('Hook: wikipage.editform, 开始添加快速插入功能');
$('#wpTextbox1').textSelection( 'encapsulateSelection', {▼
pre: $this.data( 'mw-charinsert-start' ) || $this.data( 'start' ), // undefined也没关系▼
▲ $('#wpTextbox1').textSelection( 'encapsulateSelection', {
} );▼
▲ pre: $this.data( 'mw-charinsert-start' ) || $this.data( 'start' ), // undefined也没关系
post: $this.data( 'mw-charinsert-end' ) || $this.data( 'end' )
});
}
|