Skip to content
Snippets Groups Projects
Commit 664d7ab0 authored by echicken's avatar echicken
Browse files

Accept a hide_regexp parameter.

A regular expression, but (I think) the leading/trailing slashes should
be omitted.
Files matching this pattern will not be listed.
parent 38fcd39e
No related branches found
No related tags found
No related merge requests found
......@@ -160,6 +160,7 @@ var FileBrowser = function (options) {
lbg : BG_CYAN
},
hide : [],
hide_regexp : null,
index : 0
};
......@@ -217,6 +218,11 @@ var FileBrowser = function (options) {
properties.hide = options.hide;
}
if (typeof options.hide_regexp != 'undefined') {
properties.hide_regexp = new RegExp(options.hide_regexp);
log(options.hide_regexp);
}
}
function initList() {
......@@ -244,6 +250,7 @@ var FileBrowser = function (options) {
if (!wildmatch(fn, properties.hide[h])) continue;
return;
}
if (properties.hide_regexp !== null && fn.search(properties.hide_regexp) > -1) return;
properties.tree.addItem(
fileString,
file_isdir(item)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment