你现在正在访问的是萌娘百科用于保存和管理图片、音频等媒体文件的子项目萌娘共享,想要回到萌娘百科,请使用浏览器上的返回按钮、或点击这里
“MediaWiki:Gadget-registerToDelete.js”的版本间的差异
第2行: | 第2行: | ||
var self = $('#p-cactions .menu ul'); | var self = $('#p-cactions .menu ul'); | ||
if (!self.find('li')[0] || mw.config.get('wgUserGroups').indexOf('patroller') === -1) return; | if (!self.find('li')[0] || mw.config.get('wgUserGroups').indexOf('patroller') === -1) return; | ||
− | $('<a/>', { | + | if (mw.config.get('wgAction') === 'edit' && decodeURIComponent((/preloadText=[^\&]+/.exec(location.search) || [''])[0])) $('#wpTextbox1').val(decodeURIComponent((/preloadText=[^\&]+/.exec(location.search) || [''])[0])); |
+ | else if (mw.config.get('wgAction') !== 'submit') $('<a/>', { | ||
attr: { | attr: { | ||
href: "#", | href: "#", | ||
第8行: | 第9行: | ||
accesskey: 'd' | accesskey: 'd' | ||
}, | }, | ||
− | text:'挂删' | + | text: '挂删' |
}).on('click', function() { | }).on('click', function() { | ||
var reason = prompt('挂删的理由【将会替换全文内容】\n【空白则使用默认理由(不在收录范围内或潜在价值较低)】\n【取消则不进行挂删】:'), | var reason = prompt('挂删的理由【将会替换全文内容】\n【空白则使用默认理由(不在收录范围内或潜在价值较低)】\n【取消则不进行挂删】:'), | ||
self = $(this); | self = $(this); | ||
if (reason === null) return; | if (reason === null) return; | ||
− | + | windows.open(location.origin + location.pathname + (location.search || '?action=edit') + '&preloadText={{即将删除|' + reason + '}}', '_blank'); | |
− | + | }); | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | } | ||
− | |||
− | |||
− | |||
− | |||
}); | }); |
2016年12月14日 (三) 23:22的版本
$(function() { var self = $('#p-cactions .menu ul'); if (!self.find('li')[0] || mw.config.get('wgUserGroups').indexOf('patroller') === -1) return; if (mw.config.get('wgAction') === 'edit' && decodeURIComponent((/preloadText=[^\&]+/.exec(location.search) || [''])[0])) $('#wpTextbox1').val(decodeURIComponent((/preloadText=[^\&]+/.exec(location.search) || [''])[0])); else if (mw.config.get('wgAction') !== 'submit') $('<a/>', { attr: { href: "#", title: "挂删本页[alt-shift-d]", accesskey: 'd' }, text: '挂删' }).on('click', function() { var reason = prompt('挂删的理由【将会替换全文内容】\n【空白则使用默认理由(不在收录范围内或潜在价值较低)】\n【取消则不进行挂删】:'), self = $(this); if (reason === null) return; windows.open(location.origin + location.pathname + (location.search || '?action=edit') + '&preloadText={{即将删除|' + reason + '}}', '_blank'); }); });