模块:Countdown:修订间差异

无编辑摘要
无编辑摘要
 
(未显示同一用户的2个中间版本)
第6行: 第6行:


local function formatMessage(secondsLeft, event, color)
local function formatMessage(secondsLeft, event, color)
local timeLeft = lang:formatDuration(secondsLeft, {'years', 'weeks', 'days', 'hours', 'minutes', 'seconds'})
local timeLeft = lang:formatDuration(secondsLeft, {'years', 'days', 'hours', 'minutes'})


-- Color and bold the numbers, because it makes them look important.
-- Color and bold the numbers, because it makes them look important.
timeLeft = string.gsub(timeLeft, '(%d+)', '<span >%1 </span>')
timeLeft = string.gsub(timeLeft, '(%d+)', '<span> %1</span>')
return string.format('%s', timeLeft)
return string.format('<span style="font-weight: bold;">%s</span>', timeLeft)
end
end


第51行: 第51行:
text = args.eventstart or ((lang:ucfirst(args.event or '事件')) .. ' 已开始。')
text = args.eventstart or ((lang:ucfirst(args.event or '事件')) .. ' 已开始。')
end
end
local refreshLink
return text
if args.refresh == 'no' then
refreshLink = ''
else
refreshLink = mw.title.getCurrentTitle():fullUrl({action = 'purge'})
refreshLink = string.format(' <small><span class="plainlinks">([%s 刷新])</span></small>', refreshLink)
end
return text .. refreshLink
end
end


return p
return p