https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3ASelf%2Fsandbox Module:Self/sandbox - Revision history 2025-06-07T04:58:34Z Revision history for this page on the wiki MediaWiki 1.45.0-wmf.4 https://en.wikipedia.org/w/index.php?title=Module:Self/sandbox&diff=1244690191&oldid=prev Matrix at 15:57, 8 September 2024 2024-09-08T15:57:49Z <p></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 15:57, 8 September 2024</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> local args = frame:getParent().args</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 args = frame:getParent().args</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 tstyles = frame:extensionTag( 'templatestyles', '', { src = 'Module:Self/styles.css' } )</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 tstyles = frame:extensionTag( 'templatestyles', '', { src = 'Module:Self/styles.css' } )</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 fmt_string_tmpl = '&lt;div class="wp-tmpl-self-license-wrapper<del style="font-weight: bold; text-decoration: none;"> notheme</del>"&gt;' ..</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 fmt_string_tmpl = '&lt;div class="wp-tmpl-self-license-wrapper"&gt;' ..</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> '&lt;div class="center"&gt;%s&lt;/div&gt;&lt;div class="center"&gt;%s&lt;/div&gt;%s&lt;/div&gt;%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> '&lt;div class="center"&gt;%s&lt;/div&gt;&lt;div class="center"&gt;%s&lt;/div&gt;%s&lt;/div&gt;%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 initial_text = p.start_line(args)</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 initial_text = p.start_line(args)</div></td> </tr> </table> Matrix https://en.wikipedia.org/w/index.php?title=Module:Self/sandbox&diff=1236315978&oldid=prev Jonesey95: try notheme for dark mode 2024-07-24T01:39:16Z <p>try notheme for dark mode</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 01:39, 24 July 2024</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> local args = frame:getParent().args</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 args = frame:getParent().args</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 tstyles = frame:extensionTag( 'templatestyles', '', { src = 'Module:Self/styles.css' } )</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 tstyles = frame:extensionTag( 'templatestyles', '', { src = 'Module:Self/styles.css' } )</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 fmt_string_tmpl = '&lt;div class="wp-tmpl-self-license-wrapper"&gt;' ..</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 fmt_string_tmpl = '&lt;div class="wp-tmpl-self-license-wrapper<ins style="font-weight: bold; text-decoration: none;"> notheme</ins>"&gt;' ..</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> '&lt;div class="center"&gt;%s&lt;/div&gt;&lt;div class="center"&gt;%s&lt;/div&gt;%s&lt;/div&gt;%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> '&lt;div class="center"&gt;%s&lt;/div&gt;&lt;div class="center"&gt;%s&lt;/div&gt;%s&lt;/div&gt;%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 initial_text = p.start_line(args)</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 initial_text = p.start_line(args)</div></td> </tr> </table> Jonesey95 https://en.wikipedia.org/w/index.php?title=Module:Self/sandbox&diff=1236315861&oldid=prev Jonesey95: sync with live module 2024-07-24T01:38:20Z <p>sync with live module</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 01:38, 24 July 2024</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 49:</td> <td colspan="2" class="diff-lineno">Line 49:</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 more_than_one = p.more_than_one(args)</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 more_than_one = p.more_than_one(args)</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 mw.ustring.format(</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 mw.ustring.format(</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> '\'\'\'\'\'%s, the copyright holder of this work,\'\'\' hereby publish%s<del style="font-weight: bold; text-decoration: none;">,</del> it under the following license%s:\'\'',</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> '\'\'\'\'\'%s, the copyright holder of this work,\'\'\' hereby publish%s it under the following license%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> args['author'] or 'I',</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> args['author'] or 'I',</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> args['author'] and 'es' or '',</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> args['author'] and 'es' or '',</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Line 86:</td> <td colspan="2" class="diff-lineno">Line 86:</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> errors = errors .. tmpl_with_args.errors</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> errors = errors .. tmpl_with_args.errors</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> end</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> end</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> return<del style="font-weight: bold; text-decoration: none;"> '&lt;br&gt;' ..</del> tstyles .. mw.ustring.format(fmt_string_tmpl, initial_text, templates, final_line, categories) .. errors</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> return tstyles .. mw.ustring.format(fmt_string_tmpl, initial_text, templates, final_line, categories) .. errors</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>end</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>end</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;"><br /></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;"><br /></td> </tr> </table> Jonesey95 https://en.wikipedia.org/w/index.php?title=Module:Self/sandbox&diff=1191094949&oldid=prev Sohom Datta: Create sandbox version of Module:Self add a newline ? 2023-12-21T14:57:10Z <p>Create sandbox version of <a href="/wiki/Module:Self" title="Module:Self">Module:Self</a> add a newline ?</p> <p><b>New page</b></p><div>local p = {}<br /> <br /> function p.decide_migration(args)<br /> if args[&#039;migration&#039;] then<br /> return args[&#039;migration&#039;]<br /> end<br /> local licsense_migration_data = mw.loadJsonData( &#039;Module:Self/license_migration_data.json&#039;)<br /> for _, template_name in ipairs(args) do<br /> local migration_data = licsense_migration_data[string.lower(template_name)]<br /> if migration_data == &#039;redundant&#039; then<br /> return migration_data<br /> end<br /> end<br /> return &#039;&#039;<br /> end<br /> <br /> function p.setup_template_params(template_name, frame, args, migration)<br /> local title = mw.title.new(template_name, 10)<br /> if not title.exists then<br /> return {<br /> txt=&#039;&#039;,<br /> errors=(&#039;&lt;span class=&quot;error scribunto-error&quot;&gt;The license &quot;&#039; .. template_name .. &#039;&quot; does not exist.&lt;/span&gt;&#039; ..<br /> &#039;[[Category:Wikipedia dual licensed files with invalid licenses]]&#039;<br /> )<br /> }<br /> end<br /> <br /> return { txt=(frame:expandTemplate({<br /> title = template_name,<br /> args = {<br /> dw= (args[&#039;dw&#039;] or &#039;no&#039;),<br /> date= (args[&#039;date&#039;] or &#039;&#039;),<br /> migration= (migration)<br /> } })), errors=&#039;&#039; }<br /> end<br /> <br /> function p.more_than_one(args)<br /> local c = 0<br /> for _, __ in ipairs(args) do<br /> c = c + 1<br /> if c == 2 then<br /> return true<br /> end<br /> end<br /> return false<br /> end<br /> <br /> function p.start_line(args)<br /> local more_than_one = p.more_than_one(args)<br /> return mw.ustring.format(<br /> &#039;\&#039;\&#039;\&#039;\&#039;\&#039;%s, the copyright holder of this work,\&#039;\&#039;\&#039; hereby publish%s, it under the following license%s:\&#039;\&#039;&#039;,<br /> args[&#039;author&#039;] or &#039;I&#039;,<br /> args[&#039;author&#039;] and &#039;es&#039; or &#039;&#039;,<br /> more_than_one and &#039;s&#039; or &#039;&#039;<br /> )<br /> end<br /> <br /> function p.categories(args)<br /> local currentTitle = mw.title.getCurrentTitle()<br /> local is_in_file_namespace = currentTitle.nsText == &#039;File&#039;<br /> if not is_in_file_namespace then<br /> return &#039;&#039;<br /> end<br /> <br /> if args[&#039;author&#039;] then<br /> return mw.ustring.format(&#039;[[Category:Files licensed by third parties|%s]]&#039;, currentTitle.fullText)<br /> else<br /> return mw.ustring.format(&#039;[[Category:Self-published work|%s]]&#039;, currentTitle.fullText)<br /> end<br /> end<br /> <br /> function p.main(frame)<br /> local args = frame:getParent().args<br /> local tstyles = frame:extensionTag( &#039;templatestyles&#039;, &#039;&#039;, { src = &#039;Module:Self/styles.css&#039; } )<br /> local fmt_string_tmpl = &#039;&lt;div class=&quot;wp-tmpl-self-license-wrapper&quot;&gt;&#039; ..<br /> &#039;&lt;div class=&quot;center&quot;&gt;%s&lt;/div&gt;&lt;div class=&quot;center&quot;&gt;%s&lt;/div&gt;%s&lt;/div&gt;%s&#039;<br /> local initial_text = p.start_line(args)<br /> local final_line = p.more_than_one(args) and &quot;&lt;div class=&#039;center&#039;&gt;&#039;&#039;You may select the license of your choice.&#039;&#039;&lt;/div&gt;&quot; or &#039;&#039;<br /> local categories = p.categories(args)<br /> local templates = &#039;&#039;<br /> local errors = &#039;&#039;<br /> local migration = p.decide_migration(args)<br /> for _, template_name in ipairs(args) do<br /> tmpl_with_args = p.setup_template_params(template_name, frame, args, migration)<br /> templates = templates .. tmpl_with_args.txt<br /> errors = errors .. tmpl_with_args.errors<br /> end<br /> return &#039;&lt;br&gt;&#039; .. tstyles .. mw.ustring.format(fmt_string_tmpl, initial_text, templates, final_line, categories) .. errors<br /> end<br /> <br /> return p<br /> -- &lt;/nowiki&gt;</div> Sohom Datta