1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-04-10 13:23:35 +02:00

Fix ;t and ;b extended hint modes in the MOW.

This commit is contained in:
Doug Kearns
2009-03-03 00:14:37 +11:00
parent 4cd6c1b271
commit 614ab6082c
2 changed files with 46 additions and 45 deletions

View File

@@ -1412,25 +1412,53 @@ function CommandLine() //{{{
let closeWindow = false; let closeWindow = false;
let passEvent = false; let passEvent = false;
function isScrollable() !win.scrollMaxY == 0; let key = events.toString(event);
function atEnd() win.scrollY / win.scrollMaxY >= 1;
if (event.type == "click") // TODO: Wouldn't multiple handlers be cleaner? --djk
if (event.type == "click" && event.target instanceof HTMLAnchorElement)
{ {
if (event.target instanceof HTMLAnchorElement && event.button < 2) function openLink(where)
{ {
event.preventDefault(); event.preventDefault();
let target = event.button == 0 ? liberator.CURRENT_TAB : liberator.NEW_TAB; // FIXME: Why is this needed? --djk
if (event.target.getAttribute("href") == "#") if (event.target.getAttribute("href") == "#")
liberator.open(event.target.textContent, target); liberator.open(event.target.textContent, where);
else else
liberator.open(event.target.href, target); liberator.open(event.target.href, where);
} }
switch (key)
{
case "<LeftMouse>":
// FIXME: the :ls output no longer wraps the buffer URL in an anchor element
if (event.originalTarget.getAttributeNS(NS.uri, "highlight") == "URL buffer-list")
{
event.preventDefault();
tabs.select(parseInt(event.originalTarget.parentNode.parentNode.firstChild.textContent, 10) - 1);
}
else
{
openLink(liberator.CURRENT_TAB);
}
break;
case "<MiddleMouse>":
case "<C-LeftMouse>":
case "<C-M-LeftMouse>":
openLink(liberator.NEW_BACKGROUND_TAB);
break;
case "<S-MiddleMouse>":
case "<C-S-LeftMouse>":
case "<C-M-S-LeftMouse>":
openLink(liberator.NEW_TAB);
break;
case "<S-LeftMouse>":
openLink(liberator.NEW_WINDOW);
break;
}
return; return;
} }
let key = events.toString(event);
if (startHints) if (startHints)
{ {
statusline.updateInputBuffer(""); statusline.updateInputBuffer("");
@@ -1439,6 +1467,9 @@ function CommandLine() //{{{
return; return;
} }
function isScrollable() !win.scrollMaxY == 0;
function atEnd() win.scrollY / win.scrollMaxY >= 1;
switch (key) switch (key)
{ {
case "<Esc>": case "<Esc>":
@@ -1488,34 +1519,6 @@ function CommandLine() //{{{
break; break;
// TODO: <LeftMouse> on the prompt line should scroll one page // TODO: <LeftMouse> on the prompt line should scroll one page
case "<LeftMouse>":
if (event.originalTarget.getAttributeNS(NS.uri, "highlight") == "URL buffer-list")
{
tabs.select(parseInt(event.originalTarget.parentNode.parentNode.firstChild.textContent, 10) - 1);
closeWindow = true;
break;
}
else if (event.originalTarget.localName.toLowerCase() == "a")
{
liberator.open(event.originalTarget.textContent);
break;
}
case "<A-LeftMouse>": // for those not owning a 3-button mouse
case "<MiddleMouse>":
if (event.originalTarget.localName.toLowerCase() == "a")
{
let where = /\btabopen\b/.test(options["activate"]) ?
liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB;
liberator.open(event.originalTarget.textContent, where);
}
break;
// let Firefox handle those to select table cells or show a context menu
case "<C-LeftMouse>":
case "<RightMouse>":
case "<C-S-LeftMouse>":
break;
// page down // page down
case "f": case "f":
if (options["more"] && isScrollable()) if (options["more"] && isScrollable())
@@ -1606,7 +1609,7 @@ function CommandLine() //{{{
if (passEvent) if (passEvent)
events.onKeyPress(event); events.onKeyPress(event);
} }
else // set update the prompt string else
{ {
commandline.updateMorePrompt(showMorePrompt, showMoreHelpPrompt); commandline.updateMorePrompt(showMorePrompt, showMoreHelpPrompt);
} }

View File

@@ -17,7 +17,6 @@ BUGS:
- insert abbreviations broken on <space> - insert abbreviations broken on <space>
- :sidebar improvements (:sidebar! Downloads while downloads is open should refocus the sidebar) - :sidebar improvements (:sidebar! Downloads while downloads is open should refocus the sidebar)
- ;s saves the page rather than the image - ;s saves the page rather than the image
- http://cgiirc.blitzed.org?chan=%23debug is unusable after login in
- "g<" fails without a trailing escape because both "g<" and "g<C-g>" - "g<" fails without a trailing escape because both "g<" and "g<C-g>"
are mapped. Vimp should recognize "<C-g>" as an atom that should not are mapped. Vimp should recognize "<C-g>" as an atom that should not
be matched literally. In fact, typing "g<C-g>" out literally is be matched literally. In fact, typing "g<C-g>" out literally is
@@ -33,14 +32,13 @@ BUGS:
=> it often overwrites the open command line while editing etc. => it often overwrites the open command line while editing etc.
- <tags> and <keyword> autocmd 'keywords' are not available when adding a - <tags> and <keyword> autocmd 'keywords' are not available when adding a
bookmark - they're being set after the observer triggers the autocmd event. bookmark - they're being set after the observer triggers the autocmd event.
- MOW rendering is broken for multiple commands when open E.g. :ls | ls - MOW rendering is broken for multiple commands when open (E.g. :ls | ls) This
- completion height is broken, try :a<tab>....<tab>, when it wraps it's totally off. appears to be the result of using the Message class when appending multiline
and even if it is not totally off, i had it jump by one pixel when wrapping around. output to an open MOW.
If that's unfixable, i propose reverting the new completion height stuff.
- :messages is _very_ slow for message history of several thousand lines -> - :messages is _very_ slow for message history of several thousand lines ->
Unresponsive Script: util.js:79 (sometimes xmlToDom() and elsewhere) Unresponsive Script: util.js:79 (sometimes xmlToDom() and elsewhere)
- :hardcopy! seems to be broken for me - The MOW shouldn't close when executing hints and ;F isn't working.
- some extended hint commands aren't working in the MOW (;; ;t ;b ;? ;F) - URLs in :ls output are no longer hyperlinks
FEATURES: FEATURES:
9 finish :help TODOs 9 finish :help TODOs