-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotFiles "*_files" and "*.assets" from browser->save page to html #1704
dotFiles "*_files" and "*.assets" from browser->save page to html #1704
Conversation
I'm sorry to say, but I diasgree. Why would you lets say, hide picture attachments? Both from yourself, and from users? If you really wanna hide ... the file browser already supports the most obvious and (unix) universal thing...dotfiles. So for assets that works already. |
The question beforehand is, why do you even have those folders? I mean make a assets folder or whatever and have your files in that. And your documents in another folder?
There is also reverse sort. Also a possibility is a draggable scrollbar, like at editor. |
You did already quite some things in the project and I think everything is merged. I'm really not that guy who says no to everything. But I'm not really happy with adding this. For most users it's just bloat, and for us developers one more thing to watch out for. |
This folder is generated by Google Chrome when saving a web page. The *.assets folder is generated by Typora, a popular markdown editor.
These are good features. I jsut want to save my time when maintaining my notes. |
I can't say most users need this. It's just my pain in everyday usage. So it's OK to reject the pull request. I respect this project and thank a lot to you. |
Can you send me a complete file list of that directory ( I want also to know, is it ALWAYS the case that when you have _files, you have also the .assets one albeit maybe empty? Or is either optional? |
The list here:
|
*_files and *.assets have no relations. When I save a complete web page in Chrome, it generate a xxx.html file, and a xxx_files folder. There are images, scripts, css files in the xxx_files. If the web page contains no external resources, which is rare, the xxx_files folder won't be created. Or if I save with type "HTML Only" or "Single File", no xxx_files either. *.assets folder is generated in Typora markdown editor. When I drag and drop a image into Typora, editing a document xxx.md, it automatically creates a xxx.assets folder, and place the image in the xxx.assets. So the xxx.assets is optional, but not empty. |
When you can make it nicely in around ~10 lines to check if the current folder is such a ""chrome bloated folder"" (containing assets/files/.html in that matching case) - you can add the logic to be hidden by |
This can be a good solusion for _files folders, since they has existing for over 20 years. But .assets folders are introduced by Typora not so long ago, and the name can be chagned in the preferences. So this may be enough to solve my problems, but I'm not sure it's suitable for someone else. |
As said, detect the combination of html/asset/files folder and then only enable the hidden there. Not generally .asset(s) --> if (filename.endwith("_files") && File::exists(filename.sub("_files$", ".html")) { |
I've done as you said. |
@@ -601,7 +601,9 @@ private boolean canWrite(File file) { | |||
public boolean accept(File dir, String filename) { | |||
final File f = new File(dir, filename); | |||
final boolean filterYes = f.isDirectory() || _dopt.fileOverallFilter == null || _dopt.fileOverallFilter.apply(f); | |||
final boolean dotYes = _dopt.showDotFiles || !filename.startsWith("."); | |||
final boolean dotYes = _dopt.showDotFiles || !filename.startsWith(".") && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add another (brace around the new conditions. otherwise - it's working/OK for you this way?
If so, this is ready for merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally I add a function to make it more clear. How do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
Directories like "_files" and ".assets", are containers for pictures and other binary attachments. They should be hidden in file browser.