.
This commit is contained in:
+59
-40
@@ -10,6 +10,11 @@ window.control_pressed = false;
|
||||
|
||||
|
||||
$(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) {
|
||||
$(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(() => {
|
||||
$("#question-mark-list li").each((n, el) => {
|
||||
// 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) {
|
||||
console.log(data);
|
||||
$("#exam-options").empty();
|
||||
data.forEach((obj, n) => {
|
||||
$("#exam-options").append($(document.createElement('button')).prop({
|
||||
type: 'button',
|
||||
innerHTML: obj.name,
|
||||
class: '',
|
||||
console.log(data);
|
||||
$("#exam-options").empty();
|
||||
data.forEach((obj, n) => {
|
||||
$("#exam-options").append($(document.createElement('button')).prop({
|
||||
type: 'button',
|
||||
innerHTML: obj.name,
|
||||
class: '',
|
||||
|
||||
}).data("exam-id", obj.id).click((evt) => { addToExam(evt) }))
|
||||
}).data("exam-id", obj.id).click((evt) => {
|
||||
addToExam(evt)
|
||||
}))
|
||||
})
|
||||
})
|
||||
})
|
||||
.done(function () {
|
||||
//alert( "second success" );
|
||||
})
|
||||
@@ -108,24 +117,24 @@ $(document).ready(function () {
|
||||
})
|
||||
|
||||
// if no question selected
|
||||
if (ids.length < 1) {
|
||||
toastr.info('No question selected.');
|
||||
return
|
||||
if (ids.length < 1) {
|
||||
toastr.info('No question selected.');
|
||||
return
|
||||
}
|
||||
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 csrf = document.getElementById("button-select-add-exam").dataset.csrf;
|
||||
$.ajax({
|
||||
url: post_url,
|
||||
data: {
|
||||
csrfmiddlewaretoken: csrf,
|
||||
add_exam_questions: JSON.stringify(ids),
|
||||
type: type,
|
||||
exam_id: $(evt.target).data("exam-id"),
|
||||
},
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
})
|
||||
url: post_url,
|
||||
data: {
|
||||
csrfmiddlewaretoken: csrf,
|
||||
add_exam_questions: JSON.stringify(ids),
|
||||
type: type,
|
||||
exam_id: $(evt.target).data("exam-id"),
|
||||
},
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
})
|
||||
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
|
||||
.done(function (data) {
|
||||
console.log(data);
|
||||
@@ -171,7 +180,7 @@ function loadDicomViewer(images_to_load, annotations_to_load) {
|
||||
|
||||
if (images_to_load != undefined) {
|
||||
images = images_to_load;
|
||||
//} else if (images.indexOf(",") > 0) {
|
||||
//} else if (images.indexOf(",") > 0) {
|
||||
} else if (images == undefined || images == "") {
|
||||
// No images to load
|
||||
return
|
||||
@@ -305,11 +314,11 @@ function setUpDicom(element) {
|
||||
cornerstoneTools.addToolForElement(element, RotateTool);
|
||||
cornerstoneTools.addToolForElement(element, StackScrollTool);
|
||||
cornerstoneTools.addToolForElement(element, MagnifyTool);
|
||||
|
||||
|
||||
cornerstoneTools.addToolForElement(element, ArrowAnnotateTool, {
|
||||
configuration: {
|
||||
getTextCallback: () => { },
|
||||
changeTextCallback: () => { },
|
||||
getTextCallback: () => {},
|
||||
changeTextCallback: () => {},
|
||||
allowEmptyLabel: true,
|
||||
renderDashed: false,
|
||||
drawHandles: false,
|
||||
@@ -321,13 +330,23 @@ function setUpDicom(element) {
|
||||
|
||||
// Enable our tools
|
||||
// Avoid incorrect aspect ratio
|
||||
cornerstoneTools.setToolActiveForElement(element, "Pan", { mouseButtonMask: 1 });
|
||||
cornerstoneTools.setToolActiveForElement(element, "Wwwc", { mouseButtonMask: 2 });
|
||||
cornerstoneTools.setToolActiveForElement(element, "ZoomMouseWheel", { mouseButtonMask: 3 });
|
||||
cornerstoneTools.setToolActiveForElement(element, "Zoom", { mouseButtonMask: 4 });
|
||||
cornerstoneTools.setToolActiveForElement(element, "Pan", {
|
||||
mouseButtonMask: 1
|
||||
});
|
||||
cornerstoneTools.setToolActiveForElement(element, "Wwwc", {
|
||||
mouseButtonMask: 2
|
||||
});
|
||||
cornerstoneTools.setToolActiveForElement(element, "ZoomMouseWheel", {
|
||||
mouseButtonMask: 3
|
||||
});
|
||||
cornerstoneTools.setToolActiveForElement(element, "Zoom", {
|
||||
mouseButtonMask: 4
|
||||
});
|
||||
|
||||
if (element.dataset.edit_annotation == "true") {
|
||||
cornerstoneTools.setToolActiveForElement(element, "ArrowAnnotate", { mouseButtonMask: 2 });
|
||||
cornerstoneTools.setToolActiveForElement(element, "ArrowAnnotate", {
|
||||
mouseButtonMask: 2
|
||||
});
|
||||
} else {
|
||||
cornerstoneTools.setToolEnabledForElement(element, "ArrowAnnotate");
|
||||
}
|
||||
@@ -355,8 +374,7 @@ function keyDownHandler(e) {
|
||||
// accepts some kind of input
|
||||
if ($("*:focus:not(disabled)").is("textarea, input")) {
|
||||
// unless a modifier key is pressed (not shift)
|
||||
if (e.altKey ? true : false || e.ctrlKey ? true : false) {
|
||||
} else {
|
||||
if (e.altKey ? true : false || e.ctrlKey ? true : false) {} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -375,8 +393,7 @@ function keyDownHandler(e) {
|
||||
if (e.altKey ? true : false) {
|
||||
dicomViewer.selectThumb(x);
|
||||
e.preventDefault();
|
||||
} else {
|
||||
}
|
||||
} else {}
|
||||
}
|
||||
|
||||
switch (charCode) {
|
||||
@@ -399,8 +416,8 @@ function keyDownHandler(e) {
|
||||
//toggleFlagged();
|
||||
break;
|
||||
|
||||
// Numbers 1-9 select the corresponding answer (if it exists)
|
||||
// TODO: fix for multi question questions
|
||||
// Numbers 1-9 select the corresponding answer (if it exists)
|
||||
// TODO: fix for multi question questions
|
||||
case 49: // 1
|
||||
numberKeyPressed(e, 0);
|
||||
break;
|
||||
@@ -444,7 +461,7 @@ function keyDownHandler(e) {
|
||||
//e.preventDefault();
|
||||
break;
|
||||
|
||||
// Vim like scrolling (incredibly important)
|
||||
// Vim like scrolling (incredibly important)
|
||||
case 106: // j
|
||||
//window.scrollBy(0, 25);
|
||||
break;
|
||||
@@ -457,7 +474,9 @@ function keyDownHandler(e) {
|
||||
|
||||
function create_popup_window(url, title) {
|
||||
newwindow = window.open(url, title, 'height=800,width=600');
|
||||
if (window.focus) { newwindow.focus() }
|
||||
if (window.focus) {
|
||||
newwindow.focus()
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user