 local pu800 local cfgu800 mwu800u82eloaddata 'module navbar configuration' local setfarsiarguments require 'module setu800 local argument names local function get_title_arg is_collapsible template local title_arg 1u800 ifu800 is_collapsible then title_arg 2u800 endu800 ifu800 template then title_arg 'template' endu800 return title_arg endu800 local function choose_links template args theu800 show table indicates theu800 default displayed items. view talk edit hist move watch todo move tou800 configuration. local show true true true false false false ifu800 template then show 2u800 false show 3u800 false local index tu800 2u800 du800 2u800 eu800 3u800 hu800 4u800 mu800 5u800 wu800 6u800 'u8d8a8' 2u800 'u8d988' 3u800 'u8d8aa' 4u800 'u8d8a7' 5u800 'u8d9be' 6u800 talk 2u800 edit 3u800 hist 4u800 move 5u800 watch 6u800 'u8d8a8u8d8adu8d8ab' 2u800 'u8d988u8db8cu8d8b1u8d8a7u8db8cu8d8b4' 3u800 'u8d8aau8d8a7u8d8b1u8db8cu8d8aeu8da86u8d987' 4u800 'u8d8a7u8d986u8d8aau8d982u8d8a7u8d984' 5u800 'u8d9beu8db8cu8daafu8db8cu8d8b1u8db8c' 6u800 todo consider removing tabletools dependency. foru800 _u800 vu800 inu800 ipairs require 'module tabletools .compresssparsearray args dou800 local numu800 index vu800 ifu800 numu800 then show numu800 true endu800 endu800 endu800 local remove_edit_link argsu82enoedit ifu800 remove_edit_link then show 3u800 false endu800 return show endu800 local function add_link link_description ulu800 is_mini font_style local lu800 ifu800 link_descriptionu82eurlu800 then lu800 ' '   ' ' else lu800 ' ' ' ' ' ' endu800 ulu800 tagu800 'liu800' addclass 'nvu800 ' .. link_descriptionu82efull wikitext lu800 1u800 .. link_descriptionu82elink .. lu800 2u800 tagu800 is_mini andu800 'abbr' oru800 'span' attr 'title' link_descriptionu82ehtml_title csstext font_style wikitext is_mini andu800 link_descriptionu82emini oru800 link_descriptionu82efull done wikitext lu800 3u800 done endu800 local function make_list title_text has_brackets displayed_links is_mini font_style local title mwu800u82etitleu82enewu800 mwu800u82etextu82etrim title_text cfgu800u82etitle_namespace ifu800 notu800 title then error cfgu800u82einvalid_title .. title_text endu800 local talkpage titleu82etalkpagetitle andu800 titleu82etalkpagetitleu82efulltext oru800   todo getu800 link_descriptions andu800 show into theu800 configuration module. link_descriptions should beu800 easier... local link_descriptions 'mini' 'u8d986' 'full' 'u8d986u8d985u8d8a7u8db8cu8d8b4' 'html_title' 'u8d985u8d8b4u8d8a7u8d987u8d8afu8d987u8d994 u8d8a7u8db8cu8d986 u8d8a7u8d984u8daafu8d988' 'link' titleu82efulltext 'urlu800' false 'mini' 'u8d8a8' 'full' 'u8d8a8u8d8adu8d8ab' 'html_title' 'u8d8a8u8d8adu8d8ab u8d9beu8db8cu8d8b1u8d8a7u8d985u8d988u8d986 u8d8a7u8db8cu8d986 u8d8a7u8d984u8daafu8d988' 'link' talkpage 'urlu800' false 'mini' 'u8d988' 'full' 'u8d988u8db8cu8d8b1u8d8a7u8db8cu8d8b4' 'html_title' 'u8d988u8db8cu8d8b1u8d8a7u8db8cu8d8b4 u8daa9u8d8b1u8d8afu8d986 u8d8a7u8db8cu8d986 u8d8a7u8d984u8daafu8d988' 'link' 'u8d988u8db8cu8da98u8d987 u8d988u8db8cu8d8b1u8d8a7u8db8cu8d8b4_u8d8b5u8d981u8d8adu8d987 ' .. titleu82efulltext 'urlu800' false 'mini' 'u8d8aa' 'full' 'u8d8aau8d8a7u8d8b1u8db8cu8d8aeu8da86u8d987' 'html_title' 'u8d985u8d8b4u8d8a7u8d987u8d8afu8d987u8d994 u8d8aau8d8a7u8d8b1u8db8cu8d8aeu8da86u8d987u8d994 u8d8a7u8db8cu8d986 u8d8a7u8d984u8daafu8d988' 'link' 'u8d988u8db8cu8da98u8d987 u8d8aau8d8a7u8d8b1u8db8cu8d8aeu8da86u8d987_u8d8b5u8d981u8d8adu8d987 ' .. titleu82efulltext 'urlu800' false 'mini' 'u8d8a7' 'full' 'u8d8a7u8d986u8d8aau8d982u8d8a7u8d984' 'html_title' 'u8d985u8d986u8d8aau8d982u8d984 u8daa9u8d8b1u8d8afu8d986 u8d8a7u8db8cu8d986 u8d8a7u8d984u8daafu8d988' 'link' mwu800u82etitleu82enewu800 'u8d988u8db8cu8da98u8d987 u8d8a7u8d986u8d8aau8d982u8d8a7u8d984_u8d8b5u8d981u8d8adu8d987' fullurl 'target '..titleu82efulltext 'urlu800' true 'mini' 'u8d9be' 'full' 'u8d9beu8db8cu8e2808cu8daafu8db8cu8d8b1u8db8c' 'html_title' 'u8d9beu8db8cu8e2808cu8daafu8db8cu8d8b1u8db8c u8daa9u8d8b1u8d8afu8d986 u8d8a7u8db8cu8d986 u8d8a7u8d984u8daafu8d988' 'link' title fullurl 'action watch' 'urlu800' true local ulu800 mwu800u82ehtmlu82ecreate 'ulu800' ifu800 has_brackets then ulu800 addclass cfgu800u82eclassesu82ebrackets csstext font_style endu800 foru800 iu800 _u800 inu800 ipairs displayed_links dou800 ifu800 displayed_links iu800 then add_link link_descriptions iu800 ulu800 is_mini font_style endu800 endu800 return ulu800 done endu800 function pu800u82e_navbar args setfarsiarguments args 'text' 'u8d985u8d8aau8d986' 'plain' 'u8d8b3u8d8a7u8d8afu8d987' 'mini' 'u8daa9u8d988u8da86u8daa9' 'brackets 'u8daa9u8d8b1u8d988u8d8b4u8d987' 'fontstyle' 'u8d8b3u8d8a8u8daa9 u8d982u8d984u8d985' 'style' 'u8d8b3u8d8a8u8daa9' 'fontcolor' 'u8d8b1u8d986u8daaf u8d982u8d984u8d985' 'collapsible' 'u8d8aau8d8a7u8d8b4u8d988' 'template' 'u8d8a7u8d984u8daafu8d988' todo weu800 probably donu800'tu800 need both fontstyle andu800 fontcolor... local font_style argsu82efontstyle local font_color argsu82efontcolor local is_collapsible argsu82ecollapsible local is_mini argsu82emini local is_plain argsu82eplain local collapsible_class nilu800 ifu800 is_collapsible then collapsible_class cfgu800u82eclassesu82ecollapsible ifu800 notu800 is_plain then is_mini 1u800 endu800 ifu800 font_color then font_style font_style oru800   .. '; color ' .. font_color .. ';' endu800 endu800 local navbar_style argsu82estyle local divu800 mwu800u82ehtmlu82ecreate tagu800 'divu800' divu800 addclass cfgu800u82eclassesu82enavbar addclass cfgu800u82eclassesu82eplainlinks addclass cfgu800u82eclassesu82ehorizontal_list addclass collapsible_class weu800 made theu800 determination earlier csstext navbar_style ifu800 is_mini then divu800 addclass cfgu800u82eclassesu82emini endu800 local box_text argsu82etext oru800 cfgu800u82ebox_text .. ' ' theu800 concatenated space guarantees theu800 boxu800 text isu800 separated ifu800 notu800 is_mini oru800 is_plain then divu800 tagu800 'span' addclass cfgu800u82eclassesu82ebox_text csstext font_style wikitext box_text endu800 local template argsu82etemplate local displayed_links choose_links template args local has_brackets argsu82ebrackets local title_arg get_title_arg is_collapsible template local title_text args title_arg oru800 ' ' .. mwu800u82egetcurrentframe getparent gettitle local list make_list title_text has_brackets displayed_links is_mini font_style divu800 node list ifu800 is_collapsible then local title_text_class ifu800 is_mini then title_text_class cfgu800u82eclassesu82ecollapsible_title_mini else title_text_class cfgu800u82eclassesu82ecollapsible_title_full endu800 divu800 done tagu800 'divu800' addclass title_text_class csstext font_style wikitext args 1u800 endu800 local frame mwu800u82egetcurrentframe hlist navbar isu800 best effort tou800 preserve oldu800 commonu82ecssu800 ordering. return frame extensiontag name 'templatestyles args srcu800 cfgu800u82ehlist_templatestyles .. frame extensiontag name 'templatestyles args srcu800 cfgu800u82etemplatestyles .. tostring divu800 done endu800 function pu800u82enavbar frame return pu800u82e_navbar require 'module arguments .getargs frame endu800 return pu800 