Modül:AttributePicker: Revizyonlar arasındaki fark

FM Wiki sitesinden
Gezinti kısmına atla Arama kısmına atla
Değişiklik özeti yok
Değişiklik özeti yok
 
4. satır: 4. satır:
function p.render(frame)
function p.render(frame)
     local bindName = frame.args.bind or "attributes"
     local bindName = frame.args.bind or "attributes"
    local html = ""


     html = html .. '<tr><td colspan="2" style="font-size:12px;color:#555;">Seçim Yap:</td></tr>'
     -- table oluştur
    local root = mw.html.create("tbody")
 
    -- başlık satırı
    local header = root:tag("tr")
    header:tag("td")
        :attr("colspan", "2")
        :cssText("font-size:12px;color:#555;")
        :wikitext("Seçim Yap:")


     for _, attr in ipairs(Attributes) do
     for _, attr in ipairs(Attributes) do
         html = html .. string.format([[
         local row = root:tag("tr")
<tr>
 
    <td style="width:28px;text-align:center;">
        -- checkbox hücresi
         <input type="checkbox" name="%s" value="%s" class="attribute-select"/>
        local cell1 = row:tag("td")
    </td>
        cell1:cssText("width:28px;text-align:center;padding:4px;")
    <td>%s</td>
 
</tr>
         cell1:tag("input")
]], bindName, attr, attr)
            :attr("type", "checkbox")
            :attr("name", bindName)
            :attr("value", attr)
            :addClass("attribute-select")
 
        -- attribute adı hücresi
        local cell2 = row:tag("td")
        cell2:wikitext(attr)
     end
     end


     html = html .. string.format([[
     -- buton satırı
<tr>
    local last = root:tag("tr")
     <td colspan="2" style="text-align:center;padding:8px;">
     local bt = last:tag("td")
         <button class="attribute-generate" data-bind="%s">Seçimi Uygula</button>
    bt:attr("colspan", "2")
    </td>
    bt:cssText("text-align:center;padding:8px;")
</tr>
    bt:tag("button")
]], bindName)
         :addClass("attribute-generate")
        :attr("data-bind", bindName)
        :wikitext("Seçimi Uygula")


     return frame:preprocess(html)
     return tostring(root)
end
end


return p
return p

08.53, 4 Aralık 2025 itibarı ile sayfanın şu anki hâli

Bu modül için bir Modül:AttributePicker/belge belgelendirmesi oluşturabilirsiniz

local p = {}
local Attributes = require("Modül:FMAttributes")

function p.render(frame)
    local bindName = frame.args.bind or "attributes"

    -- table oluştur
    local root = mw.html.create("tbody")

    -- başlık satırı
    local header = root:tag("tr")
    header:tag("td")
        :attr("colspan", "2")
        :cssText("font-size:12px;color:#555;")
        :wikitext("Seçim Yap:")

    for _, attr in ipairs(Attributes) do
        local row = root:tag("tr")

        -- checkbox hücresi
        local cell1 = row:tag("td")
        cell1:cssText("width:28px;text-align:center;padding:4px;")

        cell1:tag("input")
            :attr("type", "checkbox")
            :attr("name", bindName)
            :attr("value", attr)
            :addClass("attribute-select")

        -- attribute adı hücresi
        local cell2 = row:tag("td")
        cell2:wikitext(attr)
    end

    -- buton satırı
    local last = root:tag("tr")
    local bt = last:tag("td")
    bt:attr("colspan", "2")
    bt:cssText("text-align:center;padding:8px;")
    bt:tag("button")
        :addClass("attribute-generate")
        :attr("data-bind", bindName)
        :wikitext("Seçimi Uygula")

    return tostring(root)
end

return p