Commit Graph

4072 Commits

Author SHA1 Message Date
Paul Ivanov
469c70fd10 more semicolons 2014-03-13 16:23:27 -07: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
Brian E. Granger
1407b4347e Merge pull request #5268 from ellisonbg/cmd-mode
Refactoring Notebook.command_mode
2014-03-06 12:09:43 -08:00
Min RK
aaedd1a311 Merge pull request #5283 from takluyver/widget-del
Remove Widget.closed attribute
2014-03-05 17:16:35 -08:00
Thomas Kluyver
95dc697e3b Remove Widget.closed attribute
Closes gh-5282
2014-03-05 15:34:14 -08:00
Fernando Perez
bb5b480d21 Merge pull request #5281 from minrk/rebase-typo
fix a typo introduced by a rebased PR, that was causing heading cells to be displayed in both input and rendered forms.
2014-03-05 17:34:04 -05: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
Min RK
512c1fbf52 Merge pull request #5280 from jdfreder/ff_cmurlpref
append Firefox overflow-x fix
2014-03-05 13:07:06 -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
MinRK
3588fe40a9 Merge Security Pull Request: google-caja
Adds HTML sanitization.

The basics:

- untrusted HTML is always sanitized, with no warning
  (there is console logging for changes made)
- markdown is always treated as untrusted
- no warnings for simply excluded output (e.g. Javascript)
- CSS tags and attributes are always stripped from untrusted HTML
- never check whether HTML is "safe," only sanitize
- add 'Trust notebook' to File menu
2014-03-04 17:35:55 -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
Brian E. Granger
8d38e042df Merge pull request #5158 from ivanov/fix-5157
log refusal to serve hidden directories
2014-03-04 10:05:29 -08:00
Min RK
df1daf848e Merge pull request #5188 from takluyver/callbacks
New events system
2014-03-04 09:52:06 -08:00
Thomas Kluyver
9a87d9a0f2 Fix wheel dependency specification 2014-03-04 09:49:40 -08:00
MinRK
d8f2e320f2 trust method docstrings 2014-03-03 16:27:59 -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
156207ab41 don't forget to install caja 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
c9c23cd71c cleanup test_nbmanager
use class setUp / teardown instead of the same context manager in every test
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
d7b1e8b45b test style 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
a7dc526b2b testing for sanitize 2014-03-03 16:10:18 -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
4b01948200 check trust of data-attributes in sanitization 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
c298670a4b use html-sanitizer instead of html-css
always scrub css (for now)
2014-03-03 16:10:17 -08:00