Module:Large category TOC: Difference between revisions

Jump to navigation Jump to search
glad I sandboxed it. we do still want the bold weight here but not necessarily whatever the default for strong is (which may be font-weight: bolder rather than bold)
m (1 revision imported)
(glad I sandboxed it. we do still want the bold weight here but not necessarily whatever the default for strong is (which may be font-weight: bolder rather than bold))
Line 28: Line 28:
:addClass('toc')
:addClass('toc')
-- :attr('id','toc')
-- :attr('id','toc')
:css({ display = 'block !important',
:css({
background = 'WhiteSmoke',
display = 'block',
clear = 'both',
background = 'WhiteSmoke',
width = '98%' })
clear = 'both',
width = '98%'
})


-- Contains "Content: Top 0-9 A - Z"
-- Contains "Content: Top 0-9 A - Z"
local header = toc_frame:tag('div')
local header = toc_frame:tag('div')
:attr('id','toctitle')
:attr('id', 'toctitle')
:attr('class','toctitle')
:attr('class', 'toctitle')
:css('background','WhiteSmoke')
-- Contains all the rest
-- Contains all the rest
local body_wrapper
local body_wrapper
local body = toc_frame:tag('div')
local body = toc_frame:tag('div')
:css('text-align', 'center')
:css('text-align', 'center')
local jumpy_collapse = mw.html.create('div')
:cssText('margin: 0 4em')
if toc_type == 'collapsible' then
if toc_type == 'collapsible' then
toc_frame:addClass('NavFrame')
toc_frame:addClass('mw-collapsible mw-collapsed')
header:addClass('NavHead')
:cssText('padding: 4px; text-align: center; border: 1px solid #a2a9b1; font-size: 95%')
body:addClass('NavContent')
header:cssText('font-weight: bold; line-height: 1.6em')
:css({ background = 'white',
body:addClass('mw-collapsible-content')
display = 'none' })
:css({
background = 'white'
})
elseif toc_type == 'scrollable' then
elseif toc_type == 'scrollable' then
body:css({ ['overflow-x'] = 'scroll',
body:css({ ['overflow-x'] = 'scroll',
Line 56: Line 62:
end
end
local header_content = {'<strong>',toc,':</strong>',
local header_content = {'<span style="font-weight: bold">',toc,':</span>',
' [',pageurl,' Top]',
' [',pageurl,' Top]',
' [',pageurl,'?from=0 0–9]' }
' [',pageurl,'?from=0 0–9]' }
Line 63: Line 69:
table.insert(header_content,string.format(' [%s?from=%s %s]',pageurl,v,v))
table.insert(header_content,string.format(' [%s?from=%s %s]',pageurl,v,v))
end
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 = {}
local body_content = {}
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu