<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.cultopedia.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AWide_image</id>
	<title>Module:Wide image - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.cultopedia.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AWide_image"/>
	<link rel="alternate" type="text/html" href="https://www.cultopedia.org/index.php?title=Module:Wide_image&amp;action=history"/>
	<updated>2026-04-05T23:32:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.5</generator>
	<entry>
		<id>https://www.cultopedia.org/index.php?title=Module:Wide_image&amp;diff=1250&amp;oldid=prev</id>
		<title>imported&gt;Matrix: fix problem of background-fixed overriding everythign</title>
		<link rel="alternate" type="text/html" href="https://www.cultopedia.org/index.php?title=Module:Wide_image&amp;diff=1250&amp;oldid=prev"/>
		<updated>2025-12-23T22:00:57Z</updated>

		<summary type="html">&lt;p&gt;fix problem of background-fixed overriding everythign&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module implements [[template:wide image]] and [[template:panorama]]&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function getfilename(s)&lt;br /&gt;
	s = mw.ustring.gsub(s or &amp;#039;&amp;#039;, &amp;#039;^%s*[Ff][Ii][Ll][Ee]%s*:%s*&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
	s = mw.ustring.gsub(s or &amp;#039;&amp;#039;, &amp;#039;^%s*[Ii][Mm][Aa][Gg][Ee]%s*:%s*&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
	return s&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getwidth(s, w, h)&lt;br /&gt;
	w = mw.ustring.gsub(w or &amp;#039;0&amp;#039;, &amp;#039;^%s*(%d+)%s*[Pp][Xx]*%s*$&amp;#039;, &amp;#039;%1&amp;#039;)&lt;br /&gt;
	h = mw.ustring.gsub(h or &amp;#039;0&amp;#039;, &amp;#039;^%s*(%d+)%s*[Pp][Xx]*%s*$&amp;#039;, &amp;#039;%1&amp;#039;)&lt;br /&gt;
	w = tonumber(w) or 0&lt;br /&gt;
	h = tonumber(h) or 0&lt;br /&gt;
	if w &amp;gt; 0 then&lt;br /&gt;
		return w&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local file = s and mw.title.new(&amp;#039;File:&amp;#039; .. mw.uri.decode(mw.ustring.gsub(s,&amp;#039;%|.*$&amp;#039;,&amp;#039;&amp;#039;), &amp;#039;WIKI&amp;#039;))&lt;br /&gt;
	file = file and file.file or {width = 0, height = 0}&lt;br /&gt;
&lt;br /&gt;
	if h &amp;gt; 0 then&lt;br /&gt;
		w = math.floor(h * (tonumber(file.width) or 0)/(tonumber(file.height) or 1) + 0.5)&lt;br /&gt;
		if w &amp;gt; 0 then&lt;br /&gt;
			return w&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	w = tonumber(file.width) or 0&lt;br /&gt;
	return w&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getimage(s, w, a, c, rtl)&lt;br /&gt;
	if c == &amp;#039;thumb&amp;#039; or c == &amp;#039;thumbnail&amp;#039; or c == &amp;#039;frame&amp;#039; or c == &amp;#039;border&amp;#039; then&lt;br /&gt;
		c = s&lt;br /&gt;
	elseif rtl and c ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		c = &amp;#039;&amp;amp;#x202A;&amp;#039; .. c .. &amp;#039;&amp;amp;#x202C;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;[[File:&amp;#039; .. (s or &amp;#039;&amp;#039;) .. &amp;#039;|&amp;#039; .. (w or &amp;#039;&amp;#039;) .. &amp;#039;|alt=&amp;#039; .. (a or &amp;#039;&amp;#039;) &lt;br /&gt;
		.. &amp;#039;|&amp;#039; .. mw.text.unstrip(c or &amp;#039;&amp;#039;) .. &amp;#039;]]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getcontainers(noborder, float, width, maxwidth)&lt;br /&gt;
	local r = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	if noborder then&lt;br /&gt;
		if float == &amp;#039;left&amp;#039; then&lt;br /&gt;
			r:addClass(&amp;#039;floatleft&amp;#039;)&lt;br /&gt;
		elseif float == &amp;#039;right&amp;#039; then&lt;br /&gt;
			r:addClass(&amp;#039;floatright&amp;#039;)&lt;br /&gt;
		elseif float == &amp;#039;none&amp;#039; then&lt;br /&gt;
			r:addClass(&amp;#039;floatnone&amp;#039;)&lt;br /&gt;
		else -- center is default&lt;br /&gt;
			r:addClass(&amp;#039;floatnone&amp;#039;)&lt;br /&gt;
			r:css(&amp;#039;margin-left&amp;#039;, &amp;#039;auto&amp;#039;)&lt;br /&gt;
			r:css(&amp;#039;margin-right&amp;#039;, &amp;#039;auto&amp;#039;)&lt;br /&gt;
			r:css(&amp;#039;overflow&amp;#039;, &amp;#039;hidden&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		r:addClass(&amp;#039;thumb&amp;#039;)&lt;br /&gt;
		if float == &amp;#039;left&amp;#039; then&lt;br /&gt;
			r:addClass(&amp;#039;tleft&amp;#039;)&lt;br /&gt;
		elseif float == &amp;#039;right&amp;#039; then&lt;br /&gt;
			r:addClass(&amp;#039;tright&amp;#039;)&lt;br /&gt;
		elseif float == &amp;#039;none&amp;#039; then&lt;br /&gt;
			r:addClass(&amp;#039;tnone&amp;#039;)&lt;br /&gt;
		else -- center is default&lt;br /&gt;
			r:addClass(&amp;#039;tnone&amp;#039;)&lt;br /&gt;
			r:css(&amp;#039;margin-left&amp;#039;, &amp;#039;auto&amp;#039;)&lt;br /&gt;
			r:css(&amp;#039;margin-right&amp;#039;, &amp;#039;auto&amp;#039;)&lt;br /&gt;
			r:css(&amp;#039;overflow&amp;#039;, &amp;#039;hidden&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	r:css(&amp;#039;width&amp;#039;, width)&lt;br /&gt;
	r:css(&amp;#039;max-width&amp;#039;, maxwidth)&lt;br /&gt;
	local d = noborder and r or r:tag(&amp;#039;div&amp;#039;):addClass(&amp;#039;thumbinner&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	return r,d&lt;br /&gt;
end&lt;br /&gt;
	&lt;br /&gt;
function wideimage(image, width, height, caption, boxwidth, float, alt, border, capalign, dir, bgtype)&lt;br /&gt;
	if image then&lt;br /&gt;
		image = getfilename(image)&lt;br /&gt;
		local iwidth = getwidth(image, width or &amp;#039;0&amp;#039;, height or &amp;#039;0&amp;#039;)&lt;br /&gt;
		if width == nil then&lt;br /&gt;
			width = iwidth .. &amp;#039;px&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		local rtl = dir and dir == &amp;#039;rtl&amp;#039; or nil&lt;br /&gt;
		local noborder = border and border == &amp;#039;no&amp;#039; or nil&lt;br /&gt;
		&lt;br /&gt;
		local maxwidth = noborder and (iwidth .. &amp;#039;px&amp;#039;) or ((iwidth + 10) .. &amp;#039;px&amp;#039;)&lt;br /&gt;
		&lt;br /&gt;
		local r,d = getcontainers(noborder, float or &amp;#039;&amp;#039;, boxwidth or &amp;#039;auto&amp;#039;, maxwidth)&lt;br /&gt;
		&lt;br /&gt;
		if tonumber(width) then&lt;br /&gt;
			width = width .. &amp;#039;px&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		cclass = &amp;#039;noresize &amp;#039;&lt;br /&gt;
		&lt;br /&gt;
		if not (border == &amp;#039;no&amp;#039;) then&lt;br /&gt;
			cclass = cclass .. &amp;#039;thumbimage&amp;#039; &lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if (bgtype == &amp;#039;norm&amp;#039;) then&lt;br /&gt;
			cclass = cclass .. &amp;#039; wide-image-normbg&amp;#039;&lt;br /&gt;
		elseif (bgtype == &amp;#039;none&amp;#039;) then&lt;br /&gt;
			cclass = cclass .. &amp;#039; wide-image-nobg&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		d:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
			:addClass(cclass)&lt;br /&gt;
			:css(&amp;#039;overflow&amp;#039;, &amp;#039;auto&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;direction&amp;#039;, rtl and &amp;#039;rtl&amp;#039; or nil)&lt;br /&gt;
			:wikitext(getimage(image,width,alt,caption or &amp;#039;&amp;#039;,rtl))&lt;br /&gt;
		if caption then&lt;br /&gt;
			d = d:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
					:addClass(&amp;#039;thumbcaption&amp;#039;)&lt;br /&gt;
					:css(&amp;#039;text-align&amp;#039;, capalign)&lt;br /&gt;
			if noborder == nil then&lt;br /&gt;
				d:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
					:addClass(&amp;#039;magnify&amp;#039;)&lt;br /&gt;
					:wikitext(&amp;#039;[[:File:&amp;#039; .. image .. &amp;#039;| ]]&amp;#039;)&lt;br /&gt;
			end&lt;br /&gt;
			d:wikitext(caption)&lt;br /&gt;
		end&lt;br /&gt;
		return tostring(r)&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	local styles = frame:extensionTag{&lt;br /&gt;
		name = &amp;#039;templatestyles&amp;#039;,&lt;br /&gt;
		args = { src = &amp;#039;Module:Wide image/styles.css&amp;#039; },&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	return styles .. wideimage(&lt;br /&gt;
			args[&amp;#039;image&amp;#039;] or args[1], args[2] or nil, -- width&lt;br /&gt;
			args[&amp;#039;height&amp;#039;] or nil, args[&amp;#039;caption&amp;#039;] or args[3], &lt;br /&gt;
			args[&amp;#039;width&amp;#039;] or args[4], args[&amp;#039;align&amp;#039;] or args[5], &lt;br /&gt;
			args[&amp;#039;alt&amp;#039;], args[&amp;#039;border&amp;#039;], args[&amp;#039;align-cap&amp;#039;], args[&amp;#039;dir&amp;#039;], args[&amp;#039;bgtype&amp;#039;]&lt;br /&gt;
			)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Matrix</name></author>
	</entry>
</feed>