模块:Test:修订间差异

跳到导航 跳到搜索
无编辑摘要
无编辑摘要
第37行: 第37行:


local function addRow(rowArgs)
local function addRow(rowArgs)
     -- Adds a row to the infobox, with either a header cell
     -- Adds a row to the test, with either a header cell
     -- or a label/data cell combination.
     -- or a label/data cell combination.
     if rowArgs.header then
     if rowArgs.header then
第229行: 第229行:
end
end


local function _infobox()
local function _test()
     -- Specify the overall layout of the infobox, with special settings
     -- Specify the overall layout of the test, with special settings
     -- if the infobox is used as a 'child' inside another infobox.
     -- if the test is used as a 'child' inside another test.
     if args.child ~= 'yes' then
     if args.child ~= 'yes' then
         root = HtmlBuilder.create('table')
         root = HtmlBuilder.create('table')


         root
         root
             .addClass('infobox')
             .addClass('test')
             .addClass(args.bodyclass)
             .addClass(args.bodyclass)
             .attr('cellspacing', 3)
             .attr('cellspacing', 3)
第368行: 第368行:
end
end


function p.infobox(frame)
function p.test(frame)
     -- If called via #invoke, use the args passed into the invoking template.
     -- If called via #invoke, use the args passed into the invoking template.
     -- Otherwise, for testing purposes, assume args are being passed directly in.
     -- Otherwise, for testing purposes, assume args are being passed directly in.
第377行: 第377行:
     end
     end


     -- Parse the data parameters in the same order that the old {{infobox}} did, so that
     -- Parse the data parameters in the same order that the old {{test}} did, so that
     -- references etc. will display in the expected places. Parameters that depend on
     -- references etc. will display in the expected places. Parameters that depend on
     -- another parameter are only processed if that parameter is present, to avoid
     -- another parameter are only processed if that parameter is present, to avoid
第427行: 第427行:
     preprocessSingleArg('decat')
     preprocessSingleArg('decat')


     return _infobox()
     return _test()
end
end


return p
return p