mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 19:07:58 +01:00
add "s" and "a" mappings to extended hints mode for saving hint targets
This commit is contained in:
2
NEWS
2
NEWS
@@ -1,6 +1,8 @@
|
|||||||
<pre>
|
<pre>
|
||||||
2007-XX-XX:
|
2007-XX-XX:
|
||||||
* version 0.5.2
|
* version 0.5.2
|
||||||
|
* added "s" and "a" mappings to extended hints mode for saving hint
|
||||||
|
targets
|
||||||
* new :redraw and Ctrl-L commands for forced redrawing of the screen
|
* new :redraw and Ctrl-L commands for forced redrawing of the screen
|
||||||
* added new 'laststatus' option and removed "s" value from 'guioptions'
|
* added new 'laststatus' option and removed "s" value from 'guioptions'
|
||||||
* Tab-completion improvements for :javascript and :open
|
* Tab-completion improvements for :javascript and :open
|
||||||
|
|||||||
@@ -467,6 +467,8 @@ function Hints() //{{{
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: move these functions somewhere more general
|
||||||
|
|
||||||
// this function 'click' an element, which also works
|
// this function 'click' an element, which also works
|
||||||
// for javascript links
|
// for javascript links
|
||||||
this.openHints = function(new_tab, new_window)
|
this.openHints = function(new_tab, new_window)
|
||||||
@@ -561,6 +563,28 @@ function Hints() //{{{
|
|||||||
vimperator.echo("Yanked " + loc);
|
vimperator.echo("Yanked " + loc);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.saveHints = function(skip_prompt)
|
||||||
|
{
|
||||||
|
var elems = this.hintedElements();
|
||||||
|
|
||||||
|
for (var i = 0; i < elems.length; i++)
|
||||||
|
{
|
||||||
|
var doc = elems[i].ownerDocument;
|
||||||
|
var url = makeURLAbsolute(elems[i].refElem.baseURI, elems[i].refElem.href);
|
||||||
|
var text = elems[i].refElem.textContent;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
urlSecurityCheck(url, doc.location.href);
|
||||||
|
saveURL(url, text, null, true, skip_prompt, makeURI(url, doc.characterSet));
|
||||||
|
}
|
||||||
|
catch (e)
|
||||||
|
{
|
||||||
|
vimperator.echoerr(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setMouseOverElement(elem)
|
function setMouseOverElement(elem)
|
||||||
{
|
{
|
||||||
var doc = window.document;
|
var doc = window.document;
|
||||||
|
|||||||
@@ -936,7 +936,8 @@ function Mappings() //{{{
|
|||||||
"<li><code class=\"mapping\">t</code> to open its location in a new tab</li>" +
|
"<li><code class=\"mapping\">t</code> to open its location in a new tab</li>" +
|
||||||
"<li><code class=\"mapping\">O</code> to open its location in an <code class=\"command\">:open</code> query (not implemented yet)</li>" +
|
"<li><code class=\"mapping\">O</code> to open its location in an <code class=\"command\">:open</code> query (not implemented yet)</li>" +
|
||||||
"<li><code class=\"mapping\">T</code> to open its location in an <code class=\"command\">:tabopen</code> query (not implemented yet)</li>" +
|
"<li><code class=\"mapping\">T</code> to open its location in an <code class=\"command\">:tabopen</code> query (not implemented yet)</li>" +
|
||||||
"<li><code class=\"mapping\">s</code> to save its destination (not implemented yet)</li>" +
|
"<li><code class=\"mapping\">s</code> to save its destination</li>" +
|
||||||
|
"<li><code class=\"mapping\">a</code> to save its destination (prompting for save location)</li>" +
|
||||||
"<li><code class=\"mapping\"><C-w></code> to open its destination in a new window</li>" +
|
"<li><code class=\"mapping\"><C-w></code> to open its destination in a new window</li>" +
|
||||||
"</ul>" +
|
"</ul>" +
|
||||||
"Multiple hints can be separated by commas where it makes sense. <code class=\"mapping\">;ab,ac,adt</code> opens <code>AB</code>, <code>AC</code> and <code>AD</code> in a new tab.<br/>" +
|
"Multiple hints can be separated by commas where it makes sense. <code class=\"mapping\">;ab,ac,adt</code> opens <code>AB</code>, <code>AC</code> and <code>AD</code> in a new tab.<br/>" +
|
||||||
@@ -1013,7 +1014,14 @@ function Mappings() //{{{
|
|||||||
}
|
}
|
||||||
));
|
));
|
||||||
addDefaultMap(new Map(vimperator.modes.HINTS, ["s"],
|
addDefaultMap(new Map(vimperator.modes.HINTS, ["s"],
|
||||||
function() { vimperator.echoerr('Saving of links not yet implemented'); },
|
function() { vimperator.hints.saveHints(true); },
|
||||||
|
{
|
||||||
|
cancel_mode: true,
|
||||||
|
always_active: false
|
||||||
|
}
|
||||||
|
));
|
||||||
|
addDefaultMap(new Map([vimperator.modes.HINTS], ["a"],
|
||||||
|
function() { vimperator.hints.saveHints(false); },
|
||||||
{
|
{
|
||||||
cancel_mode: true,
|
cancel_mode: true,
|
||||||
always_active: false
|
always_active: false
|
||||||
|
|||||||
Reference in New Issue
Block a user