v0.0.16
This commit is contained in:
parent
95a6200dbb
commit
5b521675c4
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "filer",
|
"name": "filer",
|
||||||
"version": "0.0.15",
|
"version": "0.0.16",
|
||||||
"main": "dist/filer.js",
|
"main": "dist/filer.js",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"mocha": "1.17.1",
|
"mocha": "1.17.1",
|
||||||
|
|
|
@ -14590,11 +14590,12 @@ function FSWatcher() {
|
||||||
EventEmitter.call(this);
|
EventEmitter.call(this);
|
||||||
var self = this;
|
var self = this;
|
||||||
var recursive = false;
|
var recursive = false;
|
||||||
|
var recursivePathPrefix;
|
||||||
var filename;
|
var filename;
|
||||||
|
|
||||||
function onchange(path) {
|
function onchange(path) {
|
||||||
// Watch for exact filename, or parent path when recursive is true
|
// Watch for exact filename, or parent path when recursive is true.
|
||||||
if(filename === path || (recursive && path.indexOf(filename + '/') === 0)) {
|
if(filename === path || (recursive && path.indexOf(recursivePathPrefix) === 0)) {
|
||||||
self.trigger('change', 'change', path);
|
self.trigger('change', 'change', path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14618,6 +14619,12 @@ function FSWatcher() {
|
||||||
|
|
||||||
// Whether to watch beneath this path or not
|
// Whether to watch beneath this path or not
|
||||||
recursive = recursive_ === true;
|
recursive = recursive_ === true;
|
||||||
|
// If recursive, construct a path prefix portion for comparisons later
|
||||||
|
// (i.e., '/path' becomes '/path/' so we can search within a filename for the
|
||||||
|
// prefix). We also take care to allow for '/' on its own.
|
||||||
|
if(recursive) {
|
||||||
|
recursivePathPrefix = filename === '/' ? '/' : filename + '/';
|
||||||
|
}
|
||||||
|
|
||||||
var intercom = Intercom.getInstance();
|
var intercom = Intercom.getInstance();
|
||||||
intercom.on('change', onchange);
|
intercom.on('change', onchange);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -11,7 +11,7 @@
|
||||||
"idb",
|
"idb",
|
||||||
"websql"
|
"websql"
|
||||||
],
|
],
|
||||||
"version": "0.0.15",
|
"version": "0.0.16",
|
||||||
"author": "Alan K <ack@modeswitch.org> (http://blog.modeswitch.org)",
|
"author": "Alan K <ack@modeswitch.org> (http://blog.modeswitch.org)",
|
||||||
"homepage": "http://js-platform.github.io/filer",
|
"homepage": "http://js-platform.github.io/filer",
|
||||||
"bugs": "https://github.com/js-platform/filer/issues",
|
"bugs": "https://github.com/js-platform/filer/issues",
|
||||||
|
|
Loading…
Reference in New Issue