Modul:TemplateData: Unterschied zwischen den Versionen

2021-07-05
Keine Bearbeitungszusammenfassung
w>PerfektesChaos
(2021-07-05)
Zeile 1: Zeile 1:
local TemplateData = { suite  = "TemplateData",
local TemplateData = { suite  = "TemplateData",
                       serial = "2021-05-03",
                       serial = "2021-07-05",
                       item  = 46997995 }
                       item  = 46997995 }
--[==[
--[==[
Zeile 6: Zeile 6:
]==]
]==]
local Failsafe = TemplateData
local Failsafe = TemplateData




Zeile 338: Zeile 339:
             end    -- while j
             end    -- while j
             r = r .. s:sub( i )
             r = r .. s:sub( i )
         else
         elseif m == 1 then
             r = f( r )
             r = f( r )
         end
         end
Zeile 347: Zeile 348:
     return r
     return r
end -- fair()
end -- fair()




Zeile 734: Zeile 734:
                                       at, "suggestedvalues", i )
                                       at, "suggestedvalues", i )
                     Fault( s )
                     Fault( s )
                    e = false
                 end
                 end
                 if e then
                 if e then
Zeile 761: Zeile 762:
         r2 = { }
         r2 = { }
         for i = 1, #v do
         for i = 1, #v do
            u = mw.html.create( "li" )
             e = v[ i ]
             e = v[ i ]
             table.insert( r2, e.code )
             table.insert( r2, e.code )
             u    = mw.html.create( "li" )
             story = false
             less = ( e.less == true )
             less = ( e.less == true )
             if not less then
             if not less then
                 swift = e.code
                 swift = e.code
                 if about.type:sub( 1, 5 ) == "wiki-" then
                if e.support then
                    local scream, support
                    s = type( e.support )
                    if s == "string" then
                        support = e.support
                    elseif s == "table" then
                        support = faraway( e.support )
                    else
                        scream = "INVALID"
                    end
                    if support then
                        s = mw.text.trim( support )
                        if s == "" then
                            scream = "EMPTY"
                        elseif s:find( "[%[%]|%<%>]" ) then
                            scream = "BAD PAGE"
                        else
                            support = s
                        end
                    end
                    if scream then
                        s = string.format( "params.%s.%s[%d].support %s",
                                          at,
                                          "suggestedvalues",
                                          i,
                                          scream )
                        Fault( s )
                    else
                        swift = string.format( "[[:%s|%s]]",
                                              support, swift )
                    end
                end
                 if about.type:sub( 1, 5 ) == "wiki-" and
                  swift == e.code then
                     local rooms = { file = 6,
                     local rooms = { file = 6,
                                     temp = 10,
                                     temp = 10,
Zeile 827: Zeile 862:
                                           i,
                                           i,
                                           "EMPTY" )
                                           "EMPTY" )
                        Fault( s )
                     else
                     else
                         story = s
                         story = s
Zeile 842: Zeile 878:
                 t = mw.title.makeTitle( 6, e.icon )
                 t = mw.title.makeTitle( 6, e.icon )
                 if t and t.file.exists then
                 if t and t.file.exists then
                    local g = mw.html.create( "span" )
                     s = string.format( "[[%s|16px]]", t.prefixedText )
                     s = string.format( "[[%s|16px]]", t.prefixedText )
                    g:attr( "role", "presentation" )
                    :wikitext( s )
                    s = tostring( g )
                 end
                 end
             end
             end
Zeile 967: Zeile 1.007:
     local code    = mw.html.create( "code" )
     local code    = mw.html.create( "code" )
     local desc    = mw.html.create( "td" )
     local desc    = mw.html.create( "td" )
    local eager  = mw.html.create( "td" )
     local legal  = true
     local legal  = true
     local param  = Data.tree.params[ access ]
     local param  = Data.tree.params[ access ]
Zeile 1.119: Zeile 1.160:
         s    = Permit.types[ param.type ]
         s    = Permit.types[ param.type ]
         typed = mw.html.create( "td" )
         typed = mw.html.create( "td" )
                  :addClass( styles .. "type" )
         if s then
         if s then
             if s == "string" then
             if s == "string" then
Zeile 1.154: Zeile 1.196:
         end
         end
     end
     end
     -- status
     -- status
     if param.required then
     if param.required then
Zeile 1.197: Zeile 1.238:
         end
         end
     end
     end
    eager:attr( "data-sort-value", tostring( mode ) )
                :node( ranking )
                :addClass( string.format( "%sstatus-%s",
                                          styles, status ) )


     -- <tr>
     -- <tr>
     r:attr( "id",  "templatedata:" .. mw.uri.anchorEncode( access ) )
     r:attr( "id",  "templatedata:" .. mw.uri.anchorEncode( access ) )
     :css( Permit.css[ status ] )
     :css( Permit.css[ status ] )
    :addClass( styles .. status )
     :node( begin )
     :node( begin )
     :node( code )
     :node( code )
     :node( desc )
     :node( desc )
     :node( typed )
     :node( typed )
     :node( mw.html.create( "td" )
     :node( eager )
                  :attr( "data-sort-value", tostring( mode ) )
                  :node( ranking ) )
     :newline()
     :newline()
     if not legal then
     if not legal then
Zeile 1.454: Zeile 1.498:
         if r:find( "&", 1, true ) then
         if r:find( "&", 1, true ) then
             r = mw.text.decode( r )
             r = mw.text.decode( r )
            if r:find( "&shy;", 1, true ) then
                r = r:gsub( "&shy;", "" )
            end
         end
         end
     end
     end
Zeile 2.063: Zeile 2.110:
     --              false  -- if appropriate
     --              false  -- if appropriate
     -- 2020-08-17
     -- 2020-08-17
     local since = atleast
     local since = atleast
     local last   = ( since == "~" )
     local last   = ( since == "~" )
     local linked = ( since == "@" )
     local linked = ( since == "@" )
     local link   = ( since == "item" )
     local link   = ( since == "item" )
     local r
     local r
     if last  or  link  or  linked  or  since == "wikidata" then
     if last  or  link  or  linked  or  since == "wikidata" then
Zeile 2.183: Zeile 2.230:


-- Export
-- Export
local p = {
local p = { }
moduleInterface = TemplateData
}


p.f = function ( frame )
p.f = function ( frame )
Anonymer Benutzer