1,975
次編輯
小 (已匯入 1 筆修訂:Twinkle) |
Xiplus-bot(留言 | 貢獻) 小 (繁簡轉換) |
||
// should show on Contributions pages, anywhere there's a relevant user
if ( Morebits.userIsInGroup('sysop') && mw.config.get('wgRelevantUserName') ) {
Twinkle.addPortletLink(Twinkle.block.callback, '封禁', 'tw-block', '封禁相
}
};
Twinkle.block.callback = function twinkleblockCallback() {
if( mw.config.get('wgRelevantUserName') === mw.config.get('wgUserName') &&
!confirm( '您即
return;
}
var Window = new Morebits.simpleWindow( 650, 530 );
// need to be verbose about who we're blocking
Window.setTitle( '封禁或向' + mw.config.get('wgRelevantUserName') + '
Window.setScriptName( 'Twinkle' );
Window.addFooterLink( '封禁模板', 'Wikipedia:模板消息/用戶討論名字空間#.E5.B0.81.E7.A6.81' );
Window.addFooterLink( '封禁方
Window.addFooterLink( 'Twinkle
Twinkle.block.currentBlockInfo = undefined;
var actionfield = form.append( {
type: 'field',
label: '操作
} );
actionfield.append({
list: [
{
label: '封禁用
value: 'block',
tooltip: '用
checked: true
},
{
label: '添加封禁模板到用
value: 'template',
tooltip: '如果
checked: true
}
});
form.append({ type: 'field', label: '
form.append({ type: 'field', label: '模板
form.append({ type: 'field', label: '封禁
form.append( { type:'submit', label: '提交〜工具
var result = form.render();
}, function(msg) {
Morebits.status.init($('div[name="currentblock"] span').last()[0]);
Morebits.status.warn('抓取用
});
};
if ($form.find('[name=actiontype][value=block]').is(':checked')) {
field_preset = new Morebits.quickForm.element({ type: 'field', label: '
field_preset.append({
type: 'select',
name: 'preset',
label: '
event: Twinkle.block.callback.change_preset,
list: Twinkle.block.callback.filtered_block_groups()
});
field_block_options = new Morebits.quickForm.element({ type: 'field', label: '封禁
field_block_options.append({ type: 'div', name: 'hasblocklog', label: ' ' });
field_block_options.append({ type: 'div', name: 'currentblock', label: ' ' });
type: 'select',
name: 'expiry_preset',
label: '
event: Twinkle.block.callback.change_expiry,
list: [
{ label: '自定
{ label: '
{ label: '3小
{ label: '12小
{ label: '24小
{ label: '31小
{ label: '36小
{ label: '48小
{ label: '60小
{ label: '72小
{ label: '1周', value: '1 week' },
{ label: '2周', value: '2 weeks' },
type: 'input',
name: 'expiry',
label: '自定
tooltip: '您可以使用相
value: Twinkle.block.field_block_options.expiry || Twinkle.block.field_template_options.template_expiry
});
{
checked: Twinkle.block.field_block_options.nocreate,
label: '禁止
name: 'nocreate',
value: '1'
{
checked: Twinkle.block.field_block_options.noemail,
label: '
name: 'noemail',
value: '1'
{
checked: Twinkle.block.field_block_options.disabletalk,
label: '不能
name: 'disabletalk',
value: '1'
blockoptions.push({
checked: Twinkle.block.field_block_options.autoblock,
label: '自
name: 'autoblock',
value: '1'
blockoptions.push({
checked: Twinkle.block.field_block_options.hardblock,
label: '阻止登
name: 'hardblock',
value: '1'
blockoptions.push({
checked: Twinkle.block.field_block_options.watchuser,
label: '
name: 'watchuser',
value: '1'
field_block_options.append({
type: 'textarea',
label: '理由(
name: 'reason',
value: Twinkle.block.field_block_options.reason
if ($form.find('[name=actiontype][value=template]').is(':checked')) {
field_template_options = new Morebits.quickForm.element({ type: 'field', label: '模板
field_template_options.append( {
type: 'select',
name: 'template',
label: '
event: Twinkle.block.callback.change_template,
list: Twinkle.block.callback.filtered_block_groups(true),
name: 'article',
display: 'none',
label: '
value: '',
tooltip: '可以
} );
if (!$form.find('[name=actiontype][value=block]').is(':checked')) {
label: '封禁期限:',
value: '',
tooltip: '封禁
} );
}
type: 'input',
name: 'block_reason',
label: '
display: 'none',
tooltip: '可
value: Twinkle.block.field_template_options.block_reason
} );
label: '不在模板中包含封禁期限',
checked: Twinkle.block.field_template_options.blank_duration,
tooltip: '模板
}
]
// list: [
// {
// label: '不能
// checked: Twinkle.block.field_template_options.notalk,
// tooltip: '用此在保
// }
// ]
}
var $previewlink = $( '<a id="twinkleblock-preivew-link">
$previewlink.off('click').on('click', function(){
Twinkle.block.callback.preview($form[0]);
if (Twinkle.block.hasBlockLog) {
var $blockloglink = $( '<a target="_blank" href="' + mw.util.getUrl('Special:Log', {action: 'view', page: mw.config.get('wgRelevantUserName'), type: 'block'}) + '">封禁日
Morebits.status.init($('div[name="hasblocklog"] span').last()[0]);
Morebits.status.warn('此用
}
if (Twinkle.block.currentBlockInfo) {
Morebits.status.init($('div[name="currentblock"] span').last()[0]);
Morebits.status.warn(relevantUserName + '已被封禁', '提交
Twinkle.block.callback.update_form(e, Twinkle.block.currentBlockInfo);
} else if ($form.find('[name=actiontype][value=template]').is(':checked')) {
forRegisteredOnly: true
},
'uw-ublock|
expiry: 'infinity',
reason: '{{uw-ublock|
forRegisteredOnly: true
},
'uw-ublock|宣
expiry: 'infinity',
reason: '{{uw-ublock|宣
forRegisteredOnly: true
},
'uw-ublock|攻
expiry: 'infinity',
reason: '{{uw-ublock|攻
forRegisteredOnly: true
},
label: '封禁模板',
list: [
{ label: '
{ label: '
{ label: '
{ label: '匿名封禁', value: 'uw-ablock' }
]
label: '一般的封禁理由',
list: [
{ label: '[[WP:VAN|破
{ label: '[[WP:VAN#LANG|繁
{ label: '跨
{ label: '[[WP:VOA|
{ label: '[[WP:SOAP|散
{ label: '
{ label: '
{ label: '
{ label: '[[WP:
{ label: '[[WP:
{ label: '[[WP:GAME|
{ label: '
{ label: '
{ label: '
{ label: '在
{ label: '
{ label: '多次加入[[WP:COPYVIO|侵犯版
{ label: '
//{ label: '
]
},
{
label: '用
list: [
{ label: '', value: 'uw-ublock|
{ label: '', value: 'uw-ublock|宣
{ label: '', value: 'uw-ublock|攻
{ label: '', value: 'uw-ublock|混淆' }
]
if (toBlock) {
if (!blockoptions.expiry) return alert('
if (!blockoptions.reason) return alert('
blockoptions.reason += Twinkle.getPref('deletionSummaryAd');
Morebits.simpleWindow.setButtonsEnabled( false );
Morebits.status.init( e.target );
var statusElement = new Morebits.status('
blockoptions.action = 'block';
blockoptions.user = mw.config.get('wgRelevantUserName');
// execute block
api.getToken('block').then(function(token) {
statusElement.status('
blockoptions.token = token;
var mbApi = new Morebits.wiki.api( '
statusElement.info('完成');
if (toWarn) Twinkle.block.callback.issue_template(templateoptions);
Twinkle.block.callback.issue_template(templateoptions);
} else {
return alert('
}
};
Morebits.wiki.actionCompleted.redirect = userTalkPage;
Morebits.wiki.actionCompleted.notice = '完成,
var wikipedia_page = new Morebits.wiki.page( userTalkPage, '用
wikipedia_page.setCallbackParameters( params );
wikipedia_page.setFollowRedirect( true );
if ( Twinkle.getPref('blankTalkpageOnIndefBlock') && params.template !== 'uw-lblock' && params.indefinite ) {
Morebits.status.info( '信息', '根
text = '== ' + date.getUTCFullYear() + '年' + (date.getUTCMonth() + 1) + '月 ' + ' ==\n';
} else if( !dateHeaderRegexResult || dateHeaderRegexResult.index !== lastHeaderIndex ) {
Morebits.status.info( '信息', '未找到
text += '== ' + date.getUTCFullYear() + '年' + (date.getUTCMonth() + 1) + '月 ' + ' ==\n';
}
var summary = '{{' + templateName + '}}: ' + params.reason;
if ( messageData.suppressArticleInSummary !== true && params.article ) {
summary += ',
}
summary += Twinkle.getPref('summaryAd');
|