Module:ItemSources: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 14: Line 14:
function p.main(frame)
function p.main(frame)
local args = frame:getParent().args
local args = frame:getParent().args
mw.log("args", inspect(data))
local storeList
local storeList


local status, message = pcall(function()
local status, message = pcall(function()
storeList = storeLocationsList.main(frame)
storeList = storeLocationsList.main(frame)
end)
end)
mw.log("status", status)




Line 29: Line 24:
-- No error, continue as usual
-- No error, continue as usual


local div = mw.html.create("h3")
local itemSourcesTitle = mw.html.create("h2")
 
itemSourcesTitle:wikitext("Item sources")
 
div:wikitext("Shop locations")


mw.log("aa", tostring(div) .. storeList)
local shopLocationsTitle = mw.html.create("h3")
shopLocationsTitle:wikitext("Shop locations")


return tostring(div) .. storeList
return toString(itemSourcesTitle) .. tostring(shopLocationsTitle) .. storeList
else
else
if string.find(message, 'The item .* is not sold in any shop,') then
if string.find(message, 'The item .* is not sold in any shop,') then

Navigation menu