From b8838bd7ecfcb6f828e203c9eeabfdda06f387b1 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 14:16:07 +0000 Subject: [PATCH 01/23] . --- rapids/templates/rapids/rapid_form.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index e666fd21..7da27db9 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -172,17 +172,20 @@ if (el.files.length == 0) { el.files = dT.files; //ocr(el) - $(el).change(); + console.log(el); if(feedback) { arr = el.name.split("-"); arr.splice(2, 1, "feedback_image"); feedback_el_name = arr.join("-"); + console.log(feedback_el_name); $(`[name=${feedback_el_name}]`).prop("checked", true); + console.log(`[name=${feedback_el_name}]`); } return false; + $(el).change(); } } From 23718d614f771f1c9e0f2f75f3282901c79130cf Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 14:18:42 +0000 Subject: [PATCH 02/23] . --- rapids/templates/rapids/rapid_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 7da27db9..dd09cd2e 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -184,8 +184,8 @@ console.log(`[name=${feedback_el_name}]`); } - return false; $(el).change(); + return false; } } From 77d3f84e8afa71d02e955b1ae5ce4504e8c84851 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 14:56:08 +0000 Subject: [PATCH 03/23] . --- rapids/templates/rapids/rapid_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index dd09cd2e..0ef62a9b 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -629,6 +629,6 @@ -
+ {% endblock %} \ No newline at end of file From 69a445ccbd72e5cf0b9444e23e804a2c92a7e163 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 14:59:18 +0000 Subject: [PATCH 04/23] . --- rapids/templates/rapids/rapid_form.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 0ef62a9b..c8d606ce 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -141,7 +141,7 @@ } - loadDicomViewerAndFileImages(); + readFileAndProcess(); // Check if we have selected a examination type if (!$("#id_examination_to option").length) { @@ -414,7 +414,7 @@ } } - async function loadDicomViewerAndFileImages(callback) { + async function readFileAndProcess(callback) { //$("#single-dicom-viewer").empty() //images = [] //Function that returns a promise to read the file @@ -469,7 +469,8 @@ } function loadViewer() { - //dicomViewer.loadCornerstone($("#single-dicom-viewer"), null, images, annotations); + // temp fix before starting viewer collapsed + $("#single-dicom-viewer").show() file_set = $("#image_form_set input[type=file]"); n = 0; From 9cf4f15711ff6d4f074b2bbf2302357e204b15bc Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 15:41:23 +0000 Subject: [PATCH 05/23] . --- rapids/templates/rapids/rapid_form.html | 58 ++++++++++++++++++------- 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index c8d606ce..81bf8290 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -12,18 +12,20 @@ // set to hold the files that are still being processed let active_file_inputs = new Set() - async function listAllFilesAndDirs(dirHandle) { + async function listAllFilesAndDirs(dirHandle, files_only) { const files = []; for await (let [name, handle] of dirHandle) { const { kind } = handle; if (handle.kind === 'directory') { - files.push({ - name, - handle, - kind - }); + if (files_only != true) { + files.push({ + name, + handle, + kind + }); + } files.push(...await listAllFilesAndDirs(handle)); } else { files.push({ @@ -75,6 +77,19 @@ } + function getCurrentFiles() { + inputs = $("#rapid-form input[type=file]"); + + let files = new Set(); + for (let j = 0; j < inputs.length; j++) { + i = inputs.get(j); + console.log(i) + files.add(i.files[0]); + console.log(i.files) + } + return files; + } + function extendInputs(n) { // Makes sure we have n inputs available // returns available inputs @@ -174,7 +189,7 @@ //ocr(el) console.log(el); - if(feedback) { + if (feedback) { arr = el.name.split("-"); arr.splice(2, 1, "feedback_image"); feedback_el_name = arr.join("-"); @@ -265,17 +280,28 @@ monitor_interval_id = setInterval(function () { listAllFilesAndDirs(monitor_directory_handler).then((items) => { console.log(items); + files_to_add = Set(); + for (var i = 0; i < items.length; i++) { + files_to_add.add(items[i].getFile()); + } + current_files = getCurrentFiles(); + let distinct_set = new Set([...files_to_add].filter(x => + ! + current_files.has(x))); + + console.log(distinct_set) }); }, 5000); - $("#directory-picker-display").text(monitor_directory_handler.name).after( - $( - " [clear]").click((evt) => { - $(evt.target).remove(); - $("#directory-picker-display").text(""); - monitor_directory_handler = false; - clearInterval(monitor_interval_id); - //const files = await listAllFilesAndDirs(directoryHandle); - })); + $("#directory-picker-display").text(monitor_directory_handler.name) + .after( + $( + " [clear]").click((evt) => { + $(evt.target).remove(); + $("#directory-picker-display").text(""); + monitor_directory_handler = false; + clearInterval(monitor_interval_id); + //const files = await listAllFilesAndDirs(directoryHandle); + })); }); }); From 3b7b7dccae2561a8d39fe8339d15d46b23970200 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 15:43:11 +0000 Subject: [PATCH 06/23] . --- rapids/templates/rapids/rapid_form.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 81bf8290..05608a33 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -280,7 +280,7 @@ monitor_interval_id = setInterval(function () { listAllFilesAndDirs(monitor_directory_handler).then((items) => { console.log(items); - files_to_add = Set(); + files_to_add = new Set(); for (var i = 0; i < items.length; i++) { files_to_add.add(items[i].getFile()); } @@ -289,6 +289,9 @@ ! current_files.has(x))); + distinct_set.forEach((file) => { + addFile(file, false); + }); console.log(distinct_set) }); }, 5000); From 19e89d747f046ac3f97a85bc5363489dbeaef8f7 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 15:44:43 +0000 Subject: [PATCH 07/23] . --- rapids/templates/rapids/rapid_form.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 05608a33..5b4f7c24 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -282,7 +282,8 @@ console.log(items); files_to_add = new Set(); for (var i = 0; i < items.length; i++) { - files_to_add.add(items[i].getFile()); + + files_to_add.add(items[i].handle.getFile()); } current_files = getCurrentFiles(); let distinct_set = new Set([...files_to_add].filter(x => From b1739267e9e24018e25d30a132ba944ab2ae6092 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 15:46:27 +0000 Subject: [PATCH 08/23] . --- rapids/templates/rapids/rapid_form.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 5b4f7c24..95f64a32 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -278,12 +278,12 @@ window.showDirectoryPicker().then((handler) => { monitor_directory_handler = handler; monitor_interval_id = setInterval(function () { - listAllFilesAndDirs(monitor_directory_handler).then((items) => { + listAllFilesAndDirs(monitor_directory_handler).then(async function(items) { console.log(items); files_to_add = new Set(); for (var i = 0; i < items.length; i++) { - files_to_add.add(items[i].handle.getFile()); + files_to_add.add(await items[i].handle.getFile()); } current_files = getCurrentFiles(); let distinct_set = new Set([...files_to_add].filter(x => From af81a40033001b6a36b22c784ef711b99dce4028 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 15:48:25 +0000 Subject: [PATCH 09/23] . --- rapids/templates/rapids/rapid_form.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 95f64a32..23f93b7f 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -178,6 +178,7 @@ } function addFile(f, feedback) { + console.log("add file", f) let dT = new DataTransfer(); dT.clearData(); dT.items.add(f); @@ -278,18 +279,22 @@ window.showDirectoryPicker().then((handler) => { monitor_directory_handler = handler; monitor_interval_id = setInterval(function () { - listAllFilesAndDirs(monitor_directory_handler).then(async function(items) { + listAllFilesAndDirs(monitor_directory_handler).then(async function ( + items) { console.log(items); files_to_add = new Set(); for (var i = 0; i < items.length; i++) { - files_to_add.add(await items[i].handle.getFile()); + files_to_add.add(await items[i].handle + .getFile()); } current_files = getCurrentFiles(); - let distinct_set = new Set([...files_to_add].filter(x => + let distinct_set = new Set([...files_to_add].filter( + x => ! current_files.has(x))); + console.log("distinct set", items); distinct_set.forEach((file) => { addFile(file, false); }); From 033403b92762151fad6c72078abec1c0748ae8c5 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 15:50:44 +0000 Subject: [PATCH 10/23] . --- rapids/templates/rapids/rapid_form.html | 1 + 1 file changed, 1 insertion(+) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 23f93b7f..0cf89168 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -295,6 +295,7 @@ current_files.has(x))); console.log("distinct set", items); + extendInputs(distinct_set.length); distinct_set.forEach((file) => { addFile(file, false); }); From 9c762c1caf2d955d618b73f82411b7ac8e66b3b1 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 15:53:18 +0000 Subject: [PATCH 11/23] . --- rapids/templates/rapids/rapid_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 0cf89168..616dae69 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -294,7 +294,7 @@ ! current_files.has(x))); - console.log("distinct set", items); + console.log("distinct set", distinct_set.length, items); extendInputs(distinct_set.length); distinct_set.forEach((file) => { addFile(file, false); From fe47f06a7ce4b79c96abc807c82c32333dfeb5e6 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 15:54:47 +0000 Subject: [PATCH 12/23] . --- rapids/templates/rapids/rapid_form.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 616dae69..a7b09f6b 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -290,9 +290,7 @@ } current_files = getCurrentFiles(); let distinct_set = new Set([...files_to_add].filter( - x => - ! - current_files.has(x))); + x => !current_files.has(x))); console.log("distinct set", distinct_set.length, items); extendInputs(distinct_set.length); From 3018bd91948869ac34139c91adce0605eca279bc Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 15:56:16 +0000 Subject: [PATCH 13/23] . --- rapids/templates/rapids/rapid_form.html | 1 + 1 file changed, 1 insertion(+) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index a7b09f6b..763dfa36 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -289,6 +289,7 @@ .getFile()); } current_files = getCurrentFiles(); + console.log("1", distinct_set, current_files); let distinct_set = new Set([...files_to_add].filter( x => !current_files.has(x))); From fd3747375ad78b1bf077e780bf7835c96fde0539 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 15:56:58 +0000 Subject: [PATCH 14/23] . --- rapids/templates/rapids/rapid_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 763dfa36..79e38657 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -289,7 +289,7 @@ .getFile()); } current_files = getCurrentFiles(); - console.log("1", distinct_set, current_files); + console.log("1", files_to_add, current_files); let distinct_set = new Set([...files_to_add].filter( x => !current_files.has(x))); From 6893d43c46b20ae3126f4e57e97c6c910453d2a4 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 16:00:06 +0000 Subject: [PATCH 15/23] . --- rapids/templates/rapids/rapid_form.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 79e38657..a62177d0 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -84,7 +84,9 @@ for (let j = 0; j < inputs.length; j++) { i = inputs.get(j); console.log(i) - files.add(i.files[0]); + if (i.files.length > 0) { + files.add(i.files[0]); + } console.log(i.files) } return files; @@ -286,14 +288,15 @@ for (var i = 0; i < items.length; i++) { files_to_add.add(await items[i].handle - .getFile()); + .getFile()); } current_files = getCurrentFiles(); console.log("1", files_to_add, current_files); let distinct_set = new Set([...files_to_add].filter( x => !current_files.has(x))); - console.log("distinct set", distinct_set.length, items); + console.log("distinct set", distinct_set.length, + items); extendInputs(distinct_set.length); distinct_set.forEach((file) => { addFile(file, false); From 05c8c3e0d8c9ce2ae8ad10a2cb192163a851ee15 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 16:01:50 +0000 Subject: [PATCH 16/23] . --- rapids/templates/rapids/rapid_form.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index a62177d0..5eeb070c 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -295,9 +295,9 @@ let distinct_set = new Set([...files_to_add].filter( x => !current_files.has(x))); - console.log("distinct set", distinct_set.length, + console.log("distinct set", distinct_set.size, items); - extendInputs(distinct_set.length); + extendInputs(distinct_set.size); distinct_set.forEach((file) => { addFile(file, false); }); From 0b550126466f114e7e3bd6e88db7f79a510ccfe9 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 16:05:23 +0000 Subject: [PATCH 17/23] . --- rapids/templates/rapids/rapid_form.html | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 5eeb070c..a7855d8e 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -53,7 +53,6 @@ } function closePopup(win, newID, newRepr, id) { - console.log(id) $(id + "_to").append('') win.close(); } @@ -83,11 +82,9 @@ let files = new Set(); for (let j = 0; j < inputs.length; j++) { i = inputs.get(j); - console.log(i) if (i.files.length > 0) { files.add(i.files[0]); } - console.log(i.files) } return files; } @@ -101,7 +98,6 @@ // Make sure we have enough input targets input_diff = (n - inputs.length) - console.log("diff", input_diff) if (input_diff > 0) { for (let j = 0; j < input_diff; j++) { @@ -129,19 +125,15 @@ } function input_change(evt) { - console.log("input change", evt) file = evt.target.files[0]; $(evt.target).removeClass("image-ident-warning"); $(evt.target).removeClass("image-ident-ok"); - console.log("input change1", evt); - console.log("input change", evt.target); ocr(evt.target); el = evt.target; - console.log(el); $(el).find(".temp-thumb").remove(); if (el.files.length > 0) { extra_class = " image-ident-loading"; @@ -166,7 +158,6 @@ // Yes we do read the file twice (here and where loading it in the viewer) var reader = new FileReader(); reader.onload = function (file) { - console.log("READ EXAMINIANS", file) var arrayBuffer = reader.result; // Here we have the file data as an ArrayBuffer. dicomParser requires as input a // Uint8Array so we create that here @@ -180,7 +171,6 @@ } function addFile(f, feedback) { - console.log("add file", f) let dT = new DataTransfer(); dT.clearData(); dT.items.add(f); @@ -190,16 +180,13 @@ if (el.files.length == 0) { el.files = dT.files; //ocr(el) - console.log(el); if (feedback) { arr = el.name.split("-"); arr.splice(2, 1, "feedback_image"); feedback_el_name = arr.join("-"); - console.log(feedback_el_name); $(`[name=${feedback_el_name}]`).prop("checked", true); - console.log(`[name=${feedback_el_name}]`); } $(el).change(); @@ -283,7 +270,6 @@ monitor_interval_id = setInterval(function () { listAllFilesAndDirs(monitor_directory_handler).then(async function ( items) { - console.log(items); files_to_add = new Set(); for (var i = 0; i < items.length; i++) { @@ -291,17 +277,13 @@ .getFile()); } current_files = getCurrentFiles(); - console.log("1", files_to_add, current_files); let distinct_set = new Set([...files_to_add].filter( x => !current_files.has(x))); - console.log("distinct set", distinct_set.size, - items); extendInputs(distinct_set.size); distinct_set.forEach((file) => { addFile(file, false); }); - console.log(distinct_set) }); }, 5000); $("#directory-picker-display").text(monitor_directory_handler.name) From fab3dbf7f8bdf10438bc9979f34ad481786624d2 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 16:07:27 +0000 Subject: [PATCH 18/23] . --- rapids/templates/rapids/rapid_form.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index a7855d8e..9e315480 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -280,6 +280,8 @@ let distinct_set = new Set([...files_to_add].filter( x => !current_files.has(x))); + console.log(distinct_set); + extendInputs(distinct_set.size); distinct_set.forEach((file) => { addFile(file, false); From 6821ad8a793981cf9a02516d0fd118ad48154056 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 16:09:37 +0000 Subject: [PATCH 19/23] . --- rapids/templates/rapids/rapid_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 9e315480..db5403c5 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -280,7 +280,7 @@ let distinct_set = new Set([...files_to_add].filter( x => !current_files.has(x))); - console.log(distinct_set); + console.log(files_to_add, current_files, distinct_set); extendInputs(distinct_set.size); distinct_set.forEach((file) => { From 59c169ce2e3ccff93d1c728176c34a0fda8b6825 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 18:35:18 +0000 Subject: [PATCH 20/23] . --- rapids/templates/rapids/rapid_form.html | 28 +++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index db5403c5..218354aa 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -271,16 +271,32 @@ listAllFilesAndDirs(monitor_directory_handler).then(async function ( items) { files_to_add = new Set(); + current_files = getCurrentFiles(); + current_files_tuple = new Set() + for (let elem of current_files) { + current_files_tuple.add([elem.size, elem.name, + elem.lastModified + ]); + } + for (var i = 0; i < items.length; i++) { - files_to_add.add(await items[i].handle - .getFile()); + f = await items[i].handle.getFile() + if (!current_files_tuple.has([f.size, f.name, f + .lastModified + ])) { + files_to_add.add(f); + } } - current_files = getCurrentFiles(); - let distinct_set = new Set([...files_to_add].filter( - x => !current_files.has(x))); - console.log(files_to_add, current_files, distinct_set); + // file objects differ enough that the following does not work + //let distinct_set = new Set([...files_to_add].filter( + // x => !current_files.has(x))); + + + + console.log(files_to_add, current_files, + distinct_set); extendInputs(distinct_set.size); distinct_set.forEach((file) => { From dca8ab057a64e2fc6aa2b4addc17ad144cab3054 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 18:35:56 +0000 Subject: [PATCH 21/23] . --- rapids/templates/rapids/rapid_form.html | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 218354aa..513380ba 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -294,12 +294,8 @@ // x => !current_files.has(x))); - - console.log(files_to_add, current_files, - distinct_set); - - extendInputs(distinct_set.size); - distinct_set.forEach((file) => { + extendInputs(files_to_add.size); + files_to_add.forEach((file) => { addFile(file, false); }); }); From 8f16893ff757112c8dddeb2e480deb448227444e Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 18:37:38 +0000 Subject: [PATCH 22/23] . --- rapids/templates/rapids/rapid_form.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 513380ba..0f7e0aa8 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -279,9 +279,11 @@ ]); } + console.log(current_files_tuple) for (var i = 0; i < items.length; i++) { f = await items[i].handle.getFile() + console.log("f", f) if (!current_files_tuple.has([f.size, f.name, f .lastModified ])) { From 3298192817cd828d981a37675d72f9a7358057ed Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 6 Nov 2021 18:48:12 +0000 Subject: [PATCH 23/23] . --- rapids/templates/rapids/rapid_form.html | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 0f7e0aa8..b9993620 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -274,9 +274,9 @@ current_files = getCurrentFiles(); current_files_tuple = new Set() for (let elem of current_files) { - current_files_tuple.add([elem.size, elem.name, - elem.lastModified - ]); + current_files_tuple.add( + `${elem.size}, ${elem.name}, ${elem.lastModified}` + ); } console.log(current_files_tuple) @@ -284,9 +284,9 @@ f = await items[i].handle.getFile() console.log("f", f) - if (!current_files_tuple.has([f.size, f.name, f - .lastModified - ])) { + if (!current_files_tuple.has( + `${f.size}, ${f.name}, ${f.lastModified}` + )) { files_to_add.add(f); } } @@ -471,7 +471,6 @@ image.title = file.name; image.src = reader.result; image.className = "temp-thumb"; - console.log("read", reader, el); $(el).parent().parent().find(".temp-thumb").remove(); $(el).parent().parent().prepend(image); //images.push(reader.result); @@ -491,7 +490,6 @@ file_set.each(async (n, el) => { - console.log(el); if (el.files.length > 0) { filename = el.files[0].name; // Probably no need to await here anymore