Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Home
Random page
Pages on topics near you
Recent changes
Special pages
Search
Search
Appearance
Create account
Log in
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Editing
Module
:
Road data/browse
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} local format = mw.ustring.format local roadDataModule = require("Module:Road data") local function routeText(route) local shieldText = roadDataModule.shield(route, nil, nil, nil, true) local linkText = roadDataModule.link(route) local result = mw.html.create("span"):css({display = "inline-block"}) result:wikitext(shieldText .. ' ' .. linkText) return tostring(result) end local function previousRoute(route) local cell = mw.html.create('td'):css({ ["text-align"] = "left" }) if not route.type or route.type == '' then cell:wikitext(" ") else cell:wikitext("β " .. routeText(route)) end return cell end local function nextRoute(route) local cell = mw.html.create('td'):css({ direction = "rtl", ["text-align"] = "right" }) if not route.type or route.type == '' then cell:wikitext(" ") else cell:wikitext("β " .. routeText(route)) end return cell end function p._browse(route) local country = route.country local state = route.state or route.province local county = route.county local previousData = { country = country, state = state, county = county, type = route.previous_type, route = route.previous_route, dab = route.previous_dab } local nextData = { country = country, state = state, county = county, type = route.next_type, route = route.next_route, dab = route.next_dab } local previousRoute = previousRoute(previousData) local nextRoute = nextRoute(nextData) if previousData.typeerror or nextData.typeerror then route.typeerror = true end local centerRoute = mw.html.create('td'):css({ ["text-align"] = "center", ["white-space"] = "nowrap", ["padding-left"] = "3px", ["padding-right"] = "3px" }) local route = route.browse_route if route then centerRoute:css("padding-left", "6px") centerRoute:css("padding-right", "6px") centerRoute:wikitext(format("'''%s'''", route)) end local browseRow = mw.html.create('tr') browseRow:node(previousRoute):node(centerRoute):node(nextRoute) return tostring(browseRow) end function p.browse(frame) -- Import module function to work with passed arguments local getArgs = require('Module:Arguments').getArgs local args = getArgs(frame) args.browse_route = args.route return p._browse(args) end return p
Summary:
Please note that all contributions to Wikifacta are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 International License. A few of Wikifacta's pages are from Wikipedia.org's Mainspace and Draftspace. (see
Wikifacta:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Page included on this page:
Module:Road data/browse/doc
(
edit
)
Search
Search
Editing
Module
:
Road data/browse
Add topic