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

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

跳转到导航 跳转到搜索
添加203字节 、​ 2020年12月22日 (二) 01:24
无编辑摘要
mw.request = mw.request || api.get({action: 'query', revids: mw.config.get('wgRevisionId'), prop: 'revisions',
rvprop: 'content', curtimestamp: 1, formatversion: 2});
let text, editor, wrapper, btns;
const btns = [new OO.ui.ButtonWidget({label: '提交', flags: ['primary', 'progressive']}).on('click', () => {
const next = function() {
const list = mw.storage.getObject( 'inspect-category' );
if (!list) { return id + 1; }
if (list[0][ list[1] ] == id) {
list[1]++;
if (list[1] >= list[0].length) { btns[4].setDisabled( true ); }
mw.storage.setObject( 'inspect-category', list );
}
return list[0][ list[1] ];
},
getJSON = $.ajax({ dataType: 'json', cache: true,
url: '/zh?title=mediawiki:gadget-CodeMirror.json&action=raw&ctype=application/json' });
btns = [new OO.ui.ButtonWidget({label: '提交', flags: ['primary', 'progressive']}).on('click', () => {
btns[0].setDisabled( true );
console.log('API request: 查询最新编辑时间戳');
wrapper.toggle();
btns[3].setLabel( css.disabled ? '显示' : '隐藏');
}), new OO.ui.ButtonWidget({flags: 'progressive', icon: 'next', href: `/?redirect=no&curid=${next()}`})],
const next = function() {
const list = mw.storage.getObject( 'inspect-category' );
let nextid = '';
if (!list) { returnnextid = id + 1; }
if (list[0][ list[1] ] == id) {
list[1]++;
if (list[1] >= list[0].length) { btns[4].setDisabled( true ); }
btns[4].setDisabled( true );
return;
}
mw.storage.setObject( 'inspect-category', list );
}
returnnextid = list[0][ list[1] ];
btns[4].setDisabled( false );
btns[4].setHref( `/?redirect=no&curid=${nextid}` );
},
getJSON = $.ajax({ dataType: 'json', cache: true,
url: '/zh?title=mediawiki:gadget-CodeMirror.json&action=raw&ctype=application/json' });
btns[4].$element.contextmenu(e => {
e.preventDefault();
const currentIndex = pages[0] == id ? 1 : 0;
mw.storage.setObject( 'inspect-category', [pages, currentIndex] );
btns[4].setDisabled( false ).setHref( `/?redirect=no&curid=${pages[ currentIndex ]}` );
}, reason => { mw.notify(`无法获得该分类下的页面列表!错误信息:${reason}`, {type: 'error'}); });
}, reason => { mw.notify(`无法获得页面名称!错误信息:${reason}`, {type: 'error'}); });
wrapper = $( editor.getWrapperElement() );
$('<div>', {html: btns.map(ele => ele.$element)}).appendTo( outer );
next();
mw.request.then(data => {
console.log('End API request: 已获得页面Wikitext');
16,874

个编辑

导航菜单