OK see what you can do to generalize the UI helper methods, but I will
trust you on this.

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.


On Fri, Jan 11, 2013 at 10:58 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');
> > +
> > +    /**
>
> Yes, but the code that uses this method is much more simple than those. It
> is quite tricky to get right.
> Also there might be some UI consistency but I'll try to fix them with pure
> css.
>
> You make a good point for non metadata. I'll see if I can find a way to do
> that.
>
> Another point, what would you thing of trying to see if those js-plugin
> could be installed with npm ?
> It is a Javascript package manager that deal with dependencies, allow
> testing... etc etc we could just require some supplementary stuff to
> autodetect js file as plugin and it would allow require stuff like
> underscore in plugin. Thought ?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/ipython/ipython/pull/2333/files#r2622055>.
>
>



-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com