Module:Clade/hidden explained

local p =

function p.hidden(frame) local id = mw.getCurrentFrame:getParent.args['id'] or "" local mode = mw.getCurrentFrame:getParent.args['mode'] or "right" local expandSymbol = mw.getCurrentFrame:getParent.args['expand-symbol'] or "⊞" local collapseSymbol = mw.getCurrentFrame:getParent.args['collapse-symbol'] or "⊟" local expandText = mw.getCurrentFrame:getParent.args['expand-text'] or "" local collapseText = mw.getCurrentFrame:getParent.args['collapse-text'] or "" local initialStateExpanded = mw.getCurrentFrame:getParent.args['expanded'] or "false" if mw.getCurrentFrame:getParent.args['expand-symbol']

"none" then expandSymbol = expandText else expandSymbol = expandSymbol .. expandText end if mw.getCurrentFrame:getParent.args['collapse-symbol']

"none" then collapseSymbol = collapseText else collapseSymbol = collapseSymbol .. collapseText end -- default is content collapsed local contentState = " mw-collapsed" -- class to collapse content at start local collapseSymbolState = " mw-collapsed" local expandSymbolState = "" if initialStateExpanded

"true" or initialStateExpanded

"yes" then contentState = "" collapseSymbolState = "" expandSymbolState = " mw-collapsed" end -- collapsible element containing the EXPAND SYMBOL and/or text --local expandSymbolString = '' -- mobile exclusion no longer necessary local expandSymbolString = '' .. '

' .. '

' .. '

' .. expandSymbol .. '

' .. '

' -- collapsible element containing the CLADE CONTENT local clade = require('Module:Clade') local contentString = '' .. '

' .. '

' -- don't toggle on the content .. '\n' .. clade.main(frame) -- important to start wikitext tables on new line .. '

' -- collapsible element containing the COLLAPSE SYMBOL and/or text --local collapseSymbolString = '' -- mobile exclusion no longer necessary local collapseSymbolString = '' .. '

' .. '

' .. '

' .. collapseSymbol .. '' .. '

'

local tableStyle = frame.args.style or "" if tableStyle

'' then tableStyle = "" end local cladeString = '

'

return p.templateStyle(frame, "Clade hidden/styles.css") .. cladeStringend

function p.toggle(frame) if 1

2 then return 'some text' end --local toggleSymbol = 'toggle all' local toggleSymbol = mw.getCurrentFrame:getParent.args['button'] or ""

local toggleString = '

' .. toggleSymbol .. '

'

return toggleStringend

-- function p.templateStyle(frame, src) return frame:extensionTag('templatestyles', ,);end

return p