.
This commit is contained in:
@@ -6,8 +6,10 @@
|
||||
{% for case in cases %}
|
||||
<li data-question_pk={{case.pk}}>Case {{forloop.counter}}: {{case.title}}
|
||||
|
||||
<button class="show-case no-padding" data-title="{{case.title}}" data-target="/ohif/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}">Show</button>
|
||||
<button class="open-case no-padding" data-title="{{case.title}}" data-target="/ohif/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}">Open</button>
|
||||
aoeu
|
||||
<button class="show-case no-padding" data-title="{{case.title}}" data-target="/ohif/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}">Show</button>
|
||||
{% comment %} <button class="send-message no-padding" data-title="{{case.title}}" data-target="/ohif/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}">Open</button> {% endcomment %}
|
||||
<button class="open-case no-padding" data-title="{{case.title}}" data-target="{% url 'atlas:collection_viva_case' collection.pk forloop.counter0 %}">Case</button>
|
||||
</li>
|
||||
|
||||
{% endfor %}
|
||||
@@ -20,34 +22,41 @@
|
||||
|
||||
|
||||
{% block js %}
|
||||
<script type="text/javascript">
|
||||
var win2 = false;
|
||||
<script type="text/javascript">
|
||||
var win2 = false;
|
||||
|
||||
$(document).ready(function() {
|
||||
console.log('ready')
|
||||
$('.show-case').click(function() {
|
||||
var url = $(this).data('target');
|
||||
console.log('clicked', url)
|
||||
$('#case-title').text($(this).data('title'));
|
||||
$('#viewer').attr('src', url)
|
||||
});
|
||||
$('.open-case').click(function() {
|
||||
var url = $(this).data('target');
|
||||
if (win2 == false) {
|
||||
win2 = openSecondaryWindow(url);
|
||||
console.log('opened', win2)
|
||||
} else {
|
||||
win2.location.href = url
|
||||
}
|
||||
$(document).ready(function() {
|
||||
const bc = new BroadcastChannel("test_channel");
|
||||
console.log('ready')
|
||||
$('.show-case').click(function() {
|
||||
var url = $(this).data('target');
|
||||
console.log('clicked', url)
|
||||
$('#case-title').text($(this).data('title'));
|
||||
$('#viewer').attr('src', url)
|
||||
});
|
||||
$('.open-case').click(function() {
|
||||
var url = $(this).data('target');
|
||||
bc.postMessage(url);
|
||||
if (win2 == false || win2.closed) {
|
||||
win2 = openSecondaryWindow(url);
|
||||
console.log('opened', win2)
|
||||
} else {
|
||||
win2.location.href = url
|
||||
}
|
||||
//win2 = openSecondaryWindow(url);
|
||||
})
|
||||
});
|
||||
function openSecondaryWindow(url) {
|
||||
})
|
||||
$('.send-message').click(function() {
|
||||
var url = $(this).data('target');
|
||||
bc.postMessage(url);
|
||||
})
|
||||
|
||||
});
|
||||
function openSecondaryWindow(url) {
|
||||
//return win2 = window.open(url,'secondary','width=300,height=100');
|
||||
return win2 = window.open(url,'secondary');
|
||||
}
|
||||
return win2 = window.open(url,'secondary');
|
||||
}
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
{{ form.media }}
|
||||
{{ form.media }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Collection Viva Case</title>
|
||||
<link rel="stylesheet" type="text/css" href="path/to/your/css/file.css">
|
||||
<script src="path/to/your/javascript/file.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2 id="case-title">{{current_case.title}}</h2>
|
||||
<iframe id="viewer" style="width: 100%; height: 100%; border: none; padding: 0px;" src="/ohif/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' current_case.pk %}"></iframe>
|
||||
|
||||
<script type="text/javascript">
|
||||
var win2 = false;
|
||||
|
||||
$(document).ready(function() {
|
||||
document.title = "Case: {{current_case.title}}";
|
||||
console.log('ready');
|
||||
const bc = new BroadcastChannel("test_channel");
|
||||
bc.onmessage = (event) => {
|
||||
console.log(event);
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user