.
This commit is contained in:
@@ -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();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -76,17 +83,19 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
|
|
||||||
var jqxhr = $.get(evt.target.dataset.exam_list_url, function (data) {
|
var jqxhr = $.get(evt.target.dataset.exam_list_url, function (data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
$("#exam-options").empty();
|
$("#exam-options").empty();
|
||||||
data.forEach((obj, n) => {
|
data.forEach((obj, n) => {
|
||||||
$("#exam-options").append($(document.createElement('button')).prop({
|
$("#exam-options").append($(document.createElement('button')).prop({
|
||||||
type: 'button',
|
type: 'button',
|
||||||
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 () {
|
||||||
//alert( "second success" );
|
//alert( "second success" );
|
||||||
})
|
})
|
||||||
@@ -108,24 +117,24 @@ $(document).ready(function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// if no question selected
|
// if no question selected
|
||||||
if (ids.length < 1) {
|
if (ids.length < 1) {
|
||||||
toastr.info('No question selected.');
|
toastr.info('No question selected.');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let post_url = document.getElementById("button-select-add-exam").dataset.exam_json_edit_url;
|
let post_url = document.getElementById("button-select-add-exam").dataset.exam_json_edit_url;
|
||||||
let type = document.getElementById("button-select-add-exam").dataset.type;
|
let type = document.getElementById("button-select-add-exam").dataset.type;
|
||||||
let csrf = document.getElementById("button-select-add-exam").dataset.csrf;
|
let csrf = document.getElementById("button-select-add-exam").dataset.csrf;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: post_url,
|
url: post_url,
|
||||||
data: {
|
data: {
|
||||||
csrfmiddlewaretoken: csrf,
|
csrfmiddlewaretoken: csrf,
|
||||||
add_exam_questions: JSON.stringify(ids),
|
add_exam_questions: JSON.stringify(ids),
|
||||||
type: type,
|
type: type,
|
||||||
exam_id: $(evt.target).data("exam-id"),
|
exam_id: $(evt.target).data("exam-id"),
|
||||||
},
|
},
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
})
|
})
|
||||||
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
|
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
|
||||||
.done(function (data) {
|
.done(function (data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -171,7 +180,7 @@ function loadDicomViewer(images_to_load, annotations_to_load) {
|
|||||||
|
|
||||||
if (images_to_load != undefined) {
|
if (images_to_load != undefined) {
|
||||||
images = images_to_load;
|
images = images_to_load;
|
||||||
//} else if (images.indexOf(",") > 0) {
|
//} else if (images.indexOf(",") > 0) {
|
||||||
} else if (images == undefined || images == "") {
|
} else if (images == undefined || images == "") {
|
||||||
// No images to load
|
// No images to load
|
||||||
return
|
return
|
||||||
@@ -305,11 +314,11 @@ function setUpDicom(element) {
|
|||||||
cornerstoneTools.addToolForElement(element, RotateTool);
|
cornerstoneTools.addToolForElement(element, RotateTool);
|
||||||
cornerstoneTools.addToolForElement(element, StackScrollTool);
|
cornerstoneTools.addToolForElement(element, StackScrollTool);
|
||||||
cornerstoneTools.addToolForElement(element, MagnifyTool);
|
cornerstoneTools.addToolForElement(element, MagnifyTool);
|
||||||
|
|
||||||
cornerstoneTools.addToolForElement(element, ArrowAnnotateTool, {
|
cornerstoneTools.addToolForElement(element, ArrowAnnotateTool, {
|
||||||
configuration: {
|
configuration: {
|
||||||
getTextCallback: () => { },
|
getTextCallback: () => {},
|
||||||
changeTextCallback: () => { },
|
changeTextCallback: () => {},
|
||||||
allowEmptyLabel: true,
|
allowEmptyLabel: true,
|
||||||
renderDashed: false,
|
renderDashed: false,
|
||||||
drawHandles: false,
|
drawHandles: false,
|
||||||
@@ -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) {
|
||||||
@@ -399,8 +416,8 @@ function keyDownHandler(e) {
|
|||||||
//toggleFlagged();
|
//toggleFlagged();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Numbers 1-9 select the corresponding answer (if it exists)
|
// Numbers 1-9 select the corresponding answer (if it exists)
|
||||||
// TODO: fix for multi question questions
|
// TODO: fix for multi question questions
|
||||||
case 49: // 1
|
case 49: // 1
|
||||||
numberKeyPressed(e, 0);
|
numberKeyPressed(e, 0);
|
||||||
break;
|
break;
|
||||||
@@ -444,7 +461,7 @@ function keyDownHandler(e) {
|
|||||||
//e.preventDefault();
|
//e.preventDefault();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Vim like scrolling (incredibly important)
|
// Vim like scrolling (incredibly important)
|
||||||
case 106: // j
|
case 106: // j
|
||||||
//window.scrollBy(0, 25);
|
//window.scrollBy(0, 25);
|
||||||
break;
|
break;
|
||||||
@@ -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 () {
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
+59
-40
@@ -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();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -76,17 +83,19 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
|
|
||||||
var jqxhr = $.get(evt.target.dataset.exam_list_url, function (data) {
|
var jqxhr = $.get(evt.target.dataset.exam_list_url, function (data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
$("#exam-options").empty();
|
$("#exam-options").empty();
|
||||||
data.forEach((obj, n) => {
|
data.forEach((obj, n) => {
|
||||||
$("#exam-options").append($(document.createElement('button')).prop({
|
$("#exam-options").append($(document.createElement('button')).prop({
|
||||||
type: 'button',
|
type: 'button',
|
||||||
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 () {
|
||||||
//alert( "second success" );
|
//alert( "second success" );
|
||||||
})
|
})
|
||||||
@@ -108,24 +117,24 @@ $(document).ready(function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// if no question selected
|
// if no question selected
|
||||||
if (ids.length < 1) {
|
if (ids.length < 1) {
|
||||||
toastr.info('No question selected.');
|
toastr.info('No question selected.');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let post_url = document.getElementById("button-select-add-exam").dataset.exam_json_edit_url;
|
let post_url = document.getElementById("button-select-add-exam").dataset.exam_json_edit_url;
|
||||||
let type = document.getElementById("button-select-add-exam").dataset.type;
|
let type = document.getElementById("button-select-add-exam").dataset.type;
|
||||||
let csrf = document.getElementById("button-select-add-exam").dataset.csrf;
|
let csrf = document.getElementById("button-select-add-exam").dataset.csrf;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: post_url,
|
url: post_url,
|
||||||
data: {
|
data: {
|
||||||
csrfmiddlewaretoken: csrf,
|
csrfmiddlewaretoken: csrf,
|
||||||
add_exam_questions: JSON.stringify(ids),
|
add_exam_questions: JSON.stringify(ids),
|
||||||
type: type,
|
type: type,
|
||||||
exam_id: $(evt.target).data("exam-id"),
|
exam_id: $(evt.target).data("exam-id"),
|
||||||
},
|
},
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
})
|
})
|
||||||
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
|
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
|
||||||
.done(function (data) {
|
.done(function (data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -171,7 +180,7 @@ function loadDicomViewer(images_to_load, annotations_to_load) {
|
|||||||
|
|
||||||
if (images_to_load != undefined) {
|
if (images_to_load != undefined) {
|
||||||
images = images_to_load;
|
images = images_to_load;
|
||||||
//} else if (images.indexOf(",") > 0) {
|
//} else if (images.indexOf(",") > 0) {
|
||||||
} else if (images == undefined || images == "") {
|
} else if (images == undefined || images == "") {
|
||||||
// No images to load
|
// No images to load
|
||||||
return
|
return
|
||||||
@@ -305,11 +314,11 @@ function setUpDicom(element) {
|
|||||||
cornerstoneTools.addToolForElement(element, RotateTool);
|
cornerstoneTools.addToolForElement(element, RotateTool);
|
||||||
cornerstoneTools.addToolForElement(element, StackScrollTool);
|
cornerstoneTools.addToolForElement(element, StackScrollTool);
|
||||||
cornerstoneTools.addToolForElement(element, MagnifyTool);
|
cornerstoneTools.addToolForElement(element, MagnifyTool);
|
||||||
|
|
||||||
cornerstoneTools.addToolForElement(element, ArrowAnnotateTool, {
|
cornerstoneTools.addToolForElement(element, ArrowAnnotateTool, {
|
||||||
configuration: {
|
configuration: {
|
||||||
getTextCallback: () => { },
|
getTextCallback: () => {},
|
||||||
changeTextCallback: () => { },
|
changeTextCallback: () => {},
|
||||||
allowEmptyLabel: true,
|
allowEmptyLabel: true,
|
||||||
renderDashed: false,
|
renderDashed: false,
|
||||||
drawHandles: false,
|
drawHandles: false,
|
||||||
@@ -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) {
|
||||||
@@ -399,8 +416,8 @@ function keyDownHandler(e) {
|
|||||||
//toggleFlagged();
|
//toggleFlagged();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Numbers 1-9 select the corresponding answer (if it exists)
|
// Numbers 1-9 select the corresponding answer (if it exists)
|
||||||
// TODO: fix for multi question questions
|
// TODO: fix for multi question questions
|
||||||
case 49: // 1
|
case 49: // 1
|
||||||
numberKeyPressed(e, 0);
|
numberKeyPressed(e, 0);
|
||||||
break;
|
break;
|
||||||
@@ -444,7 +461,7 @@ function keyDownHandler(e) {
|
|||||||
//e.preventDefault();
|
//e.preventDefault();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Vim like scrolling (incredibly important)
|
// Vim like scrolling (incredibly important)
|
||||||
case 106: // j
|
case 106: // j
|
||||||
//window.scrollBy(0, 25);
|
//window.scrollBy(0, 25);
|
||||||
break;
|
break;
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user