##// END OF EJS Templates
Merge pull request #3555 from takluyver/i3547...
Merge pull request #3555 from takluyver/i3547 Simplify caching of modules with %run. Previously, we cleared and re-used a single FakeModule instance in which to run scripts, and cached copies of the modules' namespaces to prevent them from being cleared. Now, we cache one FakeModule instance per script file, clearing it and re-using it if the same script is re-run. Closes #3547, and fixes another test that was marked as a known failure.

File last commit:

r11033:fa36e98f
r11297:6217a475 merge
Show More
slideshow.js
58 lines | 2.2 KiB | application/javascript | JavascriptLexer
Matthias BUSSONNIER
add slideshow extension/preset for celltoolbar
r9087 //----------------------------------------------------------------------------
// Copyright (C) 2012 The IPython Development Team
//
// Distributed under the terms of the BSD License. The full license is in
// the file COPYING, distributed as part of this software.
//----------------------------------------------------------------------------
//============================================================================
//CellToolbar Example
//============================================================================
/**
Matthias BUSSONNIER
Uppercase and update path
r9089 * $.getScript('/static/js/celltoolbarpresets/slideshow.js');
Matthias BUSSONNIER
add slideshow extension/preset for celltoolbar
r9087 * ```
* or more generally
* ```
* $.getScript('url to this file');
* ```
*/
// IIFE without asignement, we don't modifiy the IPython namespace
(function (IPython) {
"use strict";
var CellToolbar = IPython.CellToolbar;
var slideshow_preset = [];
var select_type = CellToolbar.utils.select_ui_generator([
["-" ,undefined ],
["Slide" ,"slide" ],
Matthias BUSSONNIER
Change Slide denomination...
r9088 ["Sub-Slide" ,"subslide" ],
Matthias BUSSONNIER
add slideshow extension/preset for celltoolbar
r9087 ["Fragment" ,"fragment" ],
["Skip" ,"skip" ],
Matthias BUSSONNIER
Change Slide denomination...
r9088 ["Notes" ,"notes" ],
Matthias BUSSONNIER
add slideshow extension/preset for celltoolbar
r9087 ],
// setter
function(cell, value){
// we check that the slideshow namespace exist and create it if needed
if (cell.metadata.slideshow == undefined){cell.metadata.slideshow = {}}
// set the value
cell.metadata.slideshow.slide_type = value
},
//geter
function(cell){ var ns = cell.metadata.slideshow;
// if the slideshow namespace does not exist return `undefined`
// (will be interpreted as `false` by checkbox) otherwise
// return the value
return (ns == undefined)? undefined: ns.slide_type
},
"Slide Type");
CellToolbar.register_callback('slideshow.select',select_type);
slideshow_preset.push('slideshow.select');
Matthias BUSSONNIER
Uppercase and update path
r9089 CellToolbar.register_preset('Slideshow',slideshow_preset);
console.log('Slideshow extension for metadata editing loaded.');
Matthias BUSSONNIER
add slideshow extension/preset for celltoolbar
r9087
}(IPython));