Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Join the Playtest on Steam Now: SpiritVale

Module:GameInfo/Skills: Difference between revisions

From SpiritVale Wiki
No edit summary
Tags: Mobile edit Mobile web edit
No edit summary
Tags: Mobile edit Mobile web edit
Line 217: Line 217:


-- Keywords pill policy: ONLY Domain|Key tokens (from Domain\u007CKey in JSON).
-- Keywords pill policy: ONLY Domain|Key tokens (from Domain\u007CKey in JSON).
-- Pills should NOT render definition icons (match meta behavior).
local function _render_keyword_pill(frame, pill_text)
local function _render_keyword_pill(frame, pill_text)
pill_text = _trim(pill_text)
pill_text = _trim(pill_text)
if pill_text == "" then
if pill_text == "" then
return nil
return nil
end
-- Keywords pill policy: ONLY Domain|Key tokens (from Domain\u007CKey in JSON).
    -- Pills should NOT render definition icons (match meta behavior).
    local function _render_keyword_pill(frame, pill_text)
    pill_text = _trim(pill_text)
    if pill_text == "" then
    return nil
end
end


Line 236: Line 229:


return mw.text.nowiki(pill_text)
return mw.text.nowiki(pill_text)
end
if wt then return wt end
return mw.text.nowiki(pill_text)
end
local function _build_notes_tip(root_id, notes_wt)
notes_wt = _trim(notes_wt)
if notes_wt == "" then return nil end
local tip_id = root_id .. "-notes"
local wrap = mw.html.create("div"):addClass("sv-tip")
local btn = wrap:tag("span")
:addClass("sv-tip-btn")
:attr("role", "button")
:attr("tabindex", "0")
:attr("data-sv-toggle", "1")
:attr("aria-label", "Notes")
:attr("aria-controls", tip_id)
:attr("aria-expanded", "false")
btn:tag("span")
:addClass("sv-ico")
:addClass("sv-ico--info")
:attr("aria-hidden", "true")
:wikitext("i")
local pop = wrap:tag("div")
:addClass("sv-tip-pop")
:addClass("sv-hidden")
:attr("id", tip_id)
:attr("role", "dialog")
:attr("aria-label", "Notes")
local head = pop:tag("div"):addClass("sv-tip-pop-head")
head:tag("div"):addClass("sv-tip-pop-title"):wikitext("Notes")
head:tag("div"):addClass("sv-tip-pop-hint"):wikitext("Click to close")
pop:tag("div"):addClass("sv-tip-pop-body"):wikitext(notes_wt)
return wrap
end
end