mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 22:38:00 +01:00
Magic.
This commit is contained in:
@@ -532,6 +532,7 @@ var HintSession = Class("HintSession", CommandMode, {
|
|||||||
*/
|
*/
|
||||||
removeHints: function _removeHints(timeout) {
|
removeHints: function _removeHints(timeout) {
|
||||||
for (let { doc, start, end } in values(this.docs)) {
|
for (let { doc, start, end } in values(this.docs)) {
|
||||||
|
DOM(doc.documentElement).highlight.remove("Hinting");
|
||||||
// Goddamn stupid fucking Gecko 1.x security manager bullshit.
|
// Goddamn stupid fucking Gecko 1.x security manager bullshit.
|
||||||
try { delete doc.dactylLabels; } catch (e) { doc.dactylLabels = undefined; }
|
try { delete doc.dactylLabels; } catch (e) { doc.dactylLabels = undefined; }
|
||||||
|
|
||||||
@@ -574,6 +575,7 @@ var HintSession = Class("HintSession", CommandMode, {
|
|||||||
this.validHints = [];
|
this.validHints = [];
|
||||||
|
|
||||||
for (let { doc, start, end } in values(this.docs)) {
|
for (let { doc, start, end } in values(this.docs)) {
|
||||||
|
DOM(doc.documentElement).highlight.add("Hinting");
|
||||||
let [offsetX, offsetY] = this.getContainerOffsets(doc);
|
let [offsetX, offsetY] = this.getContainerOffsets(doc);
|
||||||
|
|
||||||
inner:
|
inner:
|
||||||
@@ -590,13 +592,13 @@ var HintSession = Class("HintSession", CommandMode, {
|
|||||||
if (!rect)
|
if (!rect)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
hint.imgSpan = util.xmlToDom(<span highlight="Hint" dactyl:hl="HintImage" xmlns:dactyl={NS}/>, doc);
|
hint.imgSpan = DOM(<span highlight="Hint" dactyl:hl="HintImage" xmlns:dactyl={NS}/>, doc).css({
|
||||||
hint.imgSpan.style.display = "none";
|
display: "none",
|
||||||
hint.imgSpan.style.left = (rect.left + offsetX) + "px";
|
left: (rect.left + offsetX) + "px",
|
||||||
hint.imgSpan.style.top = (rect.top + offsetY) + "px";
|
top: (rect.top + offsetY) + "px",
|
||||||
hint.imgSpan.style.width = (rect.right - rect.left) + "px";
|
width: (rect.right - rect.left) + "px",
|
||||||
hint.imgSpan.style.height = (rect.bottom - rect.top) + "px";
|
height: (rect.bottom - rect.top) + "px"
|
||||||
hint.span.parentNode.appendChild(hint.imgSpan);
|
}).appendTo(hint.span.parentNode)[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,12 +55,12 @@ var DOM = Class("DOM", {
|
|||||||
this[length++] = DOM.fromXML(val, context, this.nodes);
|
this[length++] = DOM.fromXML(val, context, this.nodes);
|
||||||
else if (val instanceof Ci.nsIDOMNode || val instanceof Ci.nsIDOMWindow)
|
else if (val instanceof Ci.nsIDOMNode || val instanceof Ci.nsIDOMWindow)
|
||||||
this[length++] = val;
|
this[length++] = val;
|
||||||
else if ("length" in val)
|
|
||||||
for (let i = 0; i < val.length; i++)
|
|
||||||
this[length++] = val[i];
|
|
||||||
else if ("__iterator__" in val || isinstance(val, ["Iterator", "Generator"]))
|
else if ("__iterator__" in val || isinstance(val, ["Iterator", "Generator"]))
|
||||||
for (let elem in val)
|
for (let elem in val)
|
||||||
this[length++] = elem;
|
this[length++] = elem;
|
||||||
|
else if ("length" in val)
|
||||||
|
for (let i = 0; i < val.length; i++)
|
||||||
|
this[length++] = val[i];
|
||||||
else
|
else
|
||||||
this[length++] = val;
|
this[length++] = val;
|
||||||
|
|
||||||
|
|||||||
@@ -243,8 +243,9 @@ FrameIndicator;;* {
|
|||||||
Bell /* &dactyl.appName;’s visual bell */ \
|
Bell /* &dactyl.appName;’s visual bell */ \
|
||||||
background-color: black !important;
|
background-color: black !important;
|
||||||
|
|
||||||
|
Hinting;;* /* A document which is currently being hinted */
|
||||||
Hint;;* {
|
Hint;;* {
|
||||||
/* A hint indicator. See <ex>:help hints</ex> */
|
/* A hint indicator. See :help hints */
|
||||||
font: bold 10px "Droid Sans Mono", monospace !important;
|
font: bold 10px "Droid Sans Mono", monospace !important;
|
||||||
margin: -.2ex;
|
margin: -.2ex;
|
||||||
padding: 0 0 0 1px;
|
padding: 0 0 0 1px;
|
||||||
|
|||||||
Reference in New Issue
Block a user