refocus active cell on dialog close
if there is one.
Otherwise the cursor is lost on kernel restart, etc. and the mouse must be used to get back to work.
stateless-ification of function that was using module level
variable to share data.
Now varaible are passed around, and usage of replace math
require user to pass a return value of remove_math around
CSS adjustments
- remove boilerplate.css, as it is redundant with bootstrap's own reset.less
- add ipython.less / ipython.min.css for IPython-only CSS
- move font-awesome to outermost style.less, so it is not included in ipython.min.css,
where it is not desirable.
This doesn't do any of the naming / scoping cleanup that we should ultimately do, but it does create the file where that will have its desired effect.
fix some unicode in zmqhandlers
Prevented session identity from being set properly, which in turn prevented stdin from working in the notebook in Python 3.
closes#3494
adds static/style/ipython.less and ipython.min.css
Which should contain minimal styling that conflicts with other CSS.
As we improve our CSS scoping and naming,
this file should eventually be enough to play nice with embedding IPython in other HTML contexts.
small typo prevented the previous implementation from working.
This also moves the rendering to the 'render' method,
away from set_rendered.
closes#3053
(again)
Fix duplicate completion in notebook
comparaison between kernel completion and context-completin were
returning duplicate entry in some cases, due to trailing space.
sripping trailing space in comparaison prevent this.
closes#3563
comparaison between kernel completion and context-completin were
returning duplicate entry in some cases, due to trailing space.
sripping trailing space in comparaison prevent this.
fixes#3563
example
import bar
from foo im<tab>
used to propose `import` twice (actually `import` and `import[space]` as$
`import` was a token on the first line) now just complete directly to$
`import[space]`.
add IPython.start_ipython
A public API for starting a real (non-embedded) IPython instance.
should avoid API breakage in the future due to simple module renames, as has just happened with the removal of frontend.
For implementation purposes, I have added launch_new_instance as a classmethod on Application. I did this, because I wanted to add the ability to pass arguments to the instance, and didn't want to manually update every duplicate launch_new_instance.
closes#1537
Fix basic timezone info
minor tweaks to jsonutil, to include timezone info if available
add IPython.utils.tz, which just has basic info for making utcnow(), etc. include tzinfo in the datetime object
use this tzinfo in the last_modified keys in notebook managers, which fixes Firefox's timezone offset for checkpoints
Clear up unused imports
Static analysis revealed a load of things that are imported but not used. I've tried to leave things that look like part of the API, and clear up other things.
Noticed a few test functions which had been copy-pasted without changing the name, in which case only the later one will run. I gave them separate names.
Firefox 22 broke `$(window).on("beforeunload")` somehow, for some reason,
resulting in always showing a dialog, regardless of the function's return value.
The only fix I could find was resorting to the basic low-level API.
Inject requirejs in notebook and start using it.
Mainly because the behavior of Marked change when require is injected.
So only apply the modification needed for marked to behave.
rollback #3358#3358 was a workaround for a CodeMirror (actually Chrome seems to be the one at fault) bug drawing scrollbars over text, when there isn't anything to scroll. The workaround was a compromise, always drawing the space for the scrollbars to prevent the overlay, but reducing the margin so it isn't quite so annoying in the ~99% of the time that there are no scrollbars. It turns out (#3397, #3399) that the margins are not reliable, so the margin adjustment could cause the very same problem.
closes#3391, #3397, #3399
For users who need to hide the scrollbars while zooming text while we wait for a CodeMirror release, you can add the following to your custom.css:
.CodeMirror-scroll, .CodeMirror-wrap .CodeMirror-scroll {
overflow: scroll;
}
.CodeMirror-vscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-hscrollbar {
visibility: hidden;
}
or just put CodeMirror master in your profile's static/components directory.
make cookie_secret configurable
Allows config to specify logins that survive across server instances (default behavior unchanged).
Add warning about not sharing config files with cookie secret.
closes#3391
For users who need to hide the scrollbars while zooming text in the meantime, you can add the following to your custom.css:
```css
.CodeMirror-scroll, .CodeMirror-wrap .CodeMirror-scroll {
overflow: scroll;
}
.CodeMirror-vscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-hscrollbar {
visibility: hidden;
}
```
switch default ws_url logic to js side
In some cases (proxies, #3305), the request object doesn't have the right information about the originating information. This changes the default behavior, so that ws_url is generally empty by default, which the javascript takes to mean 'the same as http'. This is simpler and should be more resilient than trying a guess on server-side.
also replaces unused websocket_host with websocket_url
Rather than specifying only the hostname, it makes much more sense to specify the whole protocol,host,port in a single go.
Use different treshold for (auto)scroll in output
Use different treshold for (auto)scroll in output
Allow, in particular to switch to scolling for longer input (or disable
it) by still keeping the possibility to manually toggle the output to
scroll.
cf jsdoc,
OutputArea.auto_scroll_threshold
and
OutputArea.minimum_scroll_threshold
OutputArea.auto_scroll_threshold < 0 will prevent auto_scroll from ever happening.
used in comparison check for notebook name change.
Unless the filenames are normalized, unchanged names may result in false positives for a name change (e.g. OS X uses NFD on the filesystem, so u'\xfc' roundtripped to the filesystem will be u'u\u0308'), which can result in the first save of a notebook after open performing the following actions:
save the recently opened notebook
old_name != new_name, so name change detected
delete old_name (which is actually new_name), which ultimately deletes the just-saved notebook
In master, this has a symptom of the first checkpoint failing because the first save actually deleted the file, and you can't checkpoint a notebook that doesn't exist.
closes#3360
In some cases (proxies, #3305), the request object doesn't have the right information about the originating information. This changes the default behavior, so that `ws_url` is generally empty by default, which the javascript takes to mean 'the same as http'. This is simpler and should be more resilient than trying a guess on server-side.
instead of random.
The random cookie name meant that every time you restarted the notebook it would get a new key in the cookie for the same host, resulting in an ever-growing cookie full of obsolete data.
used in comparison check for notebook name change.
Unless the filenames are normalized,
unchanged names may result in false positives for a name change
(e.g. OS X uses NFD on the filesystem,
so u'\xfc' roundtripped to the filesystem will be u'u\u0308'),
which can result in the first save of a notebook after open performing the following actions:
1. save the recently opened notebook
2. `old_name != new_name`, so name change detected
3. delete old_name (which is actually new_name), which ultimately deletes the just-saved notebook
In master, this has a symptom of the first checkpoint failing because the first save actually deleted the file, and you can't checkpoint a notebook that doesn't exist.
closes#3360
always draw scrollbar margin, so that inappropriate scrollbars never overlap the last line.
To compensate for the extra space, the margin between the scrollbar and the last line is shrunk significantly.
Organize the JS and less files by component, in the `static` directory of the notebook.
This PR does the client side re-org that parallels the server side work in #3321. There are now subdirectories in `static/` for each part of the client; roughly speaking there is one subdir for each page, web service or component.