 this module implements navbox with collapsible groups local qu800 local navbox require 'u8d9beu8d988u8d8afu8d985u8d8a7u8d986 navbox' helper functions local function concatstrings su800 local ru800 tableu82econcat su800   ifu800 ru800 match ' su800* ' then ru800 nilu800 endu800 return ru800 endu800 local function concatstyles su800 local ru800 tableu82econcat su800 ';' while ru800 match '; su800*;' dou800 ru800 mwu800u82eustringu82egsub ru800 '; su800*;' ';' endu800 ifu800 ru800 match ' su800*; su800* ' then ru800 nilu800 endu800 return ru800 endu800 function qu800u82e_navbox pargs table foru800 args passed tou800 navbox local targs process args local passthrough 'name' true 'navbar' true 'state' true 'border' true 'bodyclass true 'groupclass true 'listclass true 'style' true 'bodystyle' true 'basestyle' true 'title' true 'titleclass true 'titlestyle' true 'above' true 'aboveclass true 'abovestyle' true 'below' true 'belowclass true 'belowstyle' true 'image' true 'imageclass true 'imagestyle' true 'imageleft' true 'imageleftstyle' true 'imageright' true 'imagerightstyle' true foru800 ku800 vu800 inu800 pairs pargs dou800 ifu800 ku800 andu800 type ku800 'string' then ifu800 passthrough ku800 then targs ku800 vu800 elseif ku800 match ' list 0u800 9u800 0u800 9u800 * ' oru800 ku800 match ' content 0u800 9u800 0u800 9u800 * ' then local nu800 mwu800u82eustringu82egsub ku800 ' au800 zu800 * 0u800 9u800 * ' ' 1u800' ifu800 targs 'list' .. nu800 nilu800 andu800 pargs 'group' .. nu800 nilu800 andu800 pargs 'sect' .. nu800 nilu800 andu800 pargs 'section' .. nu800 nilu800 then targs 'list' .. nu800 concatstrings pargs 'list' .. nu800 oru800   pargs 'content' .. nu800 oru800   endu800 elseif ku800 match ' group 0u800 9u800 0u800 9u800 * ' oru800 ku800 match ' sect 0u800 9u800 0u800 9u800 * ' oru800 ku800 match ' section 0u800 9u800 0u800 9u800 * ' then local nu800 mwu800u82eustringu82egsub ku800 ' au800 zu800 * 0u800 9u800 * ' ' 1u800' ifu800 targs 'list' .. nu800 nilu800 then local titlestyle concatstyles pargs 'groupstyle' oru800   pargs 'secttitlestyle' oru800   pargs 'group' .. nu800 .. 'style' oru800   pargs 'section' .. nu800 ..'titlestyle' oru800   local liststyle concatstyles pargs 'liststyle' oru800   pargs 'contentstyle' oru800   pargs 'list' .. nu800 .. 'style' oru800   pargs 'content' .. nu800 .. 'style' oru800   local title concatstrings pargs 'group' .. nu800 oru800   pargs 'sect' .. nu800 oru800   pargs 'section' .. nu800 oru800   local list concatstrings pargs 'list' .. nu800 oru800   pargs 'content' .. nu800 oru800   local state pargs 'abbr' .. nu800 andu800 pargs 'abbr' .. nu800 pargs 'selected' andu800 'uncollapsed' oru800 pargs 'state' .. nu800 oru800 'collapsed' targs 'list' .. nu800 navboxu82e_navbox 'child' navbar 'plain' state state basestyle pargs 'basestyle' title title titlestyle titlestyle list1 list liststyle liststyle listclass pargs 'list' .. nu800 .. 'class image pargs 'image' .. nu800 imageleft pargs 'imageleft' .. nu800 imageright pargs 'imageright' .. nu800 listpadding pargs 'listpadding' endu800 endu800 endu800 endu800 ordering ofu800 style andu800 bodystyle targs 'style' concatstyles targs 'style' oru800   targs 'bodystyle' oru800   targs 'bodystyle' nilu800 child oru800 subgroup ifu800 targs 'border' nilu800 then targs 'border' pargs 1u800 endu800 return navboxu82e_navbox targs endu800 function qu800u82enavbox frame local pargs require 'u8d9beu8d988u8d8afu8d985u8d8a7u8d986 arguments .getargs frame wrappers 'u8d8a7u8d984u8daafu8d988 navbox with collapsible groups read theu800 arguments inu800 theu800 order they'llu800 beu800 output inu800 tou800 make references number inu800 theu800 right order. local _u800 _u800 pargsu82etitle _u800 pargsu82eabove foru800 iu800 1u800 20u800 dou800 _u800 pargs "group" .. tostring iu800 _u800 pargs "list" .. tostring iu800 endu800 _u800 pargsu82ebelow return qu800u82e_navbox pargs endu800 return qu800 