Commit Graph

1126 Commits

Author SHA1 Message Date
MinRK
89faa5f340 simplify raw_input css
for once, vertical-align: baseline is the right choice
2014-03-13 20:47:34 -07:00
MinRK
065a6eaa34 fix ambiguous raw_input classes 2014-03-13 20:45:54 -07:00
Paul Ivanov
61b47695e4 renamed 'use_shortcut' method to 'handles' 2014-03-13 16:44:19 -07:00
Paul Ivanov
d8287466d0 another doc fix 2014-03-13 16:40:37 -07:00
Paul Ivanov
f68dcc3e57 it's only half true that I'm anal about semicolons 2014-03-13 16:30:58 -07:00
Paul Ivanov
67fd905421 minor fixes to docs to address PR feedback 2014-03-13 16:29:28 -07:00
Paul Ivanov
469c70fd10 more semicolons 2014-03-13 16:23:27 -07:00
Jonathan Frederic
443083c1fd Added some comments 2014-03-13 14:34:17 -07:00
Paul Ivanov
1dc113a9cb closes #5336 2014-03-13 14:30:32 -07:00
Paul Ivanov
4142911ac7 better fix for starting with Command Mode icon 2014-03-11 18:58:46 -07:00
Paul Ivanov
12139b4d6e ensure ipython-command-mode icon displayed on load 2014-03-11 18:48:21 -07:00
Paul Ivanov
f0ae836f5f semantic names for kernel status indicator 2014-03-11 18:37:35 -07:00
Paul Ivanov
f5a02a02dd semantic names for indicator icons
For all of the discussion that we had about what kind of icons should
and should not be used to indicate what mode the notebook is in, we
never went through to make it possible to override it.

With this change, it is now possible to override what icons are
displayed for Command and Edit Modes.

For example, @minrk liked the fighter-jet icon for Command Mode, so he
can put this in his custom.css

.ipython-command-mode:before {
     content: "\f0fb";
}
2014-03-11 18:22:03 -07:00
MinRK
084aba793f fix raw_input CSS
I had to express padding in px, not em for consistent appearance.
I'm not sure why.
2014-03-11 14:45:37 -07:00
Paul Ivanov
4dd009f198 DRY: style in one place, removed code duplication 2014-03-11 00:53:15 -07:00
Jonathan Frederic
7762cb0ab3 Fixed a small bug/typo 2014-03-10 15:29:10 -07:00
Jonathan Frederic
e61b6aef47 Add logic to close tt when cell is unselected 2014-03-10 15:26:04 -07:00
Brian E. Granger
3eb654bd86 Merge pull request #5295 from minrk/no-append-prototype
OutputArea.append_type functions are not prototype methods
2014-03-10 14:13:14 -07:00
Paul Ivanov
b08665563d fix capitalization of mode-switching keys 2014-03-10 11:48:13 -07:00
MinRK
a24595d16b call append_text from append_map 2014-03-10 11:44:00 -07:00
Paul Ivanov
01c9be84d0 prettify combo keyboard shortcuts 2014-03-10 11:30:50 -07:00
Paul Ivanov
1c213bc615 first pass at capitalizing keyboard shortcuts 2014-03-10 11:13:18 -07:00
Jonathan Frederic
95492b0f42 Add illusion that cell is in edit mode when complete is up,
even though it is not in focus so it is not in edit mode.
2014-03-10 10:10:06 -07:00
Jonathan Frederic
65732920eb Remove all should cancel blur logic. 2014-03-10 09:46:59 -07:00
Jonathan Frederic
989ae4e1b3 Workaround for Tooltip & completer click focus bug. 2014-03-10 09:28:19 -07:00
MinRK
abe2dce926 back to dev 2014-03-09 21:58:09 -07:00
Paul Ivanov
1c23dee141 remove recreation of QuickHelp 2014-03-09 14:21:14 -07:00
Paul Ivanov
8bf4ffa2ca rebuild.QuickHelp event sets the dirty bit
QuickHelp is rebuilt on show if the dirty bit was set.
2014-03-09 14:15:47 -07:00
Paul Ivanov
cdb7967cc2 removing keyboard shortcuts should also update help 2014-03-09 12:26:34 -07:00
Paul Ivanov
4a287569fc update notebook quickhelp on new shortcuts 2014-03-09 12:24:32 -07:00
Paul Ivanov
cd38181438 remove raw cell placeholder on focus, closes #5238 2014-03-09 11:41:25 -07:00
MinRK
4d1f9b21c4 append functions are not prototype methods 2014-03-07 17:57:37 -08:00
Paul Ivanov
54409a196d dem semicolons 2014-03-07 17:48:34 -08:00
Paul Ivanov
19c7189b15 no need to special-case Escape anymore 2014-03-07 17:48:34 -08:00
Paul Ivanov
6a2c4121f9 up and down keys no longer need special casing 2014-03-07 17:48:34 -08:00
Paul Ivanov
2c9ff376a2 added new use_shortcut method to shortcuts
this way, you can ask if a particular event will be handled by the
shortcuts system. This takes away the need to special-case many
different possible keys which should be ignored by codemirror by
ignoring them en masse.
2014-03-07 17:48:34 -08:00
Paul Ivanov
b9e448b160 DRY: refactor common keyboard handling to Cell
Our edit mode keyboard shortcuts don't distinguish between being in a
code cell or in a text cell, so it makes sense to handle both in one
place. This is a first step in that direction.
2014-03-07 17:48:34 -08:00
Paul Ivanov
15f4345ba3 typo, use keycodes object instead of magic numbers 2014-03-07 17:48:34 -08:00
Paul Ivanov
bf3ecdb35f DRY: factor out common handle_keyevent method
This method was identical in both CodeCell and TextCell
2014-03-07 17:48:34 -08:00
Paul Ivanov
71d4c427c9 refactor to improve cell switching in edit mode
This code was repeated in both CodeCell and TextCell, both of which are
extensions of Cell, so this just unifies the logic in Cell.

TextCell had logic here to check if the cell was rendered or not, but I
don't believe it is possible to end up triggering such a code path.
(Should that be required, I can always just add back these methods to
TextCell, performing the .rendered==True check, and calling the Cell

prior to this, code mirror at_top would only return true on if the
cursor was at the first character of the top line. Now, pressing up
arrow on any character on the top line will take you to the cell above.

The same applies for the bottom line. Pressing down arrow would only go
to the next cell if the cursor was at a location *after* the last
character (something that is only possible to achieve in vim mode if the
last line is empty, for example). Now, down arrow on any character of
the last line will go to the next cell.
2014-03-07 17:48:34 -08:00
Paul Ivanov
8889a7581c start better keyboard handling 2014-03-07 17:48:34 -08:00
MinRK
3face719e8 setup jsversion 2014-03-07 15:54:55 -08:00
Brian E. Granger
30c500bfa9 Merge pull request #5292 from jdfreder/shift-enter-scroll
focus next cell on shift+enter
2014-03-07 14:55:48 -08:00
Jonathan Frederic
da334e782e focus next cell on shift+enter 2014-03-07 14:48:09 -08:00
Min RK
0a37d7bfc5 Merge pull request #5232 from jdfreder/nbc_incono
Make nbconvert html full output like notebook's html.
2014-03-07 14:14:43 -08:00
Brian E. Granger
05e6fbade4 Merge pull request #5288 from minrk/start-idle
Correct initial state of kernel status indicator
2014-03-07 14:07:42 -08:00
Thomas Kluyver
80af3b4cfb Merge pull request #4802 from ivanov/ui-docs
Tour of the notebook UI (was UI elements inline with highlighting)
2014-03-07 12:09:32 -08:00
MinRK
e901c9be33 Correct initial state of kernel status indicator
- start as busy, since we don't know
- send a kernel_info request once connections are established
- set idle on reply to the to the kernel_info request
2014-03-07 11:51:54 -08:00
Brian E. Granger
f62ce75a62 Lots of CSS tweaks to get nbconvert output looking right. 2014-03-06 16:36:39 -08:00
Jonathan Frederic
9c5bca99e2 addClass instead of adding extra_class arg everywhere 2014-03-06 14:22:36 -08:00
Jonathan Frederic
6169acfc6d Fixed rebase issues 2014-03-06 14:10:37 -08:00
Jonathan Frederic
8b3c356c8d Add extra_class arg to the rest of the append methods,
use new extra_arg to add output_pyout class
2014-03-06 13:29:09 -08:00
Jonathan Frederic
b92ede2800 Added output_pyerr to python error output 2014-03-06 13:26:44 -08:00
Brian E. Granger
1407b4347e Merge pull request #5268 from ellisonbg/cmd-mode
Refactoring Notebook.command_mode
2014-03-06 12:09:43 -08:00
Paul Ivanov
610e66615e added a note to what's new 2014-03-05 22:18:16 -08:00
Paul Ivanov
7974e32150 oops, <tt> went the way of the dodo, using <code> 2014-03-05 21:27:14 -08:00
Paul Ivanov
06e5858ee2 lower case names for keys 2014-03-05 21:08:24 -08:00
MinRK
7d87978a66 fix a typo introduced by a rebased PR
caused heading cells to appear in both rendered and unrendered state
2014-03-05 14:30:34 -08:00
Jonathan Frederic
de9b5b907e Fab CSS 2014-03-05 12:25:26 -08:00
juhasch
72864cc83c append Firefox overflow-x fix 2014-03-05 12:25:11 -08:00
Paul Ivanov
fdca0762a4 tidy up capitalization 2014-03-04 19:05:56 -08:00
Paul Ivanov
e10afab397 rewording according to feedback in #4802 2014-03-04 18:14:51 -08:00
Paul Ivanov
490e4d1e42 horizontally center menubar popup 2014-03-04 18:10:45 -08:00
Paul Ivanov
4371ebf625 fix vertical position of command mode tooltip 2014-03-04 18:02:21 -08:00
MinRK
54e1558c16 make trust notebook dialog a single paragraph 2014-03-04 17:35:38 -08:00
MinRK
8cd744db85 mention that Trust triggers reload 2014-03-04 15:58:09 -08:00
MinRK
9396619f9d security.js docstrings 2014-03-04 15:38:11 -08:00
Brian E. Granger
4e0a2ee476 Make sure we are in command mode before we select a new cell. 2014-03-04 15:09:49 -08:00
MinRK
d5b0026cf1 trust via mark cells and save, rather than trust API request 2014-03-03 16:10:21 -08:00
MinRK
e7f3c05d28 remove unused get_attr_names 2014-03-03 16:10:21 -08:00
MinRK
6792d38215 log excluded untrusted output 2014-03-03 16:10:21 -08:00
MinRK
aaefc5f296 remove warning for stripped output 2014-03-03 16:10:21 -08:00
MinRK
b5c8a51331 disable trust notebook menu item on trusted notebooks 2014-03-03 16:10:20 -08:00
MinRK
1ae689f30c Add Trust Notebook to File menu 2014-03-03 16:10:20 -08:00
MinRK
46665483ed remove struct-returning sanitize
only keep str-str sanitization
2014-03-03 16:10:20 -08:00
MinRK
d4780c2cfc remove security.is_safe 2014-03-03 16:10:20 -08:00
MinRK
d59e44a190 default to allow_css = false 2014-03-03 16:10:20 -08:00
MinRK
4d35660f3c sanitize CSS
rather than removing it entirely
2014-03-03 16:10:19 -08:00
MinRK
5f7f1c51ec remove unused security warning 2014-03-03 16:10:19 -08:00
MinRK
c49f04545a don't use result.safe to communicate incomplete information 2014-03-03 16:10:19 -08:00
MinRK
028ce17c62 fix tagName comparison 2014-03-03 16:10:19 -08:00
MinRK
3897b1c39f don't populate sanitized.safe by default
since it's potentially expensive.

walk nodes in is_safe
2014-03-03 16:10:18 -08:00
MinRK
6384502e47 sanitize untrusted HTML output
rather than checking is_safe
2014-03-03 16:10:18 -08:00
MinRK
3d0957c7bc trust latex
If mathjax is insecure, we have big problems.
And we already trust mathjax in markdown cells,
so this is consistent.
2014-03-03 16:10:18 -08:00
MinRK
367b4f85c2 wrap caja.sanitizeAttribs to trust data-* attributes 2014-03-03 16:10:17 -08:00
MinRK
eec5d427a4 add cmp_tree, in case caja log can't be trusted
(spoiler: it can't)
2014-03-03 16:10:17 -08:00
MinRK
890c0be1dd always sanitize markdown
don't check if it's safe or not
2014-03-03 16:10:17 -08:00
MinRK
2a0451fdde use google-caja for sanitization 2014-03-03 16:06:41 -08:00
Brian E. Granger
07cdb1e195 Adding first round of security tests of is_safe. 2014-03-03 16:06:41 -08:00
Brian E. Granger
3b262912a1 Display safe HTML+SVG even if untrusted, but don't set trusted=1. 2014-03-03 16:06:40 -08:00
Brian E. Granger
31c9e08fa8 Don't render insecure Markdown and show warning. 2014-03-03 16:06:40 -08:00
Brian E. Granger
fa3f998295 Adding security.js with 1st attempt at is_safe. 2014-03-03 16:06:40 -08:00
Brian E. Granger
6f4263dc74 Removing conditionals that are not needed. 2014-03-03 16:03:06 -08:00
Brian E. Granger
e374ca5ebb Refactoring Notebook.command_mode. 2014-03-03 15:32:05 -08:00
Brian E. Granger
92967c0baf Addressing things in completer.js. 2014-03-03 13:20:32 -08:00
Brian E. Granger
af7dd15181 Removing old keyboard handling from IPython.utils. 2014-03-03 13:13:50 -08:00
Brian E. Granger
ec6ea72873 Adding utility functions. 2014-03-03 13:10:17 -08:00
Brian E. Granger
ff1492f8c9 Creating new base/js/keyboard.js 2014-03-03 13:10:17 -08:00
Jonathan Frederic
ede116bee7 Get cell after first conditional 2014-03-03 11:35:15 -08:00
Jonathan Frederic
479bc6b37a Check down too. 2014-03-03 11:33:58 -08:00
Jonathan Frederic
bebe51c158 Don't allow edit mode up arrow to continue past index == 0 2014-03-03 11:27:58 -08:00
Paul Ivanov
1ce7d5ec80 tour: put the right arrow on the right side 2014-03-03 11:06:54 -08:00
Brian E. Granger
8c5b32c987 Merge pull request #5223 from minrk/tiny-images
use on-load event to trigger resizable images
2014-03-03 10:35:42 -08:00
Paul Ivanov
6d0d34d7ed entering edit mode now requires focus_cell 2014-03-01 01:23:34 -08:00
Paul Ivanov
bdbf2fe9d5 more robust forward and back tour transitions 2014-03-01 00:12:59 -08:00
Paul Ivanov
ccf6128962 addressing Fernando's feedback 2014-02-28 23:41:20 -08:00
Paul Ivanov
95bd36be10 don't automatically advance the tour 2014-02-28 20:04:22 -08:00
Paul Ivanov
9d1595aebb more refinement of the tour contents 2014-02-28 20:04:22 -08:00
Paul Ivanov
405017875e tidy up and add to the tour
@takluyver found some typos which I fixed now
2014-02-28 20:04:22 -08:00
Paul Ivanov
d11d9b4830 tidying up the tour explanation of modes 2014-02-28 20:04:22 -08:00
Paul Ivanov
3a43d776c2 End tour via 'x' in upper right corner of window 2014-02-28 20:04:22 -08:00
Paul Ivanov
1ee52fcbbc pause/play buttons for starting/stopping the tour 2014-02-28 20:04:22 -08:00
Paul Ivanov
5725bf80f5 use minified tour 2014-02-28 20:04:22 -08:00
Paul Ivanov
600facc92d allow tour restarting 2014-02-28 20:04:21 -08:00
Paul Ivanov
abe4732aa0 fix typo in tour.js 2014-02-28 20:04:21 -08:00
Paul Ivanov
5fead3cdd7 starting the tour from the menu works now
JavaScript makes me fond of this phrase:

  When there's nothing left to burn, you have to set yourself on fire.
2014-02-28 20:03:47 -08:00
Paul Ivanov
d7b569390f more work on the tour 2014-02-28 20:03:46 -08:00
Paul Ivanov
3cf601b58e initial bootstrap tour
One way to get it to play currently is with a cell like this:

    %%javascript
    $.getScript('/static/notebook/js/tour.js')

provided that you have Bootstrap Tour installed in the components
2014-02-28 20:01:48 -08:00
MinRK
15fac2c1d6 make input_area css generic to cells
removes otherwise-identical text_cell_input class in text cells
2014-02-28 16:52:00 -08:00
MinRK
983271a36f use on-load event to trigger resizable images
instead of timeout, which could get incorrect size information.

closes #5219
2014-02-28 16:46:55 -08:00
Brian E. Granger
88460cd212 Merge pull request #5175 from jdfreder/html-take2
Audit .html() calls take #2
2014-02-28 15:56:12 -08:00
Brian E. Granger
88fc1a0737 Merge pull request #5146 from jdfreder/modal-fix
Dual mode bug fixes.
2014-02-28 15:54:41 -08:00
Jonathan Frederic
39d39d0ea6 s/trigger_edit_mode/edit_mode 2014-02-28 15:52:28 -08:00
Jonathan Frederic
c41fe67da2 Re-added removed refresh 2014-02-28 15:22:30 -08:00
Jonathan Frederic
3bcee30e8c Added comments to kbm and shrunk focus_cell lines 2014-02-28 15:11:21 -08:00
Jonathan Frederic
69e760841a Move should cancel blur into codecell 2014-02-28 15:06:47 -08:00
Jonathan Frederic
4fdc99e111 Remove notebook load log succes 2014-02-28 15:03:27 -08:00
Jonathan Frederic
a6f883d7f2 Couple of whiteboard logic implementation misses 2014-02-28 14:30:06 -08:00
Jonathan Frederic
9451589e38 implemented whiteboard logic 2014-02-28 14:18:56 -08:00
Paul Ivanov
f8ab13b675 Merge pull request #5215 from ivanov/running-kernels
Dashboard "Running" Tab
2014-02-27 19:57:50 -08:00
Paul Ivanov
938f4bdfc4 small whitespace cleanup, renamed drag_info
in the dashboard, I've renamed drag_info to notebook_list_info, so
applying style to notebook_list_info and running_list_info can be done
in one place.
2014-02-27 19:36:42 -08:00
Paul Ivanov
eb4e674598 remove redundant checks in code 2014-02-27 18:13:53 -08:00
Paul Ivanov
14239c01e4 use explicit running header name + jquery's toggle 2014-02-27 17:59:16 -08:00
Jonathan Frederic
0884716a7d Re-added widget textbox blur fix FF 2014-02-27 16:15:11 -08:00
Jonathan Frederic
bfc51c2a29 Final touches? 2014-02-27 16:09:00 -08:00
Jonathan Frederic
c5fb037e41 Reorg index and focus_editor params on edit_mode func 2014-02-27 15:52:05 -08:00
Jonathan Frederic
048ca30b0c Remove fixes that are implemented correct in new CM 2014-02-27 15:47:01 -08:00
Brian E. Granger
e847a31348 Always refresh the CM editor upon TextCell unrender. 2014-02-27 15:45:06 -08:00
Jonathan Frederic
b976804051 Moved edit_mode canceling logic back into cell. 2014-02-27 15:45:06 -08:00
Jonathan Frederic
ff37fb7a36 Standardized comments and removed last logs 2014-02-27 15:45:06 -08:00
Jonathan Frederic
64ae25508d Removed change that is no longer needed 2014-02-27 15:45:06 -08:00
Jonathan Frederic
70086d352f s/unfocus/blur 2014-02-27 15:45:06 -08:00
Jonathan Frederic
c7860d8bc8 Post in person review
Removed logic for reverse ordered events
Removed almost all of the log statements
Removed list for should unfocus callbacks
Removed all the logic in focus_editor
Only call focus_editor if the keyboard was used to enter edit mode
2014-02-27 15:45:06 -08:00
Jonathan Frederic
3595c099c2 Fixed rebase problems 2014-02-27 15:45:06 -08:00
Jonathan Frederic
10d79a9102 Added cell unfocus event canceller API 2014-02-27 15:45:05 -08:00
Jonathan Frederic
a6aaa8a886 Use is_focused for element kbman removal event 2014-02-27 15:45:05 -08:00
Jonathan Frederic
6f7c502157 Fixed lots of bugs
Half overhaul of notebook focus events...
2014-02-27 15:45:05 -08:00
Jonathan Frederic
206d35a89e DEBUG
Added lots of log calls and a couple small 'fixes' (attempts)
2014-02-27 15:45:05 -08:00
Jonathan Frederic
7913305312 jshint 2014-02-27 15:45:05 -08:00
MinRK
bdde544d47 don't forget base_url when updating address bar in rename 2014-02-26 15:01:07 -08:00