1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 12:58:00 +01:00

Fix hint encoding on non-recent Gecko builds. Closes issue #110.

This commit is contained in:
Kris Maglione
2010-10-21 06:19:07 -04:00
parent fafd591cf0
commit acb635d825

View File

@@ -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