[IPython-dev] Keyboard shortcuts for slide types in ipython notebook

Mike Boyle moboyle79 at yahoo.com
Tue Apr 22 15:29:05 EDT 2014

I'm preparing my first real slideshow with the notebook, and was just wondering if there's an easy way for javascript to manipulate the slide type.  I've added the appropriate code to my custom.js -- almost.  Here's what I've tried so far (for the particular case of changing the slide type to a Fragment):

        'alt-f' : {
            help : 'Slide Type: Fragment',
            help_index : 'sd',
            handler : function (event) {
                var cell = IPython.notebook.get_selected_cell();
                if (cell.metadata.slideshow == undefined) {cell.metadata.slideshow = {}}
                cell.metadata.slideshow.slide_type = 'fragment';
                return false;

This does seem to change the metadata successfully, but obviously it doesn't change the value in that `select` element.  But I can't figure out how to get that select element and change its value directly (because I'm terrible at javascript).  Anyone more clever than me who knows how to do it?

Thanks very much!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140422/5577dd1e/attachment.html>

More information about the IPython-dev mailing list