Content deleted Content added
. |
max-width |
||
(8 intermediate revisions by the same user not shown) | |||
Line 5:
local textSize = '90%'
local tableClass="infobox"
local
local
local tableStyle="margin-left:auto; margin-right:auto; clear:left; float:left;"
local
local labelStyle = "text-align:right; font-weight: bold;"
local listStyle = "text-align:left; font-weight: normal;"
Line 31 ⟶ 30:
function makeTableRow()
debugLog(2, "makeTableRow")
thisRow = '<tr style="' .. RowStyle .. '">'
thisRow = thisRow .. '<td style="' .. listStyle .. ';"><div class="hlist">\n'
for i = -5, 5 do
thisRow = thisRow .. "* " .. makeCatLink(thisPageDecade + (i * 10)) .. "\n"
end▼
thisRow = thisRow .. '</div></td>\n</tr>\n'
return thisRow
Line 40 ⟶ 42:
function makeTable()
▲end
debugLog(1, "makeTable")
tableRowNum = 0
local myTable = '<table class="' .. tableClass .. '"'
myTable = myTable .. ' style="' .. tableStyle .. '; font-size:' .. textSize .. '; max-width:' ..
myTable = myTable .. makeTableRow("")
myTable = myTable .. "</table>\n"
Line 53 ⟶ 52:
-- Make a piped link to a decade category, if it exists▼
▲-- Make a piped link to a category, if it exists
-- If it doesn't exist, just display the greyed the link title without linking
function makeCatLink(
local decadeFulltext = tostring(math.abs(x)) .. 's'
if
decadeFulltext = decadeFulltext .. " BC"
end
local catname = title_prefix .. decadeFulltext .. title_suffix
local fmtlink
local catPage = mw.title.new( catname, "Category" )
if (catPage.exists) then
fmtlink = "[[:Category:" .. catname .. "|" ..
else
fmtlink = '<span style="color:' .. greyLinkColor .. '">' ..
end
Line 93 ⟶ 90:
function parsePagename(pn)
debugLog(1, "parsePagename: [" .. pn .. "]")
match_prefix, match_decade, match_suffix = mw.ustring.match(pn, "^(.
if match_decade == nil then
match_prefix, match_decade, match_suffix = mw.ustring.match(pn, "^(.
end
if match_decade == nil then
Line 101 ⟶ 98:
return false
end
debugLog(2, 'Split [' .. pn .. ']: /' .. match_prefix .. '/' .. match_decade ..'/' .. match_suffix ..'/')
if (match_prefix ~= nil) and (match_prefix ~= "") then
if (mw.ustring.sub(match_prefix, -1 ) ~= ' ') then
Line 210 ⟶ 208:
debugLog(nil, "Yes, this is a category")
if not parsePagename(thispagename) then
-- some error parsing the title, so don't proceed to output
return publishDebugLog()
end
debugLog(1, "all parse done")
|