Modul:PageTree: Unterschied zwischen den Versionen

K
27 Versionen von wikivoyage:Modul:PageTree importiert
Keine Bearbeitungszusammenfassung
K (27 Versionen von wikivoyage:Modul:PageTree importiert)
 
(Eine dazwischenliegende Version von einem anderen Benutzer wird nicht angezeigt)
Zeile 1: Zeile 1:
local PageTree = { suite  = "PageTree",
local PageTree = { suite  = "PageTree",
                   serial  = "2018-08-09",
                   serial  = "2018-09-13",
                   item    = 56033297,
                   item    = 56033297,
                   maxSub  = 10,
                   maxSub  = 10,
Zeile 532: Zeile 532:
             end
             end
             if let then
             if let then
                local s
                 if not e.less then
                 if not e.less then
                     PageTree.item = PageTree.item + 1
                     PageTree.item = PageTree.item + 1
                     serial       = string.format( "%s_%d",
                     serial       = string.format( "%s_%d",
                                                  PageTree.serial,
                                                  PageTree.serial,
                                                  PageTree.item )
                                                  PageTree.item )
                     r = string.format( "%s\n<div %s %s %s>",
                     if table.maxn( e.children ) > 0 then
                                      r,
                        s = "mw-collapsible"
                                      "class='mw-collapsible'",
                        if amount >= already then
                                      "data-expandtext='[+]'",
                            s = s .. " mw-collapsed"
                                      "data-collapsetext='[-]'" )
                        end
                        r = string.format( "%s\n<div class='%s' %s %s>",
                                              r,
                                              s,
                                              "data-expandtext='[+]'",
                                              "data-collapsetext='[-]'" )
                        s = "</div>"
                    else
                        s = ""
                    end
                 end
                 end
                 r = string.format( "%s\n%s%s",
                 r = string.format( "%s\n%s%s",
                                   r, ahead, field( e, false ) )
                                   r,
                                  string.rep( ahead, amount ),
                                  field( e, false ) )
                 if not e.less then
                 if not e.less then
                     r = string.format( "%s\n<div %s>\n%s\n%s",
                    local style
                    if amount >= already then
                        style  = " style='display:none'"
                    else
                        style = ""
                    end
                     r = string.format( "%s\n<div %s%s>\n%s\n</div>%s",
                                       r,
                                       r,
--                                    span,
--                                    span,
                                       "class='mw-collapsible-content'",
                                       "class='mw-collapsible-content'",
                                       flip( ahead,
                                      style,
                                       flip( already,
                                            ahead,
                                             amount + 1,
                                             amount + 1,
                                             e,
                                             e ),
                                            already ),
                                       s )
                                       "</div></div>" )
                 end
                 end
             end
             end
Zeile 740: Zeile 759:
         end
         end
         PageTree.item = 0
         PageTree.item = 0
         r = flip( init,  flag( "#" ),  1,  r )
         r = flip( init,  flag( "*" ),  1,  r )
     else
     else
         r = false
         r = false
Zeile 1.032: Zeile 1.051:
     --    Returns  string with appropriate version, or false
     --    Returns  string with appropriate version, or false
     local r
     local r
    local since = assert
     if since == "wikidata" then
     if since == "wikidata" then
         local item = PageTree.item
         local item = PageTree.item
Zeile 1.041: Zeile 1.061:
                 local vsn = ent:formatPropertyValues( "P348" )
                 local vsn = ent:formatPropertyValues( "P348" )
                 if type( vsn ) == "table"  and
                 if type( vsn ) == "table"  and
                   type( vsn.value) == "string"  and
                   type( vsn.value ) == "string"  and
                   vsn.value ~= "" then
                   vsn.value ~= "" then
                     r = vsn.value
                     r = vsn.value