Fandom Developers Wiki
Advertisement
Documentation icon Module documentation

The documentation for this module is missing. Click here to create it.

-- ModularCSS/MetaVerifyStatus
-- Modifies the non-existent page Special:ModularCSS
-- to verify the current status on ModularCSS rendering.

local i18n = {
    -- Do not modify "$TIME" in MESSAGE!
    -- The time format can by changed by providing TIMEFRM
    ["en"] = {
        TITLE   = "ModularCSS Status Verification",
        MESSAGE = "As of $TIME, ModularCSS is properly configured for use on this wiki!"
    }
}

local lang = mw.getContentLanguage()

local BASE_CSS = [==[
/**** ModularCSS/MetaVerifyStatus ****/
.mw-invalidspecialpage.page-Special_ModularCSS .page-header__title {
    visibility: hidden;
}

.mw-invalidspecialpage.page-Special_ModularCSS .page-header__title:after {
    content:   "$TITLE";
    visibility: visible;
    display:    block;
    top:        18px;
    position:   absolute;
}

.mw-invalidspecialpage.page-Special_ModularCSS #mw-content-text {
    visibility: hidden;
}

.mw-invalidspecialpage.page-Special_ModularCSS #mw-content-text:after {
    content:   "$MESSAGE";
    visibility: visible;
    display:    block;
    top:        0;
    position:   absolute;
}
]==]

return {
    page = "Special:BlankPage",
    main = function()
        local messages = i18n[lang:getCode()] or i18n.en
        return BASE_CSS:gsub("$([A-Z]+)", {
            TITLE   = messages.TITLE,
            MESSAGE = messages.MESSAGE:gsub(
                "$TIME",
                lang:formatDate(messages.TIMEFRM or "l, j F Y G:i:s \\U\\T\\C") )
        })
    end
}
Advertisement