From 54f04e274f78ce695f647c4e3250bb060cb4a2c3 2014-01-18 06:25:33
From: Matthias BUSSONNIER
Date: 2014-01-18 06:25:33
Subject: [PATCH] some $.html( -> $.text(
Thoses that are obvious and easy to fix.
we shoudl have I think a travis test that grep for .html( and return
less than 20 lines :-)
---
diff --git a/IPython/html/static/notebook/js/celltoolbarpresets/rawcell.js b/IPython/html/static/notebook/js/celltoolbarpresets/rawcell.js
index 75965f0..5560684 100644
--- a/IPython/html/static/notebook/js/celltoolbarpresets/rawcell.js
+++ b/IPython/html/static/notebook/js/celltoolbarpresets/rawcell.js
@@ -33,7 +33,7 @@
} else if (value === 'dialog'){
var dialog = $('').append(
$("")
- .html("Set the MIME type of the raw cell:")
+ .text("Set the MIME type of the raw cell:")
).append(
$(" ")
).append(
diff --git a/IPython/html/static/notebook/js/mathjaxutils.js b/IPython/html/static/notebook/js/mathjaxutils.js
index 0e76ae3..e076901 100644
--- a/IPython/html/static/notebook/js/mathjaxutils.js
+++ b/IPython/html/static/notebook/js/mathjaxutils.js
@@ -38,40 +38,40 @@ IPython.mathjaxutils = (function (IPython) {
// Don't have MathJax, but should. Show dialog.
var message = $('')
.append(
- $("
").addClass('dialog').html(
+ $("").addClass('dialog').text(
"Math/LaTeX rendering will be disabled."
)
).append(
- $("").addClass('dialog').html(
+ $("").addClass('dialog').text(
"If you have administrative access to the notebook server and" +
" a working internet connection, you can install a local copy" +
" of MathJax for offline use with the following command on the server" +
" at a Python or IPython prompt:"
)
).append(
- $("").addClass('dialog').html(
+ $("").addClass('dialog').text(
">>> from IPython.external import mathjax; mathjax.install_mathjax()"
)
).append(
- $("").addClass('dialog').html(
+ $("").addClass('dialog').text(
"This will try to install MathJax into the IPython source directory."
)
).append(
- $("").addClass('dialog').html(
+ $("").addClass('dialog').text(
"If IPython is installed to a location that requires" +
" administrative privileges to write, you will need to make this call as" +
" an administrator, via 'sudo'."
)
).append(
- $("").addClass('dialog').html(
+ $("").addClass('dialog').text(
"When you start the notebook server, you can instruct it to disable MathJax support altogether:"
)
).append(
- $("").addClass('dialog').html(
+ $("").addClass('dialog').text(
"$ ipython notebook --no-mathjax"
)
).append(
- $("").addClass('dialog').html(
+ $("").addClass('dialog').text(
"which will prevent this dialog from appearing."
)
);
diff --git a/IPython/html/static/notebook/js/notebook.js b/IPython/html/static/notebook/js/notebook.js
index 6cc0745..84f6d01 100644
--- a/IPython/html/static/notebook/js/notebook.js
+++ b/IPython/html/static/notebook/js/notebook.js
@@ -1318,7 +1318,7 @@ var IPython = (function (IPython) {
var that = this;
IPython.dialog.modal({
title : "Restart kernel or continue running?",
- body : $("").html(
+ body : $("").text(
'Do you want to restart the current kernel? You will lose all variables defined in it.'
),
buttons : {
@@ -1781,7 +1781,7 @@ var IPython = (function (IPython) {
var that = this;
var dialog = $('').append(
$("").addClass("rename-message")
- .html('This notebook name already exists.')
+ .text('This notebook name already exists.')
)
$([IPython.events]).trigger('notebook_rename_failed.Notebook', [xhr, status, error]);
IPython.dialog.modal({
diff --git a/IPython/html/static/notebook/js/notificationwidget.js b/IPython/html/static/notebook/js/notificationwidget.js
index 40a9514..d6bf108 100644
--- a/IPython/html/static/notebook/js/notificationwidget.js
+++ b/IPython/html/static/notebook/js/notificationwidget.js
@@ -43,7 +43,7 @@ var IPython = (function (IPython) {
NotificationWidget.prototype.set_message = function (msg, timeout, click_callback) {
var callback = click_callback || function() {return false;};
var that = this;
- this.element.html(msg);
+ this.element.text(msg);
this.element.fadeIn(100);
if (this.timeout !== null) {
clearTimeout(this.timeout);
@@ -51,13 +51,13 @@ var IPython = (function (IPython) {
}
if (timeout !== undefined && timeout >=0) {
this.timeout = setTimeout(function () {
- that.element.fadeOut(100, function () {that.element.html('');});
+ that.element.fadeOut(100, function () {that.element.text('');});
that.timeout = null;
}, timeout);
} else {
this.element.click(function() {
if( callback() != false ) {
- that.element.fadeOut(100, function () {that.element.html('');});
+ that.element.fadeOut(100, function () {that.element.text('');});
that.element.unbind('click');
}
if (that.timeout !== undefined) {
diff --git a/IPython/html/static/notebook/js/outputarea.js b/IPython/html/static/notebook/js/outputarea.js
index 7b19479..3e67352 100644
--- a/IPython/html/static/notebook/js/outputarea.js
+++ b/IPython/html/static/notebook/js/outputarea.js
@@ -61,7 +61,7 @@ var IPython = (function (IPython) {
this.collapse_button.addClass("btn output_collapsed");
this.collapse_button.attr('title', 'click to expand output');
- this.collapse_button.html('. . .');
+ this.collapse_button.text('. . .');
this.prompt_overlay.addClass('out_prompt_overlay prompt');
this.prompt_overlay.attr('title', 'click to expand output; double click to hide output');
@@ -442,7 +442,7 @@ var IPython = (function (IPython) {
var n = json.prompt_number || ' ';
var toinsert = this.create_output_area();
if (this.prompt_area) {
- toinsert.find('div.prompt').addClass('output_prompt').html('Out[' + n + ']:');
+ toinsert.find('div.prompt').addClass('output_prompt').text('Out[' + n + ']:');
}
this.append_mime_type(json, toinsert);
this._safe_append(toinsert);
diff --git a/IPython/html/static/notebook/js/quickhelp.js b/IPython/html/static/notebook/js/quickhelp.js
index 923b240..0894f2b 100644
--- a/IPython/html/static/notebook/js/quickhelp.js
+++ b/IPython/html/static/notebook/js/quickhelp.js
@@ -32,7 +32,7 @@ var IPython = (function (IPython) {
// The documentation
var doc = $('').addClass('alert');
doc.append(
- $('').addClass('close').attr('data-dismiss','alert').html('×')
+ $('').addClass('close').attr('data-dismiss','alert').html('×')
).append(
'The IPython Notebook has two different keyboard input modes. Edit mode '+
'allow you the type code/text into a cell and is indicated by a green cell '+
@@ -75,16 +75,16 @@ var IPython = (function (IPython) {
help = command_shortcuts[i]['help'];
shortcut = command_shortcuts[i]['shortcut'];
cmd_col1.append($('