Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/Gpmat/test
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 getArgs = require('Module:Arguments').getArgs local colori = { ["1"] = "FFFFBF", ["2"] = "DFDFDF", ["3"] = "FFDF9F", Ret = "EFCFFF", DNQ = "EFCFCF", DNS = "FFFFFF", punti = "DFFFDF", nopunti = "CFCFFF", [0] = "" } local soglia = { [1] = 5, [2] = 6, [3] = 8, [4] = 10 } function p.tabella(frame) local args = getArgs(frame) local count = 0 for _ in pairs(args) do count = count + 1 end local str = "{| class=\"wikitable\" style=\"text-align:center; font-size:85%; width:100%; margin-top:0em; margin-bottom:0em\"\n|-\n" for i=1,count do str = str .. "!" .. args[i] if i~=count then str = str .. "!" end end str = str .. "\n|}" return str end function p.main(frame) local args = getArgs(frame) local res = args[1] local anno = tonumber(args[2]) if res == nil then res = 0 end local res2 = string.gsub(res,"'","") if anno < 1960 then format = 1 elseif anno < 2003 then format = 2 elseif anno < 2010 then format = 3 else format = 4 end if tonumber(res2) ~= nil and tonumber(res2) > 3 then if tonumber(res2) < soglia[format]+1 then res2 = "punti" else res2 = "nopunti" end end local colore = colori[res2] if colore == nil then colore = "" end return "style=\"padding-left:0px;padding-right:0px;background-color:#" .. colore .. "\"" end function p.render(frame) local args = getArgs(frame) local res = args[1] local apici = args[2] if apici == "PG" or apici == "GV" then res = "''" .. res .. "''" end if apici == "PG" or apici == "PP" then res = "'''" .. res .. "'''" end return res end function p.pippo(frame) local div = mw.html.create( 'td' ) div :attr( 'id', 'testdiv' ) :css( 'width', '100%' ) :wikitext( 'Some text' ) return tostring( div ) 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/Gpmat/test/doc
(
edit
)