Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Wikipedia ads/navbox
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 displays a navbox of all available Wikipedia ads. It is used in -- [[Template:Wikipedia ads/doc]]. local DATA_MODULE = 'Module:Wikipedia ads/data' local p = {} function p.main() local data = mw.loadData(DATA_MODULE) -- Table root. local root = mw.html.create('table') root :addClass('navbox collapsible collapsed') :css('width', '100%') :css('background', '#f7f8ff') :css('text-align', 'left') :css('border', 'solid 1px #aaaaaa') :css('margin', 0) :tag('tr') :tag('th') :css('background', 'transparent') :css('font-size', '105%;') :css('text-align', 'center;') :css('font-weight', 'bold') :wikitext('[[Template:Wikipedia ads|Wikipedia ads]]: [[Template:Wikipedia ads/navbox|Overview]]') -- Ad table. local adTable = root :tag('tr') :tag('td') :tag('table') :addClass('plainlinks sortable wikitable') :css('width', '100%') :css('text-align', 'left') :css('margin', '0') :css('font-size', '90%') -- Ad table headers. adTable :tag('tr') :tag('th') :css('width', '3em') :wikitext('#') :done() :tag('th') :addClass('unsortable') :wikitext('Image') :done() :tag('th') :wikitext('Page') :done() :tag('th') :wikitext('Author') :done() -- Ads. for i, imageData in ipairs(data.list) do -- Sanity checks. The ID is already checked by the data module. for j, field in ipairs{'image', 'link', 'author'} do assert(imageData[field], string.format( "no '%s' field found in image data with ID '%s'", field, tostring(imageData.id) )) end adTable :tag('tr') :tag('th') :wikitext(imageData.id) :done() :tag('td') :wikitext(string.format( '[[File:%s|140px]]', imageData.image )) :done() :tag('td') :wikitext(string.format('[[%s]]', imageData.link)) :done() :tag('td') :wikitext(imageData.author) 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:Wikipedia ads/navbox/doc
(
edit
)