This commit is contained in:
Ross
2021-09-29 22:08:34 +01:00
parent 5be2b148ca
commit 278e38fc2c
4 changed files with 119 additions and 83 deletions
+31 -12
View File
@@ -10,6 +10,11 @@ window.control_pressed = false;
$(document).ready(function () { $(document).ready(function () {
$("table thead th input").click((e) => {
let status = e.currentTarget.checked;
$("table tbody input").prop("checked", status);
})
$(".answer-list li").each(function (index, element) { $(".answer-list li").each(function (index, element) {
$(element).append($("<span class='google-link' title='search for answer with google'><a href='https://www.google.com/search?q=" + $(element).text() + "' target='_blank'>G</a></span>")); $(element).append($("<span class='google-link' title='search for answer with google'><a href='https://www.google.com/search?q=" + $(element).text() + "' target='_blank'>G</a></span>"));
}); });
@@ -61,7 +66,9 @@ $(document).ready(function () {
$(".show-unmarked-button").click(() => { $(".show-unmarked-button").click(() => {
$("#question-mark-list li").each((n, el) => { $("#question-mark-list li").each((n, el) => {
// Can't seem to get django to output this as a int.... // Can't seem to get django to output this as a int....
if (parseInt(el.dataset.markcount) < 1) { $(el).hide(); } if (parseInt(el.dataset.markcount) < 1) {
$(el).hide();
}
}) })
}); });
@@ -84,7 +91,9 @@ $(document).ready(function () {
innerHTML: obj.name, innerHTML: obj.name,
class: '', class: '',
}).data("exam-id", obj.id).click((evt) => { addToExam(evt) })) }).data("exam-id", obj.id).click((evt) => {
addToExam(evt)
}))
}) })
}) })
.done(function () { .done(function () {
@@ -321,13 +330,23 @@ function setUpDicom(element) {
// Enable our tools // Enable our tools
// Avoid incorrect aspect ratio // Avoid incorrect aspect ratio
cornerstoneTools.setToolActiveForElement(element, "Pan", { mouseButtonMask: 1 }); cornerstoneTools.setToolActiveForElement(element, "Pan", {
cornerstoneTools.setToolActiveForElement(element, "Wwwc", { mouseButtonMask: 2 }); mouseButtonMask: 1
cornerstoneTools.setToolActiveForElement(element, "ZoomMouseWheel", { mouseButtonMask: 3 }); });
cornerstoneTools.setToolActiveForElement(element, "Zoom", { mouseButtonMask: 4 }); cornerstoneTools.setToolActiveForElement(element, "Wwwc", {
mouseButtonMask: 2
});
cornerstoneTools.setToolActiveForElement(element, "ZoomMouseWheel", {
mouseButtonMask: 3
});
cornerstoneTools.setToolActiveForElement(element, "Zoom", {
mouseButtonMask: 4
});
if (element.dataset.edit_annotation == "true") { if (element.dataset.edit_annotation == "true") {
cornerstoneTools.setToolActiveForElement(element, "ArrowAnnotate", { mouseButtonMask: 2 }); cornerstoneTools.setToolActiveForElement(element, "ArrowAnnotate", {
mouseButtonMask: 2
});
} else { } else {
cornerstoneTools.setToolEnabledForElement(element, "ArrowAnnotate"); cornerstoneTools.setToolEnabledForElement(element, "ArrowAnnotate");
} }
@@ -355,8 +374,7 @@ function keyDownHandler(e) {
// accepts some kind of input // accepts some kind of input
if ($("*:focus:not(disabled)").is("textarea, input")) { if ($("*:focus:not(disabled)").is("textarea, input")) {
// unless a modifier key is pressed (not shift) // unless a modifier key is pressed (not shift)
if (e.altKey ? true : false || e.ctrlKey ? true : false) { if (e.altKey ? true : false || e.ctrlKey ? true : false) {} else {
} else {
return; return;
} }
} }
@@ -375,8 +393,7 @@ function keyDownHandler(e) {
if (e.altKey ? true : false) { if (e.altKey ? true : false) {
dicomViewer.selectThumb(x); dicomViewer.selectThumb(x);
e.preventDefault(); e.preventDefault();
} else { } else {}
}
} }
switch (charCode) { switch (charCode) {
@@ -457,7 +474,9 @@ function keyDownHandler(e) {
function create_popup_window(url, title) { function create_popup_window(url, title) {
newwindow = window.open(url, title, 'height=800,width=600'); newwindow = window.open(url, title, 'height=800,width=600');
if (window.focus) { newwindow.focus() } if (window.focus) {
newwindow.focus()
}
return false; return false;
} }
@@ -21,9 +21,6 @@
{% block js %} {% block js %}
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$("table thead th input").click((e) => {
let status = e.currentTarget.checked; console.log(status, $("table tbody input")); $("table tbody input").prop("checked", status);
})
//$("thead input:checked").each((n, el) => { //$("thead input:checked").each((n, el) => {
$("#delete-selected-button").on("click", function () { $("#delete-selected-button").on("click", function () {
+1
View File
@@ -749,6 +749,7 @@ input {
float: right; float: right;
transform: rotate(90deg) translateX(10px); transform: rotate(90deg) translateX(10px);
color: blueviolet; color: blueviolet;
user-select: none;
} }
.clear-both { .clear-both {
+31 -12
View File
@@ -10,6 +10,11 @@ window.control_pressed = false;
$(document).ready(function () { $(document).ready(function () {
$("table thead th input").click((e) => {
let status = e.currentTarget.checked;
$("table tbody input").prop("checked", status);
})
$(".answer-list li").each(function (index, element) { $(".answer-list li").each(function (index, element) {
$(element).append($("<span class='google-link' title='search for answer with google'><a href='https://www.google.com/search?q=" + $(element).text() + "' target='_blank'>G</a></span>")); $(element).append($("<span class='google-link' title='search for answer with google'><a href='https://www.google.com/search?q=" + $(element).text() + "' target='_blank'>G</a></span>"));
}); });
@@ -61,7 +66,9 @@ $(document).ready(function () {
$(".show-unmarked-button").click(() => { $(".show-unmarked-button").click(() => {
$("#question-mark-list li").each((n, el) => { $("#question-mark-list li").each((n, el) => {
// Can't seem to get django to output this as a int.... // Can't seem to get django to output this as a int....
if (parseInt(el.dataset.markcount) < 1) { $(el).hide(); } if (parseInt(el.dataset.markcount) < 1) {
$(el).hide();
}
}) })
}); });
@@ -84,7 +91,9 @@ $(document).ready(function () {
innerHTML: obj.name, innerHTML: obj.name,
class: '', class: '',
}).data("exam-id", obj.id).click((evt) => { addToExam(evt) })) }).data("exam-id", obj.id).click((evt) => {
addToExam(evt)
}))
}) })
}) })
.done(function () { .done(function () {
@@ -321,13 +330,23 @@ function setUpDicom(element) {
// Enable our tools // Enable our tools
// Avoid incorrect aspect ratio // Avoid incorrect aspect ratio
cornerstoneTools.setToolActiveForElement(element, "Pan", { mouseButtonMask: 1 }); cornerstoneTools.setToolActiveForElement(element, "Pan", {
cornerstoneTools.setToolActiveForElement(element, "Wwwc", { mouseButtonMask: 2 }); mouseButtonMask: 1
cornerstoneTools.setToolActiveForElement(element, "ZoomMouseWheel", { mouseButtonMask: 3 }); });
cornerstoneTools.setToolActiveForElement(element, "Zoom", { mouseButtonMask: 4 }); cornerstoneTools.setToolActiveForElement(element, "Wwwc", {
mouseButtonMask: 2
});
cornerstoneTools.setToolActiveForElement(element, "ZoomMouseWheel", {
mouseButtonMask: 3
});
cornerstoneTools.setToolActiveForElement(element, "Zoom", {
mouseButtonMask: 4
});
if (element.dataset.edit_annotation == "true") { if (element.dataset.edit_annotation == "true") {
cornerstoneTools.setToolActiveForElement(element, "ArrowAnnotate", { mouseButtonMask: 2 }); cornerstoneTools.setToolActiveForElement(element, "ArrowAnnotate", {
mouseButtonMask: 2
});
} else { } else {
cornerstoneTools.setToolEnabledForElement(element, "ArrowAnnotate"); cornerstoneTools.setToolEnabledForElement(element, "ArrowAnnotate");
} }
@@ -355,8 +374,7 @@ function keyDownHandler(e) {
// accepts some kind of input // accepts some kind of input
if ($("*:focus:not(disabled)").is("textarea, input")) { if ($("*:focus:not(disabled)").is("textarea, input")) {
// unless a modifier key is pressed (not shift) // unless a modifier key is pressed (not shift)
if (e.altKey ? true : false || e.ctrlKey ? true : false) { if (e.altKey ? true : false || e.ctrlKey ? true : false) {} else {
} else {
return; return;
} }
} }
@@ -375,8 +393,7 @@ function keyDownHandler(e) {
if (e.altKey ? true : false) { if (e.altKey ? true : false) {
dicomViewer.selectThumb(x); dicomViewer.selectThumb(x);
e.preventDefault(); e.preventDefault();
} else { } else {}
}
} }
switch (charCode) { switch (charCode) {
@@ -457,7 +474,9 @@ function keyDownHandler(e) {
function create_popup_window(url, title) { function create_popup_window(url, title) {
newwindow = window.open(url, title, 'height=800,width=600'); newwindow = window.open(url, title, 'height=800,width=600');
if (window.focus) { newwindow.focus() } if (window.focus) {
newwindow.focus()
}
return false; return false;
} }