We could also just use regular python packages that include js files in a
particular location.  I would probably prefer that over npm - mainly
because 90% of our users don't have node/npm installed.


On Fri, Jan 11, 2013 at 11:29 AM, Bussonnier Matthias <
notifications@github.com> wrote:

> In IPython/frontend/html/notebook/static/js/metaui.js:
>
> > +
> > +    var toggle_test =  function(div, cell) {
> > +        var button_container = $(div)
> > +        var button = $('<div/>').button({label:String(cell.metadata.foo)});
> > +        button.click(function(){
> > +                    var v = cell.metadata.foo;
> > +                    cell.metadata.foo = !v;
> > +                    button.button("option","label",String(!v));
> > +                })
> > +       button_container.append(button);
> > +    }
> > +
> > +    MetaUI.register_callback('example.toggle',toggle_test);
> > +    example_preset.push('example.toggle');
> > +
> > +    /**
>
>  The problem with using npm is that some javascript helpers will have
> python
> code that goes with it. The Python side of things has the logic for
> building the JSON representations, etc.
>
> You will probably have Js only plugin.
> Anyway I'll make that on my todo list to look at.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/ipython/ipython/pull/2333/files#r2622465>.
>
>



-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com