FANDOM


local p = {}
local entries = {}
local OutputText = ""
function addText(text)
	OutputText = OutputText  .. text
end
function p.appendloop( frame )
    local Args = frame:getParent()
	OutputText = ""
	for iKey,iValue in pairs(Args.args) do 
		local key = iKey:match("^(%d+):")
		local item = iKey:match("^%d+:(%a+)")
        local val = iValue
		if key and item and val then
			if not entries[key] then
				entries[key] = {}
			end
			entries[key][item] = val
		end
    end
	for key,entry in pairs(entries) do
		if entry.type then
			if entry.type == 'field' and entry.name and entry.value then
				addText('<div style="clear:left;font-size:10px;text-align:center;border-bottom:1px solid {{{Border Color 1|#6699CC}}};"><div style="float:left;text-align:left;">')
				addText(entry.name)
				addText('</div><div style="width:100%;float:left;text-align:right;">')
				addText(entry.value) 
				addText('</div></div>')
			end
			if entry.type == 'header' and entry.name then
				addText('<div style="clear:left;text-align:center;font-size:16px;font-weight:900;line-height:1.5em;background-color: {{{Header Color|#6699CC}}};style=width:20em;">')
				addText(entry.name) 
				addText('</div>')
			end
			if entry.type == 'image' and entry.file then
				addText('<div style="margin-top:5px;">[[image:')
				addText(entry.file)
				addText("|")
				if entry.size then
					addText(entry.size)
				else
					addText("200px")
				end
				addText("|center|")
				addText(entry.file)
				if entry.caption then
					addText('<div style="clear:left;font-size:10px;text-align:center"><div style="text-align:center;">')
					addText(entry.caption)
					addText('</div></div>')
				end
			end
		end
	end
	return OutputText
end
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.