<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tiffa.net/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AUses_TemplateStyles</id>
	<title>Module:Uses TemplateStyles - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tiffa.net/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AUses_TemplateStyles"/>
	<link rel="alternate" type="text/html" href="https://wiki.tiffa.net/w/index.php?title=Module:Uses_TemplateStyles&amp;action=history"/>
	<updated>2026-04-03T21:13:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.tiffa.net/w/index.php?title=Module:Uses_TemplateStyles&amp;diff=148654&amp;oldid=prev</id>
		<title>Fire at 00:10, 3 June 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.tiffa.net/w/index.php?title=Module:Uses_TemplateStyles&amp;diff=148654&amp;oldid=prev"/>
		<updated>2025-06-03T00:10:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:10, 3 June 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l101&quot;&gt;Line 101:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 101:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;function p._main(args, cfg&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;function p._main(args&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	local cfg = getConfig()&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	if #args == 0 then&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		local prefixed = mw.title.getCurrentTitle().prefixedText&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		prefixed = prefixed:gsub(&quot;/doc&quot;&lt;/ins&gt;,&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&quot;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		args[1] = prefixed .. &quot;/&quot; .. &lt;/ins&gt;cfg&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[&quot;default_subpage_name&quot;]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	local tStyles = mTableTools.compressSparseArray(args)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	local tStyles = mTableTools.compressSparseArray(args)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	local box = renderBox(tStyles)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	local box = renderBox(tStyles)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Fire</name></author>
	</entry>
	<entry>
		<id>https://wiki.tiffa.net/w/index.php?title=Module:Uses_TemplateStyles&amp;diff=3399&amp;oldid=prev</id>
		<title>imported&gt;Fire at 06:34, 24 December 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.tiffa.net/w/index.php?title=Module:Uses_TemplateStyles&amp;diff=3399&amp;oldid=prev"/>
		<updated>2022-12-24T06:34:25Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local yesno = require(&amp;#039;Module:Yesno&amp;#039;)&lt;br /&gt;
local mList = require(&amp;#039;Module:List&amp;#039;)&lt;br /&gt;
local mTableTools = require(&amp;#039;Module:TableTools&amp;#039;)&lt;br /&gt;
local mMessageBox = require(&amp;#039;Module:Message box&amp;#039;)&lt;br /&gt;
local TNT = require(&amp;#039;Module:TNT&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function format(msg, ...)&lt;br /&gt;
	return TNT.format(&amp;#039;I18n/Uses TemplateStyles&amp;#039;, msg, ...)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getConfig()&lt;br /&gt;
	return mw.loadData(&amp;#039;Module:Uses TemplateStyles/config&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function renderBox(tStyles)&lt;br /&gt;
	local boxArgs = {&lt;br /&gt;
		type = &amp;#039;notice&amp;#039;,&lt;br /&gt;
		small = true,&lt;br /&gt;
		image = string.format(&amp;#039;[[File:Farm-Fresh css add.svg|32px|alt=%s]]&amp;#039;, format(&amp;#039;logo-alt&amp;#039;))&lt;br /&gt;
	}&lt;br /&gt;
	if #tStyles &amp;lt; 1 then&lt;br /&gt;
		boxArgs.text = string.format(&amp;#039;&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;%s&amp;lt;/strong&amp;gt;&amp;#039;, format(&amp;#039;error-emptylist&amp;#039;))&lt;br /&gt;
	else&lt;br /&gt;
		local cfg = getConfig()&lt;br /&gt;
		local tStylesLinks = {}&lt;br /&gt;
		for i, ts in ipairs(tStyles) do&lt;br /&gt;
			local link = string.format(&amp;#039;[[:%s]]&amp;#039;, ts)&lt;br /&gt;
			local sandboxLink = nil&lt;br /&gt;
			local tsTitle = mw.title.new(ts)&lt;br /&gt;
			if tsTitle and cfg[&amp;#039;sandbox_title&amp;#039;] then&lt;br /&gt;
				local tsSandboxTitle = mw.title.new(string.format(&lt;br /&gt;
					&amp;#039;%s:%s/%s/%s&amp;#039;, tsTitle.nsText, tsTitle.baseText, cfg[&amp;#039;sandbox_title&amp;#039;], tsTitle.subpageText))&lt;br /&gt;
				if tsSandboxTitle and tsSandboxTitle.exists then&lt;br /&gt;
					sandboxLink = format(&amp;#039;sandboxlink&amp;#039;, link, &amp;#039;:&amp;#039; .. tsSandboxTitle.prefixedText)&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			tStylesLinks[i] = sandboxLink or link&lt;br /&gt;
		end&lt;br /&gt;
		local tStylesList = mList.makeList(&amp;#039;bulleted&amp;#039;, tStylesLinks)&lt;br /&gt;
		boxArgs.text = format(&lt;br /&gt;
			mw.title.getCurrentTitle():inNamespaces(828,829) and &amp;#039;header-module&amp;#039; or &amp;#039;header-template&amp;#039;) ..&lt;br /&gt;
			&amp;#039;\n&amp;#039; .. tStylesList&lt;br /&gt;
	end&lt;br /&gt;
	return mMessageBox.main(&amp;#039;mbox&amp;#039;, boxArgs)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function renderTrackingCategories(args, tStyles, titleObj)&lt;br /&gt;
	if yesno(args.nocat) then&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local cfg = getConfig()&lt;br /&gt;
	&lt;br /&gt;
	local cats = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Error category&lt;br /&gt;
	if #tStyles &amp;lt; 1 and cfg[&amp;#039;error_category&amp;#039;] then&lt;br /&gt;
		cats[#cats + 1] = cfg[&amp;#039;error_category&amp;#039;]&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- TemplateStyles category&lt;br /&gt;
	titleObj = titleObj or mw.title.getCurrentTitle()&lt;br /&gt;
	if (titleObj.namespace == 10 or titleObj.namespace == 828)&lt;br /&gt;
		and not cfg[&amp;#039;subpage_blacklist&amp;#039;][titleObj.subpageText]&lt;br /&gt;
	then&lt;br /&gt;
		local category = args.category or cfg[&amp;#039;default_category&amp;#039;]&lt;br /&gt;
		if category then&lt;br /&gt;
			cats[#cats + 1] = category&lt;br /&gt;
		end&lt;br /&gt;
		if not yesno(args.noprotcat) and (cfg[&amp;#039;protection_conflict_category&amp;#039;] or cfg[&amp;#039;padlock_pattern&amp;#039;]) then&lt;br /&gt;
			local currentProt = titleObj.protectionLevels[&amp;quot;edit&amp;quot;] and titleObj.protectionLevels[&amp;quot;edit&amp;quot;][1] or nil&lt;br /&gt;
			local addedLevelCat = false&lt;br /&gt;
			local addedPadlockCat = false&lt;br /&gt;
			for i, ts in ipairs(tStyles) do&lt;br /&gt;
				local tsTitleObj = mw.title.new(ts)&lt;br /&gt;
				local tsProt = tsTitleObj.protectionLevels[&amp;quot;edit&amp;quot;] and tsTitleObj.protectionLevels[&amp;quot;edit&amp;quot;][1] or nil&lt;br /&gt;
				if cfg[&amp;#039;padlock_pattern&amp;#039;] and tsProt and not addedPadlockCat then&lt;br /&gt;
					local content = tsTitleObj:getContent()&lt;br /&gt;
					if not content:find(cfg[&amp;#039;padlock_pattern&amp;#039;]) then&lt;br /&gt;
						cats[#cats + 1] = cfg[&amp;#039;missing_padlock_category&amp;#039;]&lt;br /&gt;
						addedPadlockCat = true&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
				if cfg[&amp;#039;protection_conflict_category&amp;#039;] and currentProt and tsProt ~= currentProt and not addedLevelCat then&lt;br /&gt;
					currentProt = cfg[&amp;#039;protection_hierarchy&amp;#039;][currentProt] or 0&lt;br /&gt;
					tsProt = cfg[&amp;#039;protection_hierarchy&amp;#039;][tsProt] or 0&lt;br /&gt;
					if tsProt &amp;lt; currentProt then&lt;br /&gt;
						addedLevelCat = true&lt;br /&gt;
						cats[#cats + 1] = cfg[&amp;#039;protection_conflict_category&amp;#039;]&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	for i, cat in ipairs(cats) do&lt;br /&gt;
		cats[i] = string.format(&amp;#039;[[Category:%s]]&amp;#039;, cat)&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(cats)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args, cfg)&lt;br /&gt;
	local tStyles = mTableTools.compressSparseArray(args)&lt;br /&gt;
	local box = renderBox(tStyles)&lt;br /&gt;
	local trackingCategories = renderTrackingCategories(args, tStyles)&lt;br /&gt;
	return box .. trackingCategories&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local origArgs = frame:getParent().args&lt;br /&gt;
	local args = {}&lt;br /&gt;
	for k, v in pairs(origArgs) do&lt;br /&gt;
		v = v:match(&amp;#039;^%s*(.-)%s*$&amp;#039;)&lt;br /&gt;
		if v ~= &amp;#039;&amp;#039; then&lt;br /&gt;
			args[k] = v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Fire</name></author>
	</entry>
</feed>