From acb635d8250a6f2dbbe3d01aed7d86073bf0a34d Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 21 Oct 2010 06:19:07 -0400 Subject: [PATCH] Fix hint encoding on non-recent Gecko builds. Closes issue #110. --- common/content/hints.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/common/content/hints.js b/common/content/hints.js index 327dcfb3..d5efa1e1 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -414,14 +414,16 @@ const Hints = Module("hints", { } let str = this.getHintString(hintnum); - let prefix = ""; + let text = []; if (hint.elem instanceof HTMLInputElement) if (hint.elem.type === "radio") - prefix = hint.elem.checked ? "⊙ " : "○ "; + text.push(UTF8(hint.elem.checked ? "⊙ " : "○ ")); else if (hint.elem.type === "checkbox") - prefix = hint.elem.checked ? "☑ " : "☐ "; + text.push(UTF8(hint.elem.checked ? "☑ " : "☐ ")); + if (hint.showText) + text.push(hint.text.substr(0, 50)); - hint.span.setAttribute("number", str + (hint.showText ? ": " + prefix + hint.text.substr(0, 50) : "")); + hint.span.setAttribute("number", str + (text.length ? ": " + text.join(" ") : "")); if (hint.imgSpan) hint.imgSpan.setAttribute("number", str); else