1j01 / jspaint

🎨 Classic MS Paint, REVIVED + ✨Extras
https://jspaint.app/about
MIT License
7.22k stars 562 forks source link

Change default name from "untitled" to date-time #181

Open TheLastGimbus opened 4 years ago

TheLastGimbus commented 4 years ago

Every image saves as untitled, which gives me many "untitled, untitled(1), untitled(2), untitled(3)" :/ That can lead to problems - if I would want to move them to other folder, save new ones (that would have same name again) and move them there again, there will be problems...

It would be better if images saved as current date/time.

TheAwesome98-Real commented 4 years ago

You could just name them in the save box...

TheLastGimbus commented 4 years ago

Yup, but that takes extra 2 seconds! You know how much I could do with the time saved?!

Anyway, this would be nice

1j01 commented 4 years ago

Based on this suggestion, I implemented this in my MIDI Recorder web app. I made it use the timestamp of the last note, rather than the time of save, so that you can tell if you've already saved a recording based on the file name collision that will happen, and so if you don't save right away the file name will still be meaningful when you do.

I'm not sure if I want this for jspaint, though. In Paint, there is clearly a default file name, "untitled", and although I have made other deviations from MS Paint, this brings up an issue of the title of the tab. Would I keep "untitled - Paint" but not actually save with that name? Or take the opportunity to change the default title to simply "JS Paint"? If I put the date/time in the tab title it would take up enough space to push "Paint" off of the tab, and would need to change over time (unless the timestamp is of document creation, which is less useful).

A point in favor of this: on Android when you save with the same file name ("untitled") it asks you if you want to "download it again" as if it's the same file. This will be avoided when a filename dialog is added to jspaint (as long as you enter a filename). (#55, #59)

"Workaround": You could just type gibberish; it's what I do when I don't want to bother coming up with a name (to avoid conflicts when merging folders (and/or the limit on the number of files it'll disambiguate with numbers))

TheLastGimbus commented 4 years ago

it would take enough space to push "Paint" off the tab

Soooo, just set tab name "Paint - " ... ? User can tell which drawing it is by hovering above to see full name or looking at upper bar of browser</p> <blockquote> <p>You could just type gibberish</p> </blockquote> <p>This is good solution. You can make this optional in setting. Then just generate 10 random letters and numbers and problem is gone</p> <p>I would happily implement this if you could tell me where is "saving" and settings in the code ^_^</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/1j01"><img src="https://avatars.githubusercontent.com/u/3630663?v=4" />1j01</a> commented <strong> 4 years ago</strong> </div> <div class="markdown-body"> <blockquote> <p>Soooo, just set tab name "Paint - <title>" ... ?</p> </blockquote> <ol> <li>I'm using the page's title in <a href="https://98.js.org/">https://98.js.org/</a> for the window's title, and I want it to be familiar/retro/accurate for nostalgia's sake. I could change how this works, but for now it's very simple.</li> <li>I think the name of the document is more important than "Paint" so I want it to be first (especially since it distinguishes tabs if you have multiple jspaint tabs open), I just want both parts to be visible if possible.</li> </ol> <blockquote> <p>Then just generate 10 random letters and numbers</p> </blockquote> <p>I'm not suggesting the app generate gibberish for file names; I'm saying you can do that as a user in the save dialog (unless you're on android, or have the dialog disabled). A timestamp would be better than random letters/numbers.</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>