LLWiki正在建设中,欢迎加入我们!
User:Bhsd/tool.js
跳转到导航
跳转到搜索
注意:在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Internet Explorer:按住Ctrl的同时单击刷新,或按Ctrl-F5
- Opera:前往菜单 → 设置(Mac为Opera → Preferences),然后隐私和安全 → 清除浏览数据 → 缓存的图片和文件。
mw.loader.using('mediawiki.api').then(function() { var api = new mw.Api(), titles= [], table = $('table').first(), list = table.find('td:first-child a'); list.each(function() { titles.push( $(this).attr('href').substring(4) ); }); api.get({ action:'query', formatversion:2, prop:'info', titles:titles.join('|') }).then(function(data) { table.find('th').first().after( '<th>大小</th>' ); data.query.pages.forEach(function(index, ele) { list.eq(index).after('<td>' + ele.length + '</td>'); }); }); });