Nicht angemeldeter Benutzer - Bearbeiten von Seiten ist nur als angemeldeter Benutzer möglich.

Änderungen

Zur Navigation springen Zur Suche springen
79 Bytes hinzugefügt ,  23:26, 27. Mär. 2017
2017-03-27
Zeile 1: Zeile 1: −
local TemplateData = { suite  = "TemplateData",
+
local TemplateData = { serial = "2017-03-27",
                       serial = "2017-01-01" }
+
                       suite  = "TemplateData" }
 
--[=[
 
--[=[
 
improve template:TemplateData
 
improve template:TemplateData
Zeile 123: Zeile 123:       −
local function facility( about )
+
local function facility( about, asked )
 
     -- Create description head
 
     -- Create description head
 
     -- Parameter:
 
     -- Parameter:
 
     --    about  -- table, supposed to contain description
 
     --    about  -- table, supposed to contain description
 +
    --    asked  -- true, if mandatory description
 
     -- Returns <block>, with head, or nil
 
     -- Returns <block>, with head, or nil
 
     local para = mw.html.create( "p" )
 
     local para = mw.html.create( "p" )
Zeile 147: Zeile 148:  
             end -- for k, v
 
             end -- for k, v
 
         end
 
         end
     elseif Config.solo then
+
     elseif Config.solo and asked then
 
         para:addClass( "error" )
 
         para:addClass( "error" )
 
             :wikitext( Config.solo )
 
             :wikitext( Config.solo )
Zeile 425: Zeile 426:  
     local ranking = { "required", "suggested", "optional", "deprecated" }
 
     local ranking = { "required", "suggested", "optional", "deprecated" }
 
     local r      = mw.html.create( "tr" )
 
     local r      = mw.html.create( "tr" )
     local sort   = param.label or access
+
     local sort, typed
    local typed   = param.type
      +
    for k, v in pairs( param ) do
 +
        if v == "" then
 +
            param[ k ] = false
 +
        end
 +
    end -- for k, v
 +
   
 
     -- label
 
     -- label
 +
    sort = param.label or access
 
     if sort:match( "^%d+$" ) then
 
     if sort:match( "^%d+$" ) then
 
         begin:attr( "data-sort-value",
 
         begin:attr( "data-sort-value",
Zeile 501: Zeile 508:     
     -- type
 
     -- type
     if typed then
+
     if param.type then
         s = Permit.types[ typed ]
+
         s     = Permit.types[ param.type ]
 
         typed = mw.html.create( "td" )
 
         typed = mw.html.create( "td" )
 
         if s then
 
         if s then
Zeile 707: Zeile 714:     
local function flush()
 
local function flush()
     -- JSON encode narrowed input; obey unnamed (numerical) parameters       -- Returns <templatedata> JSON string
+
     -- JSON encode narrowed input; obey unnamed (numerical) parameters
 +
    -- Returns <templatedata> JSON string
 
     local r
 
     local r
 
     if Data.tag then
 
     if Data.tag then
Zeile 774: Zeile 782:  
                 if s == "string" then
 
                 if s == "string" then
 
                     v = mw.text.trim( v )
 
                     v = mw.text.trim( v )
                    if v == "" then
  −
                        s = "empty"
  −
                    end
   
                 end
 
                 end
 
                 if scope:find( s, 1, true ) then
 
                 if scope:find( s, 1, true ) then
Zeile 839: Zeile 844:  
                         tag[ k ] = v
 
                         tag[ k ] = v
 
                     end
 
                     end
                 elseif s ~= "empty" then
+
                 else
 
                     s = string.format( "Type <code>%s</code> bad for %s",
 
                     s = string.format( "Type <code>%s</code> bad for %s",
 
                                       scope,  f( k, slot ) )
 
                                       scope,  f( k, slot ) )
Zeile 859: Zeile 864:  
     -- Returns <div>
 
     -- Returns <div>
 
     local r = mw.html.create( "div" )
 
     local r = mw.html.create( "div" )
     local s = facility( Data.tree )
+
     local s = facility( Data.tree, true )
 
     if s then
 
     if s then
 
         r:node( s )
 
         r:node( s )
Cookies helfen uns bei der Bereitstellung von imedwiki. Durch die Nutzung von imedwiki erklärst du dich damit einverstanden, dass wir Cookies speichern.

Navigationsmenü