Module:Infobox road/sandbox: Difference between revisions

Content deleted Content added
Add browsetable
use sandbox subtemplate
 
(8 intermediate revisions by one other user not shown)
Line 4:
local yesno = require('Module:Yesno')
local langModule = require('Module:Lang')
local routeModule = require("Module:Infobox road/route/sandbox")
local parserModule = require("Module:Road data/parser")
local parser = parserModule.parser
Line 338:
 
--BROWSE LINKS
 
local function browsetable(content)
if not content then return nil end
local tbl = mw.html.create('table'):addClass('browse-table')
tbl:wikitext(content)
return tostring(tbl)
end
 
function p.browsetable(args)
local args = getArgs(frame)
return browsetable(args)
end
 
local function browse(args)
Line 357 ⟶ 345:
local nextRoute = args.next_route
if previousRoute or nextRoute then
local boxModule = require "Module:Road data/browse/sandbox"
local primary = boxModule._browse(args)
returnlocal tblModule = require "Module:Road data/browsetable(primary)"
return tblModule._browsetable(primary)
end
end
Line 369 ⟶ 358:
 
local function extended(args)
local extended = args.browse
if args.nobrowse thenor returnextended == nil endthen
return browsetable(args.browse)
return nil
else
local tblModule = require "Module:Road data/browsetable"
-- Negative margin to counteract infobox border-spacing
return tblModule._browsetable(extended, 'margin-top:-3px')
end
end