Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Humanipedia
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:LACMTA icon
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
Special pages
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 getArgs = require('Module:Arguments').getArgs local p = {} local function makeInvokeFunction(funcName) -- makes a function that can be returned from #invoke, using -- [[Module:Arguments]]. return function (frame) local args = getArgs(frame, {parentOnly = true}) return p[funcName](args) end end local function colorboxLinked(color,text,link) return '[['..link..'|<span role="img" aria-label="'..text..'" style="border:1px solid darkgray;-ms-user-select:none;-webkit-user-select:none;user-select:none;background-color:'..color..'" title="'..text..'"> </span>]] ' end local function colorboxUnlinked(color) return '<span style="border:1px solid darkgray;-ms-user-select:none;-webkit-user-select:none;user-select:none;background-color:'..color..'"> </span> ' end local t1 = { ['A Line'] = { 'a', 'a line', 'line a', 'blue', 'blue line', icon='img_circle', dab=true, }, ['B Line'] = { 'b', 'b line', 'line b', 'red', 'red line', icon='img_circle', dab=true, }, ['C Line'] = { 'c', 'c line', 'line c', 'green', 'green line', icon='img_circle', dab=true, }, ['D Line'] = { 'd', 'd line', 'line d', 'purple', 'purple line', icon='img_circle', dab=true, }, ['E Line'] = { 'e', 'e line', 'line e', 'expo', 'expo line', icon='img_circle', dab=true, }, ['G Line'] = { 'g', 'g line', 'line g', 'orange', 'orange line', icon='img_square', dab=true, }, ['J Line'] = { 'j', 'j line', 'line j', 'silver', 'silver line', icon='img_square', dab=true, }, ['K Line'] = { 'k', 'k line', 'line k', 'crenshaw', 'crenshaw line', 'crenshaw/lax', 'crenshaw/lax line', icon='img_circle', dab=true, }, ['L Line'] = { 'l', 'l line', 'line l', 'gold', 'gold line', icon='img_circle', dab=true, }, ['Harbor Transitway'] = { 'harbor', 'harbor transitway', color='#B8860B', icon='colorbox', }, ['El Monte Busway'] = { 'el monte', 'el monte busway', color='#B8AD93', icon='colorbox', }, ['Regional Connector'] = { 'regional', 'regional connector', 'regional connector transit corridor', color='#604020', icon='colorbox', }, } p.icon = makeInvokeFunction('_icon') function p._icon(args) local link local code = args[1] or '' local text = args[2] if text then text = '('..text..')' else text = '' end local showtext = args.showtext local alt for k, v in pairs(t1) do for _, name in ipairs(v) do if mw.ustring.lower(code) == name then if v.dab == true then if showtext then link = '' alt = 'alt=' showtext = ' [['..k..' (Los Angeles Metro)|'..k..']]' else link = k..' (Los Angeles Metro)' alt = k showtext = '' end else if showtext then link = '' alt = 'alt=' showtext = '[['..k..']] ' else link = k alt = k showtext = '' end end if v.icon == 'colorbox' then if showtext then return colorboxUnlinked(v.color)..showtext..text else return colorboxLinked(v.color,k,k)..text end elseif v.icon == 'img_circle' then return '[[File:LACMTA Circle '..k..'.svg|'..(args.size or 17)..'px|link='..link..'|'..alt..']]'..showtext..text elseif v.icon == 'img_square' then return '[[File:LACMTA Square '..k..'.svg|'..(args.size or 17)..'px|link='..link..'|'..alt..']]'..showtext..text end end end end return colorboxLinked('#fff',code..' Line',code..' Line (Los Angeles Metro)')..text end return p
Summary:
Please note that all contributions to Humanipedia 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
Humanipedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Sandbox other
(
edit
)
Template:Template link
(
edit
)
Template:Tl
(
edit
)
Module:LACMTA icon/doc
(
edit
)
Module:String
(
edit
)