Module:Quote/legacy

--

-- Old code for Module:Quote, kept to maintain backward compatibility.

local p = {} local getArgs = require('Dev:Arguments').getArgs

function p._quote(args) local quotetext = args.quote or args[1] or args.quotetext or '' local personquoted = args.person or args[2] or args.personquoted local quotesource = args[3] or args.quotesource local quotewidth = ({       ['10px'] = '20px',        ['20px'] = '40px',        ['30px'] = '60px',        ['40px'] = '80px',        ['50px'] = '100px',        ['60px'] = '120px',    })[args.size or args[4] or args.quotewidth or args.width or '20px']

local html = mw.html.create('table') :attr('align', 'center') :css('background-color', 'transparent') :css('border-collapse', 'collapse') :css('border-style', 'none') :addClass('quote') :tag('tr') :tag('td') :attr('valign', 'top') :attr('width', '20') :css('color', '#b2b7f2') :css('font-family', 'serif') :css('font-size', quotewidth) :css('font-weight', 'bold') :css('padding', '10px') :css('text-align', 'left') :wikitext('&ldquo;') :done :tag('td') :attr('valign', 'top') :css('padding', '4px 10px') :wikitext(quotetext) :done :tag('td') :attr('valign', 'bottom') :attr('width', '20') :css('color', '#b2b7f2') :css('font-family', 'serif') :css('font-size', quotewidth) :css('font-weight', 'bold') :css('padding', '10px') :css('text-align', 'right') :wikitext('&rdquo;') :done :done

if personquoted or quotesource then local source

if personquoted and quotesource then source = personquoted .. ', ' .. quotesource else source = personquoted or quotesource end

html:tag('tr') :tag('td') :wikitext(' ') :done :tag('td') :attr('valign', 'top') :tag('div') :css('line-height', '1em') :css('text-align', 'right') :tag('cite') :css('font-style', 'normal') :wikitext('&mdash; ' .. source) :done :done :done end

return tostring(html) end

-- Implements function p.quote(frame) return p._quote(getArgs(frame)) end

-- Implements function p.line end

-- Implements function p.dialogue end

return p