Modul:PageTree: Unterschied zwischen den Versionen

updates
w>PerfektesChaos
(hotfix)
w>PerfektesChaos
(updates)
Zeile 1: Zeile 1:
--[=[ 2014-09-14
--[=[ 2014-11-14
 
Module:pageTree
Module:pageTree
]=]
]=]
Zeile 149: Zeile 148:
     return r
     return r
end -- fair()
end -- fair()
local function fatal( alert )
    -- Format disaster message with class="error" and put into category
    --    alert  -- string, with message, or other data
    -- Returns message string with markup
    local ecat = mw.message.new( "Scribunto-common-error-category" )
    local r = type( alert )
    if r == "string" then
        r = alert
    else
        r = "???? " .. r
    end
    if ecat:isBlank() then
        ecat = ""
    else
        ecat = string.format( "[[Category:%s]]", ecat:plain() )
    end
    r = string.format( "<span class=\"error\">FATAL LUA ERROR %s</span>",
                      r )
        .. ecat
    return r
end -- fatal()




Zeile 380: Zeile 403:
     end
     end
     return ( a1.sort < a2.sort )
     return ( a1.sort < a2.sort )
end -- first()
local function firsthand( a1, a2 )
    -- Compare a1 with a2, considering .show
    --    a1  -- string, with page name
    --    a2  -- string, with page name
    -- Returns true if a1 < a2
    return first( a1, a2, true )
end -- first()
end -- first()


Zeile 558: Zeile 591:
             start = "\n" .. flag( "#" )
             start = "\n" .. flag( "#" )
         end
         end
         table.sort( collect, first )
         table.sort( collect, firsthand )
         r = ""
         r = ""
         for k, v in pairs( collect ) do
         for k, v in pairs( collect ) do
Zeile 795: Zeile 828:
                     suite  = frame:getTitle() }
                     suite  = frame:getTitle() }
     local pars  = frame.args
     local pars  = frame.args
    local lucky  = false
     local r      = pars[ 1 ]
     local r      = pars[ 1 ]
     if r then
     if r then
Zeile 804: Zeile 836:
     end
     end
     if r then
     if r then
        local lucky
         params.frame = frame
         params.frame = frame
         for k, v in pairs( Strings ) do
         for k, v in pairs( Strings ) do
Zeile 816: Zeile 849:
         end -- for k, v
         end -- for k, v
         lucky, r = pcall( forward, params )
         lucky, r = pcall( forward, params )
        if not lucky then
            r = fatal( r )
        end
     else
     else
         r = "'1=' missing"
         r = fault( "'1=' missing" )
     end
     end
     if not lucky then
     if not r then
        r = fault( r )
    elseif not r then
         r = ""
         r = ""
     end
     end
Anonymer Benutzer