"Module:Asbox": अवतरणों में अंतर
Content deleted Content added
imported>Codehydro repatch with patched patch; amazing how a single misplaced line can break everything :\ |
imported>Codehydro patch for note param causing gap in firefox; also streamlined asbox further |
||
पंक्ति 223:
function p.main(frame, page)
args, page = p:init(frame, page)
local output = mw.html.create
:tag'table'▼
:css{background = 'transparent'}
▲ :addClass'metadata plainlinks stub'
▲ :node((args.icon or args.image) and
:wikitext(args.icon or ('[[File:%s|%spx|alt=%s]]'):format(
▲ mw.html.create'td'
:tag'
:
:wikitext(▼
▲ Buffer'This':_(args.subject):_(args.article or 'article'):_(args.qualifier)' ',--space
▲ ' is a [[Wikipedia:stub|stub]]. You can help Wikipedia by [',
▲ page:fullUrl('action=edit', 'relative'),
▲ ' expanding it].'
▲ )
:done()▼
:node(args.name and▼
require'Module:Navbar'._navbar{▼
args.name,▼
mini = 'yes',▼
style = 'position: absolute; right: 15px; display: none;'▼
}▼
)
:node(args.note and
'<br />' .. tostring(
mw.html.create'span'
:css{['font-style'] = 'normal', ['font-size'] = 'smaller'}
:wikitext(args.note)
)
)▼
:allDone()
--[[
पंक्ति 274:
--the template but not in the article. The elseif after namespace == 0 means demo cats will never show in article space.
p.demodoc = p.demo ~= 'art' and p.templatepage(frame, page)
output
:node(output)
string.format('<small>Demo categories: %s</small>', category{done = true}),▼
p.demo == 'doc' and p.demodoc or nil▼
▲ string.format('<small>Demo categories: %s</small>', category{done = true}),
▲ )
▲ p.demo == 'doc' and p.demodoc or nil
)
else
--Checks for valid name; emulates original template's check using {{FULLPAGENAME:{{{name|}}}}}
local normalizedName = mw.title.new(args.name or '')
if normalizedName and normalizedName.fullText == page.fullText then
output = mw.html.create():node(output):wikitext(p.templatepage(frame, page))
elseif not page.isSubpage and page.namespace == 10 then-- Template namespace and not a subpage
category{{k = args.name and 'E' or 'W', t = page.text}}
|