今天是2024年9月30日 第40周 星期一

代人,时大变了。

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

更改

跳到导航 跳到搜索
添加1,564字节 、 2013年4月26日 (五) 22:16
无编辑摘要
第4行: 第4行:     
function Tcode( args )
 
function Tcode( args )
    if args.T ~= nil and args.T ~= '' then
+
    if args.T == nil and args.T == '' then
     local builder = HtmlBuilder.create()
  −
     local div = builder.tag( 'div' )
  −
       .attr( 'id', 'noteTA-title' )
  −
       .attr( 'data-noteta-code', mw.uri.encode( args.T ) )
  −
       .wikitext( WikitextLC.title( args.T ) )
  −
     if args.dt ~= nil and args.dt ~= '' then
  −
       div.attr( 'data-noteta-desc', mw.uri.encode( args.T ) )
  −
     end
  −
     return tostring( builder )
  −
   else
   
      return ''
 
      return ''
 
    end
 
    end
 +
   local builder = HtmlBuilder.create()
 +
   local div = builder.tag( 'div' )
 +
     .attr( 'id', 'noteTA-title' )
 +
     .attr( 'data-noteta-code', mw.uri.encode( args.T ) )
 +
     .wikitext( WikitextLC.title( args.T ) )
 +
   if args.dt ~= nil and args.dt ~= '' then
 +
     div.attr( 'data-noteta-desc', mw.uri.encode( args.dt ) )
 +
   end
 +
   return tostring( builder )
 
end
 
end
   第25行: 第24行:  
    local title = mw.title.makeTitle( 'Template', 'CGroup/' .. name )
 
    local title = mw.title.makeTitle( 'Template', 'CGroup/' .. name )
 
    if title.exists then
 
    if title.exists then
      return frame:expandTemplate( title )
+
      return frame:expandTemplate{ title = title }
 
    else
 
    else
 
      return tostring( HtmlBuilder.create()
 
      return tostring( HtmlBuilder.create()
第39行: 第38行:  
    local code = {}
 
    local code = {}
 
    for i = 1, 30 do
 
    for i = 1, 30 do
      code:insert( group( args['G' .. i] ) )
+
      table.insert( code, group( args['G' .. i] ) )
 
    end
 
    end
 
    code = table.concat( code )
 
    code = table.concat( code )
第46行: 第45行:  
        .tag( 'div' )
 
        .tag( 'div' )
 
          .attr( 'id', 'noteTA-group' )
 
          .attr( 'id', 'noteTA-group' )
 +
         .wikitext( code )
 +
       .allDone() )
 +
   end
 +
   return code
 +
end
 +
 +
function local_( i, code, desc )
 +
   if code == nil or code == '' then
 +
     return ''
 +
   end
 +
   local builder = HtmlBuilder.create()
 +
   local div = builder.tag( 'div' )
 +
     .attr( 'id', 'noteTA-local-' .. i )
 +
     .attr( 'data-noteta-code', mw.uri.encode( code ) )
 +
     .wikitext( WikitextLC.hidden( code ) )
 +
   if desc ~= nil and desc ~= '' then
 +
     div.attr( 'data-noteta-desc', mw.uri.encode( desc ) )
 +
   end
 +
   return tostring( builder )
 +
end
 +
 +
function Lcode( args )
 +
   local code = {}
 +
   for i = 1, 30 do
 +
     table.insert( code, local_( i, args[i], args['d' .. i] ) )
 +
   end
 +
   code = table.concat( code )
 +
   if code ~= '' then
 +
     code = tostring( HtmlBuilder.create()
 +
       .tag( 'div' )
 +
         .attr( 'id', 'noteTA-local' )
 
          .wikitext( code )
 
          .wikitext( code )
 
        .allDone() )
 
        .allDone() )
第54行: 第84行:  
function z.main( frame )
 
function z.main( frame )
 
    local args = frame:getParent().args
 
    local args = frame:getParent().args
 +
   local Tc = Tcode( args )
 +
   local Gc = Gcode( args )
 +
   local Lc = Lcode( args )
 +
   local code = Tc .. Gc .. Lc
 +
   if code ~= '' then
 +
     code = frame:expandTemplate{
 +
       title = topicon,
 +
       args = {
 +
         id = 'noteTA-topicon',
 +
         image = 'Zh conversion icon m.svg',
 +
         alt = '本页使用了标题或全文手工转换',
 +
         title = '本页使用了标题或全文手工转换',
 +
         link = '',
 +
         size = '35px',
 +
       },
 +
     } . tostring( HtmlBuilder.create()
 +
       .tag( 'div' )
 +
         .attr( 'id', 'noteTA' )
 +
         .wikitext( code )
 +
       .allDone() )
 +
   end
 +
   return code
 
end
 
end
    
return z
 
return z
匿名用户

导航菜单