Bureaucrats, Check users, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, Widget editors
1,637
edits
m (Has to be the div) |
mNo edit summary |
||
(21 intermediate revisions by 2 users not shown) | |||
Line 101: | Line 101: | ||
local inline = args['inline'] or args['Inline'] | local inline = args['inline'] or args['Inline'] | ||
local spriteDiv | local spriteDiv | ||
local parentDiv = mw.html.create("span") | local parentDiv = mw.html.create("span"):css("position","relative") | ||
if inline ~= 'false' then | if inline ~= 'false' then | ||
spriteDiv = sprite:GenerateHTML("span") | spriteDiv = sprite:GenerateHTML("span") | ||
Line 110: | Line 110: | ||
end | end | ||
local count = tonumber(args['count']) or tonumber(args['Count']) or | local count = tonumber(args['count']) or tonumber(args['Count']) or string.match(tostring(args['count']),'%?') or string.match(tostring(args['Count']),'%?') or 1 | ||
if count ~= 1 then | if count ~= 1 then | ||
local countSpan = parentDiv:tag("span"):wikitext(count) | local countSpan = parentDiv:tag("span"):wikitext(count) | ||
Line 116: | Line 116: | ||
end | end | ||
local enchanted = args['enchanted'] or args['Enchanted'] | local enchanted = args['enchanted'] or args['Enchanted'] | ||
Line 126: | Line 122: | ||
end | end | ||
parentDiv: | local link = args['link'] or args['Link'] | ||
if link and #link ~= 0 then | |||
if link:sub( 1,2 ) == '[[' then | |||
parentDiv:wikitext(link:sub( 1,#link-2 ) .. '|') | |||
elseif link:sub ( 1,1 ) == '[' then | |||
parentDiv:wikitext(link:sub( 1,#link-1 ) .. '|') | |||
end | |||
end | |||
parentDiv:node(spriteDiv) | |||
if link and #link ~= 0 then | |||
if link:sub( 1,2 ) == '[[' then | |||
parentDiv:wikitext(']]') | |||
elseif link:sub ( 1,1 ) == '[' then | |||
parentDiv:wikitext(']') | |||
end | |||
end | |||
return parentDiv | return parentDiv |
edits