“MediaWiki:Gadget-mainpage-edit.js”的版本间差异

无编辑摘要
(// 使用Wikiplus小工具快速编辑)
标签移动版网页编辑 移动版编辑
btns = [ new OO.ui.ButtonWidget({label: '保存', flags: ['primary', 'progressive']}).on('click', () => {
btns[0].setDisabled( true );
mw.safeEdit(api, null, {title: pagename, text: writeText(), section: 0, summary: mw.msg('gadget-ma-summary')}).then(() => {
.then(() => {
(mw.config.get( 'wgRestrictionEdit' ) != 'sysop' || mw.config.get( 'wgRestrictionMove' ) != 'sysop' ?
api.postWithEditToken({action: 'protect', title: pagename, protections: 'edit=sysop|move=sysop'}) :
new OO.ui.ButtonWidget({label: mw.msg( 'gadget-ma-preview' )}).on('click', () => {
mw.timedParse(api, {text: writeText()}, mw.msg( 'gadget-ma-topic' )).then(data => {
$table.html( $(data.parse.text).find( 'tbody' ).first() );
}, () => {});
}),
$this.html( item[2].$element );
});
(id ? mw.standardQuerysectionQuery( api ) : Promise.resolve()).then(data => {
wikitext = data ? data.queryparse.pages[0].revisions[0].contentwikitext : '';
table = wikitext.match( /\n{\|\n[\s\S]+?\n\|}(?=[^!}])/ );
items = [...table[0].matchAll( /首[页頁]\/[标標][签籤]\|(.+?)}}(.+?)\n/g )]
.map(ele => [ele[1].trim(), ele[2].trim()]);
16,874

个编辑