This commit is contained in:
Ross
2021-02-15 16:46:05 +00:00
parent 830eea0a09
commit 9f1ff2cdc8
3 changed files with 30 additions and 7 deletions
+11 -7
View File
@@ -193,7 +193,6 @@
$(`img[data-input-id='${input.id}'`).removeClass("image-ident-loading");
console.log(l);
if (l.includes("accesion") || l.includes("number") || l.search(/(ref|rk9|rh8|ra9|rbz)\d+/g) > -1) {
console.log("SHIT", input);
$(input).addClass("image-ident-warning");
$(`img[data-input-id='${input.id}'`).addClass("image-ident-warning");
} else {
@@ -218,13 +217,14 @@
});
}
const readFile = (file) => {
const readFile = (file, el) => {
reader(file).then(reader => {
var image = new Image();
image.height = 100;
image.title = file.name;
image.src = reader.result;
$("#images").append(image);
console.log("read" ,el);
$(el).parent().parent().preppend(image);
//images.push(reader.result);
loadViewer(images);
});
@@ -239,7 +239,7 @@
console.log(el);
if (el.files.length > 0) {
filename = el.files[0].name;
await readFile(el.files[0]);
await readFile(el.files[0], el);
}
})
@@ -261,7 +261,7 @@
}
}
image_set = $("#images img");
image_set = $("#image_form_set img");
if (n == image_set.length) {
const event = new CustomEvent('loadDicomViewer', { "detail": images });
@@ -282,9 +282,13 @@
console.log(ul)
file_element = $(ul).find("input[type=file]").get(0);
console.log(file_element);
""
// If a (new) file is being uploaded we save it's name prior to it being hashed
if (file_element.files.length > 0) {
file_name = file_element.files[0].name
$(ul).find("input[type=text]").val(file_name);
}
if (file_element.files.length > 0 || $(ul).find(":contains('Currently:')")) {
n++;
$(ul).find("input[type=number]").val(n);