mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-04 18:55:46 +01:00
minor refactoring of "gu" action
This commit is contained in:
@@ -233,21 +233,20 @@ const config = { //{{{
|
|||||||
{
|
{
|
||||||
if (/^file:\/|^\//.test(url))
|
if (/^file:\/|^\//.test(url))
|
||||||
{
|
{
|
||||||
//var strippedFilename = url.replace(/^(file:\/\/)?(.*)/, "$2");
|
let file = io.getFile(url);
|
||||||
var file = io.getFile(url);
|
return file.exists() && file.isDirectory();
|
||||||
if (!file.exists() || !file.isDirectory())
|
}
|
||||||
return false;
|
else
|
||||||
else
|
{
|
||||||
return true;
|
// for all other locations just check if the URL ends with /
|
||||||
|
return /\/$/.test(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// for all other locations just check if the URL ends with /
|
|
||||||
return /\/$/.test(url);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count < 1)
|
if (count < 1)
|
||||||
count = 1;
|
count = 1;
|
||||||
|
|
||||||
|
// XXX
|
||||||
var url = buffer.URL;
|
var url = buffer.URL;
|
||||||
for (let i = 0; i < count; i++)
|
for (let i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
@@ -259,11 +258,9 @@ const config = { //{{{
|
|||||||
url = url.replace(/^(.*:\/+.*?)\/+$/, "$1/"); // get rid of more than 1 / at the end
|
url = url.replace(/^(.*:\/+.*?)\/+$/, "$1/"); // get rid of more than 1 / at the end
|
||||||
|
|
||||||
if (url == buffer.URL)
|
if (url == buffer.URL)
|
||||||
{
|
|
||||||
liberator.beep();
|
liberator.beep();
|
||||||
return;
|
else
|
||||||
}
|
liberator.open(url);
|
||||||
liberator.open(url);
|
|
||||||
},
|
},
|
||||||
{ flags: Mappings.flags.COUNT });
|
{ flags: Mappings.flags.COUNT });
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user