Bureaucrats, Check users, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, Widget editors
1,676
edits
m (enchantable with stack argument) |
mNo edit summary |
||
(45 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"):css("position","relative") | |||
if inline ~= 'false' then | if inline ~= 'false' then | ||
spriteDiv = sprite:GenerateHTML("span") | spriteDiv = sprite:GenerateHTML("span") | ||
Line 109: | 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 = | local countSpan = parentDiv:tag("span"):wikitext(count) | ||
countSpan:addClass("invslot-stacksize") | countSpan:addClass("invslot-stacksize") | ||
end | end | ||
return | |||
local enchanted = args['enchanted'] or args['Enchanted'] | |||
if enchanted == 'true' then | |||
spriteDiv:addClass("enchanted") | |||
end | |||
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 | |||
end | end | ||
Line 167: | Line 193: | ||
if hideTooltip then | if hideTooltip then | ||
sprite:HideTooltip() | sprite:HideTooltip() | ||
end | end | ||
Line 181: | Line 202: | ||
spriteDiv:css("border-width","3px") | spriteDiv:css("border-width","3px") | ||
spriteDiv:css("border-style","solid") | spriteDiv:css("border-style","solid") | ||
spriteDiv:css("box-sizing","border-box") | |||
if args['standard'] or args['Standard'] then | if args['standard'] or args['Standard'] then |
edits