Show More
@@ -254,6 +254,9 b' var IPython = (function (IPython) {' | |||||
254 | this.append_output(json, true); |
|
254 | this.append_output(json, true); | |
255 | }; |
|
255 | }; | |
256 |
|
256 | |||
|
257 | var mime_types = ['application/javascript', 'application/json', | |||
|
258 | 'image/jpeg', 'image/png', 'image/svg+xml', 'text/html', | |||
|
259 | 'text/latex', 'text/plain']; | |||
257 |
|
260 | |||
258 | OutputArea.prototype.convert_mime_types = function (json, data) { |
|
261 | OutputArea.prototype.convert_mime_types = function (json, data) { | |
259 | if (data === undefined) { |
|
262 | if (data === undefined) { | |
@@ -283,6 +286,13 b' var IPython = (function (IPython) {' | |||||
283 | if (data['application/javascript'] !== undefined) { |
|
286 | if (data['application/javascript'] !== undefined) { | |
284 | json.javascript = data['application/javascript']; |
|
287 | json.javascript = data['application/javascript']; | |
285 | } |
|
288 | } | |
|
289 | // non-mimetype-keyed metadata used to get dropped here, this code | |||
|
290 | // re-injects it into the json. | |||
|
291 | for (x in data){ | |||
|
292 | if( !(x in mime_types) ) { | |||
|
293 | json[x] = data[x]; | |||
|
294 | } | |||
|
295 | } | |||
286 | return json; |
|
296 | return json; | |
287 | }; |
|
297 | }; | |
288 |
|
298 |
@@ -21,6 +21,32 b' casper.notebook_test(function () {' | |||||
21 | + "display_svg(SVG(s2), metadata=dict(isolated=True))\n" |
|
21 | + "display_svg(SVG(s2), metadata=dict(isolated=True))\n" | |
22 | ); |
|
22 | ); | |
23 | cell.execute(); |
|
23 | cell.execute(); | |
|
24 | console.log("hello" ); | |||
|
25 | }); | |||
|
26 | ||||
|
27 | this.then(function() { | |||
|
28 | var fname=this.test.currentTestFile.split('/').pop().toLowerCase(); | |||
|
29 | this.echo(fname) | |||
|
30 | this.echo(this.currentUrl) | |||
|
31 | this.evaluate(function (n) { | |||
|
32 | IPython.notebook.rename(n); | |||
|
33 | console.write("hello" + n); | |||
|
34 | IPython.notebook.save_notebook(); | |||
|
35 | }, {n : fname}); | |||
|
36 | this.echo(this.currentUrl) | |||
|
37 | }); | |||
|
38 | ||||
|
39 | this.then(function() { | |||
|
40 | ||||
|
41 | url = this.evaluate(function() { | |||
|
42 | IPython.notebook.rename("foo"); | |||
|
43 | //$("span#notebook_name")[0].click(); | |||
|
44 | //$("input")[0].value = "please-work"; | |||
|
45 | //$(".btn-primary")[0].click(); | |||
|
46 | return document.location.href; | |||
|
47 | }) | |||
|
48 | this.echo("renamed" + url); | |||
|
49 | this.echo(this.currentUrl); | |||
24 | }); |
|
50 | }); | |
25 |
|
51 | |||
26 | this.wait_for_output(0); |
|
52 | this.wait_for_output(0); |
General Comments 0
You need to be logged in to leave comments.
Login now