Bureaucrats, Check users, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, Widget editors
1,642
edits
(this may be dumb but maybe smart) |
mNo edit summary |
||
(18 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 121: | Line 121: | ||
spriteDiv:addClass("enchanted") | spriteDiv:addClass("enchanted") | ||
end | end | ||
local link = args['link'] or args['Link'] | local link = args['link'] or args['Link'] | ||
if link and #link ~= 0 then | if link and #link ~= 0 then | ||
if link:sub( 1,2 ) == '[[' then | if link:sub( 1,2 ) == '[[' then | ||
parentDiv:wikitext(link:sub( 1,#link-2 ) | parentDiv:wikitext(link:sub( 1,#link-2 ) .. '|') | ||
elseif link:sub ( 1,1 ) == '[' then | elseif link:sub ( 1,1 ) == '[' then | ||
parentDiv:wikitext(link:sub( 1,#link-1 ) | parentDiv:wikitext(link:sub( 1,#link-1 ) .. '|') | ||
end | end | ||
end | end | ||
Line 134: | Line 133: | ||
parentDiv:node(spriteDiv) | parentDiv:node(spriteDiv) | ||
if link and #link ~= 0 then | if link and #link ~= 0 then | ||
if link:sub( 1,2 ) == '[[' then | if link:sub( 1,2 ) == '[[' then |
edits