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

Make a distinction between Hint/@number and Hint/@text. Closes issue #186.

This commit is contained in:
Kris Maglione
2010-12-16 22:49:00 -05:00
parent 011a7edd29
commit 2b254ecc6b
5 changed files with 17 additions and 17 deletions

View File

@@ -15,7 +15,7 @@
<binding id="magic" inheritstyle="false">
<content>
<html:span xbl:inherits="dactyl:highlight=dactyl:highlight,number,style" />
<html:span xbl:inherits="dactyl:highlight=dactyl:highlight,number,style,text" />
</content>
</binding>

View File

@@ -270,7 +270,7 @@ const ConfigBase = Class(ModuleBase, {
border: 0px solid ButtonShadow !important;
padding: 0px 1px !important;
}
Hint::after;;* content: attr(number) !important;
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;

View File

@@ -426,13 +426,14 @@ const Hints = Module("hints", {
let text = [];
if (hint.elem instanceof HTMLInputElement)
if (hint.elem.type === "radio")
text.push(UTF8(hint.elem.checked ? "⊙ " : "○ "));
text.push(UTF8(hint.elem.checked ? "⊙" : "○"));
else if (hint.elem.type === "checkbox")
text.push(UTF8(hint.elem.checked ? "☑ " : "☐ "));
text.push(UTF8(hint.elem.checked ? "☑" : "☐"));
if (hint.showText)
text.push(hint.text.substr(0, 50));
hint.span.setAttribute("number", str + (text.length ? ": " + text.join(" ") : ""));
hint.span.setAttribute("text", str + (text.length ? ": " + text.join(" ") : ""));
hint.span.setAttribute("number", str);
if (hint.imgSpan)
hint.imgSpan.setAttribute("number", str);
else

View File

@@ -652,16 +652,15 @@ lookup:
completion.directory = function directory(context, full) {
this.file(context, full);
context.filters.push(function ({ item }) item.isDirectory());
context.filters.push(function (item) item.isdir);
};
completion.environment = function environment(context) {
let command = util.OS.isWindows ? "set" : "env";
let lines = io.system(command).split("\n");
lines.pop();
context.title = ["Environment Variable", "Value"];
context.generate = function () lines.map(function (line) (line.match(/([^=]+)=(.+)/) || []).slice(1));
context.generate = function ()
io.system(util.OS.isWindows ? "set" : "env")
.split("\n").filter(function (line) line.indexOf("=") > 0)
.map(function (line) line.match(/([^=]+)=(.*)/).slice(1));
};
completion.file = function file(context, full, dir) {
@@ -679,17 +678,16 @@ lookup:
context.title = [full ? "Path" : "Filename", "Type"];
context.keys = {
text: !full ? "leafName" : function (f) dir + f.leafName,
description: function (f) f.isDirectory() ? "Directory" : "File",
description: function (f) this.isdir ? "Directory" : "File",
isdir: function (f) f.isDirectory(),
icon: function (f) f.isDirectory() ? "resource://gre/res/html/folder.png"
icon: function (f) this.isdir ? "resource://gre/res/html/folder.png"
: "moz-icon://" + f.leafName
};
context.compare = function (a, b)
b.isdir - a.isdir || String.localeCompare(a.text, b.text);
context.compare = function (a, b) b.isdir - a.isdir || String.localeCompare(a.text, b.text);
if (options["wildignore"]) {
let wig = options.get("wildignore");
context.filters.push(function ({ item }) item.isDirectory() || !wig.getKey(this.name));
context.filters.push(function (item) item.isdir || !wig.getKey(this.name));
}
// context.background = true;

View File

@@ -15,6 +15,7 @@
position: absolute !important;
top: 0 !important;
left: 0 !important;
width: 4000px !important;
}
[dactyl|highlight~=HintImage],