Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dalejung committed Mar 8, 2014
1 parent 2f9b463 commit a69beb8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nbx/handlers/standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ def link(html_obj, link_name=None):
link_name = html_obj
js = """
(function() {{
// https://github.com/ipython/ipython/issues/5293
if(typeof(toinsert) != 'undefined') {{
element = toinsert;
}}
var notebook_path = encodeURIComponent(IPython.notebook.notebook_path);
var notebook_name = encodeURIComponent(IPython.notebook.notebook_name);
var link_href = '/standalone/'+ notebook_path+'/'+notebook_name+'/{html_obj}';
element.append('<a target="_new" href="'+link_href+'">{link_name}</a>');
toinsert.append('<a target="_new" href="'+link_href+'">{link_name}</a>');
}})()
""".format(html_obj=html_obj, link_name=link_name)
return Javascript(data=js)
Expand Down

0 comments on commit a69beb8

Please sign in to comment.