Fandom

Czech Star Wars Wiki

Modul:CitaceInsider

3 483stránek na
této wiki
Add New Page
Diskuse0
-- This module implements [[Template:InsiderCite]].
 
local p = {}
 
function p._main(args)
	-- Define defaults
	local image = 'SWInsider.png'
	local publication = 'Star Wars Insider'
	local defaultIssue = '{{{1}}}'
 
	-- Find optional values, and override defaults if necessary
	local size, page, display, issue, extra
	size = 'x14px'
	if args[1]
		and (
			args[1]:find('^Special%s')
			or args[1]:find('^Best%s') 
			or args[1]:find('^Digital%s')
		)
	then
		if args[2] then
			page = args[2]
			display = args[3] or args[2]
		end
		issue = args[1] or defaultIssue
	elseif args.issue1 then
		if args[1] then
			page = args[1]
			display = args[2] or args[1]
		end
		issue = args.issue1
		local issue2 = args.issue2 or '{{{issue2}}}'
		extra = string.format(
			'–[[%s %s|%s]]',
			publication, issue2, issue2
		)
	elseif tonumber(args[1]) and tonumber(args[1]) <= 22 then
		image = 'LFCMlogo.jpg'
		publication = 'The Lucasfilm Fan Club Magazine'
		size = '35px'
		if args[2] then
			page = args[2]
			display = args[3] or args[2]
		end
		issue = args[1] or defaultIssue
	else
		if args[2] then
			page = args[2]
			display = args[3] or args[2]
		end
		issue = args[1] or defaultIssue
	end
 
	-- Make the file link
	local fileLink = string.format(
		'[[File:%s%s|link=Star Wars Insider]]',
		image,
		size and '|' .. size or ''
	)
 
	-- Make the story link
	local storyLink
	if page and display then
		storyLink = string.format("\"''[[%s|%s]]''\"&mdash;", page, display)
	else
		storyLink = ''
	end
 
	-- Make the issue link
	local issueLink = string.format(
		"[[%s %s|''%s'' %s]]",
		publication, issue, publication, issue
	)
 
	-- Make the final output.
	extra = extra or ''
	return fileLink .. ' ' .. storyLink .. issueLink .. extra
end
 
function p.main(frame)
	local args = {}
	for k, v in pairs(frame:getParent().args) do
		v = v:match('^%s*(.-)%s*$') -- trim whitespace
		if v ~= '' then
			args[k] = v
		end
	end
	return p._main(args)
end
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

V síti Wikia

Náhodná Wiki