Module:ImageUnifier/constants

From Roots of Pacha Wiki
Jump to navigation Jump to search

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

-- ----------------------------------------
-- <pre> Module:ImageUnifier/constants
-- ----------------------------------------
local Self = {}

Self.VALID_EXTS = {
    ["png"]=1,
    ["jpg"]=1,
    ["jpeg"]=1,
    ["gif"]=1,
    ["ico"]=1,
    ["svg"]=1,
    ["tiff"]=1,
    ["pdf"]=1,
    ["djvu"]=1,
    ["ogg"]=1,
    ["oga"]=1,
    ["ogv"]=1,
    ["odt"]=1,
    ["ods"]=1,
    ["odp"]=1,
    ["odg"]=1,
    ["odc"]=1,
    ["odf"]=1,
    ["odi"]=1,
    ["odm"]=1,
}

Self.SHORTSTYLES = {
    -- Table for shorten syle names and conforming to lua variable naming
    whitespace = "white-space",
    padleft = "padding-left",
    padright = "padding-right",
}

Self.SIZE_GROUPS = {           -- Default sizes
    text = 26,                  -- normal text sized image for inline with text
    header = 40,                -- large text sized image for h2 and h3
    small = 30,                 -- small sized icon
    medium = 50,                -- medium sized icon
    large = 75,                 -- large sized icon
}

Self.DEFAULTS = {
    text = {whitespace="nowrap", position="relative", top="-0.22ex", padleft="2px", padright="2px"},
}
for k,v in pairs(Self.SIZE_GROUPS) do
    if not Self.DEFAULTS[k] then Self.DEFAULTS[k] = {} end
    Self.DEFAULTS[k].size = "x"..v.."px"
end

Self.OVERRIDES = {
-- Image Names need to be as seen on their file page without the .png
-- Notes: All underscores should be spaces; Full case sensitivitity
    --  ["Example"]                         = {size="x26px", top="-0.22ex", padleft="2px", padright="2px"},
    text = {
        ["Romance Flower"]                    = {size="x26px", top="-0.17ex", padleft="1px", padright="2px"},
        ["Friendship Flower"]                   = {size="x26px", top="-0.17ex", padleft="1px", padright="2px"},
    },
}

-- ----------------------------------------
-- Required for Modules to function
-- ----------------------------------------
return Self