Module:Sandbox/User:The Gaffer/Modules/Infobox Switch: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
No edit summary
No edit summary
Line 1: Line 1:
--Attribution: This module was taken from the Runescape wiki - https://runescape.wiki/w/Module:Switch_infobox - See changes there for a list of contributors
--Attribution: This module was taken from the Runescape wiki - https://runescape.wiki/w/Module:Switch_infobox - See changes there for a list of contributors
local p = {}
-- local p = {}
local yesno = require('Module:Yesno')
-- local yesno = require('Module:Yesno')


function p.main(frame)
-- function p.main(frame)
-- return frame:preprocess(tostring(p._main(frame:getParent().args)))
mw.loader.load('ext.gadget.switch-infobox')
-- end
return '<div class="infobox infobox-switch">This content will be switchable.</div>'
--return frame:preprocess(tostring(p._main(frame:getParent().args)))
end


-- function p._main(args)
-- function p._main(args)
Line 67: Line 65:
-- return ret
-- return ret
-- end
-- end

-- return p

local p = {}

function p.infobox(frame)
return [[
<div class="infobox-switch" data-default-index="1">
<table>
<caption>
<div>
<button data-switch-index="1" data-switch-anchor="#view1">Overview</button>
<button data-switch-index="2" data-switch-anchor="#view2">Details</button>
<button data-switch-index="3" data-switch-anchor="#view3">Stats</button>
</div>
</caption>
<tbody>
<tr><td>Name</td><td data-attr-param="name">Default Name</td></tr>
<tr><td>Description</td><td data-attr-param="description">Default Description</td></tr>
<tr><td>Attributes</td><td data-attr-param="attributes">Default Attributes</td></tr>
</tbody>
</table>
</div>
<div class="infobox-switch-resources">
<div data-attr-param="name">
<div data-attr-index="1">View 1 Name</div>
<div data-attr-index="2">View 2 Name</div>
<div data-attr-index="3">View 3 Name</div>
</div>
<div data-attr-param="description">
<div data-attr-index="1">View 1 Description</div>
<div data-attr-index="2">View 2 Description</div>
<div data-attr-index="3">View 3 Description</div>
</div>
<div data-attr-param="attributes">
<div data-attr-index="1"><ul><li>Attribute A (View 1)</li><li>Attribute B (View 1)</li></ul></div>
<div data-attr-index="2"><ul><li>Attribute A (View 2)</li><li>Attribute B (View 2)</li><li>Attribute C (View 2)</li></ul></div>
<div data-attr-index="3"><ul><li>Attribute A (View 3)</li><li>Attribute C (View 3)</li><li>Attribute D (View 3)</li></ul></div>
</div>
</div>
]]
end


return p
return p