mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-30 19:00:09 +00:00
added option to hide dod files in the fs browser...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
62a9b43fe5
commit
f7cc2ba306
@ -78,14 +78,21 @@ function(attr, states, a, b){
|
|||||||
: states instanceof Function ? states.call(this)
|
: states instanceof Function ? states.call(this)
|
||||||
: states
|
: states
|
||||||
|
|
||||||
|
// get attr path...
|
||||||
|
var a = attr.split(/\./g)
|
||||||
|
var cfg = a.slice(0, -1)
|
||||||
|
.reduce(function(res, cur){
|
||||||
|
return res[cur] }, this.config)
|
||||||
|
|
||||||
if(action == null){
|
if(action == null){
|
||||||
var cfg = this.config[attr]
|
var val = cfg[a.pop()]
|
||||||
return cfg == null ?
|
return val == null ?
|
||||||
(lst[lst.indexOf('none')] || lst[0])
|
(lst[lst.indexOf('none')] || lst[0])
|
||||||
: cfg
|
: val
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.config[attr] = action
|
cfg[a[a.length-1]] = action
|
||||||
|
this.config[a[0]] = this.config[a[0]]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
states, pre, post)
|
states, pre, post)
|
||||||
|
|||||||
@ -874,6 +874,9 @@ var FileSystemLoaderUIActions = actions.Actions({
|
|||||||
showNonTraversable: true,
|
showNonTraversable: true,
|
||||||
showDisabled: true,
|
showDisabled: true,
|
||||||
|
|
||||||
|
disableDotFiles: 'on',
|
||||||
|
//disableHiddenFiles: false,
|
||||||
|
|
||||||
//actionButton: '⋯', // "..."
|
//actionButton: '⋯', // "..."
|
||||||
//actionButton: '⮠', // down then left arrow (long)
|
//actionButton: '⮠', // down then left arrow (long)
|
||||||
//actionButton: '▹', // right-pointing white triangle
|
//actionButton: '▹', // right-pointing white triangle
|
||||||
@ -896,6 +899,8 @@ var FileSystemLoaderUIActions = actions.Actions({
|
|||||||
|
|
||||||
var cfg = Object.create(this.config['file-browser-settings'])
|
var cfg = Object.create(this.config['file-browser-settings'])
|
||||||
cfg.cls = 'file-browser'
|
cfg.cls = 'file-browser'
|
||||||
|
// normalize...
|
||||||
|
cfg.disableDotFiles = cfg.disableDotFiles == 'on'
|
||||||
|
|
||||||
base = base || this.location.path || '/'
|
base = base || this.location.path || '/'
|
||||||
base = util.normalizePath(base)
|
base = util.normalizePath(base)
|
||||||
@ -936,12 +941,15 @@ var FileSystemLoaderUIActions = actions.Actions({
|
|||||||
})
|
})
|
||||||
// we closed the browser -- save settings to .config...
|
// we closed the browser -- save settings to .config...
|
||||||
.on('close', function(){
|
.on('close', function(){
|
||||||
|
var config =
|
||||||
var config = that.config['file-browser-settings']
|
that.config['file-browser-settings'] =
|
||||||
|
that.config['file-browser-settings'] || {}
|
||||||
|
|
||||||
config.disableFiles = o.options.disableFiles
|
config.disableFiles = o.options.disableFiles
|
||||||
config.showDisabled = o.options.showDisabled
|
config.showDisabled = o.options.showDisabled
|
||||||
config.showNonTraversable = o.options.showNonTraversable
|
config.showNonTraversable = o.options.showNonTraversable
|
||||||
|
// normalize...
|
||||||
|
config.disableDotFiles = o.options.disableDotFiles ? 'on' : 'off'
|
||||||
})
|
})
|
||||||
|
|
||||||
return o
|
return o
|
||||||
@ -1005,6 +1013,11 @@ var FileSystemLoaderUIActions = actions.Actions({
|
|||||||
|
|
||||||
return o
|
return o
|
||||||
})],
|
})],
|
||||||
|
|
||||||
|
toggleDotFileDrawing: ['Interface/File browser/Hide dot files',
|
||||||
|
core.makeConfigToggler(
|
||||||
|
'file-browser-settings.disableDotFiles',
|
||||||
|
['on', 'off'])],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -196,16 +196,20 @@ function(path, make){
|
|||||||
}
|
}
|
||||||
|
|
||||||
var dir = res.isDirectory()
|
var dir = res.isDirectory()
|
||||||
var elem = res && make(fullpath
|
var elem = res
|
||||||
? path +'/'+ file
|
&& !(that.options.disableDotFiles
|
||||||
: file + (dir ? '/' : ''),
|
&& file.startsWith('.'))
|
||||||
null,
|
&& make(fullpath
|
||||||
that.options.disableFiles && !dir)
|
? path +'/'+ file
|
||||||
|
: file + (dir ? '/' : ''),
|
||||||
|
null,
|
||||||
|
that.options.disableFiles
|
||||||
|
&& !dir)
|
||||||
|
|
||||||
// count the number of files...
|
// count the number of files...
|
||||||
// NOTE: we do not care how long it will take
|
// NOTE: we do not care how long it will take
|
||||||
// so we'll not wait...
|
// so we'll not wait...
|
||||||
res && dir && _countDirFiles(path, file, elem)
|
res && dir && elem && _countDirFiles(path, file, elem)
|
||||||
})
|
})
|
||||||
// NOTE: we are not using promise.all(..) here because it
|
// NOTE: we are not using promise.all(..) here because it
|
||||||
// triggers BEFORE the first make(..) is called...
|
// triggers BEFORE the first make(..) is called...
|
||||||
@ -285,41 +289,60 @@ var listDir = module.listDir = listDirfs
|
|||||||
// XXX for some reason pop does not focus the container dir correctly...
|
// XXX for some reason pop does not focus the container dir correctly...
|
||||||
// ...this is potentially due to the list not being ready yet...
|
// ...this is potentially due to the list not being ready yet...
|
||||||
// XXX this should be smarter and support other URL schemes...
|
// XXX this should be smarter and support other URL schemes...
|
||||||
var WalkPrototype = Object.create(browse.Browser.prototype)
|
var WalkPrototype = {
|
||||||
WalkPrototype.options = {
|
__proto__: browse.Browser.prototype,
|
||||||
// XXX this should be smarter and support other URL schemes...
|
|
||||||
pathPrefix: os.type() == 'Windows_NT' ? '' : '/',
|
|
||||||
|
|
||||||
fullPathEdit: true,
|
options: {
|
||||||
traversable: true,
|
__proto__: browse.Browser.prototype.options,
|
||||||
flat: false,
|
|
||||||
|
|
||||||
sortTraversable: 'first',
|
// XXX this should be smarter and support other URL schemes...
|
||||||
|
pathPrefix: os.type() == 'Windows_NT' ? '' : '/',
|
||||||
|
|
||||||
//actionButton: '⋯', // "..."
|
fullPathEdit: true,
|
||||||
//actionButton: '⊙', // circle with dot
|
traversable: true,
|
||||||
actionButton: '⮠', // down then left arrow (long)
|
flat: false,
|
||||||
//actionButton: '▹', // right-pointing white triangle
|
|
||||||
//actionButton: '◹', // ne white triangle
|
|
||||||
//actionButton: '↗', // ne arrow
|
|
||||||
//actionButton: '⮣', // up then right arrow
|
|
||||||
//actionButton: '»', // right-pointing double angle
|
|
||||||
// quotation mark
|
|
||||||
// XXX not sure about this...
|
|
||||||
//actionButton: '📂', // folder icon (color)
|
|
||||||
|
|
||||||
pushButton: false,
|
sortTraversable: 'first',
|
||||||
|
|
||||||
list: listDir,
|
//actionButton: '⋯', // "..."
|
||||||
|
//actionButton: '⊙', // circle with dot
|
||||||
|
actionButton: '⮠', // down then left arrow (long)
|
||||||
|
//actionButton: '▹', // right-pointing white triangle
|
||||||
|
//actionButton: '◹', // ne white triangle
|
||||||
|
//actionButton: '↗', // ne arrow
|
||||||
|
//actionButton: '⮣', // up then right arrow
|
||||||
|
//actionButton: '»', // right-pointing double angle
|
||||||
|
// quotation mark
|
||||||
|
// XXX not sure about this...
|
||||||
|
//actionButton: '📂', // folder icon (color)
|
||||||
|
|
||||||
fileCountPattern: '*',
|
pushButton: false,
|
||||||
|
|
||||||
disableFiles: false,
|
list: listDir,
|
||||||
|
|
||||||
// enable '.' and '..' dirs...
|
fileCountPattern: '*',
|
||||||
dotDirs: true,
|
|
||||||
|
disableFiles: false,
|
||||||
|
|
||||||
|
disableDotFiles: true,
|
||||||
|
//disableHiddenFiles: false,
|
||||||
|
|
||||||
|
|
||||||
|
// enable '.' and '..' dirs...
|
||||||
|
dotDirs: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
toggleDotFileDrawing: function(){
|
||||||
|
var cur = this.selected
|
||||||
|
if(this.options.toggleDisabledDrawing == false){
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
this.options.disableDotFiles = !this.options.disableDotFiles
|
||||||
|
this.update()
|
||||||
|
cur && this.select(cur)
|
||||||
|
return this
|
||||||
|
},
|
||||||
}
|
}
|
||||||
WalkPrototype.options.__proto__ = browse.Browser.prototype.options
|
|
||||||
|
|
||||||
|
|
||||||
var Walk =
|
var Walk =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user