FANDOM


--<pre>
local Quote = {}
local getArgs = require('Dev:Arguments').getArgs
 
function Quote.quote(frame) -- Implements {{Quote}}
	local args = getArgs(frame)
	return Quote._quote(args)
end
 
function Quote._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 = args['size'] or args[4] or args['quotewidth'] or args['width'] or '20px'
    local quotemarksize = {
        ["10px"] = "20px",
        ["20px"] = "40px",
        ["30px"] = "60px",
        ["40px"] = "80px",
        ["50px"] = "100px",
        ["60px"] = "120px",
    }
    local t = mw.html.create('table'):attr('align','center')
        :css('border-collapse','collapse'):css('border-style','none'):css('background-color','transparent'):addClass('quote')
        :tag('tr')
        :tag('td'):attr('width','20'):attr('valign','top')
            :css('color','#B2B7F2'):css('font-size',quotemarksize[quotewidth]):css('font-family','serif'):css('font-weight','bold')
            :css('text-align','left'):css('padding','10px 10px')
            :wikitext('“'):done()
        :tag('td'):attr('valign','top'):css('padding','4px 10px'):wikitext(quotetext):done()
        :tag('td'):attr('width','20'):attr('valign','bottom')
            :css('color','#B2B7F2'):css('font-size',quotemarksize[quotewidth]):css('font-family','serif'):css('font-weight','bold')
            :css('text-align','right'):css('padding','10px 10px')
            :wikitext('”'):done()
        :done()
    if (personquoted or quotesource) then 
        local source = '&mdash; '..(personquoted or quotesource)
        if (personquoted and quotesource) then source = '&mdash; '..personquoted..', ' .. quotesource end
        t:tag('tr')
            :tag('td'):wikitext('&nbsp;'):done()
            :tag('td'):attr('valign','top')
            :tag('div'):css('line-height','1em'):css('text-align','right'):tag('cite'):css('font-style','normal'):wikitext(source):done()
            :done()
        :done()
    end
    return tostring(t)
end
 
function Quote.line( frame )
-- implements {{Line}}
end
 
function Quote.dialogue( frame )
-- implements {{Dialogue}}
end
 
return Quote

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.