Show More
@@ -24,8 +24,8 b' var IPython = (function (IPython) {' | |||||
24 |
|
24 | |||
25 | NotificationArea.prototype.temp_message = function (msg, timeout, css_class) { |
|
25 | NotificationArea.prototype.temp_message = function (msg, timeout, css_class) { | |
26 | var uuid = utils.uuid(); |
|
26 | var uuid = utils.uuid(); | |
27 | if( css_class == 'danger'){css_class = 'ui-state-error'} |
|
27 | if( css_class == 'danger') {css_class = 'ui-state-error';} | |
28 | if( css_class == 'warning'){css_class = 'ui-state-highlight'} |
|
28 | if( css_class == 'warning') {css_class = 'ui-state-highlight';} | |
29 | var tdiv = $('<div>') |
|
29 | var tdiv = $('<div>') | |
30 | .attr('id',uuid) |
|
30 | .attr('id',uuid) | |
31 | .addClass('notification_widget ui-widget ui-widget-content ui-corner-all') |
|
31 | .addClass('notification_widget ui-widget ui-widget-content ui-corner-all') | |
@@ -40,32 +40,32 b' var IPython = (function (IPython) {' | |||||
40 |
|
40 | |||
41 | setTimeout(function () { |
|
41 | setTimeout(function () { | |
42 | tdiv.fadeOut(100, function () {tdiv.remove();}); |
|
42 | tdiv.fadeOut(100, function () {tdiv.remove();}); | |
43 | }, tmout) |
|
43 | }, tmout); | |
44 | }; |
|
44 | }; | |
45 |
|
45 | |||
46 | NotificationArea.prototype.widget = function(name){ |
|
46 | NotificationArea.prototype.widget = function(name) { | |
47 | if(this.widget_dict[name] == undefined){ |
|
47 | if(this.widget_dict[name] == undefined) { | |
48 | return this.new_notification_widget(name) |
|
48 | return this.new_notification_widget(name); | |
49 | } |
|
49 | } | |
50 | return this.get_widget(name) |
|
50 | return this.get_widget(name); | |
51 | } |
|
51 | }; | |
52 |
|
52 | |||
53 | NotificationArea.prototype.get_widget = function(name) { |
|
53 | NotificationArea.prototype.get_widget = function(name) { | |
54 | if(this.widget_dict[name] == undefined){ |
|
54 | if(this.widget_dict[name] == undefined) { | |
55 | throw('no widgets with this name'); |
|
55 | throw('no widgets with this name'); | |
56 | } |
|
56 | } | |
57 | return this.widget_dict[name]; |
|
57 | return this.widget_dict[name]; | |
58 | } |
|
58 | }; | |
59 |
|
59 | |||
60 | NotificationArea.prototype.new_notification_widget = function(name) { |
|
60 | NotificationArea.prototype.new_notification_widget = function(name) { | |
61 | if(this.widget_dict[name] != undefined){ |
|
61 | if(this.widget_dict[name] != undefined) { | |
62 | throw('widget with that name already exists ! '); |
|
62 | throw('widget with that name already exists ! '); | |
63 | } |
|
63 | } | |
64 | var div = $('<div/>').attr('id','notification_'+name); |
|
64 | var div = $('<div/>').attr('id','notification_'+name); | |
65 | $(this.selector).append(div) |
|
65 | $(this.selector).append(div); | |
66 | this.widget_dict[name] = new IPython.NotificationWidget('#notification_'+name) |
|
66 | this.widget_dict[name] = new IPython.NotificationWidget('#notification_'+name); | |
67 | return this.widget_dict[name]; |
|
67 | return this.widget_dict[name]; | |
68 | } |
|
68 | }; | |
69 |
|
69 | |||
70 | NotificationArea.prototype.init_notification_widgets = function() { |
|
70 | NotificationArea.prototype.init_notification_widgets = function() { | |
71 | var knw = this.new_notification_widget('kernel'); |
|
71 | var knw = this.new_notification_widget('kernel'); | |
@@ -131,7 +131,7 b' var IPython = (function (IPython) {' | |||||
131 | nnw.set_message("Notebook save failed"); |
|
131 | nnw.set_message("Notebook save failed"); | |
132 | }); |
|
132 | }); | |
133 |
|
133 | |||
134 | } |
|
134 | }; | |
135 |
|
135 | |||
136 | IPython.NotificationArea = NotificationArea; |
|
136 | IPython.NotificationArea = NotificationArea; | |
137 |
|
137 |
General Comments 0
You need to be logged in to leave comments.
Login now