16,874
个编辑
LLWiki正在建设中,欢迎加入我们!
小 |
小 |
||
src = charInsert.src || 'special:我的用户页/edittools',
// 由于resizable,left, top, height必须加!important,width不可加!important
cssHide = mw.util.addCSS(
$content = $('#mw-content-text, #mw-imagepage-content').last(),
// wikitext/Scribunto对应.mw-parser-output,javascript/css对应.mw-code,json对应.mw-json
list = [pages, flag];
mw.storage.setObject( 'inspect-category', [pages, 0] );
btnGo.setHref(
};
let nextid, list = mw.storage.getObject( 'inspect-category' ), flag;
nextid = list[0][ list[1] ];
}
const btnGo = new OO.ui.ButtonWidget({flags: 'progressive', icon: 'next', href:
disabled: !nextid});
// 这个click事件不能绑到btnGo上,否则会禁用href跳转
if (cat === '') {
mw.storage.remove( 'inspect-category' );
btnGo.setHref(
return;
}
return;
}
if (!/^(category|分[类類]):/i.test( cat )) { cat =
// cmtitle参数不可自动转换,所以需要先获得转换后的正确标题
mw.timedQuery(api, {titles: cat, converttitles: 1}, wgULS('标准页面名称', '標準頁面名稱')).then(r => {
});
// 标注<p>标签
const css = mw.util.addCSS(
▲ '#mw-content-text .mw-parser-output { display:flow-root; overflow:hidden; word-wrap:break-word; }' );
css.disabled = true;
let dialog, actionP, actionD, text, editor, $wrapper, $replace, $charinsert, prefix, ns, section,
lang = mw.config.get( 'wgUserVariant' );
// 也可以使用user.options,这里使用其他方法绕过
const isGadget = (name) => ['loaded', 'loading', 'ready'].includes( mw.loader.getState(
isBackup = isGadget('contentBackup'),
backupObj = isBackup ? Object.fromEntries( mw.storage.getObject( 'LLWiki-contentBackup' ) || [] ) : {},
api.parse(editor.getValue(), {title: page, uselang: lang, disablelimitreport: 1, disableeditsection: 1})
.then(html => {
console.log(
if ($.contains( $content[0], $original[0] )) { $original.after( $placeholder ).detach(); }
$content.children( '.mw-parser-output' ).replaceWith( html );
else { mw.notify( wgULS('当前不存在该行!', '當前不存在該行!'), {type: 'warn'} ); }
});
}, reason => { mw.apiFailure(reason,
.then(() => { $outer.removeClass( 'mw-ajax-loader' ); });
});
|