今天是2024年7月1日 第27周 星期一

代人,时大变了。

我们生活在大地上,但我们的梦想超越天空。

更改

跳到导航 跳到搜索
添加174字节 、 2022年7月11日 (一) 18:56
导入41个版本
第8行: 第8行:  
local div = mw.html.create( 'div' )
 
local div = mw.html.create( 'div' )
 
:attr( 'class', 'noteTA-title' )
 
:attr( 'class', 'noteTA-title' )
:attr( 'data-noteta-code', mw.uri.encode( args.T ) )
+
:attr( 'data-noteta-code', args.T )
 
:wikitext( WikitextLC.title( args.T ) )
 
:wikitext( WikitextLC.title( args.T ) )
 
if args.dt ~= nil and args.dt ~= '' then
 
if args.dt ~= nil and args.dt ~= '' then
div:attr( 'data-noteta-desc', mw.uri.encode( args.dt ) )
+
div:attr( 'data-noteta-desc', args.dt )
 
end
 
end
 
return tostring( div )
 
return tostring( div )
第22行: 第22行:  
local moduleTitle = mw.title.makeTitle( 'Module', 'CGroup/' .. name )
 
local moduleTitle = mw.title.makeTitle( 'Module', 'CGroup/' .. name )
 
if moduleTitle and moduleTitle.exists then
 
if moduleTitle and moduleTitle.exists then
local data = require( 'Module:CGroup/' .. name )
+
local data = mw.loadData( 'Module:CGroup/' .. name )
 
local pieces = {}
 
local pieces = {}
for i, v in ipairs( data.content ) do
+
if data.content then
if v.type == 'item' then
+
for i, v in ipairs( data.content ) do
table.insert( pieces, '-{H|' .. v.rule .. '}-' )
+
if v.type == 'item' and v.rule then
 +
table.insert( pieces, '-{H|' .. v.rule .. '}-' )
 +
end
 
end
 
end
 +
return tostring( mw.html.create( 'div' )
 +
:attr( 'data-noteta-group-source', 'module' )
 +
:attr( 'data-noteta-group', data.name or name )
 +
:wikitext( table.concat( pieces ) ) )
 
end
 
end
return tostring( mw.html.create( 'div' )
  −
:attr( 'data-noteta-group-source', 'module' )
  −
:wikitext( table.concat( pieces ) ) )
   
end
 
end
 
local templateTitle = mw.title.makeTitle( 'Template', 'CGroup/' .. name )
 
local templateTitle = mw.title.makeTitle( 'Template', 'CGroup/' .. name )
第39行: 第42行:  
return tostring( mw.html.create( 'div' )
 
return tostring( mw.html.create( 'div' )
 
-- :attr( 'id', 'noteTA-group-' .. mw.uri.anchorEncode( name ) )
 
-- :attr( 'id', 'noteTA-group-' .. mw.uri.anchorEncode( name ) )
:attr( 'class', 'noteTA-missing' )
+
:attr( 'data-noteta-group-source', 'none' )
 
:attr( 'data-noteta-group', name ) )
 
:attr( 'data-noteta-group', name ) )
 
end
 
end
第66行: 第69行:  
local div = mw.html.create( 'div' )
 
local div = mw.html.create( 'div' )
 
-- :attr( 'id', 'noteTA-local-' .. i )
 
-- :attr( 'id', 'noteTA-local-' .. i )
:attr( 'data-noteta-code', mw.uri.encode( code ) )
+
:attr( 'data-noteta-code', code )
 
:wikitext( WikitextLC.hidden( code ) )
 
:wikitext( WikitextLC.hidden( code ) )
 
if desc ~= nil and desc ~= '' then
 
if desc ~= nil and desc ~= '' then
div:attr( 'data-noteta-desc', mw.uri.encode( desc ) )
+
div:attr( 'data-noteta-desc', desc )
 
end
 
end
 
return tostring( div )
 
return tostring( div )
第92行: 第95行:     
function z.main( frame )
 
function z.main( frame )
local args = frame:getParent().args
+
local args
 +
if frame == mw.getCurrentFrame() then
 +
-- Being called from {{noteTA}}
 +
args = frame:getParent().args
 +
else
 +
-- Being called from another module
 +
args = frame
 +
frame = mw.getCurrentFrame()
 +
end
 
local Tc = Tcode( args )
 
local Tc = Tcode( args )
 
local Gc = Gcode( args, frame )
 
local Gc = Gcode( args, frame )
第98行: 第109行:  
local code = Tc .. Gc .. Lc
 
local code = Tc .. Gc .. Lc
 
if code ~= '' then
 
if code ~= '' then
local hash = code:len()
+
local hash = require( 'Module:Crc32lua' ).crc32( mw.dumpObject( args ) )
code = frame:expandTemplate{
+
code = frame:extensionTag{
title = 'topicon',
+
name = 'indicator',
args = {
+
content = '[[File:Zh conversion icon m.svg|35px| 本页使用了标题或全文手工转换|link=]]',
id = 'noteTA-topicon-' .. hash,
+
args = { name = string.format( 'noteTA-%x', hash ) },
class = 'noteTA-topicon',
  −
image = 'Zh conversion icon m.svg',
  −
alt = ' 本页使用了标题或全文手工转换',
  −
title = '本页使用了标题或全文手工转换',
  −
link = '',
  −
size = '35px',
  −
},
   
} .. tostring( mw.html.create( 'div' )
 
} .. tostring( mw.html.create( 'div' )
:attr( 'id', 'noteTA-' .. hash )
+
:attr( 'id', string.format( 'noteTA-%x', hash ) )
 
:attr( 'class', 'noteTA' )
 
:attr( 'class', 'noteTA' )
 
:wikitext( code ) )
 
:wikitext( code ) )

导航菜单