User:逆襲的天邪鬼/Twinkle-lzh/friendlytag.js: Difference between revisions
Content added Content deleted
No edit summary |
No edit summary |
||
Line 176: | Line 176: | ||
var params = pageobj.getCallbackParameters(), |
var params = pageobj.getCallbackParameters(), |
||
tagRe, tagText = '', summaryText = '加入', |
tagRe, tagText = '', summaryText = '加入', |
||
tags |
tags = [], i, totalTags; |
||
// Remove tags that become superfluous with this action |
// Remove tags that become superfluous with this action |
||
Line 239: | Line 239: | ||
// Check for preexisting tags and separate tags into groupable and non-groupable arrays |
// Check for preexisting tags and separate tags into groupable and non-groupable arrays |
||
for |
for (i = 0; i < params.tags.length; i++) { |
||
tagRe = new RegExp( '(\\{\\{' + params.tags[i] + '(\\||\\}\\})|\\|\\s*' + params.tags[i] + '\\s*=[a-z ]+\\d+)', 'im' ); |
tagRe = new RegExp( '(\\{\\{' + params.tags[i] + '(\\||\\}\\})|\\|\\s*' + params.tags[i] + '\\s*=[a-z ]+\\d+)', 'im' ); |
||
if( !tagRe.exec( pageText ) ) { |
if( !tagRe.exec( pageText ) ) { |
||
tags = tags.concat( params.tags[i] ); |
|||
groupableTags = groupableTags.concat( params.tags[i] ); |
|||
⚫ | |||
⚫ | |||
} |
|||
} else { |
} else { |
||
Morebits.status.warn( '信息', '在頁面上找到{{' + params.tags[i] + |
Morebits.status.warn( '信息', '在頁面上找到{{' + params.tags[i] + |
||
'}}…跳过' ); |
'}}…跳过' ); |
||
// don't do anything else with merge tags |
// don't do anything else with merge tags |
||
if (params.tags[i] === " |
if (params.tags[i] === "併") { |
||
params. |
params.mergeTarget = params.mergeReason = false; |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
} |
} |
||
} |
} |