Module:SourceFilter

From Tardis Wiki, the free Doctor Who reference
Revision as of 21:08, 24 June 2022 by Bongolium500 (talk | contribs) (Created page with "local util_vars = require('Module:VarsUtil') local p = {} function p.startFilterBlock(frame) local args = frame:getParent().args local outputText = "" for count = 1, #args do outputText = outputText .. [[<div class="mw-collapsible" id="mw-customcollapsible-]] .. args[count] ..[[">]] end util_vars.setVar(SourceHideDiv, #args) return outputText end function p.endFilterBlock(frame) local args = frame:getParent().args local outputText = "" local divs = util_vars...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

local util_vars = require('Module:VarsUtil')
local p = {}

function p.startFilterBlock(frame)
	local args = frame:getParent().args
	local outputText = ""
	for count = 1, #args do
		outputText = outputText .. [[<div class="mw-collapsible" id="mw-customcollapsible-]] .. args[count] ..[[">]]
	end
	util_vars.setVar(SourceHideDiv, #args)
	return outputText
end

function p.endFilterBlock(frame)
	local args = frame:getParent().args
	local outputText = ""
	local divs = util_vars.getVar(SourceHideDiv)
	for count = 1, divs do
		outputText = outputText .. "</div>"
	end
	return outputText
end

return p