Module:Sprite: Difference between revisions

m
hm
(this should allow for changing sizes of spritesheets, it also may just break everything.)
m (hm)
 
(9 intermediate revisions by the same user not shown)
Line 108: Line 108:
title = title,
title = title,
lore = lore,
lore = lore,
enchanted = enchanted
enchanted = enchanted,
link = link
}
}
}
}
Line 308: Line 309:
sprite:cssText( styles )
sprite:cssText( styles )


if self.__settings.link then
sprite = html:tag("span")
local link = self.__settings.link
if link:sub ( 1,1 ) == '[' then
local parentDiv = mw.html.create("a"):attr("href",link:sub ( 2,#link-1 ))
elseif link:sub ( 1,1 ) == '#' then
local section_id = self.__source.ids[itemName].section
for index, tab in pairs(self.__source.sections) do
if tab.id == section_id then
local parentDiv = mw.html.create("a"):attr("href","/" .. tab.name .. "/" .. link:sub ( 2,#link ))
end
end
elseif string.match(link, "%#") then
local parentDiv = mw.html.create("a"):attr("href","/" .. link)
else
local parentDiv = mw.html.create("a"):attr("href","/#" .. link)
end
parentDiv:node(sprite)
return parentDiv
end


return sprite
return sprite
Bureaucrats, Check users, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, Widget editors
1,655

edits