Module:Crafting: Difference between revisions

m
no edit summary
m (Why are there two of these)
mNo edit summary
 
(44 intermediate revisions by 2 users not shown)
Line 97: Line 97:
if hideTooltip then
if hideTooltip then
sprite:HideTooltip()
sprite:HideTooltip()
end
local enchanted = args['enchanted'] or args['Enchanted']
if enchanted then
sprite:addClass("enchanted")
end
end


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 114: Line 110:
end
end


local count = tonumber(args['count']) or tonumber(args['Count']) or 1 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 = spriteDiv:tag("span"):wikitext(count)
local countSpan = parentDiv:tag("span"):wikitext(count)
countSpan:addClass("invslot-stacksize")
countSpan:addClass("invslot-stacksize")
end
end


return spriteDiv
 
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 172: Line 193:
if hideTooltip then
if hideTooltip then
sprite:HideTooltip()
sprite:HideTooltip()
end
local enchanted = args['enchanted'] or args['Enchanted']
if enchanted then
sprite:addClass("enchanted")
end
end


Line 186: 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
Bureaucrats, Check users, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, Widget editors
1,637

edits