Module:Side box/sandbox: Difference between revisions

Content deleted Content added
add templatestyles option
we cookin with plainlist templatestyles now?
 
(2 intermediate revisions by 2 users not shown)
Line 1:
-- This module implements {{side box}}.
 
local yesno = require('Module:Yesno')
 
local p = {}
 
Line 32 ⟶ 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 39 ⟶ 45:
'role',
'labelledby',
-- Classes
'textclass',
 
-- Styles
Line 80 ⟶ 82:
if data.style then
root:cssText(data.style)
end
local frame = mw.getCurrentFrame()
if data.plainlist_templatestyles then
root:wikitext(frame:extensionTag{
name = 'templatestyles', args = { src = data.plainlist_templatestyles }
})
end
 
Line 108 ⟶ 117:
local text = body:newline():tag('div')
text:addClass('side-box-text')
:addClass(data.textclass or 'plainlist')
if data.textstyle then
text:cssText(data.textstyle)
Line 131 ⟶ 140:
 
root:newline()
local frame = mw.getCurrentFrame()
local templatestyles = ''
if data.templatestyles then
Line 138 ⟶ 146:
}
end
return mw.getCurrentFrame()frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Side box/styles.css' }
} .. templatestyles .. tostring(root)