This is an old revision of this page, as edited by Izno(talk | contribs) at 15:55, 4 October 2021(sync from sandbox). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.Revision as of 15:55, 4 October 2021 by Izno(talk | contribs)(sync from sandbox)
This module is rated as beta, and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected.
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing.
This module depends on the following other modules:
localp={}localtypes=mw.loadData("Module:Road data/RJL types")localrowlocalfunctionparameterParser(args)localkeysParam=args.keysifnot(keysParam)thenreturn{}endlocalkeys=mw.text.split(keysParam,",")table.sort(keys)returnkeysendlocalfunctioncreateLegend(key)locallegend=row:tag('div'):addClass('routelist-bottom-legend hlist'):tag('ul')fork,vinipairs(key)dolocaltype=types[v]iftypethenlegend:tag('li'):tag('span'):css('background-color',type.color):wikitext(" "):done():wikitext(" "):wikitext(type.routelist)endendendfunctionp._bottom(args)localroot=mw.html.create('tr'):addClass('sortbottom')row=root:tag('td')row:attr('colspan','9'):addClass('routelist-bottom')-- we would prefer to add the TemplateStyles before the class is declared-- but that's not really feasible in this particular table context:wikitext(mw.getCurrentFrame():extensionTag{name='templatestyles',args={src='Module:Routelist bottom/styles.css'}})localconversionif(args.convor'no')=='yes'thenconversion="1.000 mi = 1.609 km; 1.000 km = 0.621 mi<br>"endrow:wikitext(conversion)localkey=parameterParser(args)ifkey[1]thencreateLegend(key)endif#row.nodes==0thenreturn'|-\n|}'elsereturntostring(root)..'\n|-\n|}'endendfunctionp.bottom(frame)returnp._bottom(require('Module:Arguments').getArgs(frame))endreturnp