Module:Qud look: Difference between revisions

Rewrite to style look like current ui
Tag: Reverted
m Undo revision 97777 by Teamtoto (talk)
Tag: Undo
Line 22: Line 22:
else
else
linebreaks = false
linebreaks = false
end
--[Determine border color]--
local bordercolorin = frame.args.bordercolor
if bordercolorin == nil then
  bordercolor = ''
elseif bordercolorin == 'c' then
  bordercolor = ''
elseif bordercolorin == 'y' then
  bordercolor='white-border'
else
  error('bordercolor not set to either "c" or "y"',0)
end
end


Line 40: Line 52:
   padding = paddingin
   padding = paddingin
end
end
--[Determine img]--
 
local imgin = frame.args.image
if imgin == nil or imgin == '' then
  img = ''
else
  img = '[[File:' .. imgin .. '|32px]]'
end
--[Determine bottomtext]--
--[Determine bottomtext]--
local bottomin = frame.args.bottomtext
local bottomin = frame.args.bottomtext
if bottomin == nil or bottomin == '' then
if bottomin == nil or bottomin == '' then
   bottomtext = '<span style="color:white;">Perfect</span>'
   bottomtext = 'Perfect'
elseif bottomin == 'none' then
elseif bottomin == 'none' then
   bottomtext = ''
   bottomtext = ''
else
else
   bottomtext = colorparse.parse('&Y'..bottomin, 'notxml')
   bottomtext = bottomin
end
end


Line 61: Line 67:
local textcontent
local textcontent
local parsedbottomtext
local parsedbottomtext
         if titlein == nil or titlein == '' then
         if colorparse.determinexml(titlein) then
        title = ''
            title = colorparse.parse('&amp;y'.. titlein, 'xml')
         else
         else
             title = colorparse.parse('&y'..titlein, 'notxml')
             title = colorparse.parse('&y'..titlein, 'notxml')
Line 70: Line 76:
else
else
             textcontent=colorparse.parse('&y' .. text, 'notxml')
             textcontent=colorparse.parse('&y' .. text, 'notxml')
end
  if colorparse.determinexml(bottomtext) then
            parsedbottomtext=colorparse.parse('&amp;Y'..bottomtext, 'xml')
        else
      parsedbottomtext=colorparse.parse('&Y'..bottomtext, 'notxml')
end
end


Line 77: Line 88:
local html = mw.html.create('div')
local html = mw.html.create('div')
html
html
     :addClass('qud-look-modern-box')
     :addClass('qud-box-wrapper ' .. bordercolor)
     :node(mw.html.create('div')
     :node(mw.html.create('div')
         :addClass('qud-look-modern-title')
         :addClass('qud-box')
        :node(mw.html.create('div')
            :wikitext(img))
     :node(mw.html.create('div')
     :node(mw.html.create('div')
             :wikitext(title)))
             :addClass('qud-box-header')
    if title ~= '' then
            :wikitext('<b>' .. title .. '</b>'))
    html:node(mw.html.create('hr'))
    end
    html
    :node(mw.html.create('div')
        :addClass('qud-look-modern-text')
        :wikitext(qudtext))
    if bottomtext ~= '' then
        html
         :node(mw.html.create('div')
         :node(mw.html.create('div')
             :addClass('qud-look-modern-status')
             :addClass('qud-box-content')
             :wikitext(bottomtext))
            :css({['font-weight']='bold', ['line-height']='1.5em', ['padding']='0em' .. padding .. 'em'})
end
             :wikitext(qudtext))
        :node(mw.html.create('span')
            :addClass('qud-box-footer-left')
            :wikitext(parsedbottomtext)))
 
return tostring(html) .. '\n'
return tostring(html) .. '\n'
end
end


return p
return p