请输入您要查询的百科知识:

 

词条 Module:Edit filter board archives
释义

local archiveList = require( 'Module:Archive list' )

-- A table of the archives to display.

local archives = {

    ef = {         root = "Wikipedia:Edit filter noticeboard",        prefix = "Archive"    },    fp = {        root = " Wikipedia:Edit filter/False positives/Reports",        prefix = "Archive"    },

}

-- Gets wikitable rows filled with archive links, using-- Archive list.

local function getLinks( funcArgs )

    if type( funcArgs ) ~= 'table' then        error( 'Invalid input to getLinks', 2 )    end    funcArgs.sep = '\| '    funcArgs.linesep = '\|-\| '    return  mw.ustring.format(        '|-\| %s',        archiveList.main( funcArgs )    )

end

-- Returns a Lua table with value being a list of archive links-- for one of the noticeboards listed in the archives table-- at the top of the module.

local function getLinksTable( all )

    local t = {}    for board, archive in pairs( archives ) do        local funcArgs = archive        if not all then            local archiveMax = archiveList.count( funcArgs )            if type( archiveMax ) == 'number' and archiveMax >= 0 then                funcArgs.max = math.floor( archiveMax )                local start = funcArgs.max -19                if start < 1 then                    start = 1                end                funcArgs.start = start            end        end        t[board] = getLinks( funcArgs )    end    return t

end

-- Build the wikitable using mw.ustring.format.

local function buildWikitable( args )

    local t = getLinksTable( args.all )    local frame = mw.getCurrentFrame()
    -- The navbar needs to be preprocessed before it can be put into    -- mw.ustring.format.    local navbar = frame:preprocess(        "{{navbar|Template:Edit filter noticeboard navbox|mini=1}}"    )        -- The following are defined here for convenience, as they recur frequently    -- in the wikitable.    local headerStyle = 'style="font-size: 111%; line-height: 1.25em;" colspan="10"'    local openSpan = ''    local closeSpan = ''    local searchLink = "search"        -- The inputbox plus header. We define it here as it is optional.    local inputbox = ''    if args.search == 'yes' then        inputbox = '\|-\! colspan="10" style="white-space: nowrap;" | '            .. frame:preprocess(

[==[

bgcolor=transparent

type=fulltext

prefix=Wikipedia:Edit filter noticeboard

break=no

width=32

searchbuttonlabel=Search

placeholder=Search noticeboards archives

]==]

            )    end            return mw.ustring.format(

[==[

Noticeboard archives

%s

__NOINDEX__]==],

        navbar,        headerStyle, openSpan, searchLink, closeSpan,        t.an,        headerStyle, openSpan, searchLink, closeSpan,        t.ani,        headerStyle,        inputbox    )        

end

function makeWrapper( all )

    return function( frame )        -- If we are being called from #invoke, get the args from #invoke        -- if they exist, or else get the arguments passed to the parent        -- frame. Otherwise, assume the arguments are being passed directly        -- in from another module or from the debug console.        local origArgs        if frame == mw.getCurrentFrame() then            origArgs = frame:getParent().args            for k, v in pairs( frame.args ) do                origArgs = frame.args                break            end        else            origArgs = frame        end         -- Ignore blank values for parameters.        local args = {}        for k, v in pairs( origArgs ) do            if v ~= '' then                args[k] = v            end        end                -- Find whether we are getting all the links or just the        -- last 20 links.        args.all = all                return buildWikitable( args )    end

end

return {

    compact = makeWrapper(),    all = makeWrapper( true )

}

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/11 16:54:10