https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3AAfC%2Fsandbox Module:AfC/sandbox - Revision history 2025-06-04T02:55:41Z Revision history for this page on the wiki MediaWiki 1.45.0-wmf.3 https://en.wikipedia.org/w/index.php?title=Module:AfC/sandbox&diff=1138279019&oldid=prev Uzume: sync from active 2023-02-08T21:33:47Z <p>sync from active</p> <a href="//en.wikipedia.org/w/index.php?title=Module:AfC/sandbox&amp;diff=1138279019&amp;oldid=848868842">Show changes</a> Uzume https://en.wikipedia.org/w/index.php?title=Module:AfC/sandbox&diff=848868842&oldid=prev Oshwah: Oshwah moved page Module:AfC statistics row/sandbox to Module:AfC/sandbox without leaving a redirect: Undoing move (see Module talk:AfC) - the move broke a ton of template pages for AFC. 2018-07-04T22:31:57Z <p>Oshwah moved page <a href="/w/index.php?title=Module:AfC_statistics_row/sandbox&amp;action=edit&amp;redlink=1" class="new" title="Module:AfC statistics row/sandbox (page does not exist)">Module:AfC statistics row/sandbox</a> to <a href="/wiki/Module:AfC/sandbox" title="Module:AfC/sandbox">Module:AfC/sandbox</a> without leaving a redirect: Undoing move (see <a href="/wiki/Module_talk:AfC" class="mw-redirect" title="Module talk:AfC">Module talk:AfC</a>) - the move broke a ton of template pages for AFC.</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <tr class="diff-title" lang="en"> <td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 22:31, 4 July 2018</td> </tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div> </td></tr></table> Oshwah https://en.wikipedia.org/w/index.php?title=Module:AfC/sandbox&diff=848790962&oldid=prev Stormy Chamber: Mahveotm moved page Module:AfC/sandbox to Module:AfC statistics row/sandbox without leaving a redirect: discussion closed as PM 2018-07-04T09:54:16Z <p>Mahveotm moved page <a href="/wiki/Module:AfC/sandbox" title="Module:AfC/sandbox">Module:AfC/sandbox</a> to <a href="/w/index.php?title=Module:AfC_statistics_row/sandbox&amp;action=edit&amp;redlink=1" class="new" title="Module:AfC statistics row/sandbox (page does not exist)">Module:AfC statistics row/sandbox</a> without leaving a redirect: discussion closed as PM</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <tr class="diff-title" lang="en"> <td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 09:54, 4 July 2018</td> </tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div> </td></tr></table> Stormy Chamber https://en.wikipedia.org/w/index.php?title=Module:AfC/sandbox&diff=577505159&oldid=prev The Earwig: update size with a sortkey 2013-10-17T00:36:58Z <p>update size with a sortkey</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 00:36, 17 October 2013</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 1:</td> <td colspan="2" class="diff-lineno">Line 1:</td> </tr> <tr> <td class="diff-marker"></td> <td style="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;"><div>local p = {}</div></td> <td class="diff-marker"></td> <td style="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;"><div>local p = {}</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="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;"><div>revlib = require("Module:Revision");</div></td> <td class="diff-marker"></td> <td style="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;"><div>revlib = require("Module:Revision");</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="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;"><div>-- current call example: {{AFC statistics/row|s=p|t=Confidential Incident Reporting &amp; Analysis System (CIRAS)|h=Submissions/Confidential Incident Reporting &amp; A...|z=6.7 kB|sr=CIRAS|sd=15:19, 22 Jan 2009|si=265715189|mr=SBaker43|md=04:45, 15 Mar 2013|mi=544281825}}</div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker"></td> <td style="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;"><div>function p.row(frame)</div></td> <td class="diff-marker"></td> <td style="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;"><div>function p.row(frame)</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="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;"><div> local status = frame.args["s"]</div></td> <td class="diff-marker"></td> <td style="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;"><div> local status = frame.args["s"]</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="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;"><div> local title = frame.args["t"]</div></td> <td class="diff-marker"></td> <td style="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;"><div> local title = frame.args["t"]</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="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;"><div> local short = p.shorttitle(title, 40)<del style="font-weight: bold; text-decoration: none;">;</del></div></td> <td class="diff-marker" data-marker="+"></td> <td style="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;"><div> local short = p.shorttitle(title, 40)</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="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;"><div> local size = frame.args["z"]</div></td> <td class="diff-marker"></td> <td style="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;"><div> local size = frame.args["z"]</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="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;"><div> local modified_by = frame.args["mr"]</div></td> <td class="diff-marker"></td> <td style="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;"><div> local modified_by = frame.args["mr"]</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Line 18:</td> <td colspan="2" class="diff-lineno">Line 17:</td> </tr> <tr> <td class="diff-marker"></td> <td style="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;"><div> local cols = {}</div></td> <td class="diff-marker"></td> <td style="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;"><div> local cols = {}</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="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;"><div> cols[1] = string.format("[[:%s|%s]]", title, short)</div></td> <td class="diff-marker"></td> <td style="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;"><div> cols[1] = string.format("[[:%s|%s]]", title, short)</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="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;"><div> cols[2] = string.format('&lt;span style="display:none" class="sortkey"&gt;%d&lt;/span&gt;%.1f kB', size, size / 1000)</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="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;"><div> cols[2] = size</div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker"></td> <td style="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;"><div> </div></td> <td class="diff-marker"></td> <td style="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;"><div> </div></td> </tr> <tr> <td class="diff-marker"></td> <td style="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;"><div> local is_userspace = string.sub(frame.args["t"], 1, 4) == "User"</div></td> <td class="diff-marker"></td> <td style="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;"><div> local is_userspace = string.sub(frame.args["t"], 1, 4) == "User"</div></td> </tr> </table> The Earwig https://en.wikipedia.org/w/index.php?title=Module:AfC/sandbox&diff=577504473&oldid=prev The Earwig: create 2013-10-17T00:29:41Z <p>create</p> <p><b>New page</b></p><div>local p = {}<br /> revlib = require(&quot;Module:Revision&quot;);<br /> -- current call example: {{AFC statistics/row|s=p|t=Confidential Incident Reporting &amp; Analysis System (CIRAS)|h=Submissions/Confidential Incident Reporting &amp; A...|z=6.7 kB|sr=CIRAS|sd=15:19, 22 Jan 2009|si=265715189|mr=SBaker43|md=04:45, 15 Mar 2013|mi=544281825}}<br /> function p.row(frame)<br /> local status = frame.args[&quot;s&quot;]<br /> local title = frame.args[&quot;t&quot;]<br /> local short = p.shorttitle(title, 40);<br /> local size = frame.args[&quot;z&quot;]<br /> local modified_by = frame.args[&quot;mr&quot;]<br /> local modified_at = frame.args[&quot;md&quot;]<br /> local old_id = frame.args[&quot;mi&quot;]<br /> local special_user = frame.args[&quot;sr&quot;]<br /> local special_time = frame.args[&quot;sd&quot;]<br /> local special_id = tonumber(frame.args[&quot;si&quot;])<br /> local display_notes = tonumber(frame.args[&quot;n&quot;])<br /> local rowtemplate = &quot;&lt;tr style=\&quot;background-color:%s\&quot;&gt; %s &lt;/tr&gt;&quot;<br /> local colorthing = p.color(status, false)<br /> local cols = {}<br /> cols[1] = string.format(&quot;[[:%s|%s]]&quot;, title, short)<br /> cols[2] = size<br /> <br /> local is_userspace = string.sub(frame.args[&quot;t&quot;], 1, 4) == &quot;User&quot;<br /> if is_userspace then display_notes = 1 end<br /> <br /> if display_notes then cols[3] = p.notes(frame) else cols[3] = &quot;&quot; end<br /> <br /> if special_id then<br /> cols[4] = p.printuser(special_user)<br /> cols[5] = string.format(&#039;&lt;span style=&quot;display:none&quot; class=&quot;sortkey&quot;&gt;%s&lt;/span&gt;%s&#039;, special_id, p.invoke(&quot;Module:Revision&quot;, &quot;diff&quot;, frame, title, &quot;prev&quot;, special_id, special_time))<br /> else<br /> cols[4] = &quot;Unknown&quot;<br /> cols[5] = &quot;Unknown&quot;<br /> end<br /> <br /> cols[6] = p.printuser(modified_by)<br /> cols[7] = string.format(&#039;&lt;span style=&quot;display:none&quot; class=&quot;sortkey&quot;&gt;%s&lt;/span&gt;%s&#039;, old_id, p.invoke(&quot;Module:Revision&quot;, &quot;diff&quot;, frame, title, &quot;prev&quot;, old_id, modified_at))<br /> local colstring = &quot;&quot;<br /> for i=1, 7 do colstring = colstring .. string.format(&quot;&lt;td&gt;%s&lt;/td&gt;&quot;, cols[i]) end<br /> return string.format(rowtemplate, colorthing, colstring)<br /> end<br /> <br /> function p.notes(frame)<br /> local result = &quot;&quot;<br /> local is_suspected_copyvio = tonumber(frame.args[&quot;nc&quot;])<br /> local is_unsourced = tonumber(frame.args[&quot;nu&quot;])<br /> local no_inline = tonumber(frame.args[&quot;ni&quot;])<br /> local is_short = tonumber(frame.args[&quot;ns&quot;])<br /> local is_resubmit = tonumber(frame.args[&quot;nr&quot;])<br /> local is_old = tonumber(frame.args[&quot;no&quot;])<br /> local submitter_is_blocked = tonumber(frame.args[&quot;nb&quot;])<br /> local is_userspace = string.sub(frame.args[&quot;t&quot;], 1, 4) == &quot;User&quot;<br /> <br /> if is_suspected_copyvio then result = result .. &quot;&lt;abbr title=\&quot;Submission is a suspected copyright violation\&quot;&gt;copyvio&lt;/abbr&gt;&amp;#32;&amp;#32;&quot; end<br /> if is_unsourced then result = result .. &quot;&lt;abbr title=\&quot;Submission lacks references completely\&quot;&gt;unsourced&lt;/abbr&gt;&amp;#32;&amp;#32;&quot; end<br /> if no_inline then result = result .. &quot;&lt;abbr title=\&quot;Submission has no inline citations\&quot;&gt;no-inline&lt;/abbr&gt;&amp;#32;&amp;#32;&quot; end<br /> if is_short then result = result ..&quot;&lt;abbr title=\&quot;Submission is less than a kilobyte in length\&quot;&gt;short&lt;/abbr&gt;&amp;#32;&amp;#32;&quot; end<br /> if is_resubmit then result = result .. &quot;&lt;abbr title=\&quot;Submission was resubmitted after a previous decline\&quot;&gt;resubmit&lt;/abbr&gt;&amp;#32;&amp;#32;&quot; end<br /> if is_old then result = result .. &quot;&lt;abbr title=\&quot;Submission has not been touched in over four days\&quot;&gt;old&lt;/abbr&gt;&amp;#32;&amp;#32;&quot; end<br /> if submitter_is_blocked then result = result .. &quot;&lt;abbr title=\&quot;Submitter is currently blocked\&quot;&gt;blocked&lt;/abbr&gt;&amp;#32;&amp;#32;&quot; end<br /> if is_userspace then result = result .. &quot;&lt;abbr title=\&quot;Submission is located in the User or User Talk space\&quot;&gt;userspace&lt;/abbr&gt;&amp;#32;&amp;#32;&quot; end<br /> <br /> return result<br /> end<br /> <br /> function p.color(status, dark)<br /> local result<br /> local dark_colors = {<br /> p = &quot;#979158&quot;,<br /> d = &quot;#a07980&quot;,<br /> r = &quot;#708a92&quot;,<br /> a = &quot;#5f9e5f&quot;<br /> }<br /> local normal_colors = {<br /> p = &quot;#f3eba3&quot;,<br /> d = &quot;#ffcdd5&quot;,<br /> r = &quot;#b1dae8&quot;,<br /> a = &quot;#adfcad&quot;<br /> }<br /> if dark then<br /> return dark_colors[status] or &quot;#7e7f7a&quot;<br /> else<br /> return normal_colors[status] or &quot;#d2d3cc&quot;<br /> end<br /> end<br /> <br /> function p.printuser(user)<br /> return string.format(&quot;[[User:%s|%s]] ([[User talk:%s|t]])&quot;, user, user, user)<br /> end<br /> <br /> function p.shorttitle(fulltitle, maxlength)<br /> --strip off namespace:basepage/ if it exists and anything is left<br /> --if not, strip off namespace<br /> --truncate to maxlength<br /> local startindex, size, namespace, basetitle, subtitle = mw.ustring.find(fulltitle, &quot;([^:]*):([^\/]*)\/?(.*)&quot;)<br /> local effective_title = subtitle or basetitle<br /> if (effective_title == nil or string.len(effective_title) == 0) then effective_title = fulltitle end<br /> effective_title = string.gsub(effective_title, &quot;^Submissions/&quot;, &quot;&quot;)<br /> -- return mw.text.truncate( effective_title, maxlength ) (mw.text is not yet deployed!)<br /> if (mw.ustring.len(effective_title) &gt; maxlength) then<br /> return mw.ustring.sub(effective_title, 1, maxlength - 3) .. &quot;...&quot;<br /> else<br /> return effective_title<br /> end<br /> <br /> <br /> end<br /> <br /> --equivalent of {{#Invoke:module|function|arg1|arg2|namedarg=arg3|namedarg2=arg4}} becomes<br /> --p.invoke(&quot;module&quot;, &quot;function&quot;, frame, arg1, arg2, {namedarg=arg3}, {namedarg2=arg4})<br /> function p.invoke(modname, call, frame, ...)<br /> local mymod = require(modname)<br /> local nargs = {}<br /> for i,v in ipairs(arg) do<br /> if type(v) == &quot;table&quot; then<br /> local argname, argv = ipairs(v)<br /> nargs[argname] = tostring(argv)<br /> else<br /> nargs[i] = tostring(v)<br /> end<br /> end<br /> local childframe = frame:newChild{title = nil, args = nargs}<br /> return mymod[call](childframe)<br /> end<br /> <br /> <br /> <br /> return p</div> The Earwig