Module:Sprite: Difference between revisions

m
hm
(ohgodIhopethisdoesn'tbreakeverything)
m (hm)
 
(8 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 309: Line 310:


if self.__settings.link then
if self.__settings.link then
local parentDiv = mw.html.create("span"):css("position","relative")
sprite = html:tag("span")
parentDiv:node(spriteDiv)
local link = self.__settings.link
local link = self.__settings.link
if link:sub ( 1,1 ) == '[' then
if link:sub( 1,2 ) == '[[' then
local parentDiv = mw.html.create("a"):attr("href",link:sub ( 2,#link-1 ))
parentDiv:wikitext(']]')
elseif link:sub ( 1,1 ) == '#' then
elseif link:sub ( 1,1 ) == '[' then
local section_id = self.__source.ids[itemName].section
parentDiv:wikitext(']')
for index, tab in pairs(self.__source.sections) do
return parentDiv
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
end
parentDiv:node(sprite)
return parentDiv
end
end


Bureaucrats, Check users, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, Widget editors
1,637

edits