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