Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Bumps chart
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!
-- -- This module implements [[Template:Bumps chart]] -- which was originally created by [[User:Richard B]] -- local p = {} function p.chart(frame) local args = frame:getParent().args -- compute the number of images plus 1 local cellcount = 0 for k, v in pairs( args ) do if type( k ) == 'number' then cellcount = math.max(cellcount, k) args[k] = mw.ustring.gsub( args[k], '^%s*(.-)%s*$', '%1' ) end end -- compute the number of rows local rows = math.ceil((cellcount - 1) / 4) -- size is stored in 4*rows + 1 local size = mw.ustring.match(args[4*rows+1] or '', '[%d]+' ) or '28' -- create the root table local root = mw.html.create('table') root :css('border-collapse', 'collapse') :attr('cellspacing', '0') :attr('cellpadding', '0') -- add the rows for i=1,rows do local row = root:tag('tr') for k=1,4 do row:tag('td') :wikitext('[[File:bumps_' .. (args[4*(i-1)+k] or '') .. '.svg|' .. size .. 'px]]') end end return tostring(root) 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)
Templates used on this page:
Template:Tl
(
edit
)
Module:Bumps chart/doc
(
edit
)