Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/Szqecs/L-rail/Version 2
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 s = { ['w'] = 'style="width: 30%; ' ,['c'] = 'style="text-align: center; ' ,['br'] = 'border: ' ,['t'] = 'border-top: ' ,['bb'] = 'border-bottom: ' ,['L'] = 'border-left: ' ,['r'] = 'border-right: ' ,['n'] = 'none; ' ,['0'] = '0px none; ' ,['1'] = '1px solid #aaa; ' } local style = { ['table'] = 'align="center" style="margin:0.5em auto; font-size:95% clear:both; ' .. s['t'] .. s['0'] .. 'border-collapse: separate;" cellspacing="0" cellpadding="-1"' ,['header leftcell'] = s['w'] .. s['br'] .. s['1'] .. s['L'] .. s['n'] .. s['bb'] .. s['n'] .. '"| ' ,['header midcell'] = 'colspan="3" style="' .. s['br'] .. s['n'] .. s['t'] .. s['1'] .. '"| ' ,['header rightcell'] = s['w'] .. s['br'] .. s['1'] .. s['r'] .. s['n'] .. s['bb'] .. s['n'] .. '"| ' ,['body leftcell'] = s['c'] .. s['L'] .. s['0'] .. s['bb'] .. s['0'] .. s['r'] .. s['1'] .. s['t'] .. s['1'] .. '"| ' ,['body banner'] = s['c'] .. s['L'] .. s['0'] .. s['bb'] .. s['0'] .. s['r'] .. s['0'] .. s['t'] .. s['1'] .. 'width: 8px; background-color: #' ,['body midcell'] = s['c'] .. s['bb'] .. s['0'] .. '"| ' ,['body rightcell'] = s['c'] .. s['L'] .. s['1'] .. s['bb'] .. s['0'] .. s['r'] .. s['0'] .. s['t'] .. s['1'] .. '"| ' } function p.top() return '{| class="wikitable" ' .. style['table'] end function p.rail(system) return '|-' .. '\n! ' .. style['header leftcell'] .. 'Preceding station' .. '\n! ' .. style['header midcell'] .. system .. '\n! ' .. style['header rightcell'] .. 'Following station' end function p.line(line, color, left, right, leftToward, rightToward) return '|-' .. '\n| ' .. style['body leftcell'] .. left .. leftToward .. '\n| ' .. style['body banner'] .. color .. '" |' .. '\n| ' .. style['body midcell'] .. line .. '\n| ' .. style['body banner'] .. color .. '" |' .. '\n| ' .. style['body rightcell'] .. right .. rightToward end function p.bottom() return '|}' end function p.main(frame) local a = frame.args local d = require('Module:Sandbox/Szqecs/L-rail/' .. a.system) local function link(s1, s2) if s1 and s2 then return '\[\[' .. s1 .. '|' .. s2 .. '\]\]' elseif s1 then return '\[\[' .. s1 .. '\]\]' else return '' end end local function subFormat(s) if s ~= '' then return '<div style="font-size: smaller; font-style: italic;">' .. s .. '</div>' else return '' end end local system = link(d['system']) local line = link(d[a.line]['lines']) local color = d[a.line]['color'] if not left then left = "''Terminus''" else left = link(d[a.line]['stations'][a.left]) end if not right then right = "''Terminus''" else right = link(d[a.line]['stations'][a.right]) end if not a.left then leftToward = '' elseif a.left == d[a.line]['leftToward'] then leftToward = subFormat('Terminus') else leftToward = subFormat('toward ' .. link(d[a.line]['leftTowardLink'], d[a.line]['leftToward'])) end if not a.right then rightToward = '' elseif a.right == d[a.line]['rightToward'] then rightToward = subFormat('Terminus') else rightToward = subFormat('toward ' .. link(d[a.line]['rightTowardLink'], d[a.line]['rightToward'])) end return p.line(line, color, left, right, leftToward, rightToward) -- return line(a.System, a.Line, a.Previous, a.Next, a.Type, a.Type2, a.Note, a.Note2, a.Notemid, a.Oneway2, a.Row1, a.hide) end return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, 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 (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Sandbox/Szqecs/L-rail/Version 2/doc
(
edit
)