https://de.seminaverbi.bibleget.io/w/index.php?title=Modul:High-use&feed=atom&action=history
Modul:High-use - Versionsgeschichte
2024-03-28T14:36:12Z
Versionsgeschichte dieser Seite in Die Samen von das Wort
MediaWiki 1.41.0
https://de.seminaverbi.bibleget.io/w/index.php?title=Modul:High-use&diff=189&oldid=prev
Johnrdorazio: 1 Version importiert
2020-08-29T22:15:42Z
<p>1 Version importiert</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="de">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Version vom 29. August 2020, 22:15 Uhr</td>
</tr><tr><td colspan="2" class="diff-notice" lang="de"><div class="mw-diff-empty">(kein Unterschied)</div>
</td></tr></table>
Johnrdorazio
https://de.seminaverbi.bibleget.io/w/index.php?title=Modul:High-use&diff=188&oldid=prev
de>Matthiaspaul: -typos
2020-08-26T21:55:16Z
<p>-typos</p>
<p><b>Neue Seite</b></p><div>local p = {}<br />
<br />
local _fetch = require('Module:Transclusion_count').fetch<br />
<br />
function p.num(frame, count)<br />
if count == nil then count = _fetch(frame) end<br />
<br />
-- Build output string<br />
local return_value = ""<br />
if count == nil then<br />
if frame.args[1] == "risk" then<br />
return_value = "a very large number of"<br />
else<br />
return_value = "many"<br />
end<br />
else<br />
-- Use 2 significant figures for smaller numbers and 3 for larger ones<br />
local sigfig = 2<br />
if count >= 100000 then<br />
sigfig = 3<br />
end<br />
<br />
-- Prepare to round to appropriate number of sigfigs<br />
local f = math.floor(math.log10(count)) - sigfig + 1<br />
<br />
-- Round and insert "approximately" or "+" when appropriate<br />
if (frame.args[2] == "yes") or (mw.ustring.sub(frame.args[1],-1) == "+") then<br />
-- Round down<br />
return_value = string.format("%s+", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) ) * (10^(f))) )<br />
else<br />
-- Round to nearest<br />
return_value = string.format("approximately&#x20;%s", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) + 0.5) * (10^(f))) )<br />
end<br />
<br />
-- Insert percent of pages<br />
if frame.args["all-pages"] and frame.args["all-pages"] ~= "" then<br />
local percent = math.floor( ( (count/frame:callParserFunction('NUMBEROFPAGES', 'R') ) * 100) + 0.5)<br />
return_value = string.format("%s&#x20;pages, or roughly %s%% of all", return_value, percent)<br />
end <br />
end<br />
<br />
return return_value<br />
end<br />
-- Actions if there is a large (greater than or equal to 100,000) transclusion count<br />
function p.risk(frame)<br />
local return_value = ""<br />
if frame.args[1] == "risk" then<br />
return_value = "risk"<br />
else<br />
local count = _fetch(frame)<br />
if count and count >= 100000 then return_value = "risk" end<br />
end<br />
return return_value<br />
end<br />
<br />
function p.text(frame, count)<br />
local bot_text = "\n\n----\nTransclusion count updated by [[User:Ahechtbot|Ahechtbot]]."<br />
if frame.args["nobot"] == true then<br />
bot_text = ""<br />
end<br />
<br />
if count == nil then count = _fetch(frame) end<br />
local return_value = {}<br />
<br />
local title = mw.title.getCurrentTitle()<br />
if title.subpageText == "doc" or title.subpageText == "sandbox" then<br />
title = title.basePageTitle<br />
end<br />
<br />
local templatecount = string.format("https://templatecount.toolforge.org/index.php?lang=en&namespace=%s&name=%s",mw.title.getCurrentTitle().namespace,mw.uri.encode(title.text))<br />
<br />
local used_on_text = string.format("'''This %s is used on [%s %s pages]'''",<br />
(mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template"),<br />
templatecount,<br />
p.num(frame, count)<br />
)<br />
<br />
local sandbox_text = string.format("%s's [[%s/sandbox|/sandbox]] or [[%s/testcases|/testcases]] subpages%s ",<br />
(mw.title.getCurrentTitle().namespace == 828 and "module" or "template"),<br />
title.fullText, title.fullText,<br />
(mw.title.getCurrentTitle().namespace == 828 and "." or ", or in your own [[Wikipedia:Subpages#How to create user subpages|user subpage]].")<br />
)<br />
<br />
if (frame.args[1] == "risk" or (count and count >= 100000) ) then<br />
local info = "" <br />
if frame.args["info"] and frame.args["info"] ~= "" then<br />
info = "<br />" .. frame.args["info"]<br />
end<br />
sandbox_text = string.format(".%s<br /> To avoid major disruption and server load, any changes should be tested in the %sThe tested changes can be added to this page in a single edit.&#x20;",<br />
info, sandbox_text<br />
)<br />
else<br />
sandbox_text = string.format(" and changes may be widely noticed. Test changes in the %s",<br />
sandbox_text<br />
)<br />
end<br />
<br />
local discussion_text = "Consider discussing changes "<br />
if frame.args["2"] and frame.args["2"] ~= "" and frame.args["2"] ~= "yes" then<br />
discussion_text = string.format("%sat [[%s]]", discussion_text, frame.args["2"])<br />
else<br />
discussion_text = string.format("%son the [[%s|talk page]]", discussion_text, title.talkPageTitle.fullText )<br />
end<br />
<br />
return table.concat({used_on_text, sandbox_text, discussion_text, " before implementing them.", bot_text})<br />
end<br />
<br />
function p.main(frame)<br />
local count = _fetch(frame)<br />
local return_value = ""<br />
local image = "[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]"<br />
local type_param = "style"<br />
if (frame.args[1] == "risk" or (count and count >= 100000) ) then<br />
image = "[[File:Ambox warning orange.svg|40px|alt=Warning|link=]]"<br />
type_param = "content"<br />
end<br />
<br />
if frame.args["form"] == "editnotice" then<br />
return_value = frame:expandTemplate{<br />
title = 'editnotice',<br />
args = {<br />
["image"] = image,<br />
["text"] = p.text(frame, count),<br />
["expiry"] = (frame.args["expiry"] or "")<br />
}<br />
}<br />
else<br />
return_value = frame:expandTemplate{<br />
title = 'ombox',<br />
args = {<br />
["type"] = type_param,<br />
["image"] = image,<br />
["text"] = p.text(frame, count),<br />
["expiry"] = (frame.args["expiry"] or "")<br />
}<br />
}<br />
end<br />
<br />
return return_value<br />
end<br />
<br />
return p</div>
de>Matthiaspaul