Commit Graph

4864 Commits

Author SHA1 Message Date
Jonathan Frederic
3870bb571b Use rsvp.js for Promises 2014-11-15 08:48:34 -08:00
Jonathan Frederic
c67dcc0dc3 Finished adding error handling. 2014-11-15 08:48:34 -08:00
Jonathan Frederic
1d1572421f Add a WrappedError class 2014-11-15 08:48:34 -08:00
Jonathan Frederic
b16b2e8749 Make display also pend on set_state. 2014-11-15 08:48:34 -08:00
Jason Grout
a4331a93cc Fix some this vs. that errors, as well as returning some promises to wait for fulfillment 2014-11-15 08:48:34 -08:00
Jason Grout
8e769a012f Load the utils module 2014-11-15 08:48:34 -08:00
Jason Grout
f11a51bb77 Dictionary key/value typo 2014-11-15 08:48:34 -08:00
Jason Grout
fc94383487 Better error messages with correct stack traces 2014-11-15 08:48:34 -08:00
Jason Grout
1b9948d178 Add some error handling for creating views and models 2014-11-15 08:48:33 -08:00
Jason Grout
686e73dfdf More simplifications due to promises 2014-11-15 08:48:33 -08:00
Jason Grout
4412c12929 Simplify code by using Promises in a better way; try_load -> load 2014-11-15 08:48:33 -08:00
Jonathan Frederic
c41dcb35e9 Proxy console.error calls 2014-11-15 08:48:33 -08:00
Jonathan Frederic
2eae36ac9a Use load_class in comms instead of callbacks. 2014-11-15 08:48:33 -08:00
Jonathan Frederic
5a745be138 Add Promise support to models. 2014-11-15 08:48:33 -08:00
Jonathan Frederic
78c0bbdb4d Fix view rendering order. 2014-11-15 08:48:33 -08:00
Jonathan Frederic
4beda5d0fb Initial stab at adding promises to the widget framework. 2014-11-15 08:48:33 -08:00
Jason Grout
ff680583c1 initial take on promises 2014-11-15 08:48:33 -08:00
Thomas Kluyver
2bfdbfc631 Fix some other bugs 2014-11-14 17:06:58 -08:00
Jonathan Frederic
ba9e7365be Fix #6385 2014-11-14 17:04:52 -08:00
Thomas Kluyver
89222b6dfd Actually define the module
I didn't forget something really obvious and important. Not at all.
2014-11-14 16:57:43 -08:00
Thomas Kluyver
cbd4929785 Use promising_ajax in config API 2014-11-14 15:00:37 -08:00
Thomas Kluyver
625c4f5bc2 Fix punctuation 2014-11-14 14:55:07 -08:00
Thomas Kluyver
d9b71ff750 Add JS config API 2014-11-14 14:55:07 -08:00
MinRK
29e49329e2 use CodeMirror.runMode to highlight in markdown
instead of highlight.js
2014-11-14 14:53:52 -08:00
Min RK
388fec4f96 Merge pull request #6924 from takluyver/contents-promises
Use promises in the JS contents API
2014-11-14 14:46:37 -08:00
Thomas Kluyver
3dbb600968 Merge pull request #6940 from takluyver/i6937
Just use notebook_path in download URLs
2014-11-14 14:32:45 -08:00
Thomas Kluyver
f7860ce9d2 Remove trailing comma 2014-11-14 13:05:55 -08:00
Thomas Kluyver
8d9d317e91 Merge pull request #6857 from jdfreder/celltoolbar_metadata_fix
Fix bug cell toolbars not redrawing on metadata change
2014-11-14 12:57:15 -08:00
Thomas Kluyver
8c962df79c Load promises polyfill from a script tag
So all JS code can assume promises work, without needing to require it.
2014-11-14 12:43:44 -08:00
Thomas Kluyver
7240d2dafc Just use notebook_path in download URLs
notebook_name is now superfluous

Closes gh-6937
2014-11-14 12:16:59 -08:00
Jonathan Frederic
f2b6697098 Use a property instead of a setter method 2014-11-14 11:22:28 -08:00
Jason Grout
d11f48eadb Make favicon and logo images blocks in the template 2014-11-14 15:28:40 +00:00
Kyle Kelley
d029a3f4a3 Fix link to /tree. 2014-11-13 17:50:57 -06:00
Thomas Kluyver
d3699c8e3b Update JS docstrings in contents API 2014-11-13 14:44:57 -08:00
Thomas Kluyver
1e53c1f924 Re-raise errors with throw instead of Promise.reject() 2014-11-13 14:25:28 -08:00
Thomas Kluyver
d04e41251d Merge pull request #6915 from minrk/contents-no-0
use Untitled instead of Untitled0
2014-11-13 14:04:00 -08:00
Thomas Kluyver
0295f5a487 Semicolons 2014-11-13 12:30:26 -08:00
Min RK
f569ccc58f Merge pull request #6920 from SylvainCorlay/serialize_date
Dates and Strings are JavaScript objects, and _pack_models behaves incorrectly in these cases.
2014-11-13 12:26:02 -08:00
Min RK
dcfaaf6acb Merge pull request #6922 from SylvainCorlay/checkbox_height
Correct height for the checkbox widget
2014-11-13 12:24:21 -08:00
Min RK
48d77b3f03 Merge pull request #6886 from minrk/tornado-4
require tornado 4
2014-11-13 12:23:32 -08:00
Thomas Kluyver
56320588da Return JSON from contents API checkpoint methods 2014-11-13 12:20:53 -08:00
Thomas Kluyver
aecb4bffa5 All aboard the promise train 2014-11-13 12:17:49 -08:00
Thomas Kluyver
11cfcc40d4 Use promises for GET requests 2014-11-13 11:42:52 -08:00
Thomas Kluyver
9b2dac3fc1 Infrastructure for AJAX requests returning ES6 promises 2014-11-13 11:42:37 -08:00
Sylvain Corlay
7ac82931ca Tooltip on toggle button 2014-11-13 19:04:06 +00:00
Sylvain Corlay
2a026ed45b Test packing/unpacking instances of Date and String 2014-11-13 18:50:21 +00:00
Sylvain Corlay
54d6d18baf Correct height for checkbox widget 2014-11-13 17:46:19 +00:00
Sylvain Corlay
604d0bb666 A String is an object 2014-11-13 15:42:31 +00:00
Sylvain Corlay
4b6c753f3f Dates are JavaScript objects, and _pack_models returns an empty object 2014-11-13 15:37:56 +00:00
Min RK
0a22217f7e Merge pull request #6900 from takluyver/contents-api-get-as-type
Contents API get as type
2014-11-12 21:43:50 -08:00
Min RK
e4e1d47203 Merge pull request #6694 from takluyver/config-rest-api
Add REST API for retrieving, storing and updating config
2014-11-12 21:40:30 -08:00
Min RK
0f8127c36f Merge pull request #6735 from Carreau/native-map
Use native map when possible
2014-11-12 16:31:51 -08:00
Min RK
456e65b1f3 adjustments to filename increment
- start with no number (Untitled0 -> Untitled.ipynb)
- copy of copy increments instead of adding another `-Copy` (copy Foo-Copy1.ipynb gives Foo-Copy2.ipynb, not Foo-Copy1-Copy1.ipynb)
- copy file to new folder starts with the original filename, instead of unconditional `-Copy0`
2014-11-12 16:24:35 -08:00
Thomas Kluyver
0f44eced72 Put frontend config files in profile_foo/nbconfig/ subdir 2014-11-12 15:53:35 -08:00
Min RK
47f307e4c8 don't use text mode in mkstemp
causes double-encoding of newlines,
preventing newline arg from having desired effect.
2014-11-12 14:17:32 -08:00
Min RK
b5e7ce30ca handle setting Widget.comm = None
which is done in `Widget.close`

fixes loads of warnings in widget test output, caused every time a widget is closed.
2014-11-12 11:29:10 -08:00
Thomas Kluyver
c9b6e30526 Actually pass URL params with API request 2014-11-11 18:18:36 -08:00
Thomas Kluyver
a469d7658a Add test for /tree redirects 2014-11-11 15:11:54 -08:00
Thomas Kluyver
f1f81e2efa Rename get_model() to get() 2014-11-11 14:51:21 -08:00
Thomas Kluyver
6f48b58b18 Fix various review comments 2014-11-11 14:46:53 -08:00
Thomas Kluyver
b5a6cb7da1 Allow specifying format when getting files from contents API 2014-11-11 14:20:56 -08:00
Min RK
287d572fb3 Merge pull request #6855 from takluyver/new-notebook-async
Open new windows before creating new notebooks

closes #6849
2014-11-11 14:18:00 -08:00
Min RK
a257e580a0 Merge pull request #6854 from takluyver/post-new-terminal
Create new terminals with POST request to API
2014-11-11 14:12:54 -08:00
Thomas Kluyver
e453b160b1 Some fixes for the tree view 2014-11-11 12:32:24 -08:00
Thomas Kluyver
f9db65ab6f Expose and use get requests specifying type in the JS 2014-11-11 12:32:13 -08:00
Thomas Kluyver
ce6dd40c5c Add type parameter for contents GET requests 2014-11-11 12:17:36 -08:00
Thomas Kluyver
c7529c53eb Eliminate remaining uses of extra_settings 2014-11-11 11:00:19 -08:00
Thomas Kluyver
ef98d48921 Disable passing extra AJAX settings to Contents.new() 2014-11-11 10:58:31 -08:00
Thomas Kluyver
b046af083c Fix some bugs in deleting notebooks from the dashboard 2014-11-11 10:58:31 -08:00
Thomas Kluyver
260ebcebcf Open window before creating new notebook
Avoids the need for synchronous requests.
2014-11-11 10:57:32 -08:00
Min RK
3870a30ce4 contents.new_untitled to match Python API 2014-11-10 17:29:53 -08:00
Min RK
da832ef59f split ContentsManager.new, add ContentsManager.new_untitled 2014-11-10 14:52:14 -08:00
Min RK
39041a9f03 address review in contents service
- various docstrings, comments clarified and updated
- misc typos
- fix and test creating an untitled directory via POST
- only define `message` if there's something to say
2014-11-10 14:02:21 -08:00
Min RK
ba370731a5 fix and test path regexes
- require leading `/`
- match empty string
- disallow consecutive `//`

This means that path_regex should be included as `/api/whatever%s`, not `/api/whatever/%s`
2014-11-10 14:02:21 -08:00
Min RK
5c2ae3e92c fix link-following logic in directory nav
avoid infinite recursion by recording which links have been visited
2014-11-10 14:02:20 -08:00
Min RK
81764cc1e0 update save test
fix some event waiting while there
2014-11-10 14:02:20 -08:00
Min RK
74c897cc0b unicode! 2014-11-10 14:02:20 -08:00
Min RK
bc4f0b32bb rename ContentsManager.create_file->new
consistent with js API
2014-11-10 14:02:19 -08:00
Min RK
8407ba3a08 update frontend with path/name changes
- remove name from models
- path is full path (contains name)
2014-11-10 14:02:19 -08:00
Min RK
62dedf921b remove notebook['name'] from sessions 2014-11-10 14:02:19 -08:00
Min RK
b6c4baa2fb remove copy via PUT
only copy via POST to directories
2014-11-10 14:02:19 -08:00
MinRK
3ada0c2c27 Remove separate 'path', 'name' in Contents API
- path is full path (including name)
- name is only used for read-only convenience, and plays no role in any API
- remove 'untitled upload' (POST with content and no path)
2014-11-10 14:02:18 -08:00
Kyle Kelley
464967d7a9 Merge pull request #6876 from minrk/falloff-reconnect
Add exponential falloff to kernel reconnect
2014-11-10 12:28:31 -06:00
Min RK
6d78644411 s/Connection lost/Not Connected/ 2014-11-09 10:06:48 -08:00
Min RK
4871cc4f1d wait for kernel_ready after ws_closed_error 2014-11-08 19:23:20 -08:00
Min RK
19bcc5fed9 bump minimum tornado version to 4.0
remove various websocket workaround for tornado 3
2014-11-07 22:39:25 -08:00
Min RK
f8d59bcd9e forward-port draft76 websockets
from tornado-3.2.2

only enabled during testing with phantomjs
2014-11-07 22:39:24 -08:00
Min RK
c0f64529bf allow js tests to run with tornado 4 and phantomjs 2014-11-07 22:19:41 -08:00
Min RK
42f0684994 add events to ws_closed_error in kernel.js 2014-11-07 16:10:50 -08:00
Min RK
59b54eba53 add Reconnect to kernel menu 2014-11-07 15:42:40 -08:00
Min RK
fe00509f32 add sticky Connection lost notification
when reconnect process gives up
2014-11-07 15:42:40 -08:00
Min RK
a6d427e5c9 add exponential falloff for reconnect
avoids constant reconnect attempts every 3 seconds forever

gives up after 6 tries (last timeout 64s)
2014-11-07 14:52:15 -08:00
Thomas Kluyver
5f456ef438 Document limitations of symlink parameter to install_nbextension
Closes gh-6239
2014-11-07 10:48:06 -08:00
Min RK
7cee09381f Merge pull request #6861 from quantopian/template_dir_option
DEV: Support for configurable list of extra jinja template directories.
2014-11-06 21:34:01 -08:00
Thomas Kluyver
9a7c6e78d9 JS Contents API doesn't need dialog module 2014-11-06 13:52:47 -08:00
Scott Sanderson
8a6af683ce DOC: Fix typo in comment. 2014-11-06 14:59:44 -05:00
Thomas Kluyver
ae6ae8f7b0 Return updated config from PATCH requests 2014-11-06 11:18:05 -08:00
Thomas Kluyver
c26b0f6961 Fix writing JSON on Python 2 2014-11-06 11:18:05 -08:00
Thomas Kluyver
425d5a1c02 Apply JSON config updates recursively 2014-11-06 11:18:05 -08:00
Thomas Kluyver
6786f86c63 Fix docstring, validate JSON on PUT 2014-11-06 11:18:04 -08:00
Thomas Kluyver
a76a546627 Add REST API for retrieving, storing and updating config 2014-11-06 11:18:04 -08:00
Scott Sanderson
c1196da096 DEV: Add IPython.html to the default template path.
This makes it possible to override a file with a template that also
inherits from that file.

For example, this makes it possible to override a single block of
notebook.html by creating a file called notebook.html that inherits from
templates/notebook.html.
2014-11-05 13:29:31 -05:00
Scott Sanderson
cd1304961f DEV: Support for configurable list of extra jinja template directories. 2014-11-05 00:19:17 -05:00
Min RK
c88bd5025a distinguish capture_output from buffer_output
allow capturing output without silencing it,
which is useful for slimerjs,
which requires looking at output to determine failure.
2014-11-04 15:59:27 -08:00
Jonathan Frederic
bfdf9596fd Fix bug where cell toolbars are not redrawn,
when cell metadata is changed.
2014-11-04 14:03:52 -08:00
Thomas Kluyver
538fcbc025 Close new window on error creating terminal 2014-11-04 10:44:08 -08:00
Thomas Kluyver
e6939f9aa5 Merge pull request #6846 from minrk/deprecate-heading-ui
deprecate heading cells in UI
2014-11-04 10:06:47 -08:00
Thomas Kluyver
8da4e89e3a Make a window immediately, and set its location on response
Avoids the need for async:false
2014-11-04 09:53:17 -08:00
v923z
a2081d042e replaced nbmodel.orig_nbformat by orig_nbformat 2014-11-04 15:10:55 +01:00
v923z
9c122dcd15 fixed notebook checking code 2014-11-04 14:57:44 +01:00
Min RK
ef49e32ef0 Merge pull request #6783 from takluyver/contentsmanager-js
contents.js wrapper for contents service
2014-11-03 17:09:49 -08:00
Thomas Kluyver
b7a558d5b9 Use synchronous request for creating new notebooks
To get round popup blockers
2014-11-03 15:29:09 -08:00
Min RK
04bcfa626d deprecate heading cells in UI
- removed from Kernel Menu
- Main toolbar warns via shouty dialog
- keyboard shortcuts still work to make headings in markdown cells, with no warning
2014-11-03 15:05:54 -08:00
Thomas Kluyver
2a497c16eb load_file -> load 2014-11-03 14:46:49 -08:00
Thomas Kluyver
1f2e4cc6c3 Fix passing empty list to draw_notebook_list() 2014-11-03 14:41:50 -08:00
Thomas Kluyver
a4f869aa8b Rename methods to remove _file suffix 2014-11-03 14:40:09 -08:00
Thomas Kluyver
5279418acf Make Contents.new more generic 2014-11-03 14:29:39 -08:00
Thomas Kluyver
4452754a6b Set notebook nbformat in toJSON 2014-11-03 14:20:12 -08:00
Min RK
6b67a69c22 don't assume converted notebooks are old
in notebook.js dialogs, which can now be triggered
by nbformat 4 from the future.
2014-11-03 11:50:11 -08:00
Thomas Kluyver
963921c4ff Merge pull request #6832 from minrk/request-only-once
actually send only one kernel_info request
2014-11-03 10:37:17 -08:00
Thomas Kluyver
684516c79f Fix copy-paste mistakes 2014-11-03 10:21:38 -08:00
Thomas Kluyver
658eb39c56 Remove one more unnecessary cache parameter 2014-11-03 10:19:51 -08:00
Thomas Kluyver
2962a3ce17 Remove some unnecessary cache: false parameters
According to the jQuery docs, this is only needed for GET and HEAD
requests.
2014-11-03 10:19:51 -08:00
Thomas Kluyver
a2f3e23fd8 Add copy_file to contents JS API 2014-11-03 10:19:51 -08:00
Thomas Kluyver
1ae6be218d Fix require config 2014-11-03 10:19:51 -08:00
Thomas Kluyver
b8f9dc07e2 Fix error callback when deleting file 2014-11-03 10:19:51 -08:00
Kester Tong
9797a6b7c0 typo fix 2014-11-03 10:19:51 -08:00
Kester Tong
89df330129 Modifies Contents API to return Error objects
Modfies the Contents class to return JavaScript Error objects instead of passing on the return values from $.ajax().  This has two advantages.  First, it allows the content manager to parse errors and give more informative messages than the ajax response.  Second, it makes the Contents interface more general, since other kinds of backends might generate client-side errors.
2014-11-03 10:19:50 -08:00
Thomas Kluyver
e1cbaf3d3c Fix spelling 2014-11-03 10:18:28 -08:00
Thomas Kluyver
f8ec8d4abe Various minor fixes from review 2014-11-03 10:18:28 -08:00
Thomas Kluyver
ea314a2a86 Rename callback parameters to success/error 2014-11-03 10:18:28 -08:00
Thomas Kluyver
060dd1305c Miscellaneous JS fixes 2014-11-03 10:18:28 -08:00
Thomas Kluyver
c1c591336e Some more event cleanup 2014-11-03 10:18:28 -08:00
Thomas Kluyver
cf828ccf4e Cut out some superfluous events 2014-11-03 10:18:28 -08:00
Thomas Kluyver
c9bd254735 Make contents JS API consistent 2014-11-03 10:18:28 -08:00
Thomas Kluyver
29d88a91a6 Standardise JS checkpointing API, use it for notebooks 2014-11-03 10:18:27 -08:00
Thomas Kluyver
14106cbd66 Move contents API module into services 2014-11-03 10:18:27 -08:00
Thomas Kluyver
a10dea4cd5 Add Contents.api_url convenience function 2014-11-03 10:18:27 -08:00
Thomas Kluyver
9538726b16 Don't do UI stuff in contents API module 2014-11-03 10:18:27 -08:00
Thomas Kluyver
478648bde5 Page URL is /notebooks/..., not contents 2014-11-03 10:18:27 -08:00
Thomas Kluyver
c661c85abd Add missing semicolon 2014-11-03 10:18:27 -08:00
Jeff Hemmelgarn
47a88f0e1d Remove version 2014-11-03 10:18:27 -08:00
Jeff Hemmelgarn
dab99c599f Remove unnecessary backwards compatibility code 2014-11-03 10:18:27 -08:00
Jeff Hemmelgarn
53463898eb Move contentmanager to contents 2014-11-03 10:18:27 -08:00
jhemmelg
5109be2d28 ContentManager function signatures updated 2014-11-03 10:18:04 -08:00
jhemmelg
496fa1901f Initial interface for javascript contentmanagers
contentmanager.js is going to be a js proxy for the current
filenbmanager.py.  This will allow a contentmanager for Google Drive to
be created.
2014-11-03 10:18:04 -08:00
Jeff Hemmelgarn
09e0ff93d8 Fix a few problems with cherry-picked commits
api/notebooks => api/contents
add type to JSON model
fix a few things in notebooklist.js
2014-11-03 10:18:04 -08:00
KesterTong
3994d4d56a Adds configuration options to use Google Drive content manager
Adds the key contentmanager_js_source to webapp_settings that allows for specifying the content manager JavaScript source file.  Also adds a NotebookManager subclass, ClientSideNotebookManager, which does minimal logic.  This class is used when the JavaScript content manager doesn't use the Python notebook manager, but rather implements that logic client side, as is the case for the Google Drive based content manager.

A sample command line that uses the Google Drive content manager, and the ClientSideNotebookManager, is

ipython notebook --NotebookApp.webapp_settings="{'contentmanager_js_source': 'base/js/drive_contentmanager'}" --NotebookApp.notebook_manager_class="IPython.html.services.notebooks.clientsidenbmanager.ClientSideNotebookManager"
2014-11-03 10:18:04 -08:00
KesterTong
952ac7d0d8 Moves load_notebook to ContentManager and adds new_notebook to Google Drive version 2014-11-03 10:17:12 -08:00
KesterTong
e3ef5d3b70 Moves list_notebooks to ContentManager 2014-11-03 10:17:12 -08:00