Anonymous
×
Create a new article
Write your page title here:
We currently have 496 articles on WIKI - Idle Pixel. Type your article name above or click on one of the titles below and start writing!



WIKI - Idle Pixel

Module:Tabs: Difference between revisions

No edit summary
No edit summary
Line 9: Line 9:
local args = frame:getParent().args
local args = frame:getParent().args
local result = ""
local result = ""
local checked = false
for key, value in pairs(args) do
for key, value in pairs(args) do
result = result .. '<htmltag tagname="input" type="radio" class="dTabsRadio" name="Areas" id="' .. key .. '" checked></htmltag><htmltag tagname="label" for="' .. key .. '" class="dTabsLabel">Test1</htmltag><div class="dTabsContent">' .. value .. '</div>'
result = result .. '<htmltag tagname="input" type="radio" class="dTabsRadio" name="Areas" id="' .. key .. '"'
if not checked then
result = result .. ' checked'
end
result = result .. '></htmltag><htmltag tagname="label" for="' .. key .. '" class="dTabsLabel">' .. key .. '</htmltag><div class="dTabsContent">' .. value .. '</div>'
checked = true
end
end
return p.pp('<div class="dTabs">' .. result .. '</div>')
return p.pp('<div class="dTabs">' .. result .. '</div>')

Revision as of 11:48, 18 September 2024

Documentation for this module may be created at Module:Tabs/doc

inspect = require("Module:InspectLua")
local p = {}

function p.pp(text)
    return mw.getCurrentFrame():preprocess(text)
end

function p.tabs (frame)
	local args = frame:getParent().args
	local result = ""
	local checked = false
	for key, value in pairs(args) do
		result = result .. '<htmltag tagname="input" type="radio" class="dTabsRadio" name="Areas" id="' .. key .. '"'
		if not checked then
			result = result .. ' checked'
		end
		result = result .. '></htmltag><htmltag tagname="label" for="' .. key .. '" class="dTabsLabel">' .. key .. '</htmltag><div class="dTabsContent">' .. value .. '</div>'
		checked = true
	end
	return p.pp('<div class="dTabs">' .. result .. '</div>')
end

return p