ARCHIVE.PH MIGHT ACK SOON (GLOWNIGGERS ARE AFTER ITS ADMIN)
ALWAYS USE MULTIPLE ARCHIVES AND REARCHIVE EVERYTHING (on megalodon.jp and other archivers) NOW!!!
(possibly a false alarm doey)

This page is "edit" protected. The "autoconfirmed" right is required to "edit" this page.<ul class='mw-logevent-loglines'> <li data-mw-logid="136304" data-mw-logaction="protect/protect" class="mw-logline-protect"> <a href="/index.php?title=Special:Log&amp;logid=136304" title="Special:Log">02:12, 22 October 2025</a> <a href="/User:Fenriris" class="mw-userlink" title="User:Fenriris"><bdi>Fenriris</bdi></a> <span class="mw-usertoollinks mw-changeslist-links"><span><a href="/User_talk:Fenriris" class="mw-usertoollinks-talk" title="User talk:Fenriris">talk</a></span> <span><a href="/Special:Contributions/Fenriris" class="mw-usertoollinks-contribs" title="Special:Contributions/Fenriris">contribs</a></span></span> protected <a href="/Module:Slideshow" title="Module:Slideshow">Module:Slideshow</a> [Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite) <span class="comment">(should also protect tihs one)</span> <span class="mw-logevent-actionlink">(<a href="/index.php?title=Module:Slideshow&amp;action=history&amp;offset=20251022021227" title="Module:Slideshow">hist</a>)</span> </li> </ul></ul>
This page is "move" protected. The "autoconfirmed" right is required to "move" this page.<ul class='mw-logevent-loglines'> <li data-mw-logid="136304" data-mw-logaction="protect/protect" class="mw-logline-protect"> <a href="/index.php?title=Special:Log&amp;logid=136304" title="Special:Log">02:12, 22 October 2025</a> <a href="/User:Fenriris" class="mw-userlink" title="User:Fenriris"><bdi>Fenriris</bdi></a> <span class="mw-usertoollinks mw-changeslist-links"><span><a href="/User_talk:Fenriris" class="mw-usertoollinks-talk" title="User talk:Fenriris">talk</a></span> <span><a href="/Special:Contributions/Fenriris" class="mw-usertoollinks-contribs" title="Special:Contributions/Fenriris">contribs</a></span></span> protected <a href="/Module:Slideshow" title="Module:Slideshow">Module:Slideshow</a> [Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite) <span class="comment">(should also protect tihs one)</span> <span class="mw-logevent-actionlink">(<a href="/index.php?title=Module:Slideshow&amp;action=history&amp;offset=20251022021227" title="Module:Slideshow">hist</a>)</span> </li> </ul></ul>

Module:Slideshow

From Soyjak Wiki, the free ensoyclopedia
Jump to navigationJump to search

you aren't supposed to fuggen use this, use Template:Slideshow instead


-- If someone could make this work with a stylesheet that would be great, because it broke with it, it's 3 am and I can't be asked to fix it
local p = {}

function p.main(frame)
    local args = frame:getParent().args
    local count = tonumber(args.count) or 3
    local title = args.title or "Slideshow"
    local position = args.position or "left"
    -- User must provide a unique prefix
    local prefix = args.prefix or "slideshow_default"

    -- Width and height can be numbers (px) or strings (like "100%")
    local width = args.width or 480
    local height = args.height or 320
    local menuWidth = args.menuWidth or 80  -- default menu column width

    -- Add "px" if width/height are numbers
    if type(width) == "number" then width = width .. "px" end
    if type(height) == "number" then height = height .. "px" end
    if type(menuWidth) == "number" then menuWidth = menuWidth .. "px" end

    local out = {}

    -- Table start
    table.insert(out, string.format(
        '{| style="float: %s; height: %s; width: %s; border-radius: 3px; border: 1px solid #444;"\n|+ %s\n|-\n',
        position, height, width, title
    ))

    -- Menu column
    table.insert(out, string.format(
        '| style="background: #eee; width: %s; text-align: center; vertical-align: top;" |\n',
        menuWidth
    ))
    table.insert(out, string.format('<div style="height: %s; overflow-y: auto; scrollbar-width:thin; overflow-x: hidden;">\n', height))
    table.insert(out, '<div style="background: #dedede; margin-bottom: 3px;"><b>Menu</b></div>\n')
    table.insert(out, string.format('<div class="slideshow-container" data-slideshow="%s">\n', prefix))

    for i = 1, count do
        local stitle = args["slide" .. i .. "title"] or ("Slide " .. i)
        local slideID = string.format("%s_slide%d", prefix, i)
        table.insert(out, string.format(
            '<div class="morphlink showhidetext" data-correspondingcontent="%s" ' ..
            'style="background-color:#ddd;color:black;padding:2px;border:1px solid #aaa;border-radius:2px;margin-bottom:2px">%s</div>\n',
            slideID, stitle
        ))
    end
    table.insert(out, "</div>\n") -- close slideshow-container
    table.insert(out, "</div>\n") -- close wrapper div for menu scrolling

    -- Slides column
    table.insert(out, '| style="vertical-align: top;" |\n')
    table.insert(out, string.format('<div style="height: %s; overflow-y: auto;">\n', height))

    for i = 1, count do
        local stitle = args["slide" .. i .. "title"] or ("Slide " .. i)
        local scontent = args["slide" .. i .. "content"] or ("Slide " .. i .. " content")
        local hidden = (i == 1) and "" or " hiddentext"
        local slideID = string.format("%s_slide%d", prefix, i)
        table.insert(out, string.format(
            '<div id="%s" class="morphcontent%s" style="overflow-y:auto;">' ..
            '<div style="background:#dedede"><b>%s</b></div>%s</div>\n',
            slideID, hidden, stitle, scontent
        ))
    end

    table.insert(out, "</div>\n") -- close wrapper div for slides scrolling
    table.insert(out, '|}\n') -- close table

    return table.concat(out)
end

return p