Module:Sandbox

From Raft Wiki
Revision as of 10:09, 8 May 2021 by TreeIsLife (talk | contribs)
Jump to: navigation, search
Raft Wiki:Sandbox Template:Sandbox Module:Sandbox

--[[ TEST]]
local phase = 0
local styleValue = ''
local link = ''
local linkEnd = ''
local textOutput = ''
local p = {}
	function p.main( f )

		local args = f
		if f == mw.getCurrentFrame() then
			args = f:getParent().args
		end
		local items = args[1] or ''
	
		local components = {}
		for component in mw.text.gsplit( items, '%s*;%s*' ) do
			if component == '' then
				table.insert( components, '<span><br></span>' )
			else
				if phase == 0 then
					table.insert( components, '<div class="componentsimage" width="64px">[[File:'..component..'.png|center|48px|link='..component..']]</div></td><td class="components" style="padding:0;"><span style="font-size:115%;"><b>[['..component..']]</b></div>')
				else
					table.insert( components, '<span style="float: right; padding: 0 15px 0 9px;"><b>'..component..'</b></span>')
				end
				--table.insert( components, '<span class="component" style="' .. styleValue .. '">'..textOutput..'</span>' )
				phase = phase + 1
			end
		end
		components[1] = components[1]:gsub( '^<span>', '<span class="componentsimage">' )
		
		return '<div class="clist" style="font-size:115%">' .. table.concat( components ) .. '</div>'
	end
return p