Jump to content

Module:Inventory slot: Difference between revisions

m
Replaced very expensive function with not very expensive function
imported>Ttv pedro270707
m (Temporary test function to reduce expensive parser function calls)
imported>Ttv pedro270707
m (Replaced very expensive function with not very expensive function)
Line 94: Line 94:
end
end
elseif (subname ~= pageName and subname) or args.link == "y" then
elseif (subname ~= pageName and subname) or args.link == "y" then
link = subname
link = require("Module:Inventory slot/links").links[subname]
end
end
Line 140: Line 140:
end
end
elseif (item ~= pageName and item) or args.link == "y" then
elseif (item ~= pageName and item) or args.link == "y" then
link = item
link = require("Module:Inventory slot/links").links[item]
end
end
Line 153: Line 153:
end
end
if link and mw.title.new( link ).exists then
if link or (args.link and args.link ~= "y" and args.link ~= "n") then
slotContainer:wikitext( "<span style='" .. display .. "'>" .. "[[" .. link .. "|" .. tostring( slot ) .. "]]" .. "</span>" )
slotContainer:wikitext( "<span style='" .. display .. "' class='no-external-icon'>" .. "[https://bta.miraheze.org/wiki/" .. link:gsub(" ", "_") .. " " .. tostring( slot ) .. "]" .. "</span>" )
else
else
slotContainer:wikitext( "<span style='" .. display .. "'>" .. tostring( slot ) .. "</span>" )
slotContainer:wikitext( "<span style='" .. display .. "'>" .. tostring( slot ) .. "</span>" )