 this module implements portal baru800 . require 'module nou800 globals local pu800 local buildnavbox require 'module navbox' ._navbox local getimagename require 'module portal' .image local yesno require 'module yesno' builds theu800 portal baru800 used byu800 portal baru800 . function pu800u82e_main portals args ifu800 #portals 1u800 then return   endu800 donu800'tu800 display au800 blank navbox ifu800 nou800 portals were specified. local list mwu800u82ehtmlu82ecreate 'ulu800' foru800 _u800 portal inu800 ipairs portals dou800 list tagu800 'liu800' cssu800 'display' 'inline' cssu800 'white space' 'nowrap' tagu800 'span' cssu800 'margin' 'auto 0u800u82e5emu800' wikitext stringu82eformat ' file su800 24x21px ' getimagename portal done tagu800 'span' cssu800 'font weight' 'bold' wikitext stringu82eformat ' u8d8afu8d8b1u8daafu8d8a7u8d987 su800 u8d8afu8d8b1u8daafu8d8a7u8d987 su800 ' portal portal endu800 ifu800 yesno argsu82eborder false then donu800'tu800 display au800 border ifu800 argsu82eborder isu800 "nou800" "nu800" "false" 0u800 oru800 false. return tostring mwu800u82ehtmlu82ecreate 'divu800' addclass 'noprint metadata' cssu800 'width' '100u800 ' cssu800 'text align' 'center' cssu800 'padding' '1pxu800' cssu800 'font size' '88u800 ' node list else return buildnavbox navbar 'offu800' bodyclass 'noprint' list1 tostring list endu800 endu800 processes external arguments andu800 sends them tou800 theu800 other functions. function pu800u82emain frame ifu800 called viau800 #invoke useu800 theu800 args passed into theu800 invoking template oru800 theu800 args passed tou800 #invoke ifu800 anyu800 exist. otherwise assume args areu800 being passed directly inu800 from theu800 debug console oru800 from another luau800 module. local origargs ifu800 type frameu82egetparent 'function' then origargs frame getparent .args foru800 ku800 vu800 inu800 pairs frameu82eargs dou800 origargs frameu82eargs break endu800 else origargs frame endu800 process theu800 args tou800 make anu800 array ofu800 portal names that canu800 beu800 used with ipairs. weu800 need tou800 useu800 ipairs because weu800 want tou800 list allu800 theu800 portals inu800 theu800 order they were passed tou800 theu800 template butu800 weu800 also want tou800 beu800 able tou800 deal with positional arguments passed explicitly foru800 example portal 2u800 politics . theu800 behaviour ofu800 ipairs isu800 undefined ifu800 nilu800 values areu800 present sou800 weu800 need tou800 make sure they areu800 allu800 removed. local portals args foru800 ku800 vu800 inu800 pairs origargs dou800 ifu800 type ku800 'number' andu800 type vu800 'string' then make sure weu800 have nou800 nonu800 string portal names. ifu800 mwu800u82eustringu82efind vu800 ' su800' then remove blank values. tableu82einsert portals ku800 endu800 elseif type ku800 'number' then separate named arguments from portals. ifu800 type vu800 'string' then vu800 mwu800u82etextu82etrim vu800 endu800 args ku800 vu800 endu800 endu800 tableu82esort portals foru800 iu800 vu800 inu800 ipairs portals dou800 portals iu800 mwu800u82etextu82etrim origargs vu800 swap keys with values trimming whitespace. endu800 return pu800u82e_main portals args endu800 return pu800 