<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://kaze.wiki/index.php?action=history&amp;feed=atom&amp;title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%3AUses_TemplateStyles</id>
	<title>モジュール:Uses TemplateStyles - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://kaze.wiki/index.php?action=history&amp;feed=atom&amp;title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%3AUses_TemplateStyles"/>
	<link rel="alternate" type="text/html" href="https://kaze.wiki/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Uses_TemplateStyles&amp;action=history"/>
	<updated>2026-04-04T10:45:06Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.38.2</generator>
	<entry>
		<id>https://kaze.wiki/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Uses_TemplateStyles&amp;diff=274&amp;oldid=prev</id>
		<title>K: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://kaze.wiki/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Uses_TemplateStyles&amp;diff=274&amp;oldid=prev"/>
		<updated>2022-08-27T16:03:21Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2022年8月28日 (日) 01:03時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>K</name></author>
	</entry>
	<entry>
		<id>https://kaze.wiki/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Uses_TemplateStyles&amp;diff=273&amp;oldid=prev</id>
		<title>ja&gt;えのきだたもつ: 「モジュール:Uses TemplateStyles」を保護しました: Wikipedia:保護依頼による: 影響が特に大きいテンプレート ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限))</title>
		<link rel="alternate" type="text/html" href="https://kaze.wiki/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Uses_TemplateStyles&amp;diff=273&amp;oldid=prev"/>
		<updated>2022-05-21T15:19:21Z</updated>

		<summary type="html">&lt;p&gt;「&lt;a href=&quot;/wiki/%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Uses_TemplateStyles&quot; title=&quot;モジュール:Uses TemplateStyles&quot;&gt;モジュール:Uses TemplateStyles&lt;/a&gt;」を保護しました: &lt;a href=&quot;https://en.wikipedia.org/wiki/%E4%BF%9D%E8%AD%B7%E4%BE%9D%E9%A0%BC&quot; class=&quot;extiw&quot; title=&quot;wikipedia:保護依頼&quot;&gt;Wikipedia:保護依頼&lt;/a&gt;による: &lt;a href=&quot;/index.php?title=WP:HRT&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WP:HRT (存在しないページ)&quot;&gt;影響が特に大きいテンプレート&lt;/a&gt; ([編集=拡張承認された利用者と管理者に許可] (無期限) [移動=拡張承認された利用者と管理者に許可] (無期限))&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module implements the {{Uses TemplateStyles}} template.&lt;br /&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;
&lt;br /&gt;
local p = {}&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;
function p._main(args)&lt;br /&gt;
	local tStyles = mTableTools.compressSparseArray(args)&lt;br /&gt;
	local box = p.renderBox(tStyles)&lt;br /&gt;
	local trackingCategories = p.renderTrackingCategories(args, tStyles)&lt;br /&gt;
	return box .. trackingCategories&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderBox(tStyles)&lt;br /&gt;
	local boxArgs = {}&lt;br /&gt;
	if #tStyles &amp;lt; 1 then&lt;br /&gt;
		boxArgs.text = &amp;#039;&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;エラー: TemplateStylesが指定されていません&amp;lt;/strong&amp;gt;&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		local tStylesLinks = {}&lt;br /&gt;
		for i, ts in ipairs(tStyles) do&lt;br /&gt;
			local sandboxLink = nil&lt;br /&gt;
			local tsTitle = mw.title.new(ts)&lt;br /&gt;
			if tsTitle then&lt;br /&gt;
				local tsSandboxTitle = mw.title.new(string.format(&amp;#039;%s:%s/sandbox/%s&amp;#039;, tsTitle.nsText, tsTitle.baseText, tsTitle.subpageText))&lt;br /&gt;
				if tsSandboxTitle and tsSandboxTitle.exists then&lt;br /&gt;
					sandboxLink = string.format(&amp;#039; ([[:%s|サンドボックス]])&amp;#039;, tsSandboxTitle.prefixedText)&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			tStylesLinks[i] = string.format(&amp;#039;[[:%s]]%s&amp;#039;, ts, sandboxLink or &amp;#039;&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local tStylesList = mList.makeList(&amp;#039;bulleted&amp;#039;, tStylesLinks)&lt;br /&gt;
		boxArgs.text = &amp;#039;この&amp;#039; .. &lt;br /&gt;
			(mw.title.getCurrentTitle():inNamespaces(828,829) and &amp;#039;モジュール&amp;#039; or &amp;#039;テンプレート&amp;#039;) ..&lt;br /&gt;
			&amp;#039;は[[mw:Help:TemplateStyles/ja|テンプレートスタイル]]を使用しています:\n&amp;#039; .. tStylesList&lt;br /&gt;
	end&lt;br /&gt;
	boxArgs.type = &amp;#039;notice&amp;#039;&lt;br /&gt;
	boxArgs.small = true&lt;br /&gt;
	boxArgs.image = &amp;#039;[[File:Farm-Fresh css add.svg|32px|alt=CSS]]&amp;#039;&lt;br /&gt;
	return mMessageBox.main(&amp;#039;mbox&amp;#039;, boxArgs)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.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 cats = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Error category&lt;br /&gt;
	if #tStyles &amp;lt; 1 then&lt;br /&gt;
		cats[#cats + 1] = &amp;#039;テンプレート呼び出しエラーのあるページ/Template:Uses TemplateStyles&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;
	local subpageBlacklist = {&lt;br /&gt;
		doc = true,&lt;br /&gt;
		sandbox = true,&lt;br /&gt;
		sandbox2 = true,&lt;br /&gt;
		testcases = true&lt;br /&gt;
	}&lt;br /&gt;
	if (titleObj.namespace == 10 or titleObj.namespace == 828)&lt;br /&gt;
		and not subpageBlacklist[titleObj.subpageText]&lt;br /&gt;
	then&lt;br /&gt;
		local category = args.category&lt;br /&gt;
		if not category then&lt;br /&gt;
			category = category or &amp;#039;テンプレートスタイルを利用するテンプレート&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		cats[#cats + 1] = category&lt;br /&gt;
		if not yesno(args.noprotcat) 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 tsProt ~= currentProt and not addedLevelCat then&lt;br /&gt;
					cats[#cats + 1] = &amp;quot;異なる保護レベルがあるテンプレートスタイル使用テンプレート&amp;quot;&lt;br /&gt;
				end&lt;br /&gt;
				if tsProt and not addedPadlockCat then&lt;br /&gt;
					local content = tsTitleObj:getContent()&lt;br /&gt;
					if not content:find(&amp;quot;{{pp-&amp;quot;) then&lt;br /&gt;
						cats[#cats + 1] = &amp;quot;保護表示がないテンプレートスタイル使用テンプレート&amp;quot;&lt;br /&gt;
						addedPadlockCat = true&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;
return p&lt;/div&gt;</summary>
		<author><name>ja&gt;えのきだたもつ</name></author>
	</entry>
</feed>