Module:Calculator
Lua
Documentation for this module may be created at Module:Calculator/doc
Code
local p = {}
function p.main( frame )
local args = require( [[Module:ProcessArgs]] ).norm( frame:getParent().args )
return p.createTag( args )
end
function p.createTag( args )
local div = mw.html.create( 'div' )
div
:attr( 'class', 'mcw-calc searchaux' )
:attr( 'data-type', args[1] )
:attr( 'style', args['style'] )
:wikitext( 'An interactive widget is being loaded. If this does not work for you, please reload the page or check if JavaScript is working or enabled.' )
for k, v in pairs(args) do
if k ~= 1 and k ~= 'style' then
div:attr( 'data-' .. k, v )
end
end
return tostring( div )
end
return p