summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-01-05 17:31:04 -0500
committerKris Maglione <maglione.k@gmail.com>2011-01-05 17:31:04 -0500
commit663a3981126591f75c3c0b8b011b7b797c29f19d (patch)
tree2b244e030b356a78444bfc10002f592d502195bb
parentf289de288797bb3b6e4ce3e055aa6aeabe74b5b8 (diff)
downloadpentadactyl-663a3981126591f75c3c0b8b011b7b797c29f19d.tar.gz
Play with semi-transparent hints.
-rw-r--r--common/content/hints.js28
-rw-r--r--common/modules/config.jsm13
2 files changed, 23 insertions, 18 deletions
diff --git a/common/content/hints.js b/common/content/hints.js
index 2f8bf604..c4c1c2fc 100644
--- a/common/content/hints.js
+++ b/common/content/hints.js
@@ -364,13 +364,17 @@ var Hints = Module("hints", {
* @param {number} oldId The currently active hint.
*/
_showActiveHint: function _showActiveHint(newId, oldId) {
- let oldElem = this._validHints[oldId - 1];
- if (oldElem)
- this._setClass(oldElem, false);
+ let oldHint = this._validHints[oldId - 1];
+ if (oldHint) {
+ this._setClass(oldHint.elem, false);
+ oldHint.span.removeAttribute("active");
+ }
- let newElem = this._validHints[newId - 1];
- if (newElem)
- this._setClass(newElem, true);
+ let newHint = this._validHints[newId - 1];
+ if (newHint) {
+ this._setClass(newHint.elem, true);
+ newHint.span.setAttribute("active", "true");
+ }
},
/**
@@ -453,7 +457,7 @@ var Hints = Module("hints", {
hint.imgSpan.setAttribute("number", str);
else
this._setClass(hint.elem, activeHint == hintnum);
- this._validHints.push(hint.elem);
+ this._validHints.push(hint);
hintnum++;
}
}
@@ -518,9 +522,9 @@ var Hints = Module("hints", {
}
if (!followFirst) {
- let firstHref = this._validHints[0].getAttribute("href") || null;
+ let firstHref = this._validHints[0].elem.getAttribute("href") || null;
if (firstHref) {
- if (this._validHints.some(function (e) e.getAttribute("href") != firstHref))
+ if (this._validHints.some(function (h) h.elem.getAttribute("href") != firstHref))
return;
}
else if (this._validHints.length > 1)
@@ -529,7 +533,7 @@ var Hints = Module("hints", {
let timeout = followFirst || events.feedingKeys ? 0 : 500;
let activeIndex = (this._hintNumber ? this._hintNumber - 1 : 0);
- let elem = this._validHints[activeIndex];
+ let elem = this._validHints[activeIndex].elem;
let top = this._top;
if (this._continue)
@@ -539,8 +543,8 @@ var Hints = Module("hints", {
let n = 5;
(function next() {
- let hinted = n || this._validHints.some(function (e) e === elem);
- this._setClass(elem, n ? n % 2 : !hinted ? null : this._validHints[Math.max(0, this._hintNumber-1)] === elem);
+ let hinted = n || this._validHints.some(function (h) h.elem === elem);
+ this._setClass(elem, n ? n % 2 : !hinted ? null : this._validHints[Math.max(0, this._hintNumber-1)].elem === elem);
if (n--)
this.timeout(next, 50);
}).call(this);
diff --git a/common/modules/config.jsm b/common/modules/config.jsm
index 79e21d7a..b01bfbd1 100644
--- a/common/modules/config.jsm
+++ b/common/modules/config.jsm
@@ -429,14 +429,15 @@ var ConfigBase = Class("ConfigBase", {
Hint;;* {
font: bold 10px "Droid Sans Mono", monospace !important;
padding: 0 1px;
- border: 1px solid black;
- background: #fff8e7;
+ border: 1px solid rgba(0, 0, 0, .5);
+ background: rgba(255, 248, 231, .8);
color: black;
}
- Hint::after;;* content: attr(text) !important;
- HintElem;;* background-color: yellow !important; color: black !important;
- HintActive;;* background-color: #88FF00 !important; color: black !important;
- HintImage;;* opacity: .5 !important;
+ Hint[active];;* background: rgba(255, 253, 208, .8);
+ Hint::after;;* content: attr(text) !important;
+ HintElem;;* background-color: yellow !important; color: black !important;
+ HintActive;;* background-color: #88FF00 !important; color: black !important;
+ HintImage;;* opacity: .5 !important;
// </css>
]]></>, /&#x0d;/g, "\n")),