Commit Graph

3157 Commits

Author SHA1 Message Date
MinRK
f02b5bef21 fix setting image height/width from metadata 2014-01-23 15:38:13 -08:00
Jonathan Frederic
dc9f81e75d Fixed bug in selection widget tests. 2014-01-23 10:58:52 -08:00
Matthias BUSSONNIER
25e68b3a75 typo 2014-01-23 19:58:09 +01:00
Jonathan Frederic
e793d022b5 Callback dispatcher return callback value.
Also import it with the widgets namespace so it can be used elsewhere.
2014-01-23 10:52:33 -08:00
Matthias BUSSONNIER
03a2cb6535 fix js formatting 2014-01-23 19:31:35 +01:00
Matthias BUSSONNIER
4ecf5c8e5b add kernel test 2014-01-23 19:08:56 +01:00
MinRK
848010e911 fix tooltip token regex for single-character names
closes #4808
2014-01-23 09:51:46 -08:00
Jonathan Frederic
00b39af9cf Fixed type in container
._children was not being set...  Instead the value was being returned (useless).
2014-01-23 09:12:05 -08:00
Matthias BUSSONNIER
f5fa732bd3 avoid injection in input prompt 2014-01-23 14:17:14 +01:00
Kyle Kelley
e06f501cd6 s/==/is/ 2014-01-22 21:12:08 -06:00
Jonathan Frederic
91e82218a8 Changed selection widget API to use labels list
for mapping custom str reprs to items in the selection list
2014-01-22 17:15:10 -08:00
Jonathan Frederic
7f12f35fea Added code that removes the views when a model/widget is closed. 2014-01-22 16:28:17 -08:00
Kyle Kelley
7efc751d0e Name change to same_origin 2014-01-22 18:26:15 -06:00
Kyle Kelley
60ab030e52 Verify that headers are set, explicitly 2014-01-22 18:21:02 -06:00
Jonathan Frederic
288b8a0ced s/view_name/_view_name 2014-01-22 16:21:00 -08:00
Kyle Kelley
b12f002b35 Performing check only on open. 2014-01-22 18:16:06 -06:00
Jonathan Frederic
2d13d05e9c Replace O(N^2) algorithm with a faster one. 2014-01-22 16:14:20 -08:00
Jonathan Frederic
9e643f5692 Support multiple types in selection widget. 2014-01-22 15:53:58 -08:00
Jonathan Frederic
c9973a7114 Float widget views now inherit from int counterparts 2014-01-22 15:00:36 -08:00
Paul Ivanov
9b7c8b0473 make the JS test fail 2014-01-22 14:45:20 -08:00
Jonathan Frederic
2bb9ba9a9c Adjusted throttling 2014-01-22 12:53:59 -08:00
Jonathan Frederic
9560b29beb Removed float widget bound tests,
once the int widget inherits from the float, or vise-versa, the tests
will be covered by the int
2014-01-22 12:12:08 -08:00
Jonathan Frederic
1b8b6b3a88 Fixed bug where views child to other views would not have cell information 2014-01-22 12:04:53 -08:00
Jonathan Frederic
f06a0a7d5e Fixed a couple more context typos 2014-01-22 11:31:01 -08:00
Jonathan Frederic
629d65da89 Fixed context errors and a couple of typos to get the tests working again 2014-01-22 11:16:50 -08:00
Matthias BUSSONNIER
98101f9c6c add js kernel_info request 2014-01-22 09:01:13 +01:00
Matthias BUSSONNIER
cbe162297f XSS casper test 2014-01-22 08:34:47 +01:00
Kyle Kelley
345de4e674 Use *args, **kwargs, log.warn 2014-01-21 21:08:24 -06:00
Jonathan Frederic
99f3f5155e Fixed some typos related to _.each loops 2014-01-21 17:23:12 -08:00
Jonathan Frederic
d7b86104b8 Fixed typo - else -> elif 2014-01-21 17:14:34 -08:00
Jonathan Frederic
046280b51a s/ModalView/PopupView 2014-01-21 17:09:49 -08:00
Jonathan Frederic
7ce9f37b17 Made tests reflect changes to widget naming scheme. 2014-01-21 16:52:37 -08:00
Jonathan Frederic
10bd54bd30 Move js *RangeWidget code into *Widget 2014-01-21 16:49:35 -08:00
Jonathan Frederic
e323f64e6d Create base widget classes 2014-01-21 16:44:57 -08:00
Jonathan Frederic
b432b4840f Use CUnicode for width and height in ImageWidget 2014-01-21 16:33:49 -08:00
Jonathan Frederic
c5e48c0b75 Added some small comments to widget code 2014-01-21 16:32:18 -08:00
Jonathan Frederic
80c3339791 - remove second line in create_child_view
- add undefined check in delete_child_view
2014-01-21 16:29:59 -08:00
Jonathan Frederic
58f56a5dd7 Explicitly return null if there aren't any results 2014-01-21 16:28:26 -08:00
Jonathan Frederic
08e40697de Removed for () loops where necessary. Replaced with _.each 2014-01-21 16:26:03 -08:00
Jonathan Frederic
35a02a0436 Replace .html with .text everywhere possible 2014-01-21 15:38:37 -08:00
Jonathan Frederic
af4809bec4 Prefer JQuery to Underscore 2014-01-21 15:24:47 -08:00
Jonathan Frederic
d9a703d305 'create' should be handled in sync 2014-01-21 15:22:26 -08:00
Jonathan Frederic
2b27b4101b Remove todo in apply update 2014-01-21 15:21:44 -08:00
Jonathan Frederic
e823d386ab Fixed name conflict with _property_lock 2014-01-21 15:18:49 -08:00
Jonathan Frederic
077bd5c6ca Added new CallbackDispatcher class 2014-01-21 15:14:27 -08:00
Jonathan Frederic
611614b6eb Document in widget packing that vaues must be JSON-able. 2014-01-21 14:25:08 -08:00
Jonathan Frederic
cf05ef015a ict comprehension and list comprehension in pack/unpack widgets 2014-01-21 14:23:44 -08:00
Jonathan Frederic
cb6094281c s/custom_content/content 2014-01-21 14:17:57 -08:00
Jonathan Frederic
5fe860ed26 Added doc strings to properties in widget.py 2014-01-21 14:16:24 -08:00
Jonathan Frederic
1689eed2f6 Reorganized attrs in widget.py 2014-01-21 14:13:33 -08:00
Kyle Kelley
104275ab73 Indicate Py3 vs. Py2 codepath. 2014-01-21 14:47:58 -06:00
Jonathan Frederic
097951a6b8 Remove residual tabs 2014-01-21 12:35:39 -08:00
Kyle Kelley
5800b1c625 Get rid of exc_info as there isn't an exception. 2014-01-21 13:23:09 -06:00
Kyle Kelley
7b552d862d Add Origin Checking. 2014-01-21 12:55:52 -06:00
MinRK
c2cb64c9a0 adjustments to notebook app logging
Mainly add a log_request function (from nbviewer) for formatting tornado access logs.

Relevant effects:

- demote successful access logs to DEBUG
- demote kernel connect messages to DEBUG

which reduces the noise at INFO-level (default)
2014-01-21 10:48:24 -08:00
Jonathan Frederic
b7cd129c37 Added a line that was accidently deleted during merge of 4e813c5 2014-01-21 11:05:32 +00:00
Jonathan Frederic
691cd56038 Change the callback logic so the order makes more sense:
*Now*
View calls Model which calls Widget Manager
*instead of *
View calls Widget Manager, which then the Model modifies right
before sync
2014-01-21 11:00:45 +00:00
Jason Grout
fe6edb26a6 Rewrite widget syncing
Conflicts:
	IPython/html/static/notebook/js/widgetmanager.js
	IPython/html/static/notebook/js/widgets/widget.js
2014-01-21 10:13:42 -08:00
Matthias BUSSONNIER
149867e74c some $.html( -> $.text(
Thoses that are obvious and easy to fix.

we shoudl have I think a travis test that grep for .html( and return
less than 20 lines :-)
2014-01-17 22:25:33 -08:00
Jonathan Frederic
e17200a533 Widget require.js fix
The WidgetManager namespace is passed around instead of a
widget_manager instance...
2014-01-17 17:03:29 +00:00
Jonathan Frederic
c39050e642 Fixed widget_manager instance test. 2014-01-17 16:32:58 +00:00
Jonathan Frederic
469c865603 Added support for multiple kernels. 2014-01-17 16:22:57 +00:00
Jonathan Frederic
6871c8f9e0 Cherry pick of @jasongrout 's 2bc2f96.
Only merged changes to notebook and kernel...  (see original comment below).

Separate the widget registry from the widget managers;
attach widget managers to kernels.

Yet to do: take care of clean-up when a kernel is deleted
Conflicts:
	IPython/html/static/notebook/js/widgetmanager.js
	IPython/html/static/notebook/js/widgets/widget.js
2014-01-17 15:36:49 +00:00
Jason Grout
140d1872f7 Delete unnecessary save 2014-01-17 15:21:30 +00:00
Jason Grout
ce19a34d93 Pass the whole message into the widget manager display_view call
We do this so implementations can see metadata and any other things in the message, if they want.
Conflicts:
	IPython/html/static/notebook/js/widgetmanager.js
2014-01-17 15:21:06 +00:00
Jason Grout
092e40df32 make the saving to python a method of the model, called with callbacks
Conflicts:
	IPython/html/static/notebook/js/widgets/widget.js
2014-01-17 15:10:17 +00:00
Jason Grout
24ec0da125 Fix the cell reference in views
This solution is kludgy, but it does fix what broke when we tried to take the cell references out of views.
Conflicts:
	IPython/html/static/notebook/js/widgets/widget.js
2014-01-17 15:04:27 +00:00
Jonathan Frederic
7cc6692fc4 Make dropdown view DOM swap elements on update. 2014-01-17 10:37:08 +00:00
Matthias Bussonnier
0ec0534ce9 Merge pull request #4796 from minrk/update-components
update components

closes #4765
2014-01-16 09:53:07 -08:00
Jonathan Frederic
82bf9c6826 Fix bug in all children containing views 2014-01-16 17:19:35 +00:00
Jonathan Frederic
d317532a38 Halign dict colons 2014-01-16 17:17:00 +00:00
Jonathan Frederic
bd3ba3328c Added PEP8 style comments to all of the JS code. 2014-01-16 16:48:14 +00:00
Jonathan Frederic
7387f886c6 containers and selectioncontainers now only allow one of any single child 2014-01-16 14:48:56 +00:00
Jonathan Frederic
bfdebf9632 More PEP8 changes 2014-01-16 14:20:04 +00:00
Jonathan Frederic
bad85fb879 Remove O(N) cell by msg-id lookup 2014-01-16 11:53:22 +00:00
Jonathan Frederic
ff39989b8b s/Int/CInt s/Float/CFloat 2014-01-16 11:42:38 +00:00
Jonathan Frederic
2aeac3a424 Make widget views work with new keyboard manager. 2014-01-16 10:57:19 +00:00
Jonathan Frederic
f86fe40c97 Fix rebase issues 2014-01-16 10:57:19 +00:00
Jonathan Frederic
6286f8b1ea Fab CSS 2014-01-16 10:57:19 +00:00
Jonathan Frederic
74185a68e7 Got containers and mutlicontainers working! Yay 2014-01-16 10:57:19 +00:00
Jonathan Frederic
16d9fa92e8 Fix test for selection widgets 2014-01-16 10:57:19 +00:00
Jonathan Frederic
4017c7b27a Fixed *almost* all of the test-detected bugs 2014-01-16 10:57:19 +00:00
Jonathan Frederic
c085593e2a More fixes 2014-01-16 10:57:18 +00:00
Jonathan Frederic
d694666e66 A lot of bug fixes...
Related to 1-to-1 changes
2014-01-16 10:57:18 +00:00
Jonathan Frederic
047a90538f 1-to-1 widget / view mapping 2014-01-16 10:57:18 +00:00
Jonathan Frederic
c1c7bb7563 Everyone uses one model 2014-01-16 10:57:18 +00:00
Jonathan Frederic
b16171ac76 Added sync=True to all view name attrs 2014-01-16 10:57:18 +00:00
Jonathan Frederic
cfe8a07337 Added sync= attr to DOMWidget 2014-01-16 10:57:18 +00:00
Jonathan Frederic
b4a83b6044 sync=True isntead of a keys list 2014-01-16 10:57:18 +00:00
Jonathan Frederic
00650fd64a Dev meeting Jan 2014, widget review day 2 2014-01-16 10:57:18 +00:00
Jonathan Frederic
d3ffd25107 Dev meeting widget review day 1 2014-01-16 10:57:18 +00:00
Paul Ivanov
897d51a567 fix typos 2014-01-16 10:57:17 +00:00
Paul Ivanov
95e99c0c61 remove unused imports 2014-01-16 10:57:17 +00:00
Jonathan Frederic
d103c682c5 Many checks off the todo list, test fixes 2014-01-16 10:57:17 +00:00
Jonathan Frederic
f6de685d9f Use .apply for calling base with not proto-type.
See codecell for example.
2014-01-16 10:57:17 +00:00
Jonathan Frederic
0f715170b3 Add a comment that explains the notion of the default element
to be styled in set_css's' doc string.
2014-01-16 10:57:17 +00:00
Jonathan Frederic
1e37a46a55 Add a helper method that acts on the changes made to a list. 2014-01-16 10:57:17 +00:00
Jonathan Frederic
be268dcf98 Implement a context manager as a property locking mechanism in Widget. 2014-01-16 10:57:17 +00:00
Jonathan Frederic
70c6a295d0 Finished renaming Multicontainer to SelectionContainer 2014-01-16 10:57:17 +00:00
Jonathan Frederic
a528610e07 renamed: ../static/notebook/js/widgets/widget_multicontainer.js -> ../static/notebook/js/widgets/widget_selectioncontainer.js
renamed:    widget_multicontainer.py -> widget_selectioncontainer.py
2014-01-16 10:57:17 +00:00
Jonathan Frederic
643516f6f9 remove .html(''); 2014-01-16 10:57:17 +00:00
Jonathan Frederic
c62b496b0e s/image_format/format 2014-01-16 10:57:17 +00:00
Jonathan Frederic
b5f97c1227 add comment views are in *_range 2014-01-16 10:57:16 +00:00
Jonathan Frederic
5e9a090423 toggle button, set $el to button (removing extra div) 2014-01-16 10:57:16 +00:00
Jonathan Frederic
5b5325507f add locks to update everywhere by using options to pass this
(and check for this)
2014-01-16 10:57:16 +00:00
Jonathan Frederic
c4edfdc828 comment model.set, so we know that it triggers update on other views 2014-01-16 10:57:16 +00:00
Jonathan Frederic
ccbfcbc159 make JS update comment more descriptive (english) 2014-01-16 10:57:16 +00:00
Jonathan Frederic
0740980d5c remove length test add_class and remove_class 2014-01-16 10:57:16 +00:00
Jonathan Frederic
ec68f38ed7 Removed get_kernel method. 2014-01-16 10:57:16 +00:00
Jonathan Frederic
8dc5535638 un-nest options.options 2014-01-16 10:57:16 +00:00
Jonathan Frederic
a6fac70e03 s/BaseWidgetView/WidgetView and s/WidgetView/DOMWidgetView 2014-01-16 10:57:16 +00:00
Jonathan Frederic
44cf406ac0 this.updating should be a key specific lock 2014-01-16 10:57:16 +00:00
Jason Grout
d658f362ac Update option-passing for creating child views. 2014-01-16 10:57:16 +00:00
Jonathan Frederic
3a271585d7 Add constructor comment for widget model. 2014-01-16 10:57:16 +00:00
Jonathan Frederic
d7835eb14e Added missing comma 2014-01-16 10:57:16 +00:00
Jonathan Frederic
d3b33828c5 handle_msg a display_model method. 2014-01-16 10:57:15 +00:00
Jonathan Frederic
261e92de74 re-order handle custom msg and handle recieve state 2014-01-16 10:57:15 +00:00
Jonathan Frederic
3254f338bb Added note in widget manager why Backbone.sync is there rather
than the base.js (widget.js)
2014-01-16 10:57:15 +00:00
Jonathan Frederic
3f3a7edd6a remove on_create_widget and handle_create_widget callback 2014-01-16 10:57:15 +00:00
Jonathan Frederic
17da002a6a remove msg.content.data.view_name and corrosponding create_view param 2014-01-16 10:57:15 +00:00
Jonathan Frederic
99d83a2ad1 move backbone sync outside the widget manager class 2014-01-16 10:57:15 +00:00
Jonathan Frederic
5dbffa5287 _model_types, _view_types, _models - and document what keys and values are 2014-01-16 10:57:15 +00:00
Jonathan Frederic
15dabce113 send_state only once for dict signature of set_css 2014-01-16 10:57:15 +00:00
Jonathan Frederic
6c11760a89 Fixed comments for optional kwargs so they are redundant. 2014-01-16 10:57:15 +00:00
Jonathan Frederic
670f4881ec remove 3rd callback type from on_displayed 2014-01-16 10:57:15 +00:00
Jonathan Frederic
7e6c8e4f1d Remove view_name from display 2014-01-16 10:57:15 +00:00
Jonathan Frederic
463bcf85ee Fixed _send so it can open a comm if needed.
It no longer returns anything.
2014-01-16 10:57:14 +00:00
Jonathan Frederic
85b5adff58 Remove first three lines of repr widgets 2014-01-16 10:57:14 +00:00
Jonathan Frederic
e383594d04 renamed: basic_widgets.js -> init.js
renamed:    init.js -> widget.js
2014-01-16 10:57:14 +00:00
Jonathan Frederic
5a3665d9ed s/widget.js/init.js 2014-01-16 10:57:14 +00:00
Jonathan Frederic
5b388df615 Added callbacks method to view 2014-01-16 10:57:14 +00:00
Jonathan Frederic
5ced2816e7 Removed sync_method parameter from backbone msg spec 2014-01-16 10:57:14 +00:00
Jonathan Frederic
4e19dd7933 s/_handle_widget_constructed/_call_widget_constructed 2014-01-16 10:57:14 +00:00
Jonathan Frederic
39aaf7bf88 s/default_view_name/view_name 2014-01-16 10:57:14 +00:00
Jonathan Frederic
21a14e11a4 s/Widget/DOMWidget s/BaseWidget/Widget 2014-01-16 10:57:14 +00:00
Jonathan Frederic
696a6e4c28 add/remove_class now can accept a list of classes 2014-01-16 10:57:14 +00:00
Jonathan Frederic
2600913067 Removed ViewWidget 2014-01-16 10:57:14 +00:00
Jonathan Frederic
441a3e3ca6 Updated require.js references 2014-01-16 10:57:14 +00:00
Jonathan Frederic
ee522adc18 Renamed widget js files 2014-01-16 10:57:14 +00:00
Jonathan Frederic
691db01e5e Missing view argument when recursively calling widgetmanager.callbacks(view) 2014-01-16 10:57:14 +00:00
Jonathan Frederic
babd5c44ba Completely remove cell from model and view. 2014-01-16 10:57:13 +00:00
Jonathan Frederic
9e43807579 Updated comm id comments in view to model id 2014-01-16 10:57:13 +00:00
Jonathan Frederic
3329f875f3 s/comm_id/model_id (left over from before) 2014-01-16 10:57:13 +00:00
Jason Grout
a0b2cc40b8 Make widget keys have more explicit inheritance 2014-01-16 10:57:13 +00:00
Jason Grout
ce98452180 Get rid of keys magic; make the keys very explicit 2014-01-16 10:57:13 +00:00
Jason Grout
f0a4b9ea30 Make the widget keys property traverse the superclasses and accumulate the _keys attributes.
This caches the result, overwriting the property.
2014-01-16 10:57:13 +00:00
Jason Grout
7cbda99b0d Add widget view options in creating child views 2014-01-16 10:57:13 +00:00
Jonathan Frederic
7c3b21d239 Fixed typo in model_id property 2014-01-16 10:57:13 +00:00
Jonathan Frederic
0c8b6029a6 Remove debug print statements in container tests 2014-01-16 10:57:13 +00:00
Jonathan Frederic
d2afb9895b Output one more for debugging 2014-01-16 10:57:13 +00:00
Jonathan Frederic
7f430db3c8 Print cell output 2014-01-16 10:57:13 +00:00
Jonathan Frederic
12760ddbe5 deleted: wigets_container.js 2014-01-16 10:57:13 +00:00
Jonathan Frederic
07b3a7639d Revert "Enabled IPython Server output for Travis debugging"
This reverts commit eb7ee3f61335a7147fcfc1b1907d41f163bb0b41.
2014-01-16 10:57:13 +00:00
Jonathan Frederic
74fccf47b3 Revert "Added line to dump page html casperjs"
This reverts commit 7091ce87f7a280dde7724d92fd542b834f764e61.
2014-01-16 10:57:13 +00:00
Jonathan Frederic
8891750535 Fixed static_url call which is no longer optionally 1 param 2014-01-16 10:57:12 +00:00
Jonathan Frederic
3a05f7e145 Enabled IPython Server output for Travis debugging 2014-01-16 10:57:12 +00:00
Jonathan Frederic
c7362cb524 Added line to dump page html casperjs 2014-01-16 10:57:12 +00:00
Jonathan Frederic
926c93eb84 Fixed indentation in widgetmanager.js 2014-01-16 10:57:12 +00:00
Jonathan Frederic
57f3057ca5 Moved view widget into widget.py 2014-01-16 10:57:12 +00:00
Jonathan Frederic
46e88dc205 Fixed indent of line 450
... caused Travis to get mad
2014-01-16 10:57:12 +00:00
Jonathan Frederic
a2235efbea Further indentation cleanup 2014-01-16 10:57:12 +00:00
Jonathan Frederic
2e4abaa13d Removed console.log, unused 2014-01-16 10:57:12 +00:00
Jonathan Frederic
35a536f3b8 Re-decoupled comm_id from widget models 2014-01-16 10:57:12 +00:00
Jonathan Frederic
1b4e2ad6fe Added ViewWidget 2014-01-16 10:57:12 +00:00
Jonathan Frederic
399f11e2b2 renamed: wigets_container.js -> widgets_container.js 2014-01-16 10:57:12 +00:00
Jonathan Frederic
c3189c1c93 Fixed JS tests to reflect Jason's changes 2014-01-16 10:57:12 +00:00
Jonathan Frederic
8732761524 Added update_children pattern to remaining parent widgets 2014-01-16 10:57:12 +00:00
Jonathan Frederic
2211abd28d Converted tabs to spaces 2014-01-16 10:57:11 +00:00
Jason Grout
b41f77e635 Fix the python side of the add/remove class functions to send custom messages 2014-01-16 10:57:11 +00:00
Jason Grout
44e2043afe Live updates for children automatically change container views.
Since traitlets does not trigger events when list elements are changed, these changes are triggered only when the entire children element is reassigned.
2014-01-16 10:57:11 +00:00
Jason Grout
b52043b4f7 Get the add/remove css classes working 2014-01-16 10:57:11 +00:00
Jason Grout
a8c8c2a5fd General cleanup of base.js, including indentation fixes and adding view callbacks to the save options dictionary. 2014-01-16 10:57:11 +00:00
Jason Grout
747b219771 Move some Widget class references to BaseWidget 2014-01-16 10:57:11 +00:00
Jason Grout
00472333ec log the error stack for a kernel javascript error message 2014-01-16 10:57:11 +00:00
Jason Grout
07ffef8392 Make sure containers transmit the children; take care of case where children is possibly empty. 2014-01-16 10:57:11 +00:00
Jason Grout
7810c78aea Fix visible attribute for the very first render 2014-01-16 10:57:11 +00:00
Jason Grout
9b1a0d70a2 fix a handle_status handler 2014-01-16 10:57:11 +00:00
Jason Grout
1bf8da0734 Note todos for widgets 2014-01-16 10:57:10 +00:00
Jason Grout
38f0135522 Delete the snapshot message handler 2014-01-16 10:57:10 +00:00
Jason Grout
9a4c5957c3 Store views in the models and store child views in the views 2014-01-16 10:57:10 +00:00
Jason Grout
7431fa37dd Make updates more granular for widgets 2014-01-16 10:57:10 +00:00
Jason Grout
641a5af70f Move all references to cells to the view objects. 2014-01-16 10:57:10 +00:00
Jason Grout
45206783c2 Delete unnecessary check for comm object 2014-01-16 10:57:10 +00:00
Jason Grout
41170f7471 Change accordion to use a children attribute 2014-01-16 10:57:10 +00:00
Jason Grout
18beaff887 Remove unused code and debugging statements 2014-01-16 10:57:10 +00:00
Jason Grout
72f7d2fe09 Remove the automatic _children_attr and _children_lists_attr.
When serializing, any Widget object is encoded as its comm_id.  The view should know how to deal with the attribute, and should know that the attribute is a comm_id.
2014-01-16 10:57:10 +00:00
Jason Grout
ad1e23bfc2 Intermediate changes to javascript side of backbone widgets 2014-01-16 10:57:10 +00:00
Jason Grout
518cb4c647 Separate the display from the models on the python side, creating a BaseWidget class.
Conflicts:
	IPython/html/widgets/widget.py
2014-01-16 10:57:10 +00:00
Jonathan Frederic
2df05bc5b8 Display handler now supports full kwargs 2014-01-16 10:57:10 +00:00
Jonathan Frederic
3361826b5a Added require.js shims for underscore and backbone
This is necessary since underscore and backbone are no longer AMD
modules.
2014-01-16 10:57:10 +00:00
Jonathan Frederic
b588a56f76 Moved touch logic out of model into view.
View now updates using backbone events.
2014-01-16 10:57:10 +00:00
Jonathan Frederic
a2c951d9b0 s/display/created for display_view stuff 2014-01-16 10:57:09 +00:00
Jonathan Frederic
996d133710 Remove redundent _handle_close method 2014-01-16 10:57:09 +00:00
Jonathan Frederic
857ae831fb Decoupled Python Widget from Comm
Fixed conflicts:
	IPython/html/widgets/widget.py
2014-01-16 10:57:09 +00:00
Jonathan Frederic
f2fefe20ff Added event for widget construction 2014-01-16 10:57:09 +00:00
Jonathan Frederic
ea27ae599b Added parent parameter to on_display callback 2014-01-16 10:57:09 +00:00
Jonathan Frederic
d4b6823a49 Removed unused that from widget manager 2014-01-16 10:57:09 +00:00
Jonathan Frederic
73380ca442 Fixed nonregistered model bug in wiget manager 2014-01-16 10:57:09 +00:00
Jonathan Frederic
3c866ea412 Made widget model state update function public 2014-01-16 10:57:09 +00:00
Jonathan Frederic
8ceb29796a Made display_view a public method. 2014-01-16 10:57:09 +00:00
Jonathan Frederic
19e9cee437 Fix, require.js needs return of widget manager for other widgets 2014-01-16 10:57:09 +00:00
Jonathan Frederic
d7c0498b13 renamed: widget.js -> widgetmanager.js 2014-01-16 10:57:09 +00:00
Jonathan Frederic
3d7557b740 Moved base widget model and view into widgets/base.js 2014-01-16 10:57:09 +00:00
Jonathan Frederic
3a936676dc Removed comm dependency of widget model and view 2014-01-16 10:57:09 +00:00
Jonathan Frederic
8120778e5a Fixed some spacing in widget.js 2014-01-16 10:57:09 +00:00
Jonathan Frederic
5678617d8f Fixed context of onclick callbacks selection widget views 2014-01-16 10:57:09 +00:00
Jonathan Frederic
4e3b2b3e94 jslint /widgets 2014-01-16 10:57:08 +00:00
Jonathan Frederic
f1986755ec Removed button.close() test because it caused the test framework to hang 2014-01-16 10:57:08 +00:00
Jonathan Frederic
43bd3ae2ef Organized tests. 2014-01-16 10:57:08 +00:00
Jonathan Frederic
8853e40905 Added throttling test 2014-01-16 10:57:08 +00:00
Jonathan Frederic
aae6970944 Added StringWidget tests 2014-01-16 10:57:08 +00:00
Jonathan Frederic
a3a8a1efb1 Added list modification test to selection widget. 2014-01-16 10:57:08 +00:00
Jonathan Frederic
401997580e Added selection widget tests 2014-01-16 10:57:08 +00:00
Jonathan Frederic
df2c5d7d06 Removed js test utils commit and rebased with master.
Also add test to see if selection widgets are atleast displayed.
2014-01-16 10:57:08 +00:00
Jonathan Frederic
4ec03f00d9 Partially implemented selection widget tests 2014-01-16 10:57:08 +00:00
Jonathan Frederic
3bc9d12eb8 jshint widget.js 2014-01-16 10:57:08 +00:00
Jonathan Frederic
d398ab6720 Added multicontainer widget tests 2014-01-16 10:57:08 +00:00
Jonathan Frederic
e9bf942375 Fixed backbone event handling for accordion view 2014-01-16 10:57:08 +00:00
Jonathan Frederic
35e74c41b8 Added int range and int widget tests. 2014-01-16 10:57:08 +00:00
Jonathan Frederic
2ae3e86b50 Added ImageWidget tests 2014-01-16 10:57:07 +00:00
Jonathan Frederic
b66bd65e75 Added float widget tests 2014-01-16 10:57:07 +00:00
Jonathan Frederic
fbaeb9bb20 Fixed flushed messages not getting sent with new 'method' message tag 2014-01-16 10:57:07 +00:00
Jonathan Frederic
a880181297 Added float range widget tests 2014-01-16 10:57:07 +00:00
Jonathan Frederic
1b02e8f607 Add ImageWidget 2014-01-16 10:57:07 +00:00
Jonathan Frederic
186e756da9 Remove uneccessary lines in String.js 2014-01-16 10:57:07 +00:00
Jonathan Frederic
a6e5ec942c Added LatexView 2014-01-16 10:57:07 +00:00
Jonathan Frederic
b656f34c48 s/LabelView/HTMLView 2014-01-16 10:57:07 +00:00
Jonathan Frederic
fff6263840 Fab CSS 2014-01-16 10:57:07 +00:00
Jonathan Frederic
d21426d461 - Fixed CSS so it also applies to widgets within modals
- Added docked modal style
2014-01-16 10:57:07 +00:00
Jonathan Frederic
32a8d43afc - ModalView can now be docked and undocked
- Clicking on a ModalView will bring it to the front
2014-01-16 10:57:07 +00:00
Jonathan Frederic
5e01a6bb1e Uncommented parent/child test that was failing 2014-01-16 10:57:06 +00:00
Jonathan Frederic
6cfdb5848a Fix bug where a child view could be displayed in a
different cell if it's parent didn't exist in the
current cell but instead another cell.
2014-01-16 10:57:06 +00:00
Jonathan Frederic
b020a0b129 Add container tests 2014-01-16 10:57:06 +00:00
Jonathan Frederic
1865d07928 Added bool widget value toggle tests 2014-01-16 10:57:06 +00:00
Jonathan Frederic
9a15dca291 Added test to check initial states of bool views 2014-01-16 10:57:06 +00:00
Jonathan Frederic
e2143d5a8f Added basic bool widget tests 2014-01-16 10:57:06 +00:00
Jonathan Frederic
0b580b9f9a Make widget tests use new casper util functions 2014-01-16 10:57:06 +00:00
Jonathan Frederic
ced0de342d Cleaned up utilities in widget casper js tests 2014-01-16 10:57:06 +00:00
Jonathan Frederic
b53802472b Added button tests 2014-01-16 10:57:06 +00:00
Jonathan Frederic
9d8a0f62f1 Basic test widget button. 2014-01-16 10:57:06 +00:00
Jonathan Frederic
8e1c52382c Added method property to messages from the front-end 2014-01-16 10:57:06 +00:00
Jonathan Frederic
d371e3772a Make selector property of the add and remove class packets optional. 2014-01-16 10:57:06 +00:00
Jonathan Frederic
d69e957b9a Added support for disabled flag to button widget. 2014-01-16 10:57:06 +00:00
Jonathan Frederic
1536c45955 Replace model 'update' event with the backbone 'sync' event, added in 1.0 2014-01-16 10:57:05 +00:00
Jonathan Frederic
dd31af4462 Do not vertically center modal 2014-01-16 10:57:05 +00:00
Jonathan Frederic
515f0d1b0f Fixed modal centering code 2014-01-16 10:57:05 +00:00
Jonathan Frederic
0f34affc35 Dont send add and remove class calls if no comm exists 2014-01-16 10:57:05 +00:00
Jonathan Frederic
c31ad5cf78 Added custom selector logic to modal view 2014-01-16 10:57:05 +00:00
Jonathan Frederic
1fb4340503 Moved flexible box model attrs out of Container and Modal js
into a common function
2014-01-16 10:57:05 +00:00
Jonathan Frederic
8b08e1c53c Center modal view on show 2014-01-16 10:57:05 +00:00
Jonathan Frederic
e36353c152 Fab CSS 2014-01-16 10:57:04 +00:00
Jonathan Frederic
f9f84fc076 Removed max height from widget modal body 2014-01-16 10:57:04 +00:00
Jonathan Frederic
61bfddbd17 Fixed body container height not stretching to fill remainer of height 2014-01-16 10:57:04 +00:00
Jonathan Frederic
4e1e091648 Added ModalView 2014-01-16 10:57:04 +00:00
Jonathan Frederic
ad25488041 Fab CSS 2014-01-16 10:57:04 +00:00
Jonathan Frederic
ee3d473cb5 Added style for widget modal 2014-01-16 10:57:04 +00:00
Jonathan Frederic
4333c84907 Fix scroll_to_bottom 2014-01-16 10:57:04 +00:00
Jonathan Frederic
02db32fe9a Fix typo, static msg content c&p from button widget view. 2014-01-16 10:57:04 +00:00
Jonathan Frederic
6aac36ee13 Remove on_click, doesn't apply 2014-01-16 10:57:04 +00:00
Jonathan Frederic
4f663d896d Made scroll to bottom use msgs
allow multiple msg handlers
added send to view to automatically hookup callbacks
changed send signature to optionally accept a cell to connect callbacks
2014-01-16 10:57:04 +00:00
Jonathan Frederic
cc96589afc Changed on_submit to use custom messages instead of stateful communcation 2014-01-16 10:57:03 +00:00
Jonathan Frederic
10002f5a81 Changed button to use custom messages instead of state to communicate events. 2014-01-16 10:57:03 +00:00
Jonathan Frederic
c299022cc7 Changed add_class and remove_class to use messages instead of stateful communication 2014-01-16 10:57:03 +00:00
Jonathan Frederic
873d1d231e Make sure DOM element ids start with alphabetic characters, not numeric. 2014-01-16 10:57:03 +00:00
Jonathan Frederic
00f72487c5 Use setElement to set the view's element properly. 2014-01-16 10:57:03 +00:00
Jonathan Frederic
0cd4226fde Fixed typo in container construction. 2014-01-16 10:57:03 +00:00
Jonathan Frederic
f16f1d6537 Make sure backbone events fire.
If $el is set to something else, make sure all the backbone machinery
knows about the new DOM element.
2014-01-16 10:57:03 +00:00
Jonathan Frederic
d795654251 Add scroll_to_bottom method for TextAreaView (StringWidget). 2014-01-16 10:57:03 +00:00
Jonathan Frederic
9019b639d1 Fixed a bug that didn't allow callbacks to set a property
on the widget that triggered the callback.
2014-01-16 10:57:03 +00:00
Jonathan Frederic
0d7428a903 Added TextBox submit event 2014-01-16 10:57:03 +00:00
Jonathan Frederic
cb0ac9c06b Remove some empty space 2014-01-16 10:57:03 +00:00
Jonathan Frederic
bcc2ce15a3 Cleaned up _make_callbacks method of widget model class 2014-01-16 10:57:03 +00:00
Jonathan Frederic
96c6db3c1d Fixed typo in widget model code causing notebook to not load 2014-01-16 10:57:03 +00:00
Jonathan Frederic
c0ff518107 Added support for custom widget msgs 2014-01-16 10:57:02 +00:00
Jonathan Frederic
67f364396f Properly dispose of widget model. Delete comm's ref to
the widget model so the GC will collect it when it is
no longer reference elsewhere.
2014-01-16 10:57:02 +00:00
Jonathan Frederic
296d0e0b31 Added on_view_displayed and on_close callbacks to widget manager. 2014-01-16 10:57:02 +00:00
Jonathan Frederic
b47cc6c3ee Added more comments to widget model JS 2014-01-16 10:57:02 +00:00
Jonathan Frederic
b6254e0ce5 Better comments in _display_view 2014-01-16 10:57:02 +00:00
Jonathan Frederic
57460cddcb Dont err if view name isn't registered. 2014-01-16 10:57:02 +00:00
Jonathan Frederic
db6ca32499 Added on_create_widget callback to WidgetManager 2014-01-16 10:57:02 +00:00
Jonathan Frederic
61f7408893 Privatize _handle_com_open of WidgetManager 2014-01-16 10:57:02 +00:00
Jonathan Frederic
5ffd0f00c6 Prviatize methods that should not be called externally
in Model and View JS widget classes
2014-01-16 10:57:02 +00:00
Jonathan Frederic
673a723a73 Moved get_msg_cell which depends on notebook specific logic
into the WidgetManager for easy override.  Also removed
almost all of the logic that refers to cell.output_area inside
the model and replaced it with logic that uses cell.
2014-01-16 10:57:02 +00:00
Jonathan Frederic
7993b1d4a1 Fab CSS 2014-01-16 10:57:02 +00:00
Jonathan Frederic
eaea930667 Added ListBoxView 2014-01-16 10:57:01 +00:00
Jonathan Frederic
1131100d21 Changed require.js load calls to allow require.js to pass
the import module handles around.
2014-01-16 10:57:01 +00:00
Jonathan Frederic
90030b238b Added missing parameter to get_msg_cell call 2014-01-16 10:57:01 +00:00
Jonathan Frederic
48eaebf683 Moved the logic to get a cell by message id into the notebook.js.
Also added more detail to the comments in the get output area function in widgets.js
2014-01-16 10:57:01 +00:00
Jonathan Frederic
215060e8e8 Added selected_index support to accordion view. 2014-01-16 10:57:01 +00:00
Jonathan Frederic
a9faa50329 Use regular expressions when fixing button-like captions 2014-01-16 10:57:01 +00:00
Jonathan Frederic
6c860e32c0 Added support for multiple lines in button-like widgets 2014-01-16 10:57:01 +00:00
Jonathan Frederic
59e7a04723 Added support for multiple spaces in a row
also added button height fix for standard buttons without a caption
2014-01-16 10:57:01 +00:00
Jonathan Frederic
ce53644d54 Added standard IPY JS header to widget JS files. 2014-01-16 10:57:01 +00:00
Jonathan Frederic
b9a274a425 Fixed indentation 2014-01-16 10:57:01 +00:00
Jonathan Frederic
f13a36f491 Fab CSS 2014-01-16 10:57:00 +00:00
Jonathan Frederic
d9f3870a2e Cleaned up widget LESS. Added comments and sorted code. 2014-01-16 10:57:00 +00:00
Jonathan Frederic
f9dd4ffd6f Fab CSS 2014-01-16 10:57:00 +00:00
Jonathan Frederic
e163d8033b Fix jquery slider on FF 2014-01-16 10:57:00 +00:00
Jonathan Frederic
8b33fa849d Fab CSS 2014-01-16 10:57:00 +00:00
Jonathan Frederic
e6aa364976 Better fix for empty dropdown button alignment
Now an   character is inserted and bootstrap is left alone to deal with alignment.
2014-01-16 10:57:00 +00:00
Jonathan Frederic
67e15f79db Fab CSS 2014-01-16 10:57:00 +00:00
Jonathan Frederic
dc785c6e36 Set a minimum height on the combobox button
to fix captionless button height.
2014-01-16 10:57:00 +00:00
Jonathan Frederic
4d7c20015b Fab CSS 2014-01-16 10:57:00 +00:00
Jonathan Frederic
b22075a126 Removed combo-box explicit height
b/c it caused the carrot button to misalign with the combo box
2014-01-16 10:57:00 +00:00
Jonathan Frederic
d35d8c242e Fixed bug that prevent model.save() from being called on
widget models without views.
2014-01-16 10:57:00 +00:00
Jonathan Frederic
742ad511f6 Added check on widget close to make sure comm isn't already none. 2014-01-16 10:57:00 +00:00
Jonathan Frederic
8daa879087 Fixed casperjs widget tests
to match WidgetManager requirejs load changes
2014-01-16 10:56:59 +00:00
Jonathan Frederic
473e22dab4 FAB CSS 2014-01-16 10:56:59 +00:00
Jonathan Frederic
458249e5c4 POST-REBASE Re-added widgets reference 2014-01-16 10:56:59 +00:00
Jonathan Frederic
65510584c5 Fixed typos in throttling code. 2014-01-16 10:56:59 +00:00
Jonathan Frederic
1f39592bb1 Added missing types import 2014-01-16 10:56:59 +00:00
Jonathan Frederic
8502b2c182 Remove init_widget_js, use require.js for everything
Updated examples
Fixed bug with message throttling
2014-01-16 10:56:59 +00:00
Jonathan Frederic
08b1d08fb6 Fix: added inspect import to widget.py 2014-01-16 10:56:59 +00:00
Jonathan Frederic
3390f64dc2 Added flex properties to container.
Also replaced underscores in flex align properties with dashes.
2014-01-16 10:56:58 +00:00
Jonathan Frederic
2ba2d42e84 Added flexible box model align properties. 2014-01-16 10:56:58 +00:00
Jonathan Frederic
a67f2ec472 Fixed doc string comments, removed extra space 2014-01-16 10:56:58 +00:00
Jonathan Frederic
8279db0eb0 Fixed widget button onclick register so it only will ever register a callback once. 2014-01-16 10:56:58 +00:00
Jonathan Frederic
35fc3af84f Added on_display callback 2014-01-16 10:56:58 +00:00
Jonathan Frederic
e39ba92172 Fixed: Last state not being sent to kernel while throttling. 2014-01-16 10:56:58 +00:00
Jonathan Frederic
12b02b3e49 Use baseProjectUrl for widget import path 2014-01-16 10:56:04 +00:00
Jonathan Frederic
6834224332 Updated set_css so it can handle a dictionary of keys and values. 2014-01-16 10:56:04 +00:00
Jonathan Frederic
20c97e0f87 Use relative paths for widget js jquery imports 2014-01-16 10:56:04 +00:00
Jonathan Frederic
6110e1c307 Updated ButtonWidget onclick description 2014-01-16 10:56:04 +00:00
Jonathan Frederic
4c23d2c7a1 Fixed comment in widget.js 2014-01-16 10:56:04 +00:00
Jonathan Frederic
c3a029acc1 Fixed & separated output_area -> widget_area logic 2014-01-16 10:56:04 +00:00
Jonathan Frederic
21383149ce Decoupled cell_index from widget model code. 2014-01-16 10:56:04 +00:00
Jonathan Frederic
8e259f401d Fixed callback mapping for widget spawned widgets 2014-01-16 10:56:03 +00:00
Jonathan Frederic
e84e1d2df6 Fixed button on_click handler so it's initiated on instanciation 2014-01-16 10:56:03 +00:00
Jonathan Frederic
4d324f28f1 Set default element to be styled in built-in views 2014-01-16 10:56:03 +00:00
Jonathan Frederic
8fba5d2f07 Added add_class and remove_class methods. 2014-01-16 10:56:03 +00:00
Jonathan Frederic
048ba656d4 Remove text repr of js includes. 2014-01-16 10:56:03 +00:00
Jonathan Frederic
810ea87e5b Added visible property to all widgets 2014-01-16 10:56:03 +00:00
Jonathan Frederic
82dd891483 Allow parent to be set after construction...
But still must be set before display call
2014-01-16 10:56:03 +00:00
Jonathan Frederic
e169e97409 Add basic widget.js tests 2014-01-16 10:56:03 +00:00
Jonathan Frederic
e9fe606ba6 More relative imports, Travis w/ Py3.3 2014-01-16 10:56:03 +00:00
Jonathan Frederic
2c3d80c275 Added selected_index property to TabView 2014-01-16 10:56:03 +00:00
Jonathan Frederic
19f0372f54 Added ability to specify the element that gets style in a view
when no jquery selector is provided (default).
2014-01-16 10:56:03 +00:00
Jonathan Frederic
c95fbfad28 Made RadioButtons and ToggleButtons views compatible with disabled property 2014-01-16 10:56:03 +00:00
Jonathan Frederic
68798d810d Made checkbox and togglebutton compatable with disabled property 2014-01-16 10:56:03 +00:00
Jonathan Frederic
9f3450448e Made TextArea and TextBox views compatable with disabled property 2014-01-16 10:56:02 +00:00
Jonathan Frederic
49662a61ba Fix slider orientation change, value-handle-offset bug 2014-01-16 10:56:02 +00:00
Jonathan Frederic
8687ad881a Fixed widget imports for Python3 2014-01-16 10:56:02 +00:00
Jonathan Frederic
fc6cb0231f Fixed checkbox click event handler 2014-01-16 10:56:02 +00:00
Jonathan Frederic
9ce2a9eeca Added ProgressView 2014-01-16 10:56:02 +00:00
Jonathan Frederic
c77bbdf01f Fixed vertical widget labels 2014-01-16 10:56:02 +00:00
Jonathan Frederic
a1a86bb8c4 Added slider vertical mode, and
fixed hbox element sizing.
2014-01-16 10:56:02 +00:00
Jonathan Frederic
72fd070739 MAJOR CSS FIXES
Fixed jquery slider horizontal style
Fixed label alignment
2014-01-16 10:56:02 +00:00
Jonathan Frederic
9cfecfb6aa Added widget-label style def && fab css 2014-01-16 10:56:02 +00:00
Jonathan Frederic
b9f6e562f7 Changed underscores in CSS names to dashes 2014-01-16 10:56:02 +00:00
Jonathan Frederic
f2d77f3b78 Added labels to basic widgets 2014-01-16 10:56:02 +00:00