Content deleted Content added
add aria support |
we cookin with plainlist templatestyles now? |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1:
local yesno = require('Module:Yesno')
local p = {}
Line 18 ⟶ 15:
table.insert(data.classes, 'side-box-right')
end
if args.collapsible then
table.insert(data.classes, 'mw-collapsible')
if args.collapsible == "collapsed" then
table.insert(data.classes, 'mw-collapsed')
end
data.collapsible = true
end
table.insert(data.classes, args.class)
Line 23 ⟶ 29:
if args.image and args.image ~= 'none' then
data.image = args.image
end
-- we have to check to see if a downstream use has plainlist like
-- Template:Sister_project. also it's the default. wikitext is :(
if args.textclass == 'plainlist' or not args.textclass then
data.textclass = 'plainlist'
data.plainlist_templatestyles = 'Plainlist/styles.css'
else
data.textclass = args.textclass
end
Line 30 ⟶ 45:
'role',
'labelledby',
-- Styles
'style',
'textstyle',
'templatestyles',
-- Above row
Line 69 ⟶ 82:
if data.style then
root:cssText(data.style)
end
if data.plainlist_templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles', args = { src = data.plainlist_templatestyles }
})
end
Line 86 ⟶ 106:
-- The body row
local body = root:newline():tag('div')
body:addClass('side-box-flex' :addClass(data.collapsible and 'mw-collapsible-content')
:newline()
if data.image then
body:tag('div')
Line 94 ⟶ 117:
local text = body:newline():tag('div')
text:addClass('side-box-text')
:addClass(data.textclass
if data.textstyle then
text:cssText(data.textstyle)
Line 117 ⟶ 140:
root:newline()
local templatestyles = ''
▲ return mw.getCurrentFrame():extensionTag{
if data.templatestyles then
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = data.templatestyles }
▲ }
end
return frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Side box/styles.css' }
} .. templatestyles .. tostring(root)
end
|