User:逆襲的天邪鬼/Twinkle-lzh/twinkleclose.js: Difference between revisions
Content added Content deleted
No edit summary |
No edit summary |
||
Line 77: | Line 77: | ||
action: 'keep' |
action: 'keep' |
||
}, |
}, |
||
'頁 |
'尋無此頁': { |
||
label: '模板頁面不存在,無效', |
label: '模板頁面不存在,無效', |
||
action: 'keep' |
action: 'keep' |
||
Line 87: | Line 87: | ||
action: 'keep' |
action: 'keep' |
||
}, |
}, |
||
' |
'速留': { |
||
label: '快速保留', |
label: '快速保留', |
||
action: 'keep' |
action: 'keep' |
||
}, |
}, |
||
'暫 |
'暫留': { |
||
label: '暫時保留', |
label: '暫時保留', |
||
action: 'keep' |
action: 'keep' |
||
Line 302: | Line 302: | ||
var newtext = text.replace(/<noinclude>\s*\{\{(afd|議刪)\|[^{}]*?\}\}\s*<\/noinclude>\s*/gi, ''); |
var newtext = text.replace(/<noinclude>\s*\{\{(afd|議刪)\|[^{}]*?\}\}\s*<\/noinclude>\s*/gi, ''); |
||
newtext = newtext.replace(/\{\{(afd|議刪)\|[^{}]*?\}\}\s*/gi, ''); |
newtext = newtext.replace(/\{\{(afd|議刪)\|[^{}]*?\}\}\s*/gi, ''); |
||
if (params.code !== 'tk') { |
// if (params.code !== 'tk') { |
||
newtext = newtext.replace(/\{\{(notability)\|[^{}]*?\}\}\n*/gi, ''); |
// newtext = newtext.replace(/\{\{(notability)\|[^{}]*?\}\}\n*/gi, ''); |
||
newtext = newtext.replace(/\{\{(substub)\|[^{}]*?\}\}\n*/gi, ''); |
// newtext = newtext.replace(/\{\{(substub)\|[^{}]*?\}\}\n*/gi, ''); |
||
} |
// } |
||
if (newtext === text) { |
if (newtext === text) { |
||
statelem.warn("未找到議刪模板,可能已經移除"); |
statelem.warn("未找到議刪模板,可能已經移除"); |
||
Line 334: | Line 334: | ||
var params = pageobj.getCallbackParameters(); |
var params = pageobj.getCallbackParameters(); |
||
if (text.indexOf('{{ |
if (text.indexOf('{{結案') !== -1) { |
||
statelem.error( "討論已經關閉" ); |
statelem.error( "討論已經關閉" ); |
||
return; |
return; |
||
} |
} |
||
var |
var split = text.split('\n'); |
||
var send = text.indexOf('<section end=backlog />') !== -1; |
|||
text = text.replace('\n<section begin=backlog />', ''); |
|||
text = text.replace('\n<section end=backlog />', ''); |
|||
⚫ | |||
var bar = text.split('\n----\n'); |
|||
var split = bar[0].split('\n'); |
|||
⚫ | |||
text += '\n----\n: ' + params.messageData.label; |
|||
if (params.remark) { |
|||
text += ':' + params.remark; |
|||
} |
|||
else { |
|||
text += '。'; |
|||
} |
|||
text += '--~~~~\n{{delf}}'; |
|||
if (bar[1]) { |
|||
text += '\n----\n' + bar.slice(1).join('\n----\n'); |
|||
} |
|||
if (send) { |
|||
text += '\n<section end=backlog />'; |
|||
} |
|||
if (sbegin) { |
|||
// guaranteed to be at tne end? |
|||
text += '\n<section begin=backlog />'; |
|||
} |
|||
pageobj.setPageText(text); |
pageobj.setPageText(text); |
||
Line 378: | Line 353: | ||
$('strong a[href=#' + params.section + '] span').css('color', 'grey'); |
$('strong a[href=#' + params.section + '] span').css('color', 'grey'); |
||
} |
} |
||
} |
}; |
||
})(jQuery); |
})(jQuery); |