mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 21:47:59 +01:00
make help.js a seperate file, small indention fixes
This commit is contained in:
@@ -180,27 +180,6 @@ function completion_select_previous_item()/*{{{*/
|
||||
}/*}}}*/
|
||||
|
||||
|
||||
function get_file_completions(filter)/*{{{*/
|
||||
{
|
||||
g_completions = [];
|
||||
|
||||
var match = filter.match(/^(.*[\/\\])(.*?)$/);
|
||||
var dir;
|
||||
if (!match || !(dir = match[1])) return [];
|
||||
var compl = match[2] || '';
|
||||
var fd = fopen(dir, "<");
|
||||
if (!fd) return [];
|
||||
var entries = fd.read();
|
||||
var delim = fd.path.length == 1 ? '' : (fd.path.search(/\\/) != -1) ? "\\" : "/";
|
||||
var reg = new RegExp("^" + fd.path + delim + compl);
|
||||
entries.forEach(function(file) {
|
||||
if (file.path.search(reg) != -1)
|
||||
g_completions.push([file.path, '']);
|
||||
});
|
||||
|
||||
return g_completions;
|
||||
}/*}}}*/
|
||||
|
||||
|
||||
/*
|
||||
* filter a list of urls
|
||||
@@ -288,6 +267,32 @@ outer:
|
||||
return filtered.concat(additional_completions);
|
||||
}/*}}}*/
|
||||
|
||||
function get_file_completions(filter)/*{{{*/
|
||||
{
|
||||
g_completions = [];
|
||||
var match = filter.match(/^(.*[\/\\])(.*?)$/);
|
||||
var dir;
|
||||
|
||||
if (!match || !(dir = match[1]))
|
||||
return [];
|
||||
|
||||
var compl = match[2] || '';
|
||||
var fd = fopen(dir, "<");
|
||||
if (!fd)
|
||||
return [];
|
||||
|
||||
var entries = fd.read();
|
||||
var delim = fd.path.length == 1 ? '' : (fd.path.search(/\\/) != -1) ? "\\" : "/";
|
||||
var reg = new RegExp("^" + fd.path + delim + compl);
|
||||
entries.forEach(function(file)
|
||||
{
|
||||
if (file.path.search(reg) != -1)
|
||||
g_completions.push([file.path, '']);
|
||||
});
|
||||
|
||||
return g_completions;
|
||||
}/*}}}*/
|
||||
|
||||
function get_search_completions(filter)/*{{{*/
|
||||
{
|
||||
var search_completions = [];
|
||||
|
||||
Reference in New Issue
Block a user