mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 05:58:03 +01:00
Merge branch 'master' into vimperator-2.1
Conflicts: vimperator/NEWS vimperator/locale/en-US/starting.txt
This commit is contained in:
@@ -867,9 +867,16 @@ function Buffer() //{{{
|
||||
/**
|
||||
* @property {string} The current top-level document's URL.
|
||||
*/
|
||||
get URL()
|
||||
get URL() window.content.location.href,
|
||||
|
||||
/**
|
||||
* @property {string} The current top-level document's URL, sans any
|
||||
* fragment identifier.
|
||||
*/
|
||||
get URI()
|
||||
{
|
||||
return window.content.document.location.href;
|
||||
let loc = window.content.location;
|
||||
return loc.href.substr(0, loc.href.length - loc.hash.length);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1044,7 +1051,12 @@ function Buffer() //{{{
|
||||
|
||||
function followFrame(frame)
|
||||
{
|
||||
function iter(elems) (e for ([i, e] in Iterator(elems)) if (e.rel.toLowerCase() == rel || e.rev.toLowerCase() == rel));
|
||||
function iter(elems)
|
||||
{
|
||||
for (let i = 0; i < elems.length; i++)
|
||||
if (elems[i].rel.toLowerCase() == rel || elems[i].rev.toLowerCase() == rel)
|
||||
yield elems[i];
|
||||
}
|
||||
|
||||
// <link>s have higher priority than normal <a> hrefs
|
||||
let elems = frame.document.getElementsByTagName("link");
|
||||
@@ -1065,16 +1077,10 @@ function Buffer() //{{{
|
||||
let res = buffer.evaluateXPath(options["hinttags"], frame.document);
|
||||
for (let [,regex] in Iterator(regexps))
|
||||
{
|
||||
for (let i in util.range(res.snapshotLength, 0, true))
|
||||
for (let i in util.range(res.snapshotLength, 0, -1))
|
||||
{
|
||||
let elem = res.snapshotItem(i);
|
||||
if (regex.test(elem.textContent))
|
||||
{
|
||||
buffer.followLink(elem, liberator.CURRENT_TAB);
|
||||
return true;
|
||||
}
|
||||
// images with alt text being href
|
||||
if (Array.some(elem.childNodes, function (child) regex.test(child.alt)))
|
||||
if (regex.test(elem.textContent) || Array.some(elem.childNodes, function (child) regex.test(child.alt)))
|
||||
{
|
||||
buffer.followLink(elem, liberator.CURRENT_TAB);
|
||||
return true;
|
||||
@@ -1462,7 +1468,7 @@ function Buffer() //{{{
|
||||
*/
|
||||
viewSource: function (url, useExternalEditor)
|
||||
{
|
||||
url = url || buffer.URL;
|
||||
url = url || buffer.URI;
|
||||
|
||||
if (useExternalEditor)
|
||||
editor.editFileExternally(url);
|
||||
@@ -1625,7 +1631,7 @@ function Marks() //{{{
|
||||
function (args)
|
||||
{
|
||||
let special = args.bang;
|
||||
let args = args.string;
|
||||
args = args.string;
|
||||
|
||||
if (!special && !args)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user