Modul:Message box/configuration: razlika između inačica

Izvor: Hrvatska internetska enciklopedija
Prijeđi na navigaciju Prijeđi na pretraživanje
Stvorena nova stranica sa sadržajem: »-------------------------------------------------------------------------------- -- Message box configuration...«.
 
Nema sažetka uređivanja
 
Nisu prikazane 2 međuinačice
Redak 1: Redak 1:
--------------------------------------------------------------------------------
local cfg = {}
--                          Message box configuration                        --
--                                                                            --
-- This module contains configuration data for [[Module:Message box]].        --
--------------------------------------------------------------------------------


return {
local function basicBox(class, image)
ambox = {
    return {
types = {
        types = {
speedy = {
            warning = { class = class .. "-warning", image = image },
class = 'ambox-speedy',
            info    = { class = class .. "-info",   image = image },
image = 'Ambox warning pn.svg'
            error  = { class = class .. "-error",   image = image },
},
        },
delete = {
 
class = 'ambox-delete',
        default = "info",
image = 'Ambox warning pn.svg'
 
},
        allowBlankParams = {},
content = {
        classes = {},
class = 'ambox-content',
        allowSmall = true,
image = 'Ambox important.svg'
        smallParam = "small",
},
        smallClass = class .. "-small",
style = {
 
class = 'ambox-style',
        imageCellDiv = true,
image = 'Edit-clear.svg'
        imageCheckBlank = true,
},
        imageRightNone = true,
move = {
        imageEmptyCell = true,
class = 'ambox-move',
 
image = 'Merge-split-transwiki default.svg'
        useCollapsibleTextFields = false,
},
        sectionDefault = "page",
protection = {
        removalNotice = nil,
class = 'ambox-protection',
 
image = 'Padlock-silver-medium.svg'
        templateCategory = nil,
},
        templateCategoryRequireName = false,
notice = {
        templateErrorCategory = nil,
class = 'ambox-notice',
        templateErrorParamsToCheck = {},
image = 'Information icon4.svg'
 
}
        allowMainspaceCategories = false,
},
    }
default                    = 'notice',
end
allowBlankParams            = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
 
allowSmall                 = true,
cfg.ambox = basicBox("ambox", "Ambox info blue.svg")
smallParam                 = 'left',
cfg.imbox = basicBox("imbox", "Ambox info blue.svg")
smallClass                 = 'mbox-small-left',
cfg.cmbox = basicBox("cmbox", "Ambox info blue.svg")
substCheck                  = true,
cfg.tmbox = basicBox("tmbox", "Ambox info blue.svg")
classes                    = {'metadata', 'ambox'},
cfg.ombox = basicBox("ombox", "Ambox info blue.svg")
imageEmptyCell              = true,
 
imageCheckBlank             = true,
return cfg
imageSmallSize              = '20x20px',
imageCellDiv                = true,
useCollapsibleTextFields   = true,
imageRightNone              = true,
sectionDefault              = 'article',
allowMainspaceCategories    = true,
templateCategory           = 'Article message templates',
        templateCategoryRequireName = true,
templateErrorCategory       = 'Article message templates with missing parameters',
templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
removalNotice              = '[[Help:Maintenance template removal|Learn how and when to remove this template message]]'
},
cmbox = {
types = {
speedy = {
class = 'cmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'cmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'cmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'cmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'cmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'cmbox-protection',
image = 'Padlock-silver-medium.svg'
},
notice = {
class = 'cmbox-notice',
image = 'Information icon4.svg'
}
},
default              = 'notice',
showInvalidTypeError = true,
classes              = {'cmbox'},
imageEmptyCell      = true
},
fmbox = {
types = {
warning = {
class = 'fmbox-warning',
image = 'Ambox warning pn.svg'
},
editnotice = {
class = 'fmbox-editnotice',
image = 'Information icon4.svg'
},
system = {
class = 'fmbox-system',
image = 'Information icon4.svg'
}
},
default              = 'system',
showInvalidTypeError = true,
classes              = {'fmbox'},
imageEmptyCell      = false,
imageRightNone      = false
},
imbox = {
types = {
speedy = {
class = 'imbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'imbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'imbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'imbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'imbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'imbox-protection',
image = 'Padlock-silver-medium.svg'
},
license = {
class = 'imbox-license licensetpl',
image = 'Imbox license.png' -- @todo We need an SVG version of this
},
featured = {
class = 'imbox-featured',
image = 'Cscr-featured.svg'
},
notice = {
class = 'imbox-notice',
image = 'Information icon4.svg'
}
},
default              = 'notice',
showInvalidTypeError = true,
classes              = {'imbox'},
imageEmptyCell      = true,
below                = true,
templateCategory    = 'File message boxes'
},
ombox = {
types = {
speedy = {
class = 'ombox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ombox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ombox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ombox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ombox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ombox-protection',
image = 'Padlock-silver-medium.svg'
},
notice = {
class = 'ombox-notice',
image = 'Information icon4.svg'
}
},
default              = 'notice',
showInvalidTypeError = true,
classes              = {'ombox'},
allowSmall          = true,
imageEmptyCell      = true,
imageRightNone      = true
},
tmbox = {
types = {
speedy = {
class = 'tmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'tmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'tmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'tmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'tmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'tmbox-protection',
image = 'Padlock-silver-medium.svg'
},
notice = {
class = 'tmbox-notice',
image = 'Information icon4.svg'
}
},
default              = 'notice',
showInvalidTypeError = true,
classes              = {'tmbox'},
allowSmall          = true,
imageRightNone      = true,
imageEmptyCell      = true,
imageEmptyCellStyle  = true,
templateCategory    = 'Talk message boxes'
}
}

Posljednja izmjena od 27. lipanj 2026. u 11:24

Dokumentacija modula
Ovaj se predložak koristi na velikom broju stranica.


local cfg = {}

local function basicBox(class, image)
    return {
        types = {
            warning = { class = class .. "-warning", image = image },
            info    = { class = class .. "-info",    image = image },
            error   = { class = class .. "-error",   image = image },
        },

        default = "info",

        allowBlankParams = {},
        classes = {},
        allowSmall = true,
        smallParam = "small",
        smallClass = class .. "-small",

        imageCellDiv = true,
        imageCheckBlank = true,
        imageRightNone = true,
        imageEmptyCell = true,

        useCollapsibleTextFields = false,
        sectionDefault = "page",
        removalNotice = nil,

        templateCategory = nil,
        templateCategoryRequireName = false,
        templateErrorCategory = nil,
        templateErrorParamsToCheck = {},

        allowMainspaceCategories = false,
    }
end

cfg.ambox = basicBox("ambox", "Ambox info blue.svg")
cfg.imbox = basicBox("imbox", "Ambox info blue.svg")
cfg.cmbox = basicBox("cmbox", "Ambox info blue.svg")
cfg.tmbox = basicBox("tmbox", "Ambox info blue.svg")
cfg.ombox = basicBox("ombox", "Ambox info blue.svg")

return cfg