mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 06:37:59 +01:00
Make a distinction between Hint/@number and Hint/@text. Closes issue #186.
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
: "moz-icon://" + f.leafName
|
||||
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;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
position: absolute !important;
|
||||
top: 0 !important;
|
||||
left: 0 !important;
|
||||
width: 4000px !important;
|
||||
}
|
||||
|
||||
[dactyl|highlight~=HintImage],
|
||||
|
||||
Reference in New Issue
Block a user