diff --git a/IPython/frontend/html/notebook/static/js/custom.js b/IPython/frontend/html/notebook/static/js/custom.js index e94e291..d1f01b6 100644 --- a/IPython/frontend/html/notebook/static/js/custom.js +++ b/IPython/frontend/html/notebook/static/js/custom.js @@ -28,6 +28,18 @@ * ]); * }); * + * Example : + * + * Use `jQuery.getScript(url [, success(script, textStatus, jqXHR)] );` + * to load custom script into the notebook. + * + * // to load the metadata ui extension example. + * $.getScript('/static/js/examples/metaui.example.js'); + * // or + * // to load the metadata ui extension to control slideshow mode / reveal js for nbconvert + * $.getScript('/static/js/examples/metaui.slideshow.js'); + * + * * @module IPython * @namespace IPython * @class customjs diff --git a/IPython/frontend/html/notebook/static/js/examples/metaui.example.js b/IPython/frontend/html/notebook/static/js/examples/metaui.example.js new file mode 100644 index 0000000..414d05a --- /dev/null +++ b/IPython/frontend/html/notebook/static/js/examples/metaui.example.js @@ -0,0 +1,184 @@ +//---------------------------------------------------------------------------- +// 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. +//---------------------------------------------------------------------------- + +//============================================================================ +// MetaUI Example +//============================================================================ + +/** + * Example Use for the MetaUI library + * add the following to your custom.js to load + * metadata UI for slideshow + * + * ``` + * $.getScript('/static/js/examples/metaui.example.js'); + * ``` + */ + // IIFE without asignement, we don't modifiy the IPython namespace +(function (IPython) { + "use strict"; + + var MetaUI = IPython.MetaUI; + + + var raw_edit = function(cell){ + + var md = cell.metadata + + var textarea = $('