http://wiki.worldsamba.org/index.php?title=Module:InfoboxImage&feed=atom&action=history
Module:InfoboxImage - Revision history
2024-03-28T20:55:04Z
Revision history for this page on the wiki
MediaWiki 1.28.0
http://wiki.worldsamba.org/index.php?title=Module:InfoboxImage&diff=637&oldid=prev
Admin: 1 revision imported
2017-03-26T19:16:14Z
<p>1 revision imported</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<tr style='vertical-align: top;' lang='en'>
<td colspan='1' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='1' style="background-color: white; color:black; text-align: center;">Revision as of 19:16, 26 March 2017</td>
</tr><tr><td colspan='2' style='text-align: center;' lang='en'><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>
Admin
http://wiki.worldsamba.org/index.php?title=Module:InfoboxImage&diff=636&oldid=prev
Frietjes: add px to sizedefault if just a number
2017-03-12T14:50:35Z
<p>add px to sizedefault if just a number</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 14:50, 12 March 2017</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l221" >Line 221:</td>
<td colspan="2" class="diff-lineno">Line 221:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>         if (tonumber(size) or 0) > 0 then</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>         if (tonumber(size) or 0) > 0 then</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>             size = size .. "px";</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>             size = size .. "px";</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;"><div><ins style="font-weight: bold; text-decoration: none;">        end</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;"><div><ins style="font-weight: bold; text-decoration: none;">        -- add px to sizedefault if just a number</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;"><div><ins style="font-weight: bold; text-decoration: none;">        if (tonumber(sizedefault) or 0) > 0 then</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; 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;"><div><ins style="font-weight: bold; text-decoration: none;">            sizedefault = sizedefault .. "px";</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>         end</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>         end</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>          </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>          </div></td></tr>
</table>
Frietjes
http://wiki.worldsamba.org/index.php?title=Module:InfoboxImage&diff=25&oldid=prev
Admin: 1 revision imported
2017-03-04T03:53:17Z
<p>1 revision imported</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<tr style='vertical-align: top;' lang='en'>
<td colspan='1' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='1' style="background-color: white; color:black; text-align: center;">Revision as of 03:53, 4 March 2017</td>
</tr><tr><td colspan='2' style='text-align: center;' lang='en'><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>
Admin
http://wiki.worldsamba.org/index.php?title=Module:InfoboxImage&diff=24&oldid=prev
Zackmann08: Undid revision 755004686 by WOSlinker (talk). Per comment on talk page, this is flooding the category with Drafts that will never be articles.
2016-12-20T19:19:37Z
<p>Undid revision 755004686 by <a href="/index.php?title=Special:Contributions/WOSlinker" title="Special:Contributions/WOSlinker">WOSlinker</a> (<a href="/index.php?title=User_talk:WOSlinker&action=edit&redlink=1" class="new" title="User talk:WOSlinker (page does not exist)">talk</a>). Per comment on talk page, this is flooding the category with Drafts that will never be articles.</p>
<p><b>New page</b></p><div>-- Inputs:<br />
-- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link<br />
-- page - page to display for multipage images (DjVu)<br />
-- size - size to display the image<br />
-- maxsize - maximum size for image<br />
-- sizedefault - default size to display the image if size param is blank<br />
-- alt - alt text for image<br />
-- title - title text for image<br />
-- border - set to yes if border<br />
-- center - set to yes, if the image has to be centered<br />
-- upright - upright image param<br />
-- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it<br />
-- link - page to visit when clicking on image<br />
-- Outputs:<br />
-- Formatted image.<br />
-- More details available at the "Module:InfoboxImage/doc" page<br />
<br />
local i = {};<br />
<br />
local placeholder_image = {<br />
"Blue - Replace this image female.svg",<br />
"Blue - Replace this image male.svg",<br />
"Female no free image yet.png",<br />
"Flag of None (square).svg",<br />
"Flag of None.svg",<br />
"Flag of.svg",<br />
"Green - Replace this image female.svg",<br />
"Green - Replace this image male.svg",<br />
"Image is needed female.svg",<br />
"Image is needed male.svg",<br />
"Location map of None.svg",<br />
"Male no free image yet.png",<br />
"Missing flag.png",<br />
"No flag.svg",<br />
"No free portrait.svg",<br />
"No portrait (female).svg",<br />
"No portrait (male).svg",<br />
"Red - Replace this image female.svg",<br />
"Red - Replace this image male.svg",<br />
"Replace this image female (blue).svg",<br />
"Replace this image female.svg",<br />
"Replace this image male (blue).svg",<br />
"Replace this image male.svg",<br />
"Silver - Replace this image female.svg",<br />
"Silver - Replace this image male.svg",<br />
"Replace this image.svg",<br />
"Cricket no pic.png",<br />
"CarersLogo.gif",<br />
"Diagram Needed.svg",<br />
"Example.jpg",<br />
"Image placeholder.png",<br />
"No male portrait.svg",<br />
"Nocover-upload.png",<br />
"NoDVDcover copy.png",<br />
"Noribbon.svg",<br />
"No portrait-BFD-test.svg",<br />
"Placeholder barnstar ribbon.png",<br />
"Project Trains no image.png",<br />
"Image-request.png",<br />
"Sin bandera.svg",<br />
"Sin escudo.svg",<br />
"Replace this image - temple.png",<br />
"Replace this image butterfly.png",<br />
"Replace this image.svg",<br />
"Replace this image1.svg",<br />
"Resolution angle.png",<br />
"Image-No portrait-text-BFD-test.svg",<br />
"Insert image here.svg",<br />
"No image available.png",<br />
"NO IMAGE YET square.png",<br />
"NO IMAGE YET.png",<br />
"No Photo Available.svg",<br />
"No Screenshot.svg",<br />
"No-image-available.jpg",<br />
"Null.png",<br />
"PictureNeeded.gif",<br />
"Place holder.jpg",<br />
"Unbenannt.JPG",<br />
"UploadACopyrightFreeImage.svg",<br />
"UploadAnImage.gif",<br />
"UploadAnImage.svg",<br />
"UploadAnImageShort.svg",<br />
"CarersLogo.gif",<br />
"Diagram Needed.svg",<br />
"No male portrait.svg",<br />
"NoDVDcover copy.png",<br />
"Placeholder barnstar ribbon.png",<br />
"Project Trains no image.png",<br />
"Image-request.png",<br />
}<br />
<br />
function i.IsPlaceholder(image)<br />
-- change underscores to spaces<br />
image = mw.ustring.gsub(image, "_", " ");<br />
assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil')<br />
-- if image starts with [[ then remove that and anything after |<br />
if mw.ustring.sub(image,1,2) == "[[" then<br />
image = mw.ustring.sub(image,3);<br />
image = mw.ustring.gsub(image, "([^|]*)|.*", "%1");<br />
assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil')<br />
end<br />
-- Trim spaces<br />
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');<br />
assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil")<br />
-- remove prefix if exists<br />
local allNames = mw.site.namespaces[6].aliases<br />
allNames[#allNames + 1] = mw.site.namespaces[6].name<br />
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName<br />
for i, name in ipairs(allNames) do<br />
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then<br />
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);<br />
break<br />
end<br />
end<br />
-- Trim spaces<br />
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');<br />
-- capitalise first letter<br />
image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2);<br />
<br />
for i,j in pairs(placeholder_image) do<br />
if image == j then<br />
return true<br />
end<br />
end<br />
return false<br />
end<br />
<br />
function i.InfoboxImage(frame)<br />
local image = frame.args["image"];<br />
<br />
if image == "" or image == nil then<br />
return "";<br />
end<br />
if image == "&nbsp;" then<br />
return image;<br />
end<br />
if frame.args["suppressplaceholder"] ~= "no" then<br />
if i.IsPlaceholder(image) == true then<br />
return "";<br />
end<br />
end<br />
<br />
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "http:" then<br />
return "";<br />
end<br />
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "[http:" then<br />
return "";<br />
end<br />
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[[http:" then<br />
return "";<br />
end<br />
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "https:" then<br />
return "";<br />
end<br />
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[https:" then<br />
return "";<br />
end<br />
if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "[[https:" then<br />
return "";<br />
end<br />
<br />
if mw.ustring.sub(image,1,2) == "[[" then<br />
-- search for thumbnail images and add to tracking cat if found<br />
if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then<br />
return image .. "[[Category:Pages using infoboxes with thumbnail images]]";<br />
elseif mw.title.getCurrentTitle().namespace == 0 then<br />
return image .. "[[Category:Pages using deprecated image syntax]]";<br />
else<br />
return image;<br />
end<br />
elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then<br />
return image;<br />
elseif mw.ustring.sub(image,1,1) == "<" then<br />
return image;<br />
elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127).."UNIQ" then<br />
-- Found strip marker at begining, so pass don't process at all<br />
return image;<br />
elseif mw.ustring.sub(image,4,9) == "`UNIQ-" then<br />
-- Found strip marker at begining, so pass don't process at all<br />
return image;<br />
else<br />
local result = "";<br />
local page = frame.args["page"];<br />
local size = frame.args["size"];<br />
local maxsize = frame.args["maxsize"];<br />
local sizedefault = frame.args["sizedefault"];<br />
local alt = frame.args["alt"];<br />
local link = frame.args["link"];<br />
local title = frame.args["title"];<br />
local border = frame.args["border"];<br />
local upright = frame.args["upright"] or "";<br />
local thumbtime = frame.args["thumbtime"] or "";<br />
local center= frame.args["center"];<br />
<br />
-- remove prefix if exists<br />
local allNames = mw.site.namespaces[6].aliases<br />
allNames[#allNames + 1] = mw.site.namespaces[6].name<br />
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName<br />
for i, name in ipairs(allNames) do<br />
if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then<br />
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);<br />
break<br />
end<br />
end<br />
<br />
if maxsize ~= "" and maxsize ~= nil then<br />
-- if no sizedefault then set to maxsize<br />
if sizedefault == "" or sizedefault == nil then<br />
sizedefault = maxsize<br />
end<br />
-- check to see if size bigger than maxsize<br />
if size ~= "" and size ~= nil then<br />
local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0;<br />
local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0;<br />
if sizenumber>maxsizenumber and maxsizenumber>0 then<br />
size = maxsize;<br />
end<br />
end<br />
end<br />
-- add px to size if just a number<br />
if (tonumber(size) or 0) > 0 then<br />
size = size .. "px";<br />
end<br />
<br />
result = "[[File:" .. image;<br />
if page ~= "" and page ~= nil then<br />
result = result .. "|page=" .. page;<br />
end<br />
if size ~= "" and size ~= nil then<br />
result = result .. "|" .. size;<br />
elseif sizedefault ~= "" and sizedefault ~= nil then<br />
result = result .. "|" .. sizedefault;<br />
else<br />
result = result .. "|frameless";<br />
end<br />
if center == "yes" then<br />
result = result .. "|center"<br />
end<br />
if alt ~= "" and alt ~= nil then<br />
result = result .. "|alt=" .. alt;<br />
end<br />
if link ~= "" and link ~= nil then<br />
result = result .. "|link=" .. link;<br />
end<br />
if border == "yes" then<br />
result = result .. "|border";<br />
end<br />
if upright == "yes" then<br />
result = result .. "|upright";<br />
elseif upright ~= "" then<br />
result = result .. "|upright=" .. upright;<br />
end<br />
if thumbtime ~= "" then<br />
result = result .. "|thumbtime=" .. thumbtime;<br />
end<br />
if title ~= "" and title ~= nil then<br />
result = result .. "|" .. title;<br />
elseif alt ~= "" and alt ~= nil then<br />
result = result .. "|" .. alt;<br />
end<br />
result = result .. "]]";<br />
<br />
return result;<br />
end<br />
end<br />
<br />
return i;</div>
Zackmann08