https://wiki.hisgis.nl/index.php?title=Module:Unsubst&feed=atom&action=historyModule:Unsubst - Bewerkingsoverzicht2024-03-28T16:15:35ZBewerkingsoverzicht voor deze pagina op de wikiMediaWiki 1.38.2https://wiki.hisgis.nl/index.php?title=Module:Unsubst&diff=1301&oldid=prevThomas: 1 versie geïmporteerd2019-09-25T12:49:24Z<p>1 versie geïmporteerd</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="nl">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Oudere versie</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Versie van 25 sep 2019 13:49</td>
</tr><tr><td colspan="2" class="diff-notice" lang="nl"><div class="mw-diff-empty">(geen verschil)</div>
</td></tr></table>Thomashttps://wiki.hisgis.nl/index.php?title=Module:Unsubst&diff=1299&oldid=prevThomas: 1 versie geïmporteerd2019-09-05T18:31:10Z<p>1 versie geïmporteerd</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="nl">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Oudere versie</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Versie van 5 sep 2019 19:31</td>
</tr><tr><td colspan="2" class="diff-notice" lang="nl"><div class="mw-diff-empty">(geen verschil)</div>
</td></tr></table>Thomashttps://wiki.hisgis.nl/index.php?title=Module:Unsubst&diff=1302&oldid=previnterwiki>Jdforrester (WMF): 9 revisions imported from :w:en:Module:Unsubst: Page about technical change that was posted to a local wiki2019-07-12T22:33:21Z<p>9 revisions imported from <a href="/index.php?title=W:en:Module:Unsubst&action=edit&redlink=1" class="new" title="W:en:Module:Unsubst (de pagina bestaat niet)">w:en:Module:Unsubst</a>: Page about technical change that was posted to a local wiki</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="nl">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Oudere versie</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Versie van 12 jul 2019 23:33</td>
</tr><tr><td colspan="2" class="diff-notice" lang="nl"><div class="mw-diff-empty">(geen verschil)</div>
</td></tr></table>interwiki>Jdforrester (WMF)https://wiki.hisgis.nl/index.php?title=Module:Unsubst&diff=1300&oldid=previnterwiki>Amorymeltzer: Changed protection level for "Module:Unsubst": High-risk Lua module: Bump to full protection, over 3.5M transclusions, including some very critical templates ([Edit=Require administrator access] (indefinite) [Move=Require...2018-12-05T02:49:39Z<p>Changed protection level for "<a href="/wiki/Module:Unsubst" title="Module:Unsubst">Module:Unsubst</a>": <a href="/index.php?title=WP:High-risk_templates&action=edit&redlink=1" class="new" title="WP:High-risk templates (de pagina bestaat niet)">High-risk Lua module</a>: Bump to full protection, over 3.5M transclusions, including some very critical templates ([Edit=Require administrator access] (indefinite) [Move=Require...</p>
<p><b>Nieuwe pagina</b></p><div>local checkType = require('libraryUtil').checkType<br />
<br />
local p = {}<br />
<br />
local BODY_PARAM = '$B'<br />
<br />
local specialParams = {<br />
['$params'] = 'parameter list',<br />
['$aliases'] = 'parameter aliases',<br />
['$flags'] = 'flags',<br />
['$B'] = 'template content'<br />
}<br />
<br />
function p.main(frame, body)<br />
-- If we are substing, this function returns a template invocation, and if<br />
-- not, it returns the template body. The template body can be specified in<br />
-- the body parameter, or in the template parameter defined in the<br />
-- BODY_PARAM variable. This function can be called from Lua or from<br />
-- #invoke.<br />
<br />
-- Return the template body if we aren't substing.<br />
if not mw.isSubsting() then<br />
if body ~= nil then<br />
return body<br />
elseif frame.args[BODY_PARAM] ~= nil then<br />
return frame.args[BODY_PARAM]<br />
else<br />
error(string.format(<br />
"no template content specified (use parameter '%s' from #invoke)",<br />
BODY_PARAM<br />
), 2)<br />
end<br />
end<br />
<br />
-- Sanity check for the frame object.<br />
if type(frame) ~= 'table'<br />
or type(frame.getParent) ~= 'function'<br />
or not frame:getParent()<br />
then<br />
error(<br />
"argument #1 to 'main' must be a frame object with a parent " ..<br />
"frame available",<br />
2<br />
)<br />
end<br />
<br />
-- Find the invocation name.<br />
local mTemplateInvocation = require('Module:Template invocation')<br />
local name = mTemplateInvocation.name(frame:getParent():getTitle())<br />
<br />
-- Combine passed args with passed defaults<br />
local args = {}<br />
if string.find( ','..(frame.args['$flags'] or '')..',', ',%s*override%s*,' ) then<br />
for k, v in pairs( frame:getParent().args ) do<br />
args[k] = v<br />
end<br />
for k, v in pairs( frame.args ) do<br />
if not specialParams[k] then<br />
if v == '__DATE__' then<br />
v = mw.getContentLanguage():formatDate( 'F Y' )<br />
end<br />
args[k] = v<br />
end<br />
end<br />
else<br />
for k, v in pairs( frame.args ) do<br />
if not specialParams[k] then<br />
if v == '__DATE__' then<br />
v = mw.getContentLanguage():formatDate( 'F Y' )<br />
end<br />
args[k] = v<br />
end<br />
end<br />
for k, v in pairs( frame:getParent().args ) do<br />
args[k] = v<br />
end<br />
end<br />
<br />
-- Trim parameters, if not specified otherwise<br />
if not string.find( ','..(frame.args['$flags'] or '')..',', ',%s*keep%-whitespace%s*,' ) then<br />
for k, v in pairs( args ) do args[k] = mw.ustring.match(v, '^%s*(.*)%s*$') or '' end<br />
end<br />
<br />
-- Pull information from parameter aliases<br />
local aliases = {}<br />
if frame.args['$aliases'] then<br />
local list = mw.text.split( frame.args['$aliases'], '%s*,%s*' )<br />
for k, v in ipairs( list ) do<br />
local tmp = mw.text.split( v, '%s*>%s*' )<br />
aliases[tonumber(mw.ustring.match(tmp[1], '^[1-9][0-9]*$')) or tmp[1]] = ((tonumber(mw.ustring.match(tmp[2], '^[1-9][0-9]*$'))) or tmp[2])<br />
end<br />
end<br />
for k, v in pairs( aliases ) do<br />
if args[k] and ( not args[v] or args[v] == '' ) then<br />
args[v] = args[k]<br />
end<br />
args[k] = nil<br />
end<br />
<br />
-- Remove empty parameters, if specified<br />
if string.find( ','..(frame.args['$flags'] or '')..',', ',%s*remove%-empty%s*,' ) then<br />
local tmp = 0<br />
for k, v in ipairs( args ) do<br />
if v ~= '' or ( args[k+1] and args[k+1] ~= '' ) or ( args[k+2] and args[k+2] ~= '' ) then<br />
tmp = k<br />
else<br />
break<br />
end<br />
end<br />
for k, v in pairs( args ) do<br />
if v == '' then<br />
if not (type(k) == 'number' and k < tmp) then args[k] = nil end<br />
end<br />
end<br />
end<br />
<br />
-- Order parameters<br />
if frame.args['$params'] then<br />
local params, tmp = mw.text.split( frame.args['$params'], '%s*,%s*' ), {}<br />
for k, v in ipairs(params) do<br />
v = tonumber(mw.ustring.match(v, '^[1-9][0-9]*$')) or v<br />
if args[v] then tmp[v], args[v] = args[v], nil end<br />
end<br />
for k, v in pairs(args) do tmp[k], args[k] = args[k], nil end<br />
args = tmp<br />
end<br />
<br />
return mTemplateInvocation.invocation(name, args)<br />
end<br />
<br />
p[''] = p.main -- For backwards compatibility<br />
<br />
return p</div>interwiki>Amorymeltzer