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:Sandbox/CAPTAIN MEDUSA
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 TableTools = require('Module:TableTools') local messages = mw.loadData('Module:Succession table monarch/messages') local p = {} p.fromArgs = function(argElements) local mainTag = mw.html.create('table') :attr('cellspacing', '0') :css('text-align', 'center') :tag('tr') :tag('th'):cssText('width: 25%; border: solid #aaa; border-width: 1px 1px 1px 1px; background: #B9D1FF; font-size: 105%;'):wikitext(messages.name or 'Name'):done() :tag('th'):cssText('width: 10%; border: solid #aaa; border-width: 1px 1px 1px 0px; background: #B9D1FF; font-size: 105%;'):wikitext(messages.lifespan or 'Lifespan'):done() :tag('th'):cssText('width: 10%; border: solid #aaa; border-width: 1px 1px 1px 0px; background: #B9D1FF; font-size: 105%;'):wikitext(messages.reignStart or 'Reign start'):done() :tag('th'):cssText('width: 10%; border: solid #aaa; border-width: 1px 1px 1px 0px; background: #B9D1FF; font-size: 105%;'):wikitext(messages.reignEnd or 'Reign end'):done() :tag('th'):cssText('width: 25%; border: solid #aaa; border-width: 1px 1px 1px 0px; background: #B9D1FF; font-size: 105%;'):wikitext(messages.notes or 'Notes'):done() :tag('th'):cssText('width: 10%; border: solid #aaa; border-width: 1px 1px 1px 0px; background: #B9D1FF; font-size: 105%;'):wikitext(messages.family or 'Family'):done() :tag('th'):cssText('width: 10%; border: solid #aaa; border-width: 1px 1px 1px 0px; background: #B9D1FF; font-size: 105%;'):wikitext(messages.image or 'Image'):done() :tag('th'):cssText('width: 5%; border: solid #aaa; border-width: 1px 1px 1px 0px; background: #B9D1FF; font-size: 105%;'):wikitext(messages.ref or 'Ref(s)'):done() :done() for _,eachElement in ipairs(argElements) do if eachElement.name then local namePlainList = '' if eachElement.nickname or eachElement.native then namePlainList = mw.getCurrentFrame():expandTemplate{ title = messages.plainlistTemplateName or 'Plainlist', args = {'\n' .. table.concat(TableTools.compressSparseArray({ eachElement.nickname and ('* ' .. tostring(mw.html.create('small'):wikitext("<i>" .. eachElement.nickname .. "</i>"))) or nil, eachElement.native and ('* ' .. eachElement.native) or nil }), '\n')} } end local rowTr = mainTag:tag('tr') rowTr:tag('td') :cssText('border: solid #aaa; border-width: 0px 1px 1px 1px; background: #F0F8FF; vertical-align: middle;') :wikitext(eachElement.name .. namePlainList) :done() :tag('td') :cssText('border: solid #aaa; border-width: 0px 1px 1px 0px; background: white;') :wikitext(eachElement.life) :tag('td') :cssText('border: solid #aaa; border-width: 0px 1px 1px 0px; background: white;') :wikitext(eachElement.reignstart) :tag('td') :cssText('border: solid #aaa; border-width: 0px 1px 1px 0px; background: white;') :wikitext(eachElement.reignend) :tag('td') :cssText('border: solid #aaa; border-width: 0px 1px 1px 0px; background: white;') :wikitext(eachElement.notes) :tag('td') :cssText('border: solid #aaa; border-width: 0px 1px 1px 0px; background: white;') :wikitext(eachElement.family) local imageTd = rowTr :tag('td') :cssText('border: solid #aaa; border-width: 0px 1px 1px 0px; background: white;') if eachElement.image then imageTd:tag('span') :addClass('photo') :wikitext('[[File:' .. eachElement.image .. '|80px|alt=' .. (eachElement.alt or '') .. ']]') :tag('td') :cssText('border: solid #aaa; border-width: 0px 1px 1px 0px; background: white;') :wikitext(eachElement.ref) end end end return tostring(mainTag) end p.fromArray = function(args) local argElements = TableTools.numData(args, true) return p.fromArgs(argElements) end p.fromFrame = function(frame) local args = getArgs(frame) return p.fromArray(args) 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/CAPTAIN MEDUSA/doc
(
edit
)