diff --git a/atlas/templates/atlas/collection_viva.html b/atlas/templates/atlas/collection_viva.html index b8622169..c0337bd8 100644 --- a/atlas/templates/atlas/collection_viva.html +++ b/atlas/templates/atlas/collection_viva.html @@ -4,14 +4,15 @@
Instructions

This set up is designed to allow you to project/share cases in a seperate window whilst controlling/tracking their display from this page.

-

Click on the 'Open' button to open the case in a new window/tab, this should be positioned on it's own window (you may have to detach the tab). Opening subsequent cases/series will replace the first case in the window.

-

It is also possible to open a single series by clicking on the 'Open' button next to the indvidual series.

+

Click on the 'Load' button to open the case in a new window/tab, this should be positioned on it's own window (you may have to detach the tab). Opening subsequent cases/series will replace the first case in the window.

+

It is also possible to open a single series by clicking on the 'Load' button next to the indvidual series.

Once opened the case details will be show on the right hand side of the page.

Cases

+
    {% for case in cases %} @@ -20,7 +21,7 @@
    Case {{forloop.counter}}: {{case.title}}   {% comment %} {% endcomment %} {% comment %} {% endcomment %} - +
    Series: @@ -34,7 +35,7 @@ show {% endcomment %}
    @@ -70,7 +71,7 @@ var win2 = false; $(document).ready(function() { - //const bc = new BroadcastChannel("test_channel"); + const bc = new BroadcastChannel("test_channel"); console.log('ready') $('.show-collection, .show-case, .show-series').click(function() { var url = $(this).data('target'); @@ -98,19 +99,23 @@ } else { $('#current-case-series').text("Series: " + $(this).data('series')); } - //bc.postMessage(url); - if (win2 == false || win2.closed) { - win2 = openSecondaryWindow(url); - console.log('opened', win2) - } else { - win2.location.href = url - } + bc.postMessage({"type": "open", "url" : url}); + //if (win2 == false || win2.closed) { + // win2 = openSecondaryWindow(url); + // console.log('opened', win2) + //} else { + // win2.location.href = url + //} //win2 = openSecondaryWindow(url); }) $('.send-message').click(function() { var url = $(this).data('target'); bc.postMessage(url); }) + $('#open-viewer').click(function() { + openSecondaryWindow("{% url 'atlas:collection_viewer' %}"); + //bc.postMessage(url); + }) }); function openSecondaryWindow(url) { diff --git a/atlas/templates/atlas/collection_viva_case.html b/atlas/templates/atlas/collection_viva_case.html index 1a886c86..cc7c9303 100644 --- a/atlas/templates/atlas/collection_viva_case.html +++ b/atlas/templates/atlas/collection_viva_case.html @@ -27,6 +27,7 @@ console.log('ready'); const bc = new BroadcastChannel("test_channel"); bc.onmessage = (event) => { + console.log("message received"); console.log(event); }; }); diff --git a/atlas/templates/atlas/viewer.html b/atlas/templates/atlas/viewer.html new file mode 100644 index 00000000..a2b4333a --- /dev/null +++ b/atlas/templates/atlas/viewer.html @@ -0,0 +1,41 @@ + + + + + Viewer + + + +

    Awating load request

    + This page will display series when loaded from other pages. + + + + + + diff --git a/atlas/urls.py b/atlas/urls.py index 7687bdab..3ae5bd71 100755 --- a/atlas/urls.py +++ b/atlas/urls.py @@ -56,6 +56,7 @@ urlpatterns = [ views.CaseCollectionUpdate.as_view(), name="exam_update", ), + path("collection/viewer", TemplateView.as_view(template_name="atlas/viewer.html"), name="collection_viewer"), path("collection/", views.collection_detail, name="collection_detail"), path("collection//viva", views.collection_viva, name="collection_viva"), path("collection//viva/", views.collection_viva_case, name="collection_viva_case"),