Show More
@@ -59,7 +59,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
59 | 59 | if (description.length === 0) { |
|
60 | 60 | this.$label.hide(); |
|
61 | 61 | } else { |
|
62 |
this.$label. |
|
|
62 | this.$label.text(description); | |
|
63 | 63 | this.$label.show(); |
|
64 | 64 | } |
|
65 | 65 | } |
@@ -103,9 +103,9 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
103 | 103 | |
|
104 | 104 | var description = this.model.get('description'); |
|
105 | 105 | if (description.length === 0) { |
|
106 |
this.$el. |
|
|
106 | this.$el.text(' '); // Preserve button height | |
|
107 | 107 | } else { |
|
108 |
this.$el. |
|
|
108 | this.$el.text(description); | |
|
109 | 109 | } |
|
110 | 110 | } |
|
111 | 111 | return ToggleButtonView.__super__.update.apply(this); |
@@ -31,12 +31,10 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
31 | 31 | // Called when the model is changed. The model may have been |
|
32 | 32 | // changed by another view or by a state update from the back-end. |
|
33 | 33 | var description = this.model.get('description'); |
|
34 | description = description.replace(/ /g, ' ', 'm'); | |
|
35 | description = description.replace(/\n/g, '<br>\n', 'm'); | |
|
36 | 34 | if (description.length === 0) { |
|
37 |
this.$el. |
|
|
35 | this.$el.text(' '); // Preserve button height | |
|
38 | 36 | } else { |
|
39 |
this.$el. |
|
|
37 | this.$el.text(description); | |
|
40 | 38 | } |
|
41 | 39 | |
|
42 | 40 | if (this.model.get('disabled')) { |
@@ -71,7 +71,6 b' define(["notebook/js/widgets/widget"], function(WidgetManager) {' | |||
|
71 | 71 | }, this); |
|
72 | 72 | |
|
73 | 73 | this.$el |
|
74 | .html('') | |
|
75 | 74 | .on("remove", function(){ |
|
76 | 75 | that.$window.remove(); |
|
77 | 76 | }); |
@@ -135,7 +134,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager) {' | |||
|
135 | 134 | }); |
|
136 | 135 | this.$title = $('<div />') |
|
137 | 136 | .addClass('widget-modal-title') |
|
138 |
. |
|
|
137 | .text(' ') | |
|
139 | 138 | .appendTo(this.$title_bar); |
|
140 | 139 | this.$body = $('<div />') |
|
141 | 140 | .addClass('modal-body') |
@@ -144,7 +143,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager) {' | |||
|
144 | 143 | .appendTo(this.$window); |
|
145 | 144 | |
|
146 | 145 | this.$show_button = $('<button />') |
|
147 |
. |
|
|
146 | .text(' ') | |
|
148 | 147 | .addClass('btn btn-info widget-modal-show') |
|
149 | 148 | .appendTo(this.$el) |
|
150 | 149 | .click(function(){ |
@@ -227,21 +226,17 b' define(["notebook/js/widgets/widget"], function(WidgetManager) {' | |||
|
227 | 226 | // Called when the model is changed. The model may have been |
|
228 | 227 | // changed by another view or by a state update from the back-end. |
|
229 | 228 | var description = this.model.get('description'); |
|
230 | description = description.replace(/ /g, ' ', 'm'); | |
|
231 | description = description.replace(/\n/g, '<br>\n', 'm'); | |
|
232 | 229 | if (description.length === 0) { |
|
233 |
this.$title. |
|
|
230 | this.$title.text(' '); // Preserve title height | |
|
234 | 231 | } else { |
|
235 |
this.$title. |
|
|
232 | this.$title.text(description); | |
|
236 | 233 | } |
|
237 | 234 | |
|
238 | 235 | var button_text = this.model.get('button_text'); |
|
239 | button_text = button_text.replace(/ /g, ' ', 'm'); | |
|
240 | button_text = button_text.replace(/\n/g, '<br>\n', 'm'); | |
|
241 | 236 | if (button_text.length === 0) { |
|
242 |
this.$show_button. |
|
|
237 | this.$show_button.text(' '); // Preserve button height | |
|
243 | 238 | } else { |
|
244 |
this.$show_button. |
|
|
239 | this.$show_button.text(button_text); | |
|
245 | 240 | } |
|
246 | 241 | |
|
247 | 242 | if (!this._shown_once) { |
@@ -100,7 +100,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
100 | 100 | if (description.length === 0) { |
|
101 | 101 | this.$label.hide(); |
|
102 | 102 | } else { |
|
103 |
this.$label. |
|
|
103 | this.$label.text(description); | |
|
104 | 104 | this.$label.show(); |
|
105 | 105 | } |
|
106 | 106 | } |
@@ -162,7 +162,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
162 | 162 | if (description.length === 0) { |
|
163 | 163 | this.$label.hide(); |
|
164 | 164 | } else { |
|
165 |
this.$label. |
|
|
165 | this.$label.text(description); | |
|
166 | 166 | this.$label.show(); |
|
167 | 167 | } |
|
168 | 168 | } |
@@ -257,7 +257,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
257 | 257 | if (description.length === 0) { |
|
258 | 258 | this.$label.hide(); |
|
259 | 259 | } else { |
|
260 |
this.$label. |
|
|
260 | this.$label.text(description); | |
|
261 | 261 | this.$label.show(); |
|
262 | 262 | } |
|
263 | 263 | return ProgressView.__super__.update.apply(this); |
@@ -99,7 +99,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
99 | 99 | if (description.length === 0) { |
|
100 | 100 | this.$label.hide(); |
|
101 | 101 | } else { |
|
102 |
this.$label. |
|
|
102 | this.$label.text(description); | |
|
103 | 103 | this.$label.show(); |
|
104 | 104 | } |
|
105 | 105 | } |
@@ -161,7 +161,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
161 | 161 | if (description.length === 0) { |
|
162 | 162 | this.$label.hide(); |
|
163 | 163 | } else { |
|
164 |
this.$label. |
|
|
164 | this.$label.text(description); | |
|
165 | 165 | this.$label.show(); |
|
166 | 166 | } |
|
167 | 167 | } |
@@ -20,8 +20,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
20 | 20 | render : function(){ |
|
21 | 21 | // Called when view is rendered. |
|
22 | 22 | this.$el |
|
23 | .addClass('widget-hbox-single') | |
|
24 | .html(''); | |
|
23 | .addClass('widget-hbox-single'); | |
|
25 | 24 | this.$label = $('<div />') |
|
26 | 25 | .appendTo(this.$el) |
|
27 | 26 | .addClass('widget-hlabel') |
@@ -34,14 +33,14 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
34 | 33 | this.$droplabel = $('<button />') |
|
35 | 34 | .addClass('btn') |
|
36 | 35 | .addClass('widget-combo-btn') |
|
37 |
. |
|
|
36 | .text(' ') | |
|
38 | 37 | .appendTo(this.$buttongroup); |
|
39 | 38 | this.$dropbutton = $('<button />') |
|
40 | 39 | .addClass('btn') |
|
41 | 40 | .addClass('dropdown-toggle') |
|
42 | 41 | .addClass('widget-combo-carrot-btn') |
|
43 | 42 | .attr('data-toggle', 'dropdown') |
|
44 |
. |
|
|
43 | .append($('<span />').addClass("caret")) | |
|
45 | 44 | .appendTo(this.$buttongroup); |
|
46 | 45 | this.$droplist = $('<ul />') |
|
47 | 46 | .addClass('dropdown-menu') |
@@ -59,12 +58,10 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
59 | 58 | |
|
60 | 59 | if (options === undefined || options.updated_view != this) { |
|
61 | 60 | var selected_item_text = this.model.get('value'); |
|
62 | selected_item_text = selected_item_text.replace(/ /g, ' '); | |
|
63 | selected_item_text = selected_item_text.replace(/\n/g, '<br>\n'); | |
|
64 | 61 | if (selected_item_text.length === 0) { |
|
65 |
this.$droplabel. |
|
|
62 | this.$droplabel.text(' '); | |
|
66 | 63 | } else { |
|
67 |
this.$droplabel. |
|
|
64 | this.$droplabel.text(selected_item_text); | |
|
68 | 65 | } |
|
69 | 66 | |
|
70 | 67 | var items = this.model.get('values'); |
@@ -73,7 +70,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
73 | 70 | for (var index in items) { |
|
74 | 71 | var that = this; |
|
75 | 72 | var item_button = $('<a href="#"/>') |
|
76 |
. |
|
|
73 | .text(items[index]) | |
|
77 | 74 | .on('click', $.proxy(this.handle_click, this)); |
|
78 | 75 | $replace_droplist.append($('<li />').append(item_button)); |
|
79 | 76 | } |
@@ -97,7 +94,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
97 | 94 | if (description.length === 0) { |
|
98 | 95 | this.$label.hide(); |
|
99 | 96 | } else { |
|
100 |
this.$label. |
|
|
97 | this.$label.text(description); | |
|
101 | 98 | this.$label.show(); |
|
102 | 99 | } |
|
103 | 100 | } |
@@ -109,7 +106,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
109 | 106 | |
|
110 | 107 | // Calling model.set will trigger all of the other views of the |
|
111 | 108 | // model to update. |
|
112 |
this.model.set('value', $(e.target). |
|
|
109 | this.model.set('value', $(e.target).text(), {updated_view: this}); | |
|
113 | 110 | this.touch(); |
|
114 | 111 | }, |
|
115 | 112 | |
@@ -148,7 +145,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
148 | 145 | if (this.$el.find(item_query).length === 0) { |
|
149 | 146 | var $label = $('<label />') |
|
150 | 147 | .addClass('radio') |
|
151 |
. |
|
|
148 | .text(items[index]) | |
|
152 | 149 | .appendTo(this.$container); |
|
153 | 150 | |
|
154 | 151 | $('<input />') |
@@ -188,7 +185,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
188 | 185 | if (description.length === 0) { |
|
189 | 186 | this.$label.hide(); |
|
190 | 187 | } else { |
|
191 |
this.$label. |
|
|
188 | this.$label.text(description); | |
|
192 | 189 | this.$label.show(); |
|
193 | 190 | } |
|
194 | 191 | } |
@@ -239,7 +236,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
239 | 236 | $('<button />') |
|
240 | 237 | .attr('type', 'button') |
|
241 | 238 | .addClass('btn') |
|
242 |
. |
|
|
239 | .text(items[index]) | |
|
243 | 240 | .appendTo(this.$buttongroup) |
|
244 | 241 | .on('click', $.proxy(this.handle_click, this)); |
|
245 | 242 | } |
@@ -255,7 +252,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
255 | 252 | |
|
256 | 253 | // Remove items that no longer exist. |
|
257 | 254 | this.$buttongroup.find('button').each(function(i, obj) { |
|
258 |
var value = $(obj). |
|
|
255 | var value = $(obj).text(); | |
|
259 | 256 | var found = false; |
|
260 | 257 | for (var index in items) { |
|
261 | 258 | if (items[index] == value) { |
@@ -273,7 +270,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
273 | 270 | if (description.length === 0) { |
|
274 | 271 | this.$label.hide(); |
|
275 | 272 | } else { |
|
276 |
this.$label. |
|
|
273 | this.$label.text(description); | |
|
277 | 274 | this.$label.show(); |
|
278 | 275 | } |
|
279 | 276 | } |
@@ -285,7 +282,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
285 | 282 | |
|
286 | 283 | // Calling model.set will trigger all of the other views of the |
|
287 | 284 | // model to update. |
|
288 |
this.model.set('value', $(e.target). |
|
|
285 | this.model.set('value', $(e.target).text(), {updated_view: this}); | |
|
289 | 286 | this.touch(); |
|
290 | 287 | }, |
|
291 | 288 | }); |
@@ -321,7 +318,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
321 | 318 | var item_query = ' :contains("' + items[index] + '")'; |
|
322 | 319 | if (this.$listbox.find(item_query).length === 0) { |
|
323 | 320 | $('<option />') |
|
324 |
. |
|
|
321 | .text(items[index]) | |
|
325 | 322 | .attr('value', items[index]) |
|
326 | 323 | .appendTo(this.$listbox) |
|
327 | 324 | .on('click', $.proxy(this.handle_click, this)); |
@@ -337,7 +334,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
337 | 334 | |
|
338 | 335 | // Remove items that no longer exist. |
|
339 | 336 | this.$listbox.find('option').each(function(i, obj) { |
|
340 |
var value = $(obj). |
|
|
337 | var value = $(obj).text(); | |
|
341 | 338 | var found = false; |
|
342 | 339 | for (var index in items) { |
|
343 | 340 | if (items[index] == value) { |
@@ -355,7 +352,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
355 | 352 | if (description.length === 0) { |
|
356 | 353 | this.$label.hide(); |
|
357 | 354 | } else { |
|
358 |
this.$label. |
|
|
355 | this.$label.text(description); | |
|
359 | 356 | this.$label.show(); |
|
360 | 357 | } |
|
361 | 358 | } |
@@ -367,7 +364,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
367 | 364 | |
|
368 | 365 | // Calling model.set will trigger all of the other views of the |
|
369 | 366 | // model to update. |
|
370 |
this.model.set('value', $(e.target). |
|
|
367 | this.model.set('value', $(e.target).text(), {updated_view: this}); | |
|
371 | 368 | this.touch(); |
|
372 | 369 | }, |
|
373 | 370 | }); |
@@ -46,7 +46,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
46 | 46 | accordian |
|
47 | 47 | .find('.accordion-heading') |
|
48 | 48 | .find('.accordion-toggle') |
|
49 |
. |
|
|
49 | .text(titles[page_index]); | |
|
50 | 50 | } |
|
51 | 51 | } |
|
52 | 52 | |
@@ -107,7 +107,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
107 | 107 | that.model.set("selected_index", index, {updated_view: this}); |
|
108 | 108 | that.touch(); |
|
109 | 109 | }) |
|
110 |
. |
|
|
110 | .text('Page ' + index) | |
|
111 | 111 | .appendTo(accordion_heading); |
|
112 | 112 | var accordion_body = $('<div />', {id: uuid}) |
|
113 | 113 | .addClass('accordion-body collapse') |
@@ -190,7 +190,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
190 | 190 | var tab_text = $('<a />') |
|
191 | 191 | .attr('href', '#' + uuid) |
|
192 | 192 | .attr('data-toggle', 'tab') |
|
193 |
. |
|
|
193 | .text('Page ' + index) | |
|
194 | 194 | .appendTo(tab) |
|
195 | 195 | .click(function (e) { |
|
196 | 196 | |
@@ -221,7 +221,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
221 | 221 | for (var page_index in titles) { |
|
222 | 222 | var tab_text = this.containers[page_index]; |
|
223 | 223 | if (tab_text !== undefined) { |
|
224 |
tab_text. |
|
|
224 | tab_text.text(titles[page_index]); | |
|
225 | 225 | } |
|
226 | 226 | } |
|
227 | 227 |
@@ -27,7 +27,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
27 | 27 | // |
|
28 | 28 | // Called when the model is changed. The model may have been |
|
29 | 29 | // changed by another view or by a state update from the back-end. |
|
30 | this.$el.html(this.model.get('value')); | |
|
30 | this.$el.html(this.model.get('value')); // CAUTION! .html(...) CALL MANDITORY!!! | |
|
31 | 31 | return HTMLView.__super__.update.apply(this); |
|
32 | 32 | }, |
|
33 | 33 | }); |
@@ -45,7 +45,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
45 | 45 | // |
|
46 | 46 | // Called when the model is changed. The model may have been |
|
47 | 47 | // changed by another view or by a state update from the back-end. |
|
48 |
this.$el. |
|
|
48 | this.$el.text(this.model.get('value')); | |
|
49 | 49 | MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$el.get(0)]); |
|
50 | 50 | |
|
51 | 51 | return LatexView.__super__.update.apply(this); |
@@ -58,8 +58,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
58 | 58 | render: function(){ |
|
59 | 59 | // Called when view is rendered. |
|
60 | 60 | this.$el |
|
61 | .addClass('widget-hbox') | |
|
62 | .html(''); | |
|
61 | .addClass('widget-hbox'); | |
|
63 | 62 | this.$label = $('<div />') |
|
64 | 63 | .appendTo(this.$el) |
|
65 | 64 | .addClass('widget-hlabel') |
@@ -101,7 +100,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
101 | 100 | if (description.length === 0) { |
|
102 | 101 | this.$label.hide(); |
|
103 | 102 | } else { |
|
104 |
this.$label. |
|
|
103 | this.$label.text(description); | |
|
105 | 104 | this.$label.show(); |
|
106 | 105 | } |
|
107 | 106 | } |
@@ -131,8 +130,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
131 | 130 | render: function(){ |
|
132 | 131 | // Called when view is rendered. |
|
133 | 132 | this.$el |
|
134 | .addClass('widget-hbox-single') | |
|
135 | .html(''); | |
|
133 | .addClass('widget-hbox-single'); | |
|
136 | 134 | this.$label = $('<div />') |
|
137 | 135 | .addClass('widget-hlabel') |
|
138 | 136 | .appendTo(this.$el) |
@@ -162,7 +160,7 b' define(["notebook/js/widgets/widget"], function(WidgetManager){' | |||
|
162 | 160 | if (description.length === 0) { |
|
163 | 161 | this.$label.hide(); |
|
164 | 162 | } else { |
|
165 |
this.$label. |
|
|
163 | this.$label.text(description); | |
|
166 | 164 | this.$label.show(); |
|
167 | 165 | } |
|
168 | 166 | } |
General Comments 0
You need to be logged in to leave comments.
Login now