Module:GameSkills: Difference between revisions
From SpiritVale Wiki
More actions
No edit summary |
No edit summary |
||
| Line 145: | Line 145: | ||
return (v ~= nil) and tostring(v) or nil | return (v ~= nil) and tostring(v) or nil | ||
end | end | ||
| Line 917: | Line 905: | ||
local iconBox = wrap:tag("div") | local iconBox = wrap:tag("div") | ||
iconBox:addClass("sv-herobar-icon") | iconBox:addClass("sv-herobar-icon") | ||
if icon and icon ~= "" then | if icon and icon ~= "" then | ||
| Line 925: | Line 910: | ||
end | end | ||
if hasNotes then | local textBox = wrap:tag("div") | ||
local notesBtn = mw.html.create(" | textBox:addClass("sv-herobar-text") | ||
local titleBox = textBox:tag("div") | |||
titleBox:addClass("spiritvale-infobox-title") | |||
if hasNotes and icon and icon ~= "" then | |||
local notesBtn = mw.html.create("span") | |||
notesBtn:addClass("sv-tip-btn sv-tip-btn--notes") | notesBtn:addClass("sv-tip-btn sv-tip-btn--notes") | ||
notesBtn:attr(" | notesBtn:attr("role", "button") | ||
notesBtn:attr("tabindex", "0") | |||
notesBtn:attr("data-sv-tip", "notes") | notesBtn:attr("data-sv-tip", "notes") | ||
notesBtn:attr("aria-label", "Notes") | notesBtn:attr("aria-label", "Notes") | ||
notesBtn:attr("aria-expanded", "false") | notesBtn:attr("aria-expanded", "false") | ||
notesBtn: | notesBtn:tag("span"):addClass("sv-ico sv-ico--info"):attr("aria-hidden", "true"):wikitext("i") | ||
iconBox:node(notesBtn) | iconBox:node(notesBtn) | ||
end | end | ||
if hasNotes and (not icon or icon == "") then | |||
:addClass(" | local notesBtn = mw.html.create("span") | ||
:wikitext(title) | notesBtn:addClass("sv-tip-btn sv-tip-btn--notes") | ||
notesBtn:attr("role", "button") | |||
notesBtn:attr("tabindex", "0") | |||
notesBtn:attr("data-sv-tip", "notes") | |||
notesBtn:attr("aria-label", "Notes") | |||
notesBtn:attr("aria-expanded", "false") | |||
notesBtn:tag("span"):addClass("sv-ico sv-ico--info"):attr("aria-hidden", "true"):wikitext("i") | |||
titleBox:node(notesBtn) | |||
end | |||
titleBox:wikitext(title) | |||
if hasReq then | if hasReq then | ||
local pillRow = | local pillRow = textBox:tag("div") | ||
pillRow:addClass("sv-pill-row") | pillRow:addClass("sv-pill-row") | ||
local pill = mw.html.create(" | local pill = mw.html.create("span") | ||
pill:addClass("sv-pill sv-pill--req sv-tip-btn") | pill:addClass("sv-pill sv-pill--req sv-tip-btn") | ||
pill:attr(" | pill:attr("role", "button") | ||
pill:attr("tabindex", "0") | |||
pill:attr("data-sv-tip", "req") | pill:attr("data-sv-tip", "req") | ||
pill:attr("aria-label", "Requirements") | pill:attr("aria-label", "Requirements") | ||