<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://www.helmstedt-wiki.de/index.php?action=history&amp;feed=atom&amp;title=Modul%3ASort%2Fcell</id>
	<title>Modul:Sort/cell - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://www.helmstedt-wiki.de/index.php?action=history&amp;feed=atom&amp;title=Modul%3ASort%2Fcell"/>
	<link rel="alternate" type="text/html" href="https://www.helmstedt-wiki.de/index.php?title=Modul:Sort/cell&amp;action=history"/>
	<updated>2026-04-11T22:30:05Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Helmstedt-Wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://www.helmstedt-wiki.de/index.php?title=Modul:Sort/cell&amp;diff=23441&amp;oldid=prev</id>
		<title>Admin: AZ: Die Seite wurde neu angelegt: local Sort = { suite   = &quot;Sort&quot;,                sub     = &quot;cell&quot;,                serial  = &quot;2021-04-11&quot;,                item    = 90144855 } --[=[ Sort/cell    --  support table cells sorting modules ]=] local Failsafe = Sort    local face = function ( assign, attribute, args, apply, allow )     -- Store preceding attribute     -- Precondition:     --     assign       -- table, to extend     --…</title>
		<link rel="alternate" type="text/html" href="https://www.helmstedt-wiki.de/index.php?title=Modul:Sort/cell&amp;diff=23441&amp;oldid=prev"/>
		<updated>2024-06-20T18:33:13Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php?title=Hilfe:Zusammenfassung_und_Quellen&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Hilfe:Zusammenfassung und Quellen (Seite nicht vorhanden)&quot;&gt;AZ&lt;/a&gt;: Die Seite wurde neu angelegt: local Sort = { suite   = &amp;quot;Sort&amp;quot;,                sub     = &amp;quot;cell&amp;quot;,                serial  = &amp;quot;2021-04-11&amp;quot;,                item    = 90144855 } --[=[ Sort/cell    --  support table cells sorting modules ]=] local Failsafe = Sort    local face = function ( assign, attribute, args, apply, allow )     -- Store preceding attribute     -- Precondition:     --     assign       -- table, to extend     --…&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local Sort = { suite   = &amp;quot;Sort&amp;quot;,&lt;br /&gt;
               sub     = &amp;quot;cell&amp;quot;,&lt;br /&gt;
               serial  = &amp;quot;2021-04-11&amp;quot;,&lt;br /&gt;
               item    = 90144855 }&lt;br /&gt;
--[=[&lt;br /&gt;
Sort/cell    --  support table cells sorting modules&lt;br /&gt;
]=]&lt;br /&gt;
local Failsafe = Sort&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local face = function ( assign, attribute, args, apply, allow )&lt;br /&gt;
    -- Store preceding attribute&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     assign       -- table, to extend&lt;br /&gt;
    --     attribute    -- string, attribute name&lt;br /&gt;
    --     args         -- table|nil, parameters to retrieve&lt;br /&gt;
    --     apply        -- string|number|nil, for value&lt;br /&gt;
    --     allow        -- boolean, permit and request numbers &amp;gt;(=)0&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     attributes extended&lt;br /&gt;
    local d, s, v&lt;br /&gt;
    if apply then&lt;br /&gt;
        d = apply&lt;br /&gt;
    elseif args then&lt;br /&gt;
        d = args[ attribute ]&lt;br /&gt;
    end&lt;br /&gt;
    s = type( d )&lt;br /&gt;
    if s == &amp;quot;string&amp;quot; then&lt;br /&gt;
        d = mw.text.trim( d )&lt;br /&gt;
        if d == &amp;quot;&amp;quot; then&lt;br /&gt;
            d = false&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    if d then&lt;br /&gt;
        if allow then&lt;br /&gt;
            local min = 1&lt;br /&gt;
            if attribute == &amp;quot;rowspan&amp;quot; then&lt;br /&gt;
                min = 0&lt;br /&gt;
            end&lt;br /&gt;
            if s == &amp;quot;string&amp;quot; then&lt;br /&gt;
                s = string.format( &amp;quot;[%d-9]%%d*&amp;quot;, min )&lt;br /&gt;
                if d:match( string.format( &amp;quot;^%s$&amp;quot;, s ) ) then&lt;br /&gt;
                    v = d&lt;br /&gt;
                else&lt;br /&gt;
                    local p&lt;br /&gt;
                    s = string.format( &amp;quot;^([&amp;#039;\&amp;quot;]) *(%s) *%%1$&amp;quot;, s )&lt;br /&gt;
                    p, s = d:match( s )&lt;br /&gt;
                    if s then&lt;br /&gt;
                        v = s&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
            elseif s == &amp;quot;number&amp;quot;  and  d &amp;gt;= min then&lt;br /&gt;
                local k = math.floor( d )&lt;br /&gt;
                if d == k then&lt;br /&gt;
                    v = tostring( k )&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
            if not v then&lt;br /&gt;
                assign.scream = attribute .. &amp;quot;=????&amp;quot;&lt;br /&gt;
            end&lt;br /&gt;
        elseif s == &amp;quot;string&amp;quot; then&lt;br /&gt;
            local p&lt;br /&gt;
            p, s = d:match( &amp;quot;^([&amp;#039;\&amp;quot;])([^\&amp;quot;]*)%1$&amp;quot; )&lt;br /&gt;
            if s then&lt;br /&gt;
                d = mw.text.trim( s )&lt;br /&gt;
            end&lt;br /&gt;
            if d ~= &amp;quot;&amp;quot; then&lt;br /&gt;
                if attribute == &amp;quot;dir&amp;quot; then&lt;br /&gt;
                    d = d:lower()&lt;br /&gt;
                    if d == &amp;quot;ltr&amp;quot;  or  d == &amp;quot;rtl&amp;quot; then&lt;br /&gt;
                        v = d&lt;br /&gt;
                    end&lt;br /&gt;
                else&lt;br /&gt;
                    v = d&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    if v then&lt;br /&gt;
        assign.props = assign.props  or  { }&lt;br /&gt;
        assign.props[ attribute ] = v&lt;br /&gt;
    end&lt;br /&gt;
end -- face()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local facing = function ( args, append )&lt;br /&gt;
    -- Prepend preceding attributes&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     args      -- table, parameters&lt;br /&gt;
    --     append    -- string|html|nil, thing to be extended&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Returns string, if append is a string or nil&lt;br /&gt;
    --     otherwise html is extended&lt;br /&gt;
    local p = args.props&lt;br /&gt;
    local r = append&lt;br /&gt;
    if p then&lt;br /&gt;
        if type( append ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
            for k, v in pairs( p ) do&lt;br /&gt;
                if k == &amp;quot;class&amp;quot; then&lt;br /&gt;
                    append:addClass( v )&lt;br /&gt;
                elseif k == &amp;quot;css&amp;quot; then&lt;br /&gt;
                    append:css( v )&lt;br /&gt;
                else&lt;br /&gt;
                    append:attr( k, v )&lt;br /&gt;
                end&lt;br /&gt;
            end -- for k, v&lt;br /&gt;
        else&lt;br /&gt;
            if p.css then&lt;br /&gt;
                local s = &amp;quot;&amp;quot;&lt;br /&gt;
                for k, v in pairs( p.css ) do&lt;br /&gt;
                    if type( k ) == &amp;quot;string&amp;quot;  and&lt;br /&gt;
                       type( v ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
                        v = mw.text.trim( v )&lt;br /&gt;
                        k = mw.text.trim( k )&lt;br /&gt;
                        if v ~= &amp;quot;&amp;quot;  and&lt;br /&gt;
                           k ~= &amp;quot;&amp;quot; then&lt;br /&gt;
                            s = string.format( &amp;quot;%s;%s:%s&amp;quot;, s, k, v )&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                end -- for k, v&lt;br /&gt;
                if s ~= &amp;quot;&amp;quot; then&lt;br /&gt;
                    face( args, &amp;quot;style&amp;quot;, false, s:sub( 2 ) )&lt;br /&gt;
                end&lt;br /&gt;
                p.css = nil&lt;br /&gt;
            end&lt;br /&gt;
            if type( append ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
                r = &amp;quot;| &amp;quot; .. append&lt;br /&gt;
            else&lt;br /&gt;
                r = &amp;quot;|&amp;quot;&lt;br /&gt;
            end&lt;br /&gt;
            for k, v in pairs( p ) do&lt;br /&gt;
                if k ~= &amp;quot;lang&amp;quot;  or  v ~= Sort.facility() then&lt;br /&gt;
                    r = string.format( &amp;quot; %s=\&amp;quot;%s\&amp;quot;%s&amp;quot;, k, v, r )&lt;br /&gt;
                end&lt;br /&gt;
            end -- for k, v&lt;br /&gt;
            r = r:sub( 2 )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- facing()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local features = function ( args, assign )&lt;br /&gt;
    -- Parse CSS string&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     args      -- table, parameters&lt;br /&gt;
    --                  .style    -- string|nil, CSS to be parsed&lt;br /&gt;
    --     assign    -- table, to be extended&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     args.props.css added&lt;br /&gt;
    if args.style then&lt;br /&gt;
        local s         = mw.text.trim( args.style )&lt;br /&gt;
        local pair, css = s:match( &amp;quot;^([&amp;#039;\&amp;quot;])([^\&amp;quot;]*)%1$&amp;quot; )&lt;br /&gt;
        if css then&lt;br /&gt;
            s = mw.text.trim( css )&lt;br /&gt;
        end&lt;br /&gt;
        css = mw.text.split( s, &amp;quot;;&amp;quot; )&lt;br /&gt;
        --    Problem: URL; not expected&lt;br /&gt;
        for i = 1, #css do&lt;br /&gt;
            pair = mw.text.split( css[ i ], &amp;quot;:&amp;quot; )&lt;br /&gt;
            --     Problem: URL; not expected&lt;br /&gt;
            if #pair == 2 then&lt;br /&gt;
                s = mw.text.trim( pair[ 1 ] )&lt;br /&gt;
                if s ~= &amp;quot;&amp;quot; then&lt;br /&gt;
                    assign.props          = assign.props  or  { }&lt;br /&gt;
                    assign.props.css      = assign.props.css  or  { }&lt;br /&gt;
                    assign.props.css[ s ] = mw.text.trim( pair[ 2 ] )&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end -- i = 1, #css&lt;br /&gt;
    end&lt;br /&gt;
end -- features()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sort.faced = function ( args, assign )&lt;br /&gt;
    -- Assign a sortable value&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     args      -- table, to be extended&lt;br /&gt;
    --     assign    -- string, to be memorized&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     args is extended, if meaningful&lt;br /&gt;
    if type( assign ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
        local s = mw.text.trim( assign )&lt;br /&gt;
        if s ~= &amp;quot;&amp;quot; then&lt;br /&gt;
            s = mw.text.decode( s )&lt;br /&gt;
            s = mw.ustring.gsub( s, mw.ustring.char( 160 ), &amp;quot; &amp;quot; )&lt;br /&gt;
            s = mw.ustring.gsub( s, &amp;quot;%s+&amp;quot;, &amp;quot; &amp;quot; )&lt;br /&gt;
            s = s:gsub( &amp;quot;\&amp;quot;&amp;quot;, &amp;quot;&amp;quot; )&lt;br /&gt;
                 :gsub( &amp;quot;&amp;lt;&amp;quot;, &amp;quot;&amp;quot; )&lt;br /&gt;
                 :gsub( &amp;quot;&amp;gt;&amp;quot;, &amp;quot;&amp;quot; )&lt;br /&gt;
            s = mw.ustring.sub( s, 1, 99 )&lt;br /&gt;
            face( args, &amp;quot;data-sort-value&amp;quot;, false, s )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end -- Sort.faced()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sort.facility = function ()&lt;br /&gt;
    -- Retrieve page or project language&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Returns string, downcased&lt;br /&gt;
    if type( Sort.slang ) ~= &amp;quot;string&amp;quot; then&lt;br /&gt;
        Sort.contLang = Sort.contLang  or&lt;br /&gt;
                        mw.language.getContentLanguage()&lt;br /&gt;
        Sort.slang    = Sort.contLang:getCode():lower()&lt;br /&gt;
    end&lt;br /&gt;
    return Sort.slang&lt;br /&gt;
end -- Sort.facility()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sort.fair = function ( args, access, assign )&lt;br /&gt;
    -- Assign a non-empty string&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     args      -- table, to be queried&lt;br /&gt;
    --     access    -- string, to identify a component&lt;br /&gt;
    --     assign    -- table, to be extended&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     assign is extended, if meaningful&lt;br /&gt;
    if type( args[ access ] ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
        local s = mw.text.trim( args[ access ] )&lt;br /&gt;
        if s ~= &amp;quot;&amp;quot; then&lt;br /&gt;
            assign[ access ] = s&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end -- Sort.fair()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sort.fault = function ( alert, args )&lt;br /&gt;
    -- Error occurred&lt;br /&gt;
    -- Parameter:&lt;br /&gt;
    --     alert    -- string, with message&lt;br /&gt;
    --     args     -- table, parameters&lt;br /&gt;
    --                 .elem    -- table, if mw.html&lt;br /&gt;
    --                 .cat     -- string|table|nil, for error category&lt;br /&gt;
    --                             may contain one or more mw.title&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Returns string, or expands .elem&lt;br /&gt;
    local r, suffix&lt;br /&gt;
    local e = mw.html.create( &amp;quot;span&amp;quot; )&lt;br /&gt;
                     :addClass( &amp;quot;error&amp;quot; )&lt;br /&gt;
                     :wikitext( alert )&lt;br /&gt;
    if args.cat then&lt;br /&gt;
        local s = type( args.cat )&lt;br /&gt;
        local c&lt;br /&gt;
        if s == &amp;quot;string&amp;quot; then&lt;br /&gt;
            s = mw.text.trim( args.cat )&lt;br /&gt;
            if s ~= &amp;quot;&amp;quot; then&lt;br /&gt;
                c = { }&lt;br /&gt;
                table.insert( c, s )&lt;br /&gt;
            end&lt;br /&gt;
        elseif s == &amp;quot;table&amp;quot; then&lt;br /&gt;
            if type( args.cat.baseText ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
                c = { }&lt;br /&gt;
                table.insert( c, args.cat.text )&lt;br /&gt;
            else&lt;br /&gt;
                local v&lt;br /&gt;
                for i = 1, #args.cat do&lt;br /&gt;
                    v = args.cat[ i ]&lt;br /&gt;
                    s = type( v )&lt;br /&gt;
                    if s == &amp;quot;string&amp;quot; then&lt;br /&gt;
                        s = mw.text.trim( v )&lt;br /&gt;
                        if s ~= &amp;quot;&amp;quot; then&lt;br /&gt;
                            c = c or { }&lt;br /&gt;
                            table.insert( c, s )&lt;br /&gt;
                        end&lt;br /&gt;
                    elseif s == &amp;quot;table&amp;quot;  and&lt;br /&gt;
                           type( v.baseText ) == &amp;quot;string&amp;quot; then&lt;br /&gt;
                        c = c or { }&lt;br /&gt;
                        table.insert( c, v.text )&lt;br /&gt;
                    end&lt;br /&gt;
                end -- i = 1, #args.cat&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        if c then&lt;br /&gt;
            suffix = &amp;quot;&amp;quot;&lt;br /&gt;
            for i = 1, #c do&lt;br /&gt;
                suffix = string.format( &amp;quot;%s[[Category:%s]]&amp;quot;,&lt;br /&gt;
                                        suffix, c[ i ] )&lt;br /&gt;
            end -- i = 1, #c&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    if args.elem then&lt;br /&gt;
        if suffix then&lt;br /&gt;
            e:wikitext( suffix )&lt;br /&gt;
        end&lt;br /&gt;
        args.elem:node( e )&lt;br /&gt;
    else&lt;br /&gt;
        r = tostring( e )&lt;br /&gt;
        if suffix then&lt;br /&gt;
            r = r .. suffix&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- Sort.fault()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sort.feature = function ( args, access, assign )&lt;br /&gt;
    -- Retrieve or set CSS property&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     args      -- table, parameters&lt;br /&gt;
    --     access    -- string, property name&lt;br /&gt;
    --     assign    -- string|nil, value to be set&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Returns string, or not, if not assigned&lt;br /&gt;
    local r&lt;br /&gt;
    if assign then&lt;br /&gt;
        args.props               = args.props  or  { }&lt;br /&gt;
        args.props.css           = args.props.css  or  { }&lt;br /&gt;
        args.props.css[ access ] = assign&lt;br /&gt;
    elseif args.props  and&lt;br /&gt;
       args.props.css  and&lt;br /&gt;
       args.props.css[ access ] then&lt;br /&gt;
        r = args.props.css[ access ]&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- Sort.feature()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sort.finalize = function ( args, append )&lt;br /&gt;
    -- Complete table cell&lt;br /&gt;
    -- Parameter:&lt;br /&gt;
    --     args      -- table, parameters&lt;br /&gt;
    --                  .props     -- table, if present&lt;br /&gt;
    --                  .cell      -- true, if mandatory table syntax&lt;br /&gt;
    --                  .elem      -- table, if mw.html&lt;br /&gt;
    --                  .scream    -- string|nil, with error message&lt;br /&gt;
    --     append    -- string|nil, with content&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Returns string, or expands .elem, or nil&lt;br /&gt;
    local r&lt;br /&gt;
    if args.props then&lt;br /&gt;
        if args.elem then&lt;br /&gt;
            facing( args, args.elem )&lt;br /&gt;
            if append then&lt;br /&gt;
                args.elem:wikitext( append )&lt;br /&gt;
            end&lt;br /&gt;
        elseif append  and  not args.cell then&lt;br /&gt;
            local e = mw.html.create( &amp;quot;span&amp;quot; )&lt;br /&gt;
                             :wikitext( append )&lt;br /&gt;
            facing( args, e )&lt;br /&gt;
            r = tostring( e )&lt;br /&gt;
        else&lt;br /&gt;
            r = facing( args, append )&lt;br /&gt;
        end&lt;br /&gt;
    elseif args.elem and append then&lt;br /&gt;
        args.elem:wikitext( append )&lt;br /&gt;
    else&lt;br /&gt;
        r = append&lt;br /&gt;
    end&lt;br /&gt;
    if args.scream then&lt;br /&gt;
        if args.elem then&lt;br /&gt;
            Sort.fault( args.scream, args )&lt;br /&gt;
        else&lt;br /&gt;
            r = r or &amp;quot;&amp;quot;&lt;br /&gt;
            r = r .. Sort.fault( args.scream, args )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- Sort.finalize()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sort.first = function ( args, always )&lt;br /&gt;
    -- Initialize table cell start&lt;br /&gt;
    -- Parameter:&lt;br /&gt;
    --     args    -- table, parameters&lt;br /&gt;
    --                .cell       -- string|boolean|table, enforce sort&lt;br /&gt;
    --                .rowspan    -- number|string, for cell attribute&lt;br /&gt;
    --                .colspan    -- number|string, for cell attribute&lt;br /&gt;
    --                .class      -- string, for cell attribute&lt;br /&gt;
    --                .style      -- string|table, for cell attribute&lt;br /&gt;
    --                .id         -- string, for cell attribute&lt;br /&gt;
    --                .lang       -- string, for cell attribute&lt;br /&gt;
    --                .dir        -- string, for cell attribute&lt;br /&gt;
    --                .frame      -- object, if present&lt;br /&gt;
    --     always    -- true, if mandatory table syntax&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Returns table with consolidated parameters&lt;br /&gt;
    local r = { }&lt;br /&gt;
    local s = type( args.style )&lt;br /&gt;
    if s == &amp;quot;string&amp;quot; then&lt;br /&gt;
        features( args, r )&lt;br /&gt;
    elseif s == &amp;quot;table&amp;quot; then&lt;br /&gt;
        r.props     = { }&lt;br /&gt;
        r.props.css = args.style&lt;br /&gt;
    end&lt;br /&gt;
    s = type( args.cell )&lt;br /&gt;
    if s == &amp;quot;string&amp;quot; then&lt;br /&gt;
        r.cell = ( args.cell == &amp;quot;1&amp;quot; )&lt;br /&gt;
    elseif s == &amp;quot;table&amp;quot;  and&lt;br /&gt;
           type( args.cell.node ) == &amp;quot;function&amp;quot; then&lt;br /&gt;
        r.elem = args.cell&lt;br /&gt;
        r.cell = true&lt;br /&gt;
    elseif s == &amp;quot;boolean&amp;quot; then&lt;br /&gt;
        r.cell = args.cell&lt;br /&gt;
    else&lt;br /&gt;
        r.cell = always&lt;br /&gt;
    end&lt;br /&gt;
    if r.cell then&lt;br /&gt;
        face( r, &amp;quot;rowspan&amp;quot;, args, false, true )&lt;br /&gt;
        face( r, &amp;quot;colspan&amp;quot;, args, false, true )&lt;br /&gt;
    end&lt;br /&gt;
    face( r, &amp;quot;class&amp;quot;, args )&lt;br /&gt;
    face( r, &amp;quot;id&amp;quot;, args )&lt;br /&gt;
    face( r, &amp;quot;lang&amp;quot;, args )&lt;br /&gt;
    face( r, &amp;quot;dir&amp;quot;, args )&lt;br /&gt;
    if type( args.frame ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
        r.frame = args.frame&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- Sort.first()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sort.following = function ()&lt;br /&gt;
    -- Retrieve text order&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Returns true, if left-to-right&lt;br /&gt;
    if type( Sort.ltr ) ~= &amp;quot;boolean&amp;quot; then&lt;br /&gt;
        Sort.contLang = Sort.contLang  or&lt;br /&gt;
                        mw.language.getContentLanguage()&lt;br /&gt;
        Sort.ltr = not Sort.contLang:isRTL()&lt;br /&gt;
    end&lt;br /&gt;
    return Sort.ltr&lt;br /&gt;
end -- Sort.following()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sort.formatDate = function ( align, at )&lt;br /&gt;
    -- Format local date and time&lt;br /&gt;
    --     align    -- string, with format&lt;br /&gt;
    --     at       -- string|nil, with timestamp&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Returns string&lt;br /&gt;
    Sort.contLang = Sort.contLang  or&lt;br /&gt;
                    mw.language.getContentLanguage()&lt;br /&gt;
    return Sort.contLang:formatDate( align, at, true )&lt;br /&gt;
end -- Sort.following()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Failsafe.failsafe = function ( atleast )&lt;br /&gt;
    -- Retrieve versioning and check for compliance&lt;br /&gt;
    -- Precondition:&lt;br /&gt;
    --     atleast  -- string, with required version or &amp;quot;wikidata&amp;quot; or &amp;quot;~&amp;quot;&lt;br /&gt;
    --                 or false&lt;br /&gt;
    -- Postcondition:&lt;br /&gt;
    --     Returns  string  -- with queried version, also if problem&lt;br /&gt;
    --              false   -- if appropriate&lt;br /&gt;
    -- 2019-10-15&lt;br /&gt;
    local last  = ( atleast == &amp;quot;~&amp;quot; )&lt;br /&gt;
    local since = atleast&lt;br /&gt;
    local r&lt;br /&gt;
    if last  or  since == &amp;quot;wikidata&amp;quot; then&lt;br /&gt;
        local item = Failsafe.item&lt;br /&gt;
        since = false&lt;br /&gt;
        if type( item ) == &amp;quot;number&amp;quot;  and  item &amp;gt; 0 then&lt;br /&gt;
            local entity = mw.wikibase.getEntity( string.format( &amp;quot;Q%d&amp;quot;,&lt;br /&gt;
                                                                 item ) )&lt;br /&gt;
            if type( entity ) == &amp;quot;table&amp;quot; then&lt;br /&gt;
                local seek = Failsafe.serialProperty or &amp;quot;P348&amp;quot;&lt;br /&gt;
                local vsn  = entity:formatPropertyValues( seek )&lt;br /&gt;
                if type( vsn ) == &amp;quot;table&amp;quot;  and&lt;br /&gt;
                   type( vsn.value ) == &amp;quot;string&amp;quot;  and&lt;br /&gt;
                   vsn.value ~= &amp;quot;&amp;quot; then&lt;br /&gt;
                    if last  and  vsn.value == Failsafe.serial then&lt;br /&gt;
                        r = false&lt;br /&gt;
                    else&lt;br /&gt;
                        r = vsn.value&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    if type( r ) == &amp;quot;nil&amp;quot; then&lt;br /&gt;
        if not since  or  since &amp;lt;= Failsafe.serial then&lt;br /&gt;
            r = Failsafe.serial&lt;br /&gt;
        else&lt;br /&gt;
            r = false&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return r&lt;br /&gt;
end -- Failsafe.failsafe()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Export&lt;br /&gt;
local p = { }&lt;br /&gt;
&lt;br /&gt;
p.failsafe = function ( frame )&lt;br /&gt;
    -- Versioning interface&lt;br /&gt;
    local s = type( frame )&lt;br /&gt;
    local since&lt;br /&gt;
    if s == &amp;quot;table&amp;quot; then&lt;br /&gt;
        since = frame.args[ 1 ]&lt;br /&gt;
    elseif s == &amp;quot;string&amp;quot; then&lt;br /&gt;
        since = frame&lt;br /&gt;
    end&lt;br /&gt;
    if since then&lt;br /&gt;
        since = mw.text.trim( since )&lt;br /&gt;
        if since == &amp;quot;&amp;quot; then&lt;br /&gt;
            since = false&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return Failsafe.failsafe( since )  or  &amp;quot;&amp;quot;&lt;br /&gt;
end -- p.failsafe&lt;br /&gt;
&lt;br /&gt;
p.Sort = function ()&lt;br /&gt;
    -- Module interface&lt;br /&gt;
    return Sort&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>