Differenze tra le versioni di "Modulo:AIRBox"

Da Wiki Acquisti in rete PA.
m
Etichetta: Ripristino manuale
m
Riga 12: Riga 12:
     local output = mw.html.create('div')
     local output = mw.html.create('div')
     output:addClass('multibox')
     output:addClass('multibox')
    local boxHeader = mw.html.create('div')
    boxHeader:addClass('box-header')


     if icona ~= "" then
     if icona ~= "" then
         local iconDiv = mw.html.create('div')
         local iconDiv = mw.html.create('div')
         iconDiv:addClass('box-icon')
         iconDiv:addClass('box-icon')
        iconDiv:css('background-image', 'url("' .. icona .. '")')
         boxHeader:node(iconDiv)
         boxHeader:node(iconDiv)
     end
     end
    local boxHeader = mw.html.create('div')
    boxHeader:addClass('box-header')


     boxHeader:wikitext(titolo)
     boxHeader:wikitext(titolo)
     output:node(boxHeader)
     output:node(boxHeader)
    local contentDiv = mw.html.create('div')
    contentDiv:addClass('box-content')


     local boxBody = mw.html.create('div')
     local boxBody = mw.html.create('div')
     boxBody:addClass('box-body')
     boxBody:addClass('box-body')
     boxBody:wikitext(frame:preprocess(testo))
     boxBody:wikitext(frame:preprocess(testo))
     output:node(boxBody)
    contentDiv:node(boxBody)
 
     output:node(contentDiv)


     return tostring(output)
     return tostring(output)

Versione delle 11:28, 29 mag 2023

La documentazione per questo modulo può essere creata in Modulo:AIRBox/man

-- Nome del modulo: AIRBox

local p = {}

function p.renderBox(frame)
    local args = frame.args

    local titolo = args.titolo or "Da sapere che"
    local testo = args.testo or ""
    local icona = args.icona or ""

    local output = mw.html.create('div')
    output:addClass('multibox')

    if icona ~= "" then
        local iconDiv = mw.html.create('div')
        iconDiv:addClass('box-icon')
        iconDiv:css('background-image', 'url("' .. icona .. '")')
        boxHeader:node(iconDiv)
    end

    local boxHeader = mw.html.create('div')
    boxHeader:addClass('box-header')

    boxHeader:wikitext(titolo)
    output:node(boxHeader)

    local contentDiv = mw.html.create('div')
    contentDiv:addClass('box-content')

    local boxBody = mw.html.create('div')
    boxBody:addClass('box-body')
    boxBody:wikitext(frame:preprocess(testo))
    contentDiv:node(boxBody)

    output:node(contentDiv)

    return tostring(output)
end

return p