Module:User:Litzsch/Sandbox

local p = {}

local util = require 'libraryUtil' local checkType = util.checkType local checkTypeMulti = util.checkTypeMulti

local metatable = {} local methodtable = {}

metatable.__index = methodtable

function p.create local tabber = {} setmetatable( tabber, metatable )

tabber.tabs = {}

return tabber end

function methodtable.addTab( t, page, options ) checkType( 'addTab', 1, page, 'string' ) checkType( 'addTab', 2, title, 'table', true ) local options = options or {} t.tabs[#t.tabs+1] = { page = page, title = ( options.title or page ), class = ( options.class or 'page-tabber-tab' ), } if options.active then t.activeTab = #t.tabs end return t end

function methodtable.removeTab( t, index ) checkType( 'removeTab', 1, index, 'number' ) t.tabs[index] = nil return t end

return p