<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Modul:Jcon - Oʻzgarishlar tarixi</title>
		<link>https://ziyosfera.uz/index.php?title=Modul:Jcon&amp;action=history</link>
		<description>Ziyosferadagi mazkur sahifaning oʻzgarishlar tarixi</description>
		<language>uz</language>
		<generator>MediaWiki 1.45.1</generator>
		<lastBuildDate>Wed, 18 Nov 2026 14:05:38 GMT</lastBuildDate>
		<item>
			<title>Admin 11:17, 2026-yil 26-avgust da</title>
			<link>https://ziyosfera.uz/index.php?title=Modul:Jcon&amp;diff=1005895&amp;oldid=prev</link>
			<guid isPermaLink="false">https://ziyosfera.uz/index.php?title=Modul:Jcon&amp;diff=1005895&amp;oldid=prev</guid>
			<description>&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Yangi sahifa&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require(&amp;#039;strict&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
local yesno = require(&amp;#039;Module:Yesno&amp;#039;)&lt;br /&gt;
local parser = require(&amp;#039;Module:Road data/parser&amp;#039;).parser&lt;br /&gt;
&lt;br /&gt;
local dataModuleName = &amp;#039;Module:Jcon/data&amp;#039;&lt;br /&gt;
local data = mw.loadData(dataModuleName)&lt;br /&gt;
&lt;br /&gt;
-- Normalize the given road type&lt;br /&gt;
local function normalizeType(roadType)&lt;br /&gt;
	roadType = (roadType or &amp;#039;&amp;#039;):lower() -- Make the road type lowercase&lt;br /&gt;
&lt;br /&gt;
	for index, placeType in ipairs(data._placeTypes) do&lt;br /&gt;
		roadType = roadType -- Remove the place types from the road type&lt;br /&gt;
			:gsub(&amp;#039;^&amp;#039; .. placeType .. &amp;#039; of &amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
			:gsub(&amp;#039; &amp;#039; .. placeType .. &amp;#039;$&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
			:gsub(&amp;#039; &amp;#039; .. placeType .. &amp;#039; road$&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return roadType&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Generate wikitext to show an icon&lt;br /&gt;
local function showFile(fileName, args, sign)&lt;br /&gt;
	local size = args.size or &amp;#039;20px&amp;#039; -- Image size&lt;br /&gt;
	&lt;br /&gt;
	if sign then&lt;br /&gt;
		fileName = data._signs[fileName] -- Get the file name from the sign definition&lt;br /&gt;
	else&lt;br /&gt;
		local titleObj = mw.title.new(&amp;#039;File:&amp;#039; .. fileName)&lt;br /&gt;
		&lt;br /&gt;
		if not titleObj or not titleObj.file.exists then&lt;br /&gt;
			return &amp;#039;&amp;#039; -- Return nothing if no existing file was found&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return &amp;#039;[[File:&amp;#039; .. fileName .. &amp;#039;|alt=|link=|&amp;#039; .. size .. &amp;#039;]]&amp;#039; -- Return the file wikitext&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Get the first defined shield from a table&lt;br /&gt;
local function getShield(parserArgs, shield, to)&lt;br /&gt;
	-- Shield format for &amp;quot;to&amp;quot; routes&lt;br /&gt;
	if to and shield then&lt;br /&gt;
		local res = parser(parserArgs, &amp;#039;shieldtomain&amp;#039;, nil, dataModuleName)&lt;br /&gt;
		if res then return res end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Guide format for &amp;quot;to&amp;quot; routes&lt;br /&gt;
	if to then&lt;br /&gt;
		local res = parser(parserArgs, &amp;#039;shieldto&amp;#039;, nil, dataModuleName)&lt;br /&gt;
		if res then return res end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Shield format (used as reassurance marker)&lt;br /&gt;
	if shield then&lt;br /&gt;
		local res = parser(parserArgs, &amp;#039;shieldlist&amp;#039;, nil, dataModuleName)&lt;br /&gt;
		if res then return res end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Guide format (used on guide signs)&lt;br /&gt;
	local res = parser(parserArgs, &amp;#039;shield&amp;#039;, nil, dataModuleName)&lt;br /&gt;
	if res then return res end&lt;br /&gt;
	&lt;br /&gt;
	return &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Generate the wikitext for the shield&lt;br /&gt;
local function shieldWikitext(parserArgs, args, prefix)&lt;br /&gt;
	local shield = getShield(parserArgs, yesno(args.shield), prefix == &amp;#039;to&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	if type(shield) == &amp;#039;table&amp;#039; then&lt;br /&gt;
		local out = {}&lt;br /&gt;
		&lt;br /&gt;
		for i, single in ipairs(shield) do&lt;br /&gt;
			table.insert(out, showFile(single, args))&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		return table.concat(out, &amp;#039; &amp;#039;) -- Add a space between multiple shields&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return showFile(shield, args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Display a link, accounting for presentation arguments&lt;br /&gt;
local function displayLink(link, display, args, followNoLink, noSelfRedirect)&lt;br /&gt;
	local titleObj = mw.title.new(link)&lt;br /&gt;
	local noLink = followNoLink and yesno(args.nolink)&lt;br /&gt;
	local showRed = yesno(args.showred)&lt;br /&gt;
	&lt;br /&gt;
	if&lt;br /&gt;
		(not noLink)&lt;br /&gt;
			and (showRed or (titleObj and titleObj.exists))&lt;br /&gt;
			and not (noSelfRedirect and titleObj and titleObj.redirectTarget == mw.title.getCurrentTitle())&lt;br /&gt;
	then&lt;br /&gt;
		return &amp;#039;[[&amp;#039; .. link .. &amp;#039;|&amp;#039; .. display .. &amp;#039;]]&amp;#039; -- Return the link&lt;br /&gt;
	else&lt;br /&gt;
		return display -- Fallback to returning the display text&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Generate the text part of the output&lt;br /&gt;
local function getText(parserArgs, args, noSelfRedirect)&lt;br /&gt;
	local link = parser(parserArgs, &amp;#039;link&amp;#039;, nil, dataModuleName)&lt;br /&gt;
	&lt;br /&gt;
	local display = &amp;#039;&amp;#039;&lt;br /&gt;
	if yesno(args.fulltext) then&lt;br /&gt;
		-- Display the full link title when requested&lt;br /&gt;
		display = parser(parserArgs, &amp;#039;name&amp;#039;, nil, dataModuleName)&lt;br /&gt;
	else&lt;br /&gt;
		display = parser(parserArgs, &amp;#039;abbr&amp;#039;, nil, dataModuleName)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return displayLink(link, display, args, true, noSelfRedirect)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Gets the wikitext link for a place&lt;br /&gt;
local function getPlace(place, args)&lt;br /&gt;
	return displayLink(place .. &amp;#039;, Ontario&amp;#039;, place, args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Process routes present in the provided arguments&lt;br /&gt;
local function processRoutes(roadType, showShield, showText, args, prefix, name)&lt;br /&gt;
	local shield = &amp;#039;&amp;#039; -- Generated shield wikitext&lt;br /&gt;
	local text = &amp;#039;&amp;#039; -- Generated text/link wikitext&lt;br /&gt;
	&lt;br /&gt;
	local conNumber = prefix ~= &amp;#039;con&amp;#039; and 1 or 0 -- The number of the entry being processed&lt;br /&gt;
	local paramName = prefix ~= &amp;#039;con&amp;#039; and prefix or 2 -- Route number parameter name&lt;br /&gt;
	local typeParam = prefix ~= &amp;#039;con&amp;#039; and  prefix .. &amp;#039;type&amp;#039; or nil -- Road type override parameter name&lt;br /&gt;
	local dirParam =  prefix ~= &amp;#039;con&amp;#039; and prefix .. &amp;#039;dir&amp;#039; or &amp;#039;dir&amp;#039; -- Direction parameter name&lt;br /&gt;
&lt;br /&gt;
	while args[paramName] do&lt;br /&gt;
		local routeRoadType = roadType -- Local copy of the road info&lt;br /&gt;
		&lt;br /&gt;
		if typeParam and args[typeParam] then&lt;br /&gt;
			-- Override the road info if one is provided&lt;br /&gt;
			routeRoadType = normalizeType(args[typeParam])&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- Arguments for the road data parser&lt;br /&gt;
		local parserArgs = {&lt;br /&gt;
			ignoreifexists = true,&lt;br /&gt;
			country = &amp;#039;CAN&amp;#039;,&lt;br /&gt;
			province = &amp;#039;ON&amp;#039;,&lt;br /&gt;
			type = routeRoadType,&lt;br /&gt;
			route = args[paramName]&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		if showShield then&lt;br /&gt;
			local routeShield = shieldWikitext(parserArgs, args, prefix) -- Generate route shield&lt;br /&gt;
			&lt;br /&gt;
			if routeShield ~= &amp;#039;&amp;#039; then&lt;br /&gt;
				if shield ~= &amp;#039;&amp;#039; then shield = shield .. &amp;#039; &amp;#039; end -- Add space after existing shields&lt;br /&gt;
				shield = shield .. routeShield -- Add the shield&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if showText then&lt;br /&gt;
			local routeText = getText(parserArgs, args) -- Generate route text&lt;br /&gt;
			&lt;br /&gt;
			if routeText ~= &amp;#039;&amp;#039; then&lt;br /&gt;
				if text ~= &amp;#039;&amp;#039; then text = text .. &amp;#039;&amp;amp;nbsp;/ &amp;#039; end -- Add &amp;quot; / &amp;quot; after existing text&lt;br /&gt;
				text = text .. routeText -- Add route text&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if args[dirParam] then&lt;br /&gt;
			text = text .. &amp;#039; &amp;#039; .. args[dirParam] -- Add the direction&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		conNumber = conNumber + 1 -- Move on to the next concurrency&lt;br /&gt;
		local suffix = conNumber == 1 and &amp;#039;&amp;#039; or conNumber -- Calculate the next parameter suffix&lt;br /&gt;
&lt;br /&gt;
		-- Update the parameter names&lt;br /&gt;
		paramName = prefix .. suffix&lt;br /&gt;
		typeParam = prefix .. &amp;#039;type&amp;#039; .. suffix&lt;br /&gt;
		dirParam = prefix .. &amp;#039;dir&amp;#039; .. suffix&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if name and yesno(args.namefirst) then&lt;br /&gt;
		text = name .. &amp;#039; (&amp;#039; .. text .. &amp;#039;)&amp;#039; -- Output name before text when namefirst is set to yes&lt;br /&gt;
	elseif name then&lt;br /&gt;
		text = text .. &amp;#039; (&amp;#039; .. name .. &amp;#039;)&amp;#039; -- Add the name to the produced text&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return shield, text -- Return generated shield and text wikitext&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Entry function for {{jcon}}&lt;br /&gt;
function p.jcon(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
&lt;br /&gt;
	if yesno(args.ot) then&lt;br /&gt;
		-- Set correct arguments if output should be only text&lt;br /&gt;
		args.nosh = &amp;#039;yes&amp;#039;&lt;br /&gt;
		args.nolink = &amp;#039;yes&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local roadType = normalizeType(args[1]) -- The first road type&lt;br /&gt;
	local showShield = not yesno(args.nosh)&lt;br /&gt;
	local showText = not yesno(args.notext)&lt;br /&gt;
	local shieldAfter = yesno(args.picaft or args[&amp;#039;pic aft&amp;#039;])&lt;br /&gt;
	&lt;br /&gt;
	local shield = nil -- Generated shield wikitext&lt;br /&gt;
	local text = nil -- Generated text/name wikitext&lt;br /&gt;
	&lt;br /&gt;
	if data._signs[roadType] then&lt;br /&gt;
		-- Handle MTO signs&lt;br /&gt;
		shield = showFile(roadType, args, true)&lt;br /&gt;
		text = args[2] or &amp;#039;&amp;#039;&lt;br /&gt;
	elseif data[roadType] then&lt;br /&gt;
		-- Handle numbered roads&lt;br /&gt;
		shield, text = processRoutes(roadType, showShield, showText, args, &amp;#039;con&amp;#039;, args[3])&lt;br /&gt;
		&lt;br /&gt;
		-- Handle to and via parameters&lt;br /&gt;
		local toShield, toText = processRoutes(roadType, showShield, showText, args, &amp;#039;to&amp;#039;, args.toname)&lt;br /&gt;
		local viaShield, viaText = processRoutes(roadType, showShield, showText, args, &amp;#039;via&amp;#039;, args.vianame)&lt;br /&gt;
		&lt;br /&gt;
		if toShield ~= &amp;#039;&amp;#039; then&lt;br /&gt;
			shield = shield .. (shield == &amp;#039;&amp;#039; and &amp;#039;&amp;#039; or &amp;#039; &amp;#039;) .. toShield -- Add to shields to output&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if toText ~= &amp;#039;&amp;#039; then&lt;br /&gt;
			text = text .. (text == &amp;#039;&amp;#039; and &amp;#039;To &amp;#039; or &amp;#039; to &amp;#039;) .. toText -- Add to text&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if viaShield ~= &amp;#039;&amp;#039; then&lt;br /&gt;
			-- Add via shields to the output&lt;br /&gt;
			shield = shield .. (shield == &amp;#039;&amp;#039; and &amp;#039;&amp;#039; or &amp;#039; &amp;lt;span style=&amp;quot;vertical-align:middle;&amp;quot;&amp;gt;Via&amp;lt;/span&amp;gt; &amp;#039;) .. viaShield&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if viaText ~= &amp;#039;&amp;#039; then&lt;br /&gt;
			-- Add via text to the output&lt;br /&gt;
			text = text .. (text == &amp;#039;&amp;#039; and &amp;#039;Via &amp;#039; or &amp;#039; via &amp;#039;) .. viaText&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;amp;#8203;&amp;#039; -- Return ZWSP if road type is not supported&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if args.sign and showShield then&lt;br /&gt;
		if shield ~= &amp;#039;&amp;#039; then shield = shield .. &amp;#039; &amp;#039; end -- Add space after existing shields&lt;br /&gt;
		-- Add the MTO sign if provided&lt;br /&gt;
		shield = shield .. showFile(args.sign, args, true)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if yesno(args.tch) then&lt;br /&gt;
		if showShield then&lt;br /&gt;
			if shield ~= &amp;#039;&amp;#039; then shield = shield .. &amp;#039; &amp;#039; end -- Add space after existing shields&lt;br /&gt;
			shield = shield .. showFile(&amp;#039;tch&amp;#039;, args, true) -- Add the TCH shield&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if showText then&lt;br /&gt;
			if text ~= &amp;#039;&amp;#039; then text = text .. &amp;#039;&amp;amp;nbsp;/ &amp;#039; end -- Add &amp;quot; / &amp;quot; after existing text&lt;br /&gt;
			text = text .. &amp;#039;[[Trans-Canada Highway|TCH]]&amp;#039; -- Add the TCH text&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local output = &amp;#039;&amp;#039; -- The returned output&lt;br /&gt;
	&lt;br /&gt;
	if not shieldAfter then&lt;br /&gt;
		-- Add the shield if it goes first&lt;br /&gt;
		output = output .. shield&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if text ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		if output ~= &amp;#039;&amp;#039; then output = output .. &amp;#039;&amp;amp;nbsp;&amp;#039; end -- Add a NBSP after the shield if it exists&lt;br /&gt;
		output = output .. text -- Add the generated text to the output&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Process control cities&lt;br /&gt;
	if args.city or args.town then&lt;br /&gt;
		output = output .. &amp;#039; – &amp;#039; .. getPlace(args.city or args.town, args) -- Add the first city&lt;br /&gt;
		&lt;br /&gt;
		local extraCityNum = 2 -- The number of the additional city being processed&lt;br /&gt;
		&lt;br /&gt;
		while args[&amp;#039;city&amp;#039; .. extraCityNum] or args[&amp;#039;town&amp;#039; .. extraCityNum] do&lt;br /&gt;
			local val = args[&amp;#039;city&amp;#039; .. extraCityNum] or args[&amp;#039;town&amp;#039; .. extraCityNum]&lt;br /&gt;
			output = output .. &amp;#039;, &amp;#039; .. getPlace(val, args) -- Add extra cities&lt;br /&gt;
			extraCityNum = extraCityNum + 1&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if shieldAfter and shield then&lt;br /&gt;
		if output ~= &amp;#039;&amp;#039; then output = output .. &amp;#039; &amp;#039; end -- Add a space if output already has text&lt;br /&gt;
		output = output .. shield -- Add the shield if it goes last&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return output&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Entry function for {{shieldlist}}&lt;br /&gt;
function p.shieldlist(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	local type = normalizeType(args[1])&lt;br /&gt;
	local route = args[2]&lt;br /&gt;
	local size = args.size or &amp;#039;36px&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	if not data[type] then return &amp;#039;&amp;#039; end&lt;br /&gt;
	&lt;br /&gt;
	-- Add table&lt;br /&gt;
	local out = &amp;#039;&amp;lt;table style=&amp;quot;margin: 0; padding: 0; width: 100%; align: left;&amp;quot;&amp;gt;&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	-- Add a table row&lt;br /&gt;
	out = out .. &amp;#039;&amp;lt;tr&amp;gt;&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	-- Arguments for the road data parser&lt;br /&gt;
	local parserArgs = {&lt;br /&gt;
		ignoreifexists = true,&lt;br /&gt;
		country = &amp;#039;CAN&amp;#039;,&lt;br /&gt;
		province = &amp;#039;ON&amp;#039;,&lt;br /&gt;
		type = type,&lt;br /&gt;
		route = route&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	-- Generate route shield&lt;br /&gt;
	local routeShield = shieldWikitext(parserArgs, { size = size, shield = true })&lt;br /&gt;
	&lt;br /&gt;
	if routeShield ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		out = out .. &amp;#039;&amp;lt;td style=&amp;quot;border: 0px; margin: 0px; padding: 0px;&amp;quot;&amp;gt;&amp;#039; .. routeShield .. &amp;#039;&amp;lt;/td&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	 -- Generate route text&lt;br /&gt;
	local routeText = getText(parserArgs, { fulltext = true }, true)&lt;br /&gt;
	&lt;br /&gt;
	if routeText ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		out = out .. &amp;#039;&amp;lt;td style=&amp;quot;border: 0px; margin: 0px; padding: 0px; text-align: center;&amp;quot;&amp;gt;&amp;#039; .. routeText .. &amp;#039;&amp;lt;/td&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	out = out .. &amp;#039;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&amp;#039; -- Finish the table and table row&lt;br /&gt;
	&lt;br /&gt;
	return out&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</description>
			<pubDate>Wed, 26 Aug 2026 11:17:09 GMT</pubDate>
			<dc:creator>Admin</dc:creator>
			<comments>https://ziyosfera.uz/ziyo/Modul_munozarasi:Jcon</comments>
		</item>
</channel></rss>