https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3AHighlighted_date_list Module:Highlighted date list - Revision history 2025-06-16T01:01:34Z Revision history for this page on the wiki MediaWiki 1.45.0-wmf.5 https://en.wikipedia.org/w/index.php?title=Module:Highlighted_date_list&diff=653610581&oldid=prev MSGJ: let's try without the 120% 2015-03-26T14:34:53Z <p>let&#039;s try without the 120%</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 14:34, 26 March 2015</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 73:</td> <td colspan="2" class="diff-lineno">Line 73:</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> highlighter</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> highlighter</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> :css('background-color', color)</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> :css('background-color', color)</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> :css('font-size', '120%')</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> :wikitext(lang:getArrow('forwards'))</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> :wikitext(lang:getArrow('forwards'))</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> return tostring(highlighter)</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> return tostring(highlighter)</div></td> </tr> </table> MSGJ https://en.wikipedia.org/w/index.php?title=Module:Highlighted_date_list&diff=653587465&oldid=prev Mr. Stradivarius: Protected Module:Highlighted date list: High-risk Lua module ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only template editors and admins] (indefinite)) 2015-03-26T10:07:43Z <p>Protected Module:Highlighted date list: <a href="/wiki/Wikipedia:High-risk_templates" title="Wikipedia:High-risk templates">High-risk Lua module</a> ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only template editors and admins] (indefinite))</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 10:07, 26 March 2015</td> </tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div> </td></tr></table> Mr. Stradivarius https://en.wikipedia.org/w/index.php?title=Module:Highlighted_date_list&diff=653561669&oldid=prev Mr. Stradivarius: we need to subtract the grace period, not add it 2015-03-26T04:30:13Z <p>we need to subtract the grace period, not add it</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 04:30, 26 March 2015</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 56:</td> <td colspan="2" class="diff-lineno">Line 56:</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 timestamp</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 timestamp</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> if gracePeriod then</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> if gracePeriod then</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> timestamp = 'now <del style="font-weight: bold; text-decoration: none;">+</del> ' .. gracePeriod</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> timestamp = 'now <ins style="font-weight: bold; text-decoration: none;">-</ins> ' .. gracePeriod</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> else</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> else</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> timestamp = 'now'</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> timestamp = 'now'</div></td> </tr> </table> Mr. Stradivarius https://en.wikipedia.org/w/index.php?title=Module:Highlighted_date_list&diff=653557696&oldid=prev Mr. Stradivarius: create 2015-03-26T03:43:51Z <p>create</p> <p><b>New page</b></p><div>-- This module takes a list of dates and adds a marker highlighting the closest<br /> -- date in the future.<br /> <br /> local p = {}<br /> local lang = mw.language.getContentLanguage()<br /> <br /> local function normalizeDate(timestamp)<br /> local success, date = pcall(lang.formatDate, lang, &#039;Y-m-d&#039;, timestamp)<br /> return success and date<br /> end<br /> <br /> local function makeData(args)<br /> local data, unsorted = {}, {}<br /> for k, v in pairs(args) do<br /> if type(k) == &#039;string&#039; then<br /> local datakey, num = k:match(&#039;^(.-)([1-9][0-9]*)$&#039;)<br /> if datakey == &#039;item&#039; or datakey == &#039;date&#039; then<br /> num = tonumber(num)<br /> unsorted[num] = unsorted[num] or {}<br /> unsorted[num][datakey] = v<br /> elseif datakey then<br /> error(string.format(&quot;invalid parameter &#039;%s&#039; detected&quot;, k), 3)<br /> end<br /> end<br /> end<br /> for num, t in pairs(unsorted) do<br /> if t.item and t.date then<br /> local date = normalizeDate(t.date)<br /> if not date then<br /> error(string.format(<br /> &quot;invalid date &#039;%s&#039; in parameter &#039;date%d&#039;&quot;,<br /> t.date, num<br /> ), 3)<br /> end<br /> t.date = date<br /> table.insert(data, t)<br /> elseif t.item then<br /> error(string.format(<br /> &quot;parameter &#039;item%d&#039; was specified but parameter &#039;date%d&#039; is missing&quot;,<br /> num, num<br /> ), 3)<br /> else<br /> error(string.format(<br /> &quot;parameter &#039;date%d&#039; was specified but parameter &#039;item%d&#039; is missing&quot;,<br /> num, num<br /> ), 3)<br /> end<br /> end<br /> table.sort(data, function (t1, t2)<br /> return t1.date &lt; t2.date<br /> end)<br /> return data<br /> end<br /> <br /> local function makeComparisonDate(gracePeriod)<br /> local timestamp<br /> if gracePeriod then<br /> timestamp = &#039;now + &#039; .. gracePeriod<br /> else<br /> timestamp = &#039;now&#039;<br /> end<br /> local date = normalizeDate(timestamp)<br /> if date then<br /> return date<br /> else<br /> error(string.format(&quot;invalid grace period &#039;%s&#039;&quot;, gracePeriod), 3)<br /> end<br /> end<br /> <br /> local function makeHighlighter(color)<br /> color = color or &#039;#FC6&#039;<br /> local highlighter = mw.html.create(&#039;span&#039;)<br /> highlighter<br /> :css(&#039;background-color&#039;, color)<br /> :css(&#039;font-size&#039;, &#039;120%&#039;)<br /> :wikitext(lang:getArrow(&#039;forwards&#039;))<br /> return tostring(highlighter)<br /> end<br /> <br /> function p._main(args)<br /> local data = makeData(args)<br /> local comparisonDate = makeComparisonDate(args.graceperiod)<br /> local highlighter = args.highlighter or makeHighlighter(args.highlightercolor)<br /> local root = mw.html.create(&#039;ul&#039;)<br /> root<br /> :addClass(args.class)<br /> :cssText(args.style)<br /> local doneHighlight = false<br /> for i, t in ipairs(data) do<br /> local item<br /> if not doneHighlight and t.date &gt;= comparisonDate then<br /> doneHighlight = true<br /> item = highlighter .. &#039; &#039; .. t.item<br /> else<br /> item = t.item<br /> end<br /> root<br /> :newline()<br /> :tag(&#039;li&#039;)<br /> :wikitext(item)<br /> end<br /> root:newline()<br /> return tostring(root)<br /> end<br /> <br /> function p.main(frame)<br /> local args = require(&#039;Module:Arguments&#039;).getArgs(frame, {<br /> wrappers = &#039;Template:Highlighted date list&#039;<br /> })<br /> return p._main(args)<br /> end<br /> <br /> return p</div> Mr. Stradivarius