1. The trust dialog is not called with the notebook context, so we have to use the closure to bind to a notebook event.
2. Replace != with !==
3. The trust_changed.Notebook event default handler expects the trust value to be value key inside an object. In fact, the event handler is redundant with the code--both seem to set the trust value of the current notebook.
Latex tab completion will have to be done outside the normal
completer logic as the completer line splitting logic uses
\\ as a special character to split lines on. I probably want
to put the latex completions first and it if finds any matches,
don't do any other completion logic. The only issue is that might
short circuit dir/path matching on windows. Hmmm.
The new file list is always placed after the upload filename boxes. I also removed the autorefresh guards against refreshing while having an upload box since this is no longer a problem.
When there is an error reading a file, a message is shown (I could reproduce this easily by dragging a folder onto the list), added a missing "return false;" after an illegal notebook was detected, and we prevent no-name files and files starting with dots (which will not be visible in dashboard and automatically overwritten).
javascript doesn't guarantee the order of AJAX requests,
so we give `Session.delete` and `Kernel.kill` a callback signature.
Changing the kernel type calls `Notebook.start_kernel`,
which terminates the previous session, if defined,
before starting the new one.
A flag is stored, to prevent multiple simultaneous attempts to start sessions, raising a SessionAlreadyStarting Error,
preventing the spec_changed event from firing.
This is not perfect (it doesn't check against the real filesystem but the current list in the browser which may be stale) but it is better than nothing.
Updated file upload so that the icon of the new upload item reflects if it is a file or notebook, added the ability to use the "Enter" key in the filename text box to cause the upload to happen, and make it so that the list of files refreshes immediately upon successful upload.