Module:LoadData and Module:LoadData/sandbox: Difference between pages

(Difference between pages)
Jump to navigation Jump to search
Page 1
Page 2
imported>MusikBot II
m Protected "Module:LoadData": High-risk template or module: 398 transclusions (more info) ([Edit=Require autoconfirmed or confirmed access] (indefinite))
 
imported>GKFX
Create sandbox version of Module:LoadData
 
Line 55: Line 55:
__index = function(t, k)
__index = function(t, k)
return function(frame)
return function(frame)
return load('Module:' .. k, frame)
if k:sub(-5) == '.json' then
    end
return load(mw.text.jsonDecode(mw.title.new(k).getContent()), frame)
else
    return load(mw.loadData('Module:' .. k), frame)
end
    end
end
end
})
})