LLWiki正在建设中,欢迎加入我们

“MediaWiki:Gadget-site-shared.js”的版本间差异

跳转到导航 跳转到搜索
*/
if (['edit', 'submit'].includes( action ) && mw.config.get( 'wgIsProbablyEditable' )) {
// 这个事件不能重复添加,但#editform可能会重建
mw$('#bodyContent').hookon('click', 'wikipagespan.editformmw-charinsert-item', ).add(function($form) {
const $this = } $(this);
console.log('Hook: wikipage.editform, 开始添加快速插入功能');
$form.find( '.mw-editTools#wpTextbox1' ).ontextSelection('click', 'span.mw-charinsert-itemencapsulateSelection', function() {
constpre: $this.data( ='mw-charinsert-start' ) || $(this.data( 'start' );, // undefined也没关系
post: $this.data( '#wpTextbox1mw-charinsert-end' ) || $this.textSelectiondata( 'encapsulateSelectionend', {)
} );
pre: $this.data( 'mw-charinsert-start' ) || $this.data( 'start' ), // undefined也没关系
post: $this.data( 'mw-charinsert-end' ) || $this.data( 'end' )
} );
});
});
}