Jump to content

Module:Sandbox/Akar1

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Akar1 (talk | contribs) at 01:19, 27 May 2017. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local p = {}
function p.headerRender(frame)
	-- Attempting to remove the key from the table frame args, Unsuccessful attempt
	lookie_here = frame.args['color']
	if lookie_here == nil then
		lookie_here = 'f1f1f1'
	end
	-- place_holder = type(frame.args)
    -- frame.args['color'] = nil
    -- place_holder = frame.args['color']
    returner = --lookie_here..place_holder..
    '<span style="overflow: hidden; border: 1px solid #ccc; width:100%; background-color:#'..lookie_here..';">'
    
    for i in pairs(frame.args) do
    	-- val = string.gmatch(frame.args[i], "%S+")
    	-- dic = {}
    	-- local val1, val2 = string:match("([^,]+):([^,]+)")
    	local val1, val2 = (frame.args[i]):match("([^,]+),([^,]+)")
    	tot = ""
    	-- flag = 1
    	-- -- tot = tot..next(val).."$$1"
    	-- for every in val do
    	-- 	-- local val1, val2 = string:match("([^,]+),([^,]+)")
    	-- 	-- dic[#dic] = every
    	-- 	if flag == 1 then 
    	-- 		val1 = every
    	-- 		tot = tot..'TTT'
    	-- 		flag = 2 
    	-- 	else
    	-- 		tot = tot..'FFF'
    	-- 		val2 = every
    	-- 		flag = 1 
    	-- 	end
    	-- 	tot = tot..every	
    	-- end
    	tot = tot..val1..type(val2)
    	
    	if i ~= 'color' then
	    	returner = returner..'<span style="color: '..i..'; float: left; border-top: 6px solid '..i..'; font-weight: bold; outline: none; cursor: pointer; padding: 14px 16px; transition: 0.3s;">'
	    	returner = returner..tot
	    	returner = returner..'</span>'
	    end
    end
    returner = returner..'</span>'
    return returner
end
return p