Diferencies ente revisiones de «Módulu:Message box/usu»

Contenido eliminado Contenido añadido
Oriciu (alderique | contribuciones)
Sin resumen de edición
Etiqueta: edición de fonte 2017
Xqbot (alderique | contribuciones)
m Bot: Reemplace la etiqueta obsoleta <source> y el parámetro "enclose"; cambios cosméticos
 
Llinia 9:
To use this module from another Lua module, first you need to load it.
 
<sourcesyntaxhighlight lang="lua">
local messageBox = require('Module:Message box')
</syntaxhighlight>
</source>
 
To create a message box, use the <code>main</code> function. It takes two parameters: the first is the box type (as a string), and the second is a table containing the message box parameters.
 
<sourcesyntaxhighlight lang="lua">
local box = messageBox.main( boxType, {
param1 = param1,
Llinia 21:
-- More parameters...
})
</syntaxhighlight>
</source>
 
There are seven available box types:
Llinia 51:
== Technical details ==
 
The module uses the same basic code for each of the templates listed above; the differences between each of them are configured using the data at [[ModuleMódulu:Message box/configuration]]. Here are the various configuration options and what they mean:
 
* <code>types</code> - a table containing data used by the type parameter of the message box. The table keys are the values that can be passed to the type parameter, and the table values are tables containing the class and the image used by that type.