Duckey Sandbox Wiki
Nie podano opisu zmian
Nie podano opisu zmian
Linia 67: Linia 67:
 
:wikitext('Informacje')
 
:wikitext('Informacje')
 
:done()
 
:done()
:tag('data')
+
:tag('group')
:tag('label')
+
:tag('data')
:wikitext('Frakcja')
+
:tag('label')
  +
:wikitext('Frakcja')
  +
:done()
  +
:tag('default')
  +
:wikitext('Neutralne')
  +
:done()
 
:done()
 
:done()
:tag('default')
+
:tag('data')
:wikitext('Neutralne')
+
:tag('label')
  +
:wikitext('Frakcja')
  +
:done()
  +
:tag('default')
  +
:wikitext('Neutralne')
  +
:done()
  +
:done()
  +
:tag('data')
  +
:tag('label')
  +
:wikitext('Frakcja')
  +
:done()
  +
:tag('default')
  +
:wikitext('Neutralne')
  +
:done()
  +
:done()
  +
:tag('data')
  +
:tag('label')
  +
:wikitext('Frakcja')
  +
:done()
  +
:tag('default')
  +
:wikitext('Neutralne')
  +
:done()
  +
:done()
  +
:tag('data')
  +
:tag('label')
  +
:wikitext('Frakcja')
  +
:done()
  +
:tag('default')
  +
:wikitext('Neutralne')
  +
:done()
  +
:done()
  +
:tag('data')
  +
:tag('label')
  +
:wikitext('Frakcja')
  +
:done()
  +
:tag('default')
  +
:wikitext('Neutralne')
  +
:done()
  +
:done()
  +
:tag('data')
  +
:tag('label')
  +
:wikitext('Frakcja')
  +
:done()
  +
:tag('default')
  +
:wikitext('Neutralne')
  +
:done()
  +
:done()
  +
:tag('data')
  +
:tag('label')
  +
:wikitext('Frakcja')
  +
:done()
  +
:tag('default')
  +
:wikitext('Neutralne')
  +
:done()
  +
:done()
  +
:tag('data')
  +
:tag('label')
  +
:wikitext('Frakcja')
  +
:done()
  +
:tag('default')
  +
:wikitext('Neutralne')
  +
:done()
  +
:done()
  +
:tag('data')
  +
:tag('label')
  +
:wikitext('Frakcja')
  +
:done()
  +
:tag('default')
  +
:wikitext('Neutralne')
  +
:done()
 
:done()
 
:done()
 
:done()
 
:done()

Wersja z 12:07, 16 lut 2019

Dokumentacja dla tego modułu może zostać utworzona pod nazwą Moduł:Karta/opis

local p = {}

local data = mw.loadData('Module:Karty')

function p.main(frame)
    local title = frame.args[1] or mw.title.getCurrentTitle().text
    
    local card = data[title]
    
    if not card then
        return 'Nie znaleziono karty "'..title..'".'
    end
    
    local image = title:gsub(':', ''):gsub(' ', '_') .. '.png'
    local art = title:gsub(':', ''):gsub(' ', '_') .. '_Art.jpg'
    local premium = title:gsub(':', ''):gsub(' ', '_') .. '_Premium.gif'

    local infobox = mw.html.create('infobox'):attr('type', 'card')
    infobox
        :tag('title')
            :tag('default')
            :wikitext(title)
            :done()
        :done()
        :tag('group')
            :attr('name', 'content')
            :tag('group')
                :attr('name', 'image')
                :tag('panel')
                    :tag('section')
                        :tag('label')
                        :wikitext('Karta')
                        :done()
                        :tag('image')
                            :tag('default')
                            :wikitext(image)
                            :done()
                        :done()
                    :done()
                    :tag('section')
                        :tag('label')
                        :wikitext('Obraz')
                        :done()
                        :tag('image')
                            :tag('default')
                            :wikitext(art)
                            :done()
                        :done()
                    :done()
                    :tag('section')
                        :tag('label')
                        :wikitext('Premium')
                        :done()
                        :tag('image')
                            :tag('default')
                            :wikitext(premium)
                            :done()
                        :done()
                    :done()
                :done()
            :done()
            :tag('group')
            :attr('name', 'data')
                :tag('panel')
                    :tag('section')
                        :tag('label')
                        :wikitext('Informacje')
                        :done()
                        :tag('group')
                            :tag('data')
                                :tag('label')
                                :wikitext('Frakcja')
                                :done()
                                :tag('default')
                                :wikitext('Neutralne')
                                :done()
                            :done()
                            :tag('data')
                                :tag('label')
                                :wikitext('Frakcja')
                                :done()
                                :tag('default')
                                :wikitext('Neutralne')
                                :done()
                            :done()
                            :tag('data')
                                :tag('label')
                                :wikitext('Frakcja')
                                :done()
                                :tag('default')
                                :wikitext('Neutralne')
                                :done()
                            :done()
                            :tag('data')
                                :tag('label')
                                :wikitext('Frakcja')
                                :done()
                                :tag('default')
                                :wikitext('Neutralne')
                                :done()
                            :done()
                            :tag('data')
                                :tag('label')
                                :wikitext('Frakcja')
                                :done()
                                :tag('default')
                                :wikitext('Neutralne')
                                :done()
                            :done()
                            :tag('data')
                                :tag('label')
                                :wikitext('Frakcja')
                                :done()
                                :tag('default')
                                :wikitext('Neutralne')
                                :done()
                            :done()
                            :tag('data')
                                :tag('label')
                                :wikitext('Frakcja')
                                :done()
                                :tag('default')
                                :wikitext('Neutralne')
                                :done()
                            :done()
                            :tag('data')
                                :tag('label')
                                :wikitext('Frakcja')
                                :done()
                                :tag('default')
                                :wikitext('Neutralne')
                                :done()
                            :done()
                            :tag('data')
                                :tag('label')
                                :wikitext('Frakcja')
                                :done()
                                :tag('default')
                                :wikitext('Neutralne')
                                :done()
                            :done()
                            :tag('data')
                                :tag('label')
                                :wikitext('Frakcja')
                                :done()
                                :tag('default')
                                :wikitext('Neutralne')
                                :done()
                            :done()
                        :done()
                    :done()
                :done()
            :done()
        :done()
    
    local markup = tostring(infobox)

    return mw.getCurrentFrame():preprocess(markup)
end

return p