Require.js (WIP)

Opened so people can spy on me.  Please ignore random code snippets sitting in files they don't belong in (especially in notebook.js), I'll move them when I get to the correct file.
Dont care about people accessing IPython.CodeCell.

Might do a IP.CodeCell = IP.Nb.CodeCell in main.js for back compat. But if you like to access Module, you should use require.

Envoyé de mon iPhone

> Le 12 juin 2014 à 23:33, Jonathan Frederic <notifications@github.com> a écrit :
> 
> In IPython/html/static/notebook/js/main.js:
> 
> > -    } catch (e) {
> > -        console.log("Failed to instantiate Notebook Tour", e);
> > -    }
> > -    IPython.login_widget = new IPython.LoginWidget('span#login_widget', opts);
> > -    IPython.notebook = new IPython.Notebook('div#notebook', opts);
> > -    IPython.keyboard_manager = new IPython.KeyboardManager();
> > -    IPython.save_widget = new IPython.SaveWidget('span#save_widget');
> > -    IPython.menubar = new IPython.MenuBar('#menubar', opts);
> > -    IPython.toolbar = new IPython.MainToolBar('#maintoolbar-container');
> > -    IPython.tooltip = new IPython.Tooltip();
> > -    IPython.notification_area = new IPython.NotificationArea('#notification_area');
> > -    IPython.notification_area.init_notification_widgets();
> > +    page = new Page();
> > +    pager = new Pager('div#pager', 'div#pager_splitter');
> > +    layout_manager = new LayoutManager(pager);
> > +    notebook = new Notebook('div#notebook', opts);
> I do like this idea, since it means we don't need to import IPython everywhere. However, I don't know how to handle this kind of scenario:
> 
> main.js requires notebook.js (which returns Notebook class)
> Notebook class requires codecell.js (which returns CodeCell class)
> 
> in main.js how will I register CodeCell if notebook.js only returns Notebook? I don't think notebook.js should return anything other than Notebook class (i.e. I think returning [Notebook, CodeCell, ...] will get messy and confusing real fast). If I'm to do it the way you suggest, the only option I see is to unflatten the tree: i.e. you would have IPython.Notebook.CodeCell. Is this the kind of thing you were suggesting?
> 
> —
> Reply to this email directly or view it on GitHub.