Module:UserSkin

From IxWiki
Jump to navigation Jump to search

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

local p = {}

function p.getUserSkin()
    local skin = mw.site.stats.skin
    if not skin or skin == '' then
        -- Fallback detection method
        local frame = mw.getCurrentFrame()
        if frame then
            local html = frame:preprocess('{{HTMLPAGEHEADER}}')
            if html:find('citizen') or html:find('skin-citizen') then
                return 'citizen'
            end
        end
        return 'vector' -- Default to vector if we can't detect
    end
    return skin:lower()
end

return p