Module:Ref: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 47: Line 47:
local warnings = ''
local warnings = ''
local listArgs = {}
local args = {}
if group ~= nil and group ~= '' then
if group ~= nil and group ~= '' then
listArgs.group = tostring( group )
args.group = tostring( group )
end
end
local wikitext = frame:extensionTag( 'references', '', args )
local divArgs = {}
local html = mw.html.create( 'div' )
if colNum ~= nil and colNum ~= '' then
if colNum ~= nil and colNum ~= '' then
if tonumber( colNum ) == nil then
if tonumber( colNum ) == nil then
Line 61: Line 62:
else
else
colNum = tostring( tonumber( colNum ) )
colNum = tostring( tonumber( colNum ) )
divArgs[ '-moz-column-count' ] = colNum
html = html
divArgs[ '-moz-webkit-count' ] = colNum
:attr( '-moz-column-count', colNum )
divArgs[ 'column-count' ] = colNum
:attr( '-webkit-column-count', colNum )
:attr( 'column-count', colNum )
end
end
end
end
Line 74: Line 76:
'Pages containing invalid template parameter warnings' )
'Pages containing invalid template parameter warnings' )
else
else
divArgs[ '-moz-column-width' ] = colWidth
html = html
divArgs[ '-webkit-column-width' ] = colWidth
:attr( '-moz-column-width', colWidth )
divArgs[ 'column-width' ] = colWidth
:attr( '-webkit-column-width', colWidth )
:attr( 'column-width', colWidth )
end
end
end
end
Line 87: Line 90:
'Pages containing invalid template parameter warnings' )
'Pages containing invalid template parameter warnings' )
else
else
divArgs[ '-moz-column-gap' ] = colGap
html = html
divArgs[ '-webkit-column-gap' ] = colGap
:attr( '-moz-column-gap', colGap )
divArgs[ 'column-gap' ] = colGap
:attr( '-webkit-column-gap', colGap )
:attr( 'column-gap', colGap )
end
end
end
end
local wikitext = frame:extensionTag( 'references', '', listArgs )
local html = html
local html = mw.html.create( 'div' )
:attr( divArgs )
:wikitext( wikitext )
:wikitext( wikitext )
:allDone()
:allDone()
local debug_str = ''
for k, v in pairs( divArgs ) do
debug_str = debug_str ..'\n\n' .. k .. '=>' .. v .. ','
end
for i, v in ipairs( divArgs ) do
debug_str = debug_str ..'\n\n' .. tostring( i ) .. '=>' .. v .. ','
end
return debug_str .. tostring( html ) .. warnings
return tostring( html ) .. warnings
end
end