From 03d0484ab98d6d2560d0a719922188e7aa074752 2014-07-10 20:47:22 From: Jonathan Frederic Date: 2014-07-10 20:47:22 Subject: [PATCH] Return dicts instead of classes, this makes require.js more Python import like. --- diff --git a/IPython/html/static/auth/js/loginmain.js b/IPython/html/static/auth/js/loginmain.js index 5e1dd17..9fb40f2 100644 --- a/IPython/html/static/auth/js/loginmain.js +++ b/IPython/html/static/auth/js/loginmain.js @@ -2,8 +2,8 @@ // Distributed under the terms of the Modified BSD License. var ipython = ipython || {}; -require(['base/js/page'], function(Page) { - ipython.page = new Page(); +require(['base/js/page'], function(page) { + ipython.page = new page.Page(); $('button#login_submit').addClass("btn btn-default"); ipython.page.show(); $('input#password_input').focus(); diff --git a/IPython/html/static/auth/js/loginwidget.js b/IPython/html/static/auth/js/loginwidget.js index 3a22cee..8d9f5a2 100644 --- a/IPython/html/static/auth/js/loginwidget.js +++ b/IPython/html/static/auth/js/loginwidget.js @@ -43,5 +43,5 @@ define([ // Set module variables IPython.LoginWidget = LoginWidget; - return LoginWidget; + return {'LoginWidget': LoginWidget}; }); \ No newline at end of file diff --git a/IPython/html/static/auth/js/logoutmain.js b/IPython/html/static/auth/js/logoutmain.js index ad58cfd..7408694 100644 --- a/IPython/html/static/auth/js/logoutmain.js +++ b/IPython/html/static/auth/js/logoutmain.js @@ -3,7 +3,7 @@ var ipython = ipython || {}; require(['base/js/page'], function(Page) { - ipython.page = new Page(); + ipython.page = new page.Page(); $('#ipython-main-app').addClass('border-box-sizing'); ipython.page.show(); }); diff --git a/IPython/html/static/base/js/dialog.js b/IPython/html/static/base/js/dialog.js index 4a66302..0cb4e4e 100644 --- a/IPython/html/static/base/js/dialog.js +++ b/IPython/html/static/base/js/dialog.js @@ -154,5 +154,5 @@ define([ // Backwards compatability. IPython.Dialog = Dialog; - return Dialog; + return {'Dialog': Dialog}; }); diff --git a/IPython/html/static/base/js/events.js b/IPython/html/static/base/js/events.js index 2917546..e49271a 100644 --- a/IPython/html/static/base/js/events.js +++ b/IPython/html/static/base/js/events.js @@ -15,5 +15,5 @@ define(['base/js/namespace'], function(IPython) { // Backwards compatability. IPython.Events = Events; - return Events; + return {'Events': Events}; }); diff --git a/IPython/html/static/base/js/page.js b/IPython/html/static/base/js/page.js index b852c19..c52728f 100644 --- a/IPython/html/static/base/js/page.js +++ b/IPython/html/static/base/js/page.js @@ -44,5 +44,5 @@ define([ // Register self in the global namespace for convenience. IPython.Page = Page; - return Page; + return {'Page': Page}; }); diff --git a/IPython/html/static/base/js/pagemain.js b/IPython/html/static/base/js/pagemain.js index 177f4c7..9b0a1f9 100644 --- a/IPython/html/static/base/js/pagemain.js +++ b/IPython/html/static/base/js/pagemain.js @@ -3,6 +3,6 @@ var ipython = ipython || {}; require(['base/js/page'], function(Page) { - ipython.page = new Page(); + ipython.page = new page.Page(); ipython.page.show(); }); diff --git a/IPython/html/static/dateformat/date.format.js b/IPython/html/static/dateformat/date.format.js index 14160e0..02d94d0 100644 --- a/IPython/html/static/dateformat/date.format.js +++ b/IPython/html/static/dateformat/date.format.js @@ -128,5 +128,5 @@ define([], function() { return dateFormat(this, mask, utc); }; - return dateFormat; + return {'dateFormat': dateFormat}; }); \ No newline at end of file diff --git a/IPython/html/static/notebook/js/cell.js b/IPython/html/static/notebook/js/cell.js index e3d94ee..237c9e7 100644 --- a/IPython/html/static/notebook/js/cell.js +++ b/IPython/html/static/notebook/js/cell.js @@ -559,6 +559,6 @@ define([ // Backwards compatability. IPython.Cell = Cell; - return Cell; + return {'Cell': Cell}; }); diff --git a/IPython/html/static/notebook/js/celltoolbar.js b/IPython/html/static/notebook/js/celltoolbar.js index 4104fed..72270d5 100644 --- a/IPython/html/static/notebook/js/celltoolbar.js +++ b/IPython/html/static/notebook/js/celltoolbar.js @@ -411,5 +411,5 @@ define([ // Backwards compatability. IPython.CellToolbar = CellToolbar; - return CellToolbar; + return {'CellToolbar': CellToolbar}; }); diff --git a/IPython/html/static/notebook/js/codecell.js b/IPython/html/static/notebook/js/codecell.js index 80b0f6e..dc1ab08 100644 --- a/IPython/html/static/notebook/js/codecell.js +++ b/IPython/html/static/notebook/js/codecell.js @@ -511,5 +511,5 @@ define([ // Backwards compatability. IPython.CodeCell = CodeCell; - return CodeCell; + return {'CodeCell': CodeCell}; }); diff --git a/IPython/html/static/notebook/js/completer.js b/IPython/html/static/notebook/js/completer.js index 39cbc79..fcec9fd 100644 --- a/IPython/html/static/notebook/js/completer.js +++ b/IPython/html/static/notebook/js/completer.js @@ -383,5 +383,5 @@ define([ // For backwards compatability. IPython.Completer = Completer; - return Completer; + return {'Completer': Completer}; }); diff --git a/IPython/html/static/notebook/js/contexthint.js b/IPython/html/static/notebook/js/contexthint.js index d819f46..c64b67b 100644 --- a/IPython/html/static/notebook/js/contexthint.js +++ b/IPython/html/static/notebook/js/contexthint.js @@ -94,5 +94,5 @@ define([], function() { return filterd; }; - return CodeMirror.contextHint; + return {'contextHint': CodeMirror.contextHint}; }); diff --git a/IPython/html/static/notebook/js/keyboardmanager.js b/IPython/html/static/notebook/js/keyboardmanager.js index 45c2fca..519a41f 100644 --- a/IPython/html/static/notebook/js/keyboardmanager.js +++ b/IPython/html/static/notebook/js/keyboardmanager.js @@ -555,6 +555,5 @@ define([ // For backwards compatability. IPython.KeyboardManager = KeyboardManager; - return KeyboardManager; - + return {'KeyboardManager': KeyboardManager}; }); diff --git a/IPython/html/static/notebook/js/layoutmanager.js b/IPython/html/static/notebook/js/layoutmanager.js index b837d84..e5e48d6 100644 --- a/IPython/html/static/notebook/js/layoutmanager.js +++ b/IPython/html/static/notebook/js/layoutmanager.js @@ -54,5 +54,5 @@ define([ // Backwards compatability. IPython.LayoutManager = LayoutManager; - return LayoutManager; + return {'LayoutManager': LayoutManager}; }); diff --git a/IPython/html/static/notebook/js/maintoolbar.js b/IPython/html/static/notebook/js/maintoolbar.js index 82f2c6d..eb1bfea 100644 --- a/IPython/html/static/notebook/js/maintoolbar.js +++ b/IPython/html/static/notebook/js/maintoolbar.js @@ -216,5 +216,5 @@ define([ // Backwards compatability. IPython.MainToolBar = MainToolBar; - return MainToolBar; + return {'MainToolBar': MainToolBar}; }); diff --git a/IPython/html/static/notebook/js/menubar.js b/IPython/html/static/notebook/js/menubar.js index 58020ab..cc7d6fe 100644 --- a/IPython/html/static/notebook/js/menubar.js +++ b/IPython/html/static/notebook/js/menubar.js @@ -343,5 +343,5 @@ define([ // Backwards compatability. IPython.MenuBar = MenuBar; - return MenuBar; + return {'MenuBar': MenuBar}; }); diff --git a/IPython/html/static/notebook/js/notebook.js b/IPython/html/static/notebook/js/notebook.js index bf51ec9..e2bc66e 100644 --- a/IPython/html/static/notebook/js/notebook.js +++ b/IPython/html/static/notebook/js/notebook.js @@ -2477,5 +2477,5 @@ define([ // For backwards compatability. IPython.Notebook = Notebook; - return Notebook; + return {'Notebook': Notebook}; }); diff --git a/IPython/html/static/notebook/js/notificationarea.js b/IPython/html/static/notebook/js/notificationarea.js index c29d26b..8077aab 100644 --- a/IPython/html/static/notebook/js/notificationarea.js +++ b/IPython/html/static/notebook/js/notificationarea.js @@ -229,5 +229,5 @@ define([ IPython.NotificationArea = NotificationArea; - return NotificationArea; + return {'NotificationArea': NotificationArea}; }); diff --git a/IPython/html/static/notebook/js/notificationwidget.js b/IPython/html/static/notebook/js/notificationwidget.js index 98ce1ba..0a1f725 100644 --- a/IPython/html/static/notebook/js/notificationwidget.js +++ b/IPython/html/static/notebook/js/notificationwidget.js @@ -73,5 +73,5 @@ define([ // For backwards compatability. IPython.NotificationWidget = NotificationWidget; - return NotificationWidget; + return {'NotificationWidget': NotificationWidget}; }); diff --git a/IPython/html/static/notebook/js/outputarea.js b/IPython/html/static/notebook/js/outputarea.js index 2b8790e..6480873 100644 --- a/IPython/html/static/notebook/js/outputarea.js +++ b/IPython/html/static/notebook/js/outputarea.js @@ -988,5 +988,5 @@ define([ // For backwards compatability. IPython.OutputArea = OutputArea; - return OutputArea; + return {'OutputArea': OutputArea}; }); diff --git a/IPython/html/static/notebook/js/pager.js b/IPython/html/static/notebook/js/pager.js index deff08f..034e2b3 100644 --- a/IPython/html/static/notebook/js/pager.js +++ b/IPython/html/static/notebook/js/pager.js @@ -174,5 +174,5 @@ define([ // Backwards compatability. IPython.Pager = Pager; - return Pager; + return {'Pager': Pager}; }); diff --git a/IPython/html/static/notebook/js/quickhelp.js b/IPython/html/static/notebook/js/quickhelp.js index feb05f3..f98c536 100644 --- a/IPython/html/static/notebook/js/quickhelp.js +++ b/IPython/html/static/notebook/js/quickhelp.js @@ -169,5 +169,5 @@ define([ // Backwards compatability. IPython.QuickHelp = QuickHelp; - return QuickHelp; + return {'QuickHelp': QuickHelp}; }); diff --git a/IPython/html/static/notebook/js/savewidget.js b/IPython/html/static/notebook/js/savewidget.js index 0841ab3..5829dd6 100644 --- a/IPython/html/static/notebook/js/savewidget.js +++ b/IPython/html/static/notebook/js/savewidget.js @@ -167,6 +167,6 @@ define([ // Backwards compatability. IPython.SaveWidget = SaveWidget; - return SaveWidget; + return {'SaveWidget': SaveWidget}; }); diff --git a/IPython/html/static/notebook/js/toolbar.js b/IPython/html/static/notebook/js/toolbar.js index 570c034..443475b 100644 --- a/IPython/html/static/notebook/js/toolbar.js +++ b/IPython/html/static/notebook/js/toolbar.js @@ -97,5 +97,5 @@ define([ // Backwards compatability. IPython.ToolBar = ToolBar; - return ToolBar; + return {'ToolBar': ToolBar}; }); diff --git a/IPython/html/static/notebook/js/tooltip.js b/IPython/html/static/notebook/js/tooltip.js index c58d7c0..bec9b41 100644 --- a/IPython/html/static/notebook/js/tooltip.js +++ b/IPython/html/static/notebook/js/tooltip.js @@ -331,5 +331,5 @@ define([ // Backwards compatability. IPython.Tooltip = Tooltip; - return Tooltip; + return {'Tooltip': Tooltip}; }); diff --git a/IPython/html/static/notebook/js/tour.js b/IPython/html/static/notebook/js/tour.js index bc8058c..b7a806d 100644 --- a/IPython/html/static/notebook/js/tour.js +++ b/IPython/html/static/notebook/js/tour.js @@ -164,7 +164,7 @@ define([ // For backwards compatability. IPython.NotebookTour = NotebookTour; - return NotebookTour; + return {'NotebookTour': NotebookTour}; }); diff --git a/IPython/html/static/services/kernels/js/kernel.js b/IPython/html/static/services/kernels/js/kernel.js index 6c6ff17..7ee7afb 100644 --- a/IPython/html/static/services/kernels/js/kernel.js +++ b/IPython/html/static/services/kernels/js/kernel.js @@ -608,5 +608,5 @@ define([ // Backwards compatability. IPython.Kernel = Kernel; - return Kernel; + return {'Kernel': Kernel}; }); diff --git a/IPython/html/static/services/sessions/js/session.js b/IPython/html/static/services/sessions/js/session.js index 405f8d5..ef17e5d 100644 --- a/IPython/html/static/services/sessions/js/session.js +++ b/IPython/html/static/services/sessions/js/session.js @@ -112,5 +112,5 @@ define([ // For backwards compatability. IPython.Session = Session; - return Session; + return {'Session': Session}; }); diff --git a/IPython/html/static/tree/js/clusterlist.js b/IPython/html/static/tree/js/clusterlist.js index 85775f6..d162681 100644 --- a/IPython/html/static/tree/js/clusterlist.js +++ b/IPython/html/static/tree/js/clusterlist.js @@ -186,5 +186,8 @@ define([ IPython.ClusterList = ClusterList; IPython.ClusterItem = ClusterItem; - return ClusterList; + return { + 'ClusterList': ClusterList, + 'ClusterItem': ClusterItem, + }; }); diff --git a/IPython/html/static/tree/js/kernellist.js b/IPython/html/static/tree/js/kernellist.js index 628946e..44e8fbe 100644 --- a/IPython/html/static/tree/js/kernellist.js +++ b/IPython/html/static/tree/js/kernellist.js @@ -30,5 +30,5 @@ define([ // Backwards compatability. IPython.KernelList = KernelList; - return KernelList; + return {'KernelList': KernelList}; }); diff --git a/IPython/html/static/tree/js/notebooklist.js b/IPython/html/static/tree/js/notebooklist.js index bddc88b..025a745 100644 --- a/IPython/html/static/tree/js/notebooklist.js +++ b/IPython/html/static/tree/js/notebooklist.js @@ -434,5 +434,5 @@ define([ // Backwards compatability. IPython.NotebookList = NotebookList; - return NotebookList; + return {'NotebookList': NotebookList}; }); diff --git a/IPython/html/static/tree/js/sessionlist.js b/IPython/html/static/tree/js/sessionlist.js index e5abb5c..93822d0 100644 --- a/IPython/html/static/tree/js/sessionlist.js +++ b/IPython/html/static/tree/js/sessionlist.js @@ -45,5 +45,5 @@ define([ // Backwards compatability. IPython.SesssionList = SesssionList; - return SesssionList; + return {'SesssionList': SesssionList}; });