Module:UserSkin

From IxWiki
Revision as of 16:36, 1 August 2024 by Heku (talk | contribs) (Created page with "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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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