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
make setting the notebook dirty flag an event #3371
Conversation
simple, liberal check for whether a keypress is probably typing or not.
set_dirty.Notebook
COMMAND : 91, | ||
LEFT_SUPER : 91, | ||
RIGHT_SUPER : 92, | ||
COMMAND : 93, |
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.
COMMAND
from 91
to 93
?
on mine COMMAND
(ex Apple key right?) is 91
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.
Correction, LEFT_COMMAND
is 91 RIGHT_COMMAND
is 93 (mbp 13" mid 2012)
http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes
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.
I used that reference as well - my keyboard (Kinesis Advantage) sends 93 for command, and the OS interprets that as command as well.
Why not bind to CM |
I will do that instead, and remove the silly utility function |
Looks fine to me. |
instead of last-saved timestamp
@@ -148,9 +149,12 @@ var IPython = (function (IPython) { | |||
); | |||
} | |||
|
|||
SaveWidget.prototype.set_last_saved = function () { | |||
var d = new Date(); | |||
this.set_save_status('(autosaved: '+d.format('mmm dd HH:MM') + ')'); |
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.
Having time was great ! May I suggest somethig like http://momentjs.com/ ? Can be done as another PR.
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.
I think we specifically want to get away from this notion of autosave times. Either the document has been autosaved, or some small amount of recent changes have not. I don't think we want to be presenting two timestamps for every file.
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.
But if we decide to keep the timestamp, I can always just add the "unsaved changes" message, but the save widget's text is already too long, and needs to be shorter.
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.
It's fine I can do it with my custom.js
if I need to. But it is true that now you have the 2 status.
I just have the bad habit of soemetime having the same notebook opened on multiple window... so I use this to know which one is the "last" saved.
make setting the notebook dirty flag an event
make setting the notebook dirty flag an event
also adds a more liberal setting of the dirty flag when the user is typing, to avoid the current state of things where editing a code cell has no effect on the dirty flag unless it is executed.