@@ -20,6 +20,7 @@ var base_url = "{{ resources.base_url }}/formgrader";
20
20
<script src =" {{ resources.base_url }}/formgrader/static/js/formgrade_keyboardmanager.js" ></script >
21
21
<script src =" {{ resources.base_url }}/formgrader/static/js/formgrade_models.js" ></script >
22
22
<script src =" {{ resources.base_url }}/formgrader/static/js/formgrade.js" ></script >
23
+ <script src =" {{ resources.base_url }}/formgrader/static/js/utils.js" ></script >
23
24
<script type =" text/javascript" >
24
25
function toggle_name (on ) {
25
26
$ (" .name-shown" ).tooltip (' hide' );
@@ -33,12 +34,11 @@ function toggle_name(on) {
33
34
}
34
35
}
35
36
36
- function jlab_open_notebook (notebook_path ) {
37
- return JSON .stringify ({
38
- " command" : " docmanager:open" ,
39
- " arguments" : {" path" : notebook_path}
37
+ $ (document ).ready (function () {
38
+ $ (" [data-link]" ).each (function () {
39
+ $ (this ).map (linkTo (" notebook" , $ (this ).data (" link" ))).removeAttr (" data-link" );
40
40
});
41
- }
41
+ });
42
42
</script >
43
43
44
44
<link rel =" stylesheet" href =" {{ resources.base_url }}/formgrader/static/components/bootstrap/css/bootstrap.min.css" />
@@ -64,12 +64,12 @@ function jlab_open_notebook(notebook_path) {
64
64
<li ><a href =" {{ resources.base_url }}/formgrader/gradebook/{{ resources.assignment_id }}/{{ resources.notebook_id }}" >{{ resources.notebook_id }}</a ></li >
65
65
<li class =" active live-notebook" >
66
66
<a class =" name-hidden" data-toggle =" tooltip" data-placement =" bottom" title =" Open live notebook"
67
- onclick = ' window.parent.postMessage(jlab_open_notebook( "{{ resources.notebook_path }}"), "*"); '
67
+ data-link = " {{ resources.notebook_path }}"
68
68
>
69
69
Submission #{{ resources.index + 1 }}
70
70
</a >
71
71
<a class =" name-shown" data-toggle =" tooltip" data-placement =" bottom" title =" Open live notebook"
72
- onclick = ' window.parent.postMessage(jlab_open_notebook( "{{ resources.notebook_path }}"), "*"); '
72
+ data-link = " {{ resources.notebook_path }}"
73
73
>
74
74
{% - if resources .last_name and resources .first_name -%}
75
75
{{ resources.last_name }}, {{ resources.first_name }}
@@ -99,4 +99,4 @@ function jlab_open_notebook(notebook_path) {
99
99
$ (' span.glyphicon.name-hidden' ).tooltip ({title: " Show student name" , placement: " bottom" , trigger: " hover" });
100
100
$ (' span.glyphicon.name-shown' ).tooltip ({title: " Hide student name" , placement: " bottom" , trigger: " hover" });
101
101
</script >
102
- {% endmacro %}
102
+ {% endmacro %}
0 commit comments