Module:NoteTA:修订间差异

IdleTap-bot​(留言 | 贡献)
导入自求闻百科
 
CaelLab-import​(留言 | 贡献)
导入自中文维基百科
 
第98行: 第98行:
if frame == mw.getCurrentFrame() then
if frame == mw.getCurrentFrame() then
-- Being called from {{noteTA}}
-- Being called from {{noteTA}}
args = frame:getParent().args
args = require('Module:Arguments').getArgs(frame)
else
else
-- Being called from another module
-- Being called from another module
第108行: 第108行:
local Lc = Lcode( args )
local Lc = Lcode( args )
local code = Tc .. Gc .. Lc
local code = Tc .. Gc .. Lc
local topicon = ''
if args.type ~= nil and args.T ~= nil then
if args.type == 'downsize' then
topicon = topicon .. '[[File:Conversion downsize.svg|24px|本页使用了标题手工转换,涉及上下标字符|link=]]'
elseif args.type == 'lowercase' then
topicon = topicon .. '[[File:Conversion lowercase.svg|24px|本页使用了标题手工转换,涉及首字符小写|link=]]'
elseif args.type == 'italic' then
topicon = topicon .. '[[File:Conversion italic.svg|24px|本页使用了标题手工转换,涉及斜体标题|link=]]'
elseif args.type == 'displaytitle' then
topicon = topicon .. '[[File:Conversion displaytitle.svg|24px|本页使用了标题手工转换|link=]]'
end
elseif args.type == 'rare' then
topicon = topicon .. '[[File:Conversion rare.svg|24px|本页使用了全文手工转换,涉及全局僻字转换|link=]]'
else
topicon = topicon .. '-{zh:[[File:Conversion zh.svg|24px|本页使用了标题或全文手工转换,现处于不转换模式|link=]];zh-hans:[[File:Conversion zh-hans.svg|24px|本页使用了标题或全文手工转换,现处于简体转换模式|link=]];zh-cn:[[File:Conversion zh-hans.svg|24px|本页使用了标题或全文手工转换,现处于中国大陆简体模式|link=]];zh-my:[[File:Conversion zh-hans.svg|24px|本页使用了标题或全文手工转换,现处于马来西亚简体模式|link=]];zh-sg:[[File:Conversion zh-hans.svg|24px|本页使用了标题或全文手工转换,现处于新加坡简体模式|link=]];zh-hant:[[File:Conversion zh-hant.svg|24px|本页使用了标题或全文手工转换,现处于繁体转换模式|link=]];zh-hk:[[File:Conversion zh-hant.svg|24px|本页使用了标题或全文手工转换,现处于香港繁体模式|link=]];zh-mo:[[File:Conversion zh-hant.svg|24px|本页使用了标题或全文手工转换,现处于澳门繁体模式|link=]];zh-tw:[[File:Conversion zh-hant.svg|24px|本页使用了标题或全文手工转换,现处于台湾繁体模式|link=]];}-'
end
if code ~= '' then
if code ~= '' then
local hash = require( 'Module:Crc32lua' ).crc32( mw.dumpObject( args ) )
local hash = require( 'Module:Crc32lua' ).crc32( mw.dumpObject( args ) )
code = frame:extensionTag{
code = frame:extensionTag{
name = 'indicator',
name = 'indicator',
content = topicon,
content = '[[File:Zh conversion icon m.svg|35px|本页使用了标题或全文手工转换|link=|class=skin-invert]]',
args = { name = string.format( 'noteTA-%x', hash ) },
args = { name = string.format( 'noteTA-%x', hash ) },
} .. tostring( mw.html.create( 'div' )
} .. tostring( mw.html.create( 'div' )
第138行: 第120行:
if mw.title.getCurrentTitle():inNamespace( 'Template' ) then
if mw.title.getCurrentTitle():inNamespace( 'Template' ) then
code = code .. '[[Category:放置于模板的noteTA]]'
code = code .. '[[Category:放置于模板的noteTA]]'
end
if args.type ~= nil and args.T ~= nil then
if args.type == 'downsize' then
code = code .. '[[Category:标题含有上下标的文章]]'
elseif args.type == 'lowercase' then
code = code .. '[[Category:小写标题]]'
elseif args.type == 'italic' then
code = code .. '[[Category:斜体标题]]'
elseif args.type == 'displaytitle' then
code = code .. '[[Category:调整标题显示的文章]]'
end
elseif args.type == nil and args.T ~= nil then
code = code .. '[[Category:调整标题显示的文章]]'
elseif args.type == 'rare' then
code = code .. '[[Category:涉及全局僻字转换的文章]]'
end
end
end
end