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

Added n and N commands

This commit is contained in:
Martin Stubenschrott
2007-04-17 20:07:56 +00:00
parent d80bc4666a
commit 277eaa6eb9
5 changed files with 34 additions and 11 deletions

View File

@@ -1,4 +1,10 @@
<pre>
date:
* version 0.4
* added :edit, :e and :tabedit aliases for :open, :tabopen
* :open without argument reloads current page, :tabopen opens an empty tab
* added 'n' and 'N' to repeat a search
17/04/2007:
* version 0.3
* added Ctrl-v support to pass one key to firefox (patch by Muthu Kannan)

View File

@@ -1,6 +1,6 @@
<pre>
<b>Note:</b> If you don't wish to appear on this list when making a donation, please tell me.
Also if you want the amount or email adress or whatever listet, send me an email.
Also if you want the amount or email address or whatever listet, send me an email.
* Andrew Pantyukhin
</pre>

1
TODO
View File

@@ -46,5 +46,6 @@ FEATURES:
4 Support multiple top-level windows?
4 :restart command to restart firefox
3 Splitting Windows with [:sp :vsp ctrl-w,s ctrl-w,v] and closing with [ctrl-w,q], moving with [ctrl-w,w or tab]
have a look into the split browser extension
3 :set should also set about:config options (with autocomplete)
</pre>

View File

@@ -173,7 +173,7 @@ var g_commands = [/*{{{*/
null
],
[
["open", "o"],
["open", "o", "op", "ope", "edit", "e"],
"Open one ore more URLs",
"Usage: <code>:open &lt;url&gt; [| &lt;url&gt;]</code><br>" +
"Opens one ore more URLs in the current buffer.<br>"+
@@ -183,8 +183,9 @@ var g_commands = [/*{{{*/
" <li>Opened with the default search engine if the first word is no search engine (<code>:open linus torvalds</code> will open a google search for linux torvalds).</li>"+
" <li>Passed directly to Firefox in all other cases (<code>:open www.osnews.com | www.slashdot.org</code> will open OSNews in the current, and Slashdot in a new background tab).</li></ol>"+
"You WILL be able to use <code>:open [-T \"linux\"] torvalds&lt;Tab&gt;</code> to complete bookmarks with tag \"linux\" and which contain \"torvalds\". Note that -T support is only available for tab completion, not for the actual command.<br>"+
"The items which are completed on <code>&lt;Tab&gt;</code> are specified in the <code>'complete'</code> option.",
function(args) { if(args) openURLs(args); else reload(false); },
"The items which are completed on <code>&lt;Tab&gt;</code> are specified in the <code>'complete'</code> option.<br>"+
"Without argument, reloads the current page.",
function(args) { if(args.length > 0) openURLs(args); else reload(false); },
function(filter) { return get_url_completions(filter); }
],
[
@@ -195,7 +196,7 @@ var g_commands = [/*{{{*/
null
],
[
["quit", "q"],
["quit", "q", "qu", "qui"],
"Quit current tab or quit Vimperator if this was the last tab",
"When quitting Vimperator, the session is not stored.",
function (args) { tab_remove(1, false, 1); },
@@ -250,10 +251,10 @@ var g_commands = [/*{{{*/
null
],
[
["tabopen", "t", "to", "topen"],
["tabopen", "t", "to", "topen", "tabedit"],
"Open one or more URLs in a new tab",
"Like <code class=command>:open</code> but open URLs in a new tab. If used with !, the 'tabopen' value of the 'activate' setting is negated.",
function (args, special) { openURLsInNewTab(args, !special); },
function (args, special) { if (args.length > 0) openURLsInNewTab(args, !special); else openURLsInNewTab("about:blank", true); },
function (filter) { return get_url_completions(filter); }
],
[
@@ -552,7 +553,7 @@ var g_mappings = [/*{{{*/
[
["<C-f>", "<PageDown>"],
"Scroll down a page",
"Scroll dow a full page of the current document. No count support for now.",
"Scroll down a full page of the current document. No count support for now.",
function(count) { goDoCommand('cmd_scrollPageDown'); }
],
@@ -619,6 +620,19 @@ var g_mappings = [/*{{{*/
function(count) { hah.enableHahMode(HINT_MODE_EXTENDED); }
],
/* search managment */
[
["n"],
"Find next",
"Repeat the last \"/\" 1 time (until count is supported).",
function(count) { gFindBar.onFindAgainCmd(); } // this does not work, why?: goDoCommand('cmd_findAgain'); }
],
[
["N"],
"Find previous",
"Repeat the last \"/\" 1 time (until count is supported) in the opposite direction.",
function(count) { gFindBar.onFindPreviousCmd(); } // this does not work, why?: goDoCommand('cmd_findPrevious'); }
],
/* vimperator managment */
[
@@ -880,11 +894,13 @@ function openURLs(str)
{
urls = stringToURLs(str);
if (urls.length == 0)
return;
return false;
getWebNavigation().loadURI(urls[0], nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
for (var url=1; url < urls.length; url++)
gBrowser.addTab(urls[url]);
return true;
}
function openURLsInNewTab(str, activate)

View File

@@ -245,7 +245,7 @@ function hit_a_hint()
}
/* removes all visible hints from doc
* or from current document, if doc == null
* or from current document, if win == null
*/
function removeHints(win)
{
@@ -253,7 +253,7 @@ function hit_a_hint()
win = window._content;
var doc = win.document;
var res = doc.evaluate("//HINTS/SPAN", doc, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE , null);
var res = doc.evaluate("//HINTS/SPAN", doc, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
var elem, i;
for (i = 0; i < res.snapshotLength; i++)