Module:Large category TOC: Difference between revisions

m
1 revision imported
m (Protected "Module:Large category TOC": Highly visible template ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite)))
 
m (1 revision imported)
 
(2 intermediate revisions by 2 users not shown)
Line 28:
:addClass('toc')
-- :attr('id','toc')
:css({ display = 'block !important',
backgrounddisplay = 'WhiteSmokeblock',
clearbackground = 'bothWhiteSmoke',
widthclear = '98%both' }),
displaywidth = 'none98%' })
})
 
-- Contains "Content: Top 0-9 A - Z"
local header = toc_frame:tag('div')
:attr('id', 'toctitle')
:cssattr('backgroundclass', 'WhiteSmoketoctitle')
-- Contains all the rest
local body_wrapper
local body = toc_frame:tag('div')
:css('text-align', 'center')
local jumpy_collapse = mw.html.create('div')
:cssText('margin: 0 4em')
if toc_type == 'collapsible' then
toc_frame:addClass('NavFramemw-collapsible mw-collapsed')
:cssText('padding: 4px; text-align: center; border: 1px solid #a2a9b1; font-size: 95%')
header:addClass('NavHead')
header:cssText('font-weight: bold; line-height: 1.6em')
body:addClass('NavContentmw-collapsible-content')
:css({ background = 'white',
:css({
display = 'none' })
:css({ background = 'white',
})
elseif toc_type == 'scrollable' then
body:css({ ['overflow-x'] = 'scroll',
Line 55 ⟶ 62:
end
local header_content = {'<strongspan style="font-weight: bold">',toc,':</strongspan>',
' [',pageurl,' Top]',
' [',pageurl,'?from=0 0–9]' }
Line 62 ⟶ 69:
table.insert(header_content,string.format(' [%s?from=%s %s]',pageurl,v,v))
end
header:wikitext(table.concat(header_content))
if toc_type == 'collapsible' then
jumpy_collapse:wikitext(table.concat(header_content))
header:node(jumpy_collapse)
else
header:wikitext(table.concat(header_content))
end
local body_content = {}