"साचा:TemplateBox" च्या विविध आवृत्यांमधील फरक
Content deleted Content added
छो paste from sandbox |
छो resolve issue "no params" |
||
ओळ ३४५:
end
end
end▼
if not pargs.useTemplateData then▼
local warning = "Warning: Module:TemplateBox - templatedata invoked but not requested by user (setting useTemplateData=1)."▼
mw.log(warning)▼
return tdata, 0;▼
end
Line ४६४ ⟶ ४५७:
-- The TemplateData-portion for [[Template:TemplateBox]]
function p.templatedata(frame)
local tdata
local pargs = ( frame:getParent() or {} ).args or {}
▲ if not pargs.useTemplateData then
▲ local warning = "Warning: Module:TemplateBox - templatedata invoked but not requested by user (setting useTemplateData=1)."
▲ mw.log(warning)
tdata = '{"description":"' .. warning .. '","params":{},"sets":[]}'
▲ end
-- Load the JSON-Module which will convert LUA tables into valid JSON
local JSON = require('Module:JSON')
JSON.strictTypes = true
-- Obtain the object containing info
-- And finally return the result
return JSON:encode(tdata)
|