This Lua module is used on many pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them.
localp={}localtypes=mw.loadData("Module:Road data/RJL types")localcolumns={-- Constants for how many columns different list types should have.default=6,-- defaultexit=7,-- default + exit numberold=8,-- default + exit number + old exit number}localfunctionparameterParser(args)localkeysParam=args.keysifnot(keysParam)thenreturn{}endlocalkeys=mw.text.split(keysParam,",")table.sort(keys)returnkeysendlocalfunctioncreateLegend(key,html_object)locallistargs={class='jct-bottom-legend'}for_,vinipairs(key)dolocaltype=types[v]iftypethentable.insert(listargs,'<span class="jct-bottom-legend-color" style="background-color: '..type.color..'"> </span> <span class="nowrap">'..type.jctbtm..'</span>')endendhtml_object:wikitext(require('Module:List').horizontal(listargs))endfunctionp._jctbtm(args)localroot=mw.html.create()localcols=args.colorcolumns[args[1]]orcolumns.defaultrow=root:tag('tr'):tag('td'):attr('colspan',cols):addClass('jct-bottom'):wikitext(mw.getCurrentFrame():extensionTag{name='templatestyles',args={src='Module:Jctbtm/styles.css'}})if(args.convor'yes')=='yes'thenrow:wikitext("1.000 mi = 1.609 km; 1.000 km = 0.621 mi<br>")endlocalkey=parameterParser(args)ifkey[1]thencreateLegend(key,row)endlocalkeyParam=args.keyifkeyParamthen-- This is a deprecated parameterlocalpage=mw.title.getCurrentTitle()localpagename=page.prefixedTextrow:wikitext(string.format("[[Category:Jctbtm temporary tracking category|# %s]]",pagename))endrow:wikitext(args.notesorargs.key)-- If additional notes are provided, display them.if#row.nodes==0thenreturn'|-\n|}'elsereturntostring(root)..'\n|-\n|}'endendfunctionp.jctbtm(frame)returnp._jctbtm(require('Module:Arguments').getArgs(frame))endreturnp