diff --git a/IPython/html/static/notebook/js/widgets/widget_bool.js b/IPython/html/static/notebook/js/widgets/widget_bool.js
index 960b143..050306d 100644
--- a/IPython/html/static/notebook/js/widgets/widget_bool.js
+++ b/IPython/html/static/notebook/js/widgets/widget_bool.js
@@ -59,7 +59,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
if (description.length === 0) {
this.$label.hide();
} else {
- this.$label.html(description);
+ this.$label.text(description);
this.$label.show();
}
}
@@ -103,9 +103,9 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
var description = this.model.get('description');
if (description.length === 0) {
- this.$el.html(' '); // Preserve button height
+ this.$el.text(' '); // Preserve button height
} else {
- this.$el.html(description);
+ this.$el.text(description);
}
}
return ToggleButtonView.__super__.update.apply(this);
diff --git a/IPython/html/static/notebook/js/widgets/widget_button.js b/IPython/html/static/notebook/js/widgets/widget_button.js
index 6a5f460..50c448c 100644
--- a/IPython/html/static/notebook/js/widgets/widget_button.js
+++ b/IPython/html/static/notebook/js/widgets/widget_button.js
@@ -31,12 +31,10 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
// Called when the model is changed. The model may have been
// changed by another view or by a state update from the back-end.
var description = this.model.get('description');
- description = description.replace(/ /g, ' ', 'm');
- description = description.replace(/\n/g, '
\n', 'm');
if (description.length === 0) {
- this.$el.html(' '); // Preserve button height
+ this.$el.text(' '); // Preserve button height
} else {
- this.$el.html(description);
+ this.$el.text(description);
}
if (this.model.get('disabled')) {
diff --git a/IPython/html/static/notebook/js/widgets/widget_container.js b/IPython/html/static/notebook/js/widgets/widget_container.js
index 9f8bde2..af8e1b2 100644
--- a/IPython/html/static/notebook/js/widgets/widget_container.js
+++ b/IPython/html/static/notebook/js/widgets/widget_container.js
@@ -71,7 +71,6 @@ define(["notebook/js/widgets/widget"], function(WidgetManager) {
}, this);
this.$el
- .html('')
.on("remove", function(){
that.$window.remove();
});
@@ -135,7 +134,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager) {
});
this.$title = $('
')
.addClass('widget-modal-title')
- .html(' ')
+ .text(' ')
.appendTo(this.$title_bar);
this.$body = $('')
.addClass('modal-body')
@@ -144,7 +143,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager) {
.appendTo(this.$window);
this.$show_button = $('')
- .html(' ')
+ .text(' ')
.addClass('btn btn-info widget-modal-show')
.appendTo(this.$el)
.click(function(){
@@ -227,21 +226,17 @@ define(["notebook/js/widgets/widget"], function(WidgetManager) {
// Called when the model is changed. The model may have been
// changed by another view or by a state update from the back-end.
var description = this.model.get('description');
- description = description.replace(/ /g, ' ', 'm');
- description = description.replace(/\n/g, '
\n', 'm');
if (description.length === 0) {
- this.$title.html(' '); // Preserve title height
+ this.$title.text(' '); // Preserve title height
} else {
- this.$title.html(description);
+ this.$title.text(description);
}
var button_text = this.model.get('button_text');
- button_text = button_text.replace(/ /g, ' ', 'm');
- button_text = button_text.replace(/\n/g, '
\n', 'm');
if (button_text.length === 0) {
- this.$show_button.html(' '); // Preserve button height
+ this.$show_button.text(' '); // Preserve button height
} else {
- this.$show_button.html(button_text);
+ this.$show_button.text(button_text);
}
if (!this._shown_once) {
diff --git a/IPython/html/static/notebook/js/widgets/widget_float_range.js b/IPython/html/static/notebook/js/widgets/widget_float_range.js
index 7074ece..37c1095 100644
--- a/IPython/html/static/notebook/js/widgets/widget_float_range.js
+++ b/IPython/html/static/notebook/js/widgets/widget_float_range.js
@@ -100,7 +100,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
if (description.length === 0) {
this.$label.hide();
} else {
- this.$label.html(description);
+ this.$label.text(description);
this.$label.show();
}
}
@@ -162,7 +162,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
if (description.length === 0) {
this.$label.hide();
} else {
- this.$label.html(description);
+ this.$label.text(description);
this.$label.show();
}
}
@@ -257,7 +257,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
if (description.length === 0) {
this.$label.hide();
} else {
- this.$label.html(description);
+ this.$label.text(description);
this.$label.show();
}
return ProgressView.__super__.update.apply(this);
diff --git a/IPython/html/static/notebook/js/widgets/widget_int_range.js b/IPython/html/static/notebook/js/widgets/widget_int_range.js
index a02a98b..f01109b 100644
--- a/IPython/html/static/notebook/js/widgets/widget_int_range.js
+++ b/IPython/html/static/notebook/js/widgets/widget_int_range.js
@@ -99,7 +99,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
if (description.length === 0) {
this.$label.hide();
} else {
- this.$label.html(description);
+ this.$label.text(description);
this.$label.show();
}
}
@@ -161,7 +161,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
if (description.length === 0) {
this.$label.hide();
} else {
- this.$label.html(description);
+ this.$label.text(description);
this.$label.show();
}
}
diff --git a/IPython/html/static/notebook/js/widgets/widget_selection.js b/IPython/html/static/notebook/js/widgets/widget_selection.js
index 20bfb23..db35626 100644
--- a/IPython/html/static/notebook/js/widgets/widget_selection.js
+++ b/IPython/html/static/notebook/js/widgets/widget_selection.js
@@ -20,8 +20,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
render : function(){
// Called when view is rendered.
this.$el
- .addClass('widget-hbox-single')
- .html('');
+ .addClass('widget-hbox-single');
this.$label = $('')
.appendTo(this.$el)
.addClass('widget-hlabel')
@@ -34,14 +33,14 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
this.$droplabel = $('')
.addClass('btn')
.addClass('widget-combo-btn')
- .html(' ')
+ .text(' ')
.appendTo(this.$buttongroup);
this.$dropbutton = $('')
.addClass('btn')
.addClass('dropdown-toggle')
.addClass('widget-combo-carrot-btn')
.attr('data-toggle', 'dropdown')
- .html('')
+ .append($('').addClass("caret"))
.appendTo(this.$buttongroup);
this.$droplist = $('')
.addClass('dropdown-menu')
@@ -59,12 +58,10 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
if (options === undefined || options.updated_view != this) {
var selected_item_text = this.model.get('value');
- selected_item_text = selected_item_text.replace(/ /g, ' ');
- selected_item_text = selected_item_text.replace(/\n/g, '
\n');
if (selected_item_text.length === 0) {
- this.$droplabel.html(' ');
+ this.$droplabel.text(' ');
} else {
- this.$droplabel.html(selected_item_text);
+ this.$droplabel.text(selected_item_text);
}
var items = this.model.get('values');
@@ -73,7 +70,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
for (var index in items) {
var that = this;
var item_button = $('')
- .html(items[index])
+ .text(items[index])
.on('click', $.proxy(this.handle_click, this));
$replace_droplist.append($('').append(item_button));
}
@@ -97,7 +94,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
if (description.length === 0) {
this.$label.hide();
} else {
- this.$label.html(description);
+ this.$label.text(description);
this.$label.show();
}
}
@@ -109,7 +106,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
// Calling model.set will trigger all of the other views of the
// model to update.
- this.model.set('value', $(e.target).html(), {updated_view: this});
+ this.model.set('value', $(e.target).text(), {updated_view: this});
this.touch();
},
@@ -148,7 +145,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
if (this.$el.find(item_query).length === 0) {
var $label = $('')
.addClass('radio')
- .html(items[index])
+ .text(items[index])
.appendTo(this.$container);
$('')
@@ -188,7 +185,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
if (description.length === 0) {
this.$label.hide();
} else {
- this.$label.html(description);
+ this.$label.text(description);
this.$label.show();
}
}
@@ -239,7 +236,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
$('')
.attr('type', 'button')
.addClass('btn')
- .html(items[index])
+ .text(items[index])
.appendTo(this.$buttongroup)
.on('click', $.proxy(this.handle_click, this));
}
@@ -255,7 +252,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
// Remove items that no longer exist.
this.$buttongroup.find('button').each(function(i, obj) {
- var value = $(obj).html();
+ var value = $(obj).text();
var found = false;
for (var index in items) {
if (items[index] == value) {
@@ -273,7 +270,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
if (description.length === 0) {
this.$label.hide();
} else {
- this.$label.html(description);
+ this.$label.text(description);
this.$label.show();
}
}
@@ -285,7 +282,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
// Calling model.set will trigger all of the other views of the
// model to update.
- this.model.set('value', $(e.target).html(), {updated_view: this});
+ this.model.set('value', $(e.target).text(), {updated_view: this});
this.touch();
},
});
@@ -321,7 +318,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
var item_query = ' :contains("' + items[index] + '")';
if (this.$listbox.find(item_query).length === 0) {
$('')
- .html(items[index])
+ .text(items[index])
.attr('value', items[index])
.appendTo(this.$listbox)
.on('click', $.proxy(this.handle_click, this));
@@ -337,7 +334,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
// Remove items that no longer exist.
this.$listbox.find('option').each(function(i, obj) {
- var value = $(obj).html();
+ var value = $(obj).text();
var found = false;
for (var index in items) {
if (items[index] == value) {
@@ -355,7 +352,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
if (description.length === 0) {
this.$label.hide();
} else {
- this.$label.html(description);
+ this.$label.text(description);
this.$label.show();
}
}
@@ -367,7 +364,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
// Calling model.set will trigger all of the other views of the
// model to update.
- this.model.set('value', $(e.target).html(), {updated_view: this});
+ this.model.set('value', $(e.target).text(), {updated_view: this});
this.touch();
},
});
diff --git a/IPython/html/static/notebook/js/widgets/widget_selectioncontainer.js b/IPython/html/static/notebook/js/widgets/widget_selectioncontainer.js
index 1c3558c..bff6efc 100644
--- a/IPython/html/static/notebook/js/widgets/widget_selectioncontainer.js
+++ b/IPython/html/static/notebook/js/widgets/widget_selectioncontainer.js
@@ -46,7 +46,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
accordian
.find('.accordion-heading')
.find('.accordion-toggle')
- .html(titles[page_index]);
+ .text(titles[page_index]);
}
}
@@ -107,7 +107,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
that.model.set("selected_index", index, {updated_view: this});
that.touch();
})
- .html('Page ' + index)
+ .text('Page ' + index)
.appendTo(accordion_heading);
var accordion_body = $('', {id: uuid})
.addClass('accordion-body collapse')
@@ -190,7 +190,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
var tab_text = $('')
.attr('href', '#' + uuid)
.attr('data-toggle', 'tab')
- .html('Page ' + index)
+ .text('Page ' + index)
.appendTo(tab)
.click(function (e) {
@@ -221,7 +221,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
for (var page_index in titles) {
var tab_text = this.containers[page_index];
if (tab_text !== undefined) {
- tab_text.html(titles[page_index]);
+ tab_text.text(titles[page_index]);
}
}
diff --git a/IPython/html/static/notebook/js/widgets/widget_string.js b/IPython/html/static/notebook/js/widgets/widget_string.js
index a241faa..62612b8 100644
--- a/IPython/html/static/notebook/js/widgets/widget_string.js
+++ b/IPython/html/static/notebook/js/widgets/widget_string.js
@@ -27,7 +27,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
//
// Called when the model is changed. The model may have been
// changed by another view or by a state update from the back-end.
- this.$el.html(this.model.get('value'));
+ this.$el.html(this.model.get('value')); // CAUTION! .html(...) CALL MANDITORY!!!
return HTMLView.__super__.update.apply(this);
},
});
@@ -45,7 +45,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
//
// Called when the model is changed. The model may have been
// changed by another view or by a state update from the back-end.
- this.$el.html(this.model.get('value'));
+ this.$el.text(this.model.get('value'));
MathJax.Hub.Queue(["Typeset",MathJax.Hub,this.$el.get(0)]);
return LatexView.__super__.update.apply(this);
@@ -58,8 +58,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
render: function(){
// Called when view is rendered.
this.$el
- .addClass('widget-hbox')
- .html('');
+ .addClass('widget-hbox');
this.$label = $('')
.appendTo(this.$el)
.addClass('widget-hlabel')
@@ -101,7 +100,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
if (description.length === 0) {
this.$label.hide();
} else {
- this.$label.html(description);
+ this.$label.text(description);
this.$label.show();
}
}
@@ -131,8 +130,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
render: function(){
// Called when view is rendered.
this.$el
- .addClass('widget-hbox-single')
- .html('');
+ .addClass('widget-hbox-single');
this.$label = $('')
.addClass('widget-hlabel')
.appendTo(this.$el)
@@ -162,7 +160,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
if (description.length === 0) {
this.$label.hide();
} else {
- this.$label.html(description);
+ this.$label.text(description);
this.$label.show();
}
}