Module:Lyrics: Difference between revisions
no hover for songs without translations
PetraMagna (talk | contribs) mNo edit summary |
PetraMagna (talk | contribs) (no hover for songs without translations) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 36:
:css('width', args.width)
:cssText(args.containerstyle or '')
local hover = args.hover or (translated == '' and "false" or "true")
if hover == "true" then
hover = true
html:addClass("Lyrics-hover")
end
if ((args['hasRuby'] or '') ~= '') or (not args.colorsMode and (args.original or ''):find('<ruby')) then
Line 79 ⟶ 85:
local len = math.max(#orig, #tran)
for i=1, len do
local line_original = orig[i] or ''
local line = mw.html.create('div'):addClass('Lyrics-line')
:tag('div')
:addClass('Lyrics-original')
:cssText(lstyle)
:node(lang.wrap(
:done()
if hastran then
local line_translation = tran[i] or ''
line:tag('div')
:addClass('Lyrics-translated')
:cssText(rstyle)
:node(lang.wrap(
:done()
if (hover and line_original == '' and line_translation == '') or string.find(line_translation, "#NoHover") then
line:addClass('Lyrics-line-nohover')
end
end
table.insert(lines, tostring(line))
|