diff --git a/IPython/frontend/html/notebook/static/js/cell.js b/IPython/frontend/html/notebook/static/js/cell.js index b186bd8c3..6806dd3cf 100644 --- a/IPython/frontend/html/notebook/static/js/cell.js +++ b/IPython/frontend/html/notebook/static/js/cell.js @@ -45,16 +45,16 @@ var IPython = (function (IPython) { Cell.prototype.bind_events = function () { var that = this; - var nb = that.notebook + var nb = that.notebook; that.element.click(function (event) { if (that.selected === false) { nb.select(nb.find_cell_index(that)); - }; + } }); that.element.focusin(function (event) { if (that.selected === false) { nb.select(nb.find_cell_index(that)); - }; + } }); }; diff --git a/IPython/frontend/html/notebook/static/js/codecell.js b/IPython/frontend/html/notebook/static/js/codecell.js index c96d4b22c..8aa744199 100644 --- a/IPython/frontend/html/notebook/static/js/codecell.js +++ b/IPython/frontend/html/notebook/static/js/codecell.js @@ -44,7 +44,7 @@ var IPython = (function (IPython) { var output = $('
').addClass('output vbox'); cell.append(input).append(output); this.element = cell; - this.collapse() + this.collapse(); }; //TODO, try to diminish the number of parameters. @@ -123,7 +123,7 @@ var IPython = (function (IPython) { return true; } else { return false; - }; + } } else if (event.keyCode === 76 && event.ctrlKey && event.shiftKey && event.type == 'keydown') { // toggle line numbers with Ctrl-Shift-L @@ -138,10 +138,11 @@ var IPython = (function (IPython) { if (ed_cur.line !== cc_cur.line || ed_cur.ch !== cc_cur.ch) { this.is_completing = false; this.completion_cursor = null; - }; - }; + } + } return false; }; + return false; }; CodeCell.prototype.remove_and_cancell_tooltip = function(timeout) @@ -345,7 +346,7 @@ var IPython = (function (IPython) { } else { this.code_mirror.setOption('lineNumbers', false); } - this.code_mirror.refresh() + this.code_mirror.refresh(); }; CodeCell.prototype.select = function () { @@ -447,7 +448,7 @@ var IPython = (function (IPython) { CodeCell.prototype.append_display_data = function (json) { var toinsert = this.create_output_area(); - this.append_mime_type(json, toinsert) + this.append_mime_type(json, toinsert); this.element.find('div.output').append(toinsert); // If we just output latex, typeset it. if ( (json.latex !== undefined) || (json.html !== undefined) ) { @@ -477,7 +478,7 @@ var IPython = (function (IPython) { var toinsert = $("").addClass("box_flex1 output_subarea output_html rendered_html"); toinsert.append(html); element.append(toinsert); - } + }; CodeCell.prototype.append_text = function (data, element, extra_class) { @@ -517,7 +518,7 @@ var IPython = (function (IPython) { var toinsert = $("").addClass("box_flex1 output_subarea output_latex"); toinsert.append(latex); element.append(toinsert); - } + }; CodeCell.prototype.clear_output = function (stdout, stderr, other) { @@ -589,7 +590,7 @@ var IPython = (function (IPython) { CodeCell.prototype.set_input_prompt = function (number) { var n = number || ' '; - this.input_prompt_number = n + this.input_prompt_number = n; this.element.find('div.input_prompt').html('In [' + n + ']:'); }; @@ -653,7 +654,7 @@ var IPython = (function (IPython) { data.input = this.get_code(); data.cell_type = 'code'; if (this.input_prompt_number !== ' ') { - data.prompt_number = this.input_prompt_number + data.prompt_number = this.input_prompt_number; }; var outputs = []; var len = this.outputs.length; diff --git a/IPython/frontend/html/notebook/static/js/kernel.js b/IPython/frontend/html/notebook/static/js/kernel.js index b3ae6ba4f..16f9445bf 100644 --- a/IPython/frontend/html/notebook/static/js/kernel.js +++ b/IPython/frontend/html/notebook/static/js/kernel.js @@ -23,9 +23,9 @@ var IPython = (function (IPython) { this.session_id = utils.uuid(); if (typeof(WebSocket) !== 'undefined') { - this.WebSocket = WebSocket + this.WebSocket = WebSocket; } else if (typeof(MozWebSocket) !== 'undefined') { - this.WebSocket = MozWebSocket + this.WebSocket = MozWebSocket; } else { alert('Your browser does not have WebSocket support, please try Chrome, Safari or Firefox ≥ 6. Firefox 4 and 5 are also supported by you have to enable WebSockets in about:config.'); }; @@ -44,13 +44,13 @@ var IPython = (function (IPython) { parent_header : {} }; return msg; - } + }; Kernel.prototype.start = function (notebook_id, callback) { var that = this; if (!this.running) { var qs = $.param({notebook:notebook_id}); - var url = this.base_url + '?' + qs + var url = this.base_url + '?' + qs; $.post(url, function (kernel_id) { that._handle_start_kernel(kernel_id, callback); @@ -95,10 +95,10 @@ var IPython = (function (IPython) { " You will NOT be able to run code.' + code + '
';
});
this.rendered = true;
- };
+ }
};
@@ -234,9 +234,9 @@ var IPython = (function (IPython) {
RSTCell.prototype.render = function () {
- if (this.rendered === false) {
+ if (this.rendered === false) {
var text = this.get_source();
- if (text === "") {text = this.placeholder;};
+ if (text === "") { text = this.placeholder; }
var settings = {
processData : false,
cache : false,
@@ -249,7 +249,7 @@ var IPython = (function (IPython) {
this.element.find('div.text_cell_input').hide();
this.element.find("div.text_cell_render").show();
this.set_rendered("Rendering...");
- };
+ }
};
diff --git a/IPython/frontend/html/notebook/static/js/utils.js b/IPython/frontend/html/notebook/static/js/utils.js
index f81c7d48d..bce44b367 100644
--- a/IPython/frontend/html/notebook/static/js/utils.js
+++ b/IPython/frontend/html/notebook/static/js/utils.js
@@ -9,7 +9,7 @@
// Utilities
//============================================================================
-IPython.namespace('IPython.utils')
+IPython.namespace('IPython.utils');
IPython.utils = (function (IPython) {
@@ -35,7 +35,7 @@ IPython.utils = (function (IPython) {
.replace(/>/g,'&'+'gt;')
.replace(/\'/g,'&'+'apos;')
.replace(/\"/g,'&'+'quot;')
- .replace(/`/g,'&'+'#96;')
+ .replace(/`/g,'&'+'#96;');
}
@@ -45,32 +45,32 @@ IPython.utils = (function (IPython) {
"32":"ansigreen", "33":"ansiyellow",
"34":"ansiblue", "35":"ansipurple","36":"ansicyan",
"37":"ansigrey", "01":"ansibold"
- }
+ };
// Transform ANI color escape codes into HTML tags with css
// classes listed in the above ansi_colormap object. The actual color used
// are set in the css file.
function fixConsole(txt) {
- txt = xmlencode(txt)
- var re = /\033\[([\d;]*?)m/
- var opened = false
- var cmds = []
- var opener = ""
- var closer = ""
+ txt = xmlencode(txt);
+ var re = /\033\[([\d;]*?)m/;
+ var opened = false;
+ var cmds = [];
+ var opener = "";
+ var closer = "";
while (re.test(txt)) {
- var cmds = txt.match(re)[1].split(";")
- closer = opened?"":""
- opened = cmds.length > 1 || cmds[0] != 0
- var rep = []
+ var cmds = txt.match(re)[1].split(";");
+ closer = opened?"":"";
+ opened = cmds.length > 1 || cmds[0] != 0;
+ var rep = [];
for (var i in cmds)
if (typeof(ansi_colormap[cmds[i]]) != "undefined")
- rep.push(ansi_colormap[cmds[i]])
- opener = rep.length > 0?"":""
- txt = txt.replace(re, closer + opener)
+ rep.push(ansi_colormap[cmds[i]]);
+ opener = rep.length > 0?"":"";
+ txt = txt.replace(re, closer + opener);
}
- if (opened) txt += ""
- return txt
+ if (opened) txt += "";
+ return txt;
}
@@ -95,7 +95,7 @@ IPython.utils = (function (IPython) {
uuid : uuid,
fixConsole : fixConsole,
grow : grow
- }
+ };
}(IPython));