-
Notifications
You must be signed in to change notification settings - Fork 333
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
Greater save granularity #233
Comments
Differentiating auto/manual save can also be relevant because while one wouldn't really want to give user feedback on every single autosave, they would want to give feedback on a manual save. |
I really like this idea a lot. It's true that you may want to autosave to localStorage, but only save to the server in some instances.
It shouldn't save if there has not been any changes, but it does. I can't remember off the top of my head why I'm resaving even if the content is the same, but it could just be a mistake. |
Alright, I'll go with the auto flag. Then the question is, what's an "auto" save? I'm noticing there's several places where the system saves just because its updated something. I'm inclined to say all of those are "auto". Basically the only calls that aren't "auto" are CTRL/CMD+S. That sound right to you? Also, should the auto attribute be fed directly into the emit, or should something be done to avoid clobbering the default value (self.getFiles(...)). Basically, are you guaranteeing that level of API stability yet, or is that for 1.0? |
I'd say anything saved by the public API or the keyboard command. As an example, if a dev added a save button and made a call to The other idea I was just thinking is, should we change it so there's an I'd rather get a nice API before 1.0 then start to worry about backwards compatibility. As long as we do a major bump ( |
Having a straight split between save and autosave is probably easier, yeah. |
…hanged, tweaking what is an autosave
…f the save and autosave events
Since you capture and block the CTRL/CMD+S shortcut, the only way to hook into this is to piggyback on the .on("save") event. Since a theoretical hook-in might want to save to the server itself, It would therefore be desirable to be able to gain greater control over how the save functionality behaves. For instance, one may want to autosave to localStorage every 100ms, but that might be excessive for saving to the server. However, the system should always save right away when a manual save has been triggered. Currently, there is no way to differentiate between these invocations, though.
I see three possible routes for this:
These aren't mutually exclusive, of course.
Personally, I'm not entirely clear why the system keeps autosaving at all when the text has clearly not been modified. I suppose this is simply an easy way to avoid having to consider every way the textfield could have been modified?
The text was updated successfully, but these errors were encountered: