IPython Notebook with in-browser Javascript Kernel

With this profile, kernel.js is replaced by a simple object that executes javascript in the browser rather than remotely via websockets.

This is more of a toy / proof of concept than anything.

In [3]:
1
Out[3]:
1
In [4]:
2
Out[4]:
2
In [5]:
console.log("hi")
hi

In [6]:
double = function (x) {
    return x * x;
}
console.log(double(5));
console.log(double(10));
25
100

In [7]:
foo = 5
Out[7]:
5
In [8]:
console.log(location)
http://127.0.0.1:8890/05f99275-69db-42ff-92c2-59780eb7f1fc

In [9]:
foo + double(10)
Out[9]:
105
In [10]:
bar
ReferenceError: bar is not defined
    at eval (eval at <anonymous> (http://127.0.0.1:8890/static/js/kernel.js:236:22), <anonymous>:1:1)
    at Kernel.execute (http://127.0.0.1:8890/static/js/kernel.js:236:17)
    at CodeCell.execute (http://127.0.0.1:8890/static/js/codecell.js:251:34)
    at Notebook.execute_selected_cell (http://127.0.0.1:8890/static/js/notebook.js:1366:18)
    at HTMLDocument.<anonymous> (http://127.0.0.1:8890/static/js/notebook.js:158:22)
    at HTMLDocument.f.event.dispatch (http://127.0.0.1:8890/static/jquery/js/jquery-1.7.1.min.js:3:4351)
    at HTMLDocument.h.handle.i (http://127.0.0.1:8890/static/jquery/js/jquery-1.7.1.min.js:3:328)