Module:Sprite: Difference between revisions

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


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

edits

Navigation menu