mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 22:47:59 +01:00
Show status of radio/checkbox elements in hint label.
This commit is contained in:
@@ -16,7 +16,7 @@ const RangeFinder = Module("rangefinder", {
|
||||
let backwards = mode == modes.FIND_BACKWARD;
|
||||
commandline.open(backwards ? "?" : "/", "", mode);
|
||||
|
||||
if (this.rangeFind && this.rangeFind.window.get() == window)
|
||||
if (this.rangeFind && this.rangeFind.window.get() === window)
|
||||
this.rangeFind.reset();
|
||||
this.find("", backwards);
|
||||
},
|
||||
@@ -127,9 +127,8 @@ const RangeFinder = Module("rangefinder", {
|
||||
set rangeFind(val) buffer.localStore.rangeFind = val,
|
||||
|
||||
/**
|
||||
* Highlights all occurrences of <b>str</b> in the buffer.
|
||||
*
|
||||
* @param {string} str The string to highlight.
|
||||
* Highlights all occurrences of the last searched for string in the
|
||||
* current buffer.
|
||||
*/
|
||||
highlight: function () {
|
||||
if (this.rangeFind)
|
||||
@@ -157,7 +156,6 @@ const RangeFinder = Module("rangefinder", {
|
||||
commandline.registerCallback("change", modes.FIND_BACKWARD, this.closure.onKeyPress);
|
||||
commandline.registerCallback("submit", modes.FIND_BACKWARD, this.closure.onSubmit);
|
||||
commandline.registerCallback("cancel", modes.FIND_BACKWARD, this.closure.onCancel);
|
||||
|
||||
},
|
||||
commands: function () {
|
||||
commands.add(["noh[lsearch]"],
|
||||
@@ -321,7 +319,7 @@ const RangeFind = Class("RangeFind", {
|
||||
let doc = range.startContainer.ownerDocument;
|
||||
let win = doc.defaultView;
|
||||
let ranges = this.ranges.filter(function (r)
|
||||
r.window == win && RangeFind.contains(r.range, range));
|
||||
r.window === win && RangeFind.contains(r.range, range));
|
||||
|
||||
if (this.backward)
|
||||
return ranges[ranges.length - 1];
|
||||
|
||||
@@ -414,7 +414,14 @@ const Hints = Module("hints", {
|
||||
}
|
||||
|
||||
let str = this.getHintString(hintnum);
|
||||
hint.span.setAttribute("number", hint.showText ? str + ": " + hint.text.substr(0, 50) : str);
|
||||
let prefix = "";
|
||||
if (hint.elem instanceof HTMLInputElement)
|
||||
if (hint.elem.type === "radio")
|
||||
prefix = hint.elem.checked ? "⊙ " : "○ ";
|
||||
else if (hint.elem.type === "checkbox")
|
||||
prefix = hint.elem.checked ? "☑ " : "☐ ";
|
||||
|
||||
hint.span.setAttribute("number", str + (hint.showText ? ": " + prefix + hint.text.substr(0, 50) : ""));
|
||||
if (hint.imgSpan)
|
||||
hint.imgSpan.setAttribute("number", str);
|
||||
else
|
||||
@@ -521,6 +528,8 @@ const Hints = Module("hints", {
|
||||
dactyl.trapErrors(this._hintMode.action, this._hintMode,
|
||||
elem, elem.href || elem.src || "",
|
||||
this._extendedhintCount, top);
|
||||
if (this._continue && this._top)
|
||||
this._showHints();
|
||||
}, timeout);
|
||||
return true;
|
||||
},
|
||||
|
||||
@@ -324,16 +324,18 @@
|
||||
|
||||
<item>
|
||||
<tags>D</tags>
|
||||
<strut/>
|
||||
<spec><oa>count</oa>D</spec>
|
||||
<description short="true">
|
||||
<description>
|
||||
<p>Like <k>d</k> but selects the tab to the left of the deleted tabs after deletion.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<tags>:tabo :tabonly</tags>
|
||||
<strut/>
|
||||
<spec>:tabo<oa>nly</oa></spec>
|
||||
<description short="true">
|
||||
<description>
|
||||
<p>Close all buffers other than the currently visible tab.</p>
|
||||
</description>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user