Fortnite Esports Wiki

Power Rankings of Brazil and Oceania at the moment are not updated to the last two competitive seasons, so the current positions of the players are not 100% accurate.

READ MORE

Fortnite Esports Wiki
Advertisement

To edit the documentation or categories for this module, click here.


local util_args = require('Module:ArgsUtil')
local util_title = require('Module:TitleUtil')
local util_vars = require('Module:VarsUtil')
local util_text = require('Module:TextUtil')

local TabsAbstract = require('Module:TabsAbstract')

local Tabs = TabsAbstract:extends()
local TabsFromLua = Tabs:extends()
local p = {}

function p.fromArgs(frame)
	local args = util_args.merge()
	return Tabs():run(args)
end

function p.fromTables(names, links, This)
	return TabsFromLua():run(links, names, This)
end

function Tabs:init()
	self.tabClass = 'tabheader-tab'
	self.contentClass = 'tabheader-content'
	self.activeClass = 'tabheader-active'
	self.outerClass = 'tabheader-top'
end

function Tabs:printOneTab(output, tabDisplay)
	local tab = output:tag('div')
		:addClass(self.tabClass)
	tab:tag('div')
		:addClass(self.contentClass)
		:wikitext(tabDisplay)
	return tab
end

function TabsFromLua:run(links, names, This)
	self.title = mw.title.getCurrentTitle().prefixedText
	self.This = This
	self.links = self:getLinksFromTables(links, names)
	self:setThisVar()
	return self:makeOutput()
end

function TabsFromLua:getLinksFromTables(links, names)
	local ret = {}
	for i, link in ipairs(links) do
		ret[#ret+1] = {
			link = link,
			name = names[i]
		}
	end
	return ret
end

return p
Advertisement