Content deleted Content added
No edit summary |
No edit summary |
||
Line 84:
--[[--------------------------< G E T _ D I S P L A Y _ Y E A R >----------------------------------------------
for
TODO: add support for new parameters |lk_pref_y= and |lk_suff_y=?
TODO: share this with yearly calendar header (call from get_year_header())?
]]
Line 93 ⟶ 94:
local year_text = props.year;
if props.lk_y then -- if to be linked
year_text = make_wikilink (props.year);
end
Line 153 ⟶ 154:
local tags = {}; -- table of <tag>...</tag> tag strings
local opt_attr = options.attr or {}; -- if options not supplied, use empty table
local
for i, item in ipairs (items) do
Line 160 ⟶ 161:
:addClass (options.class)
:attr (opt_attr)
:css (
:wikitext (item) -- get a calendar for month number mnum
:done() -- close <td>
Line 356 ⟶ 357:
--[[--------------------------< G E T _ Y E A R _ H E A D E R >------------------------------------------------
create html header for yearly calendar;
]]
local function get_year_header (props)
local css_opts = {};
local header = mw.html.create('tr');▼
if props.hide_year and not props.title then -- for accesibility, when |hide_year=yes
header:tag ('tr')▼
css_opts['display'] = 'none'; -- use css to hide the year header (but not when |title= has a value)
:addClass ('ycalhdr')▼
:tag ('th')▼
:attr ('colspan', props.cols)▼
return tostring (header)▼
end
header
:css(css_opts)
:wikitext (props.title or props.year); -- use get_display_year() so that yearly calendar header can be linked?
end
|