FANDOM


local p = {}
 
function p.main(frame) 
    local args = frame:getParent().args
    local toggleLinks = mw.html.create("span")
    local toggleContent = mw.html.create("span")
    local group = math.random(999) --intentionally avoided seeding, as it would cause all invokations on the same page to have the same group id
    local i = 1
 
    toggleLinks:addClass("toggle-links")
 
    toggleLinks:tag("span")
    :addClass("toggle")
    :addClass("toggle-active")
    :attr("data-toggle-id", i)
    :attr("data-toggle-group", group)
    :wikitext(args["title" .. i] or i)
 
    toggleContent:tag("span")
    :addClass("toggle-content")
    :attr("data-toggle-id", i)
    :attr("data-toggle-group", group)
    :wikitext(args[i])
 
    i = i + 1
 
    while args[i] ~= nil and args[i] ~= "" do
        toggleLinks:wikitext(" | ")
        :tag("span")
        :addClass("toggle")
        :attr("data-toggle-id", i)
        :attr("data-toggle-group", group)
        :wikitext(args["title" .. i] or i)
 
        toggleContent:tag("span")
        :addClass("toggle-content")
        :addClass("toggle-hidden")
        :attr("data-toggle-id", i)
        :attr("data-toggle-group", group)
        :wikitext(args[i])
 
        i = i + 1
    end
 
    return tostring(toggleLinks) .. "<br>" .. tostring(toggleContent)
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.