Module:Lyrics: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
mNo edit summary
(add hover support)
Line 36: Line 36:
:css('width', args.width)
:css('width', args.width)
:cssText(args.containerstyle or '')
:cssText(args.containerstyle or '')
local hover = args.hover 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
if ((args['hasRuby'] or '') ~= '') or (not args.colorsMode and (args.original or ''):find('<ruby')) then
Line 86: Line 92:
:done()
:done()
if hastran then
if hastran then
local line_translation = tran[i] or ''
line:tag('div')
line:tag('div')
:addClass('Lyrics-translated')
:addClass('Lyrics-translated')
:cssText(rstyle)
:cssText(rstyle)
:node(lang.wrap(tran[i] or '', rlang))
:node(lang.wrap(line_translation, rlang))
:done()
:done()
if hover and string.find(line_translation, "#NoHover") then
line:addClass('Lyrics-line-nohover')
end
end
end
table.insert(lines, tostring(line))
table.insert(lines, tostring(line))