From bea6437645831c60f9a14841daecd9346fbeff9a Mon Sep 17 00:00:00 2001 From: grey Date: Tue, 18 Jun 2024 23:44:39 +0200 Subject: [PATCH 1/3] Added AFLOW-46 (duplicating items) --- static/js/confettiHeader.js | 12 ------------ static/js/editItems.js | 10 ++++++++++ static/js/itemPageHandler.js | 3 +++ 3 files changed, 13 insertions(+), 12 deletions(-) delete mode 100644 static/js/confettiHeader.js diff --git a/static/js/confettiHeader.js b/static/js/confettiHeader.js deleted file mode 100644 index 091f065..0000000 --- a/static/js/confettiHeader.js +++ /dev/null @@ -1,12 +0,0 @@ -function randomInRange(min, max) { - return Math.random() * (max - min) + min; -} - -function doTheConfetti() { - confetti({ - angle: randomInRange(90, 110), - spread: randomInRange(70, 120), - particleCount: randomInRange(100, 200), - origin: { y: 0.6, x: randomInRange(0.4, 0.8) }, - }); -} diff --git a/static/js/editItems.js b/static/js/editItems.js index 61d1e6d..a96141b 100644 --- a/static/js/editItems.js +++ b/static/js/editItems.js @@ -8,6 +8,16 @@ function primeCreateNew() { return true; } +function triggerDuplicationDialog(sourceItemId) { + // Clear the form + $('.form-control').val(''); + const form = document.getElementById('ItemModalForm'); + document.getElementById('itemModifyModalLabel').innerText= "Duplicate an item"; + form.setAttribute('method', 'POST'); + getDataForEdit(sourceItemId); + return true; +} + function primeEdit() { const form = document.getElementById('ItemModalForm'); document.getElementById('itemModifyModalLabel').innerText = 'Edit an item'; diff --git a/static/js/itemPageHandler.js b/static/js/itemPageHandler.js index 7b9d3c6..90fe789 100644 --- a/static/js/itemPageHandler.js +++ b/static/js/itemPageHandler.js @@ -49,6 +49,9 @@ function dataResponseHandler(json) { + ` -- 2.39.5 From 40be3ef91d375ec2bcd611aae8fa1d0bb65805fc Mon Sep 17 00:00:00 2001 From: grey Date: Tue, 18 Jun 2024 23:44:39 +0200 Subject: [PATCH 2/3] Added AFLOW-46 (duplicating items) --- static/js/confettiHeader.js | 12 ------------ static/js/editItems.js | 10 ++++++++++ static/js/itemPageHandler.js | 3 +++ 3 files changed, 13 insertions(+), 12 deletions(-) delete mode 100644 static/js/confettiHeader.js diff --git a/static/js/confettiHeader.js b/static/js/confettiHeader.js deleted file mode 100644 index 091f065..0000000 --- a/static/js/confettiHeader.js +++ /dev/null @@ -1,12 +0,0 @@ -function randomInRange(min, max) { - return Math.random() * (max - min) + min; -} - -function doTheConfetti() { - confetti({ - angle: randomInRange(90, 110), - spread: randomInRange(70, 120), - particleCount: randomInRange(100, 200), - origin: { y: 0.6, x: randomInRange(0.4, 0.8) }, - }); -} diff --git a/static/js/editItems.js b/static/js/editItems.js index 61d1e6d..a96141b 100644 --- a/static/js/editItems.js +++ b/static/js/editItems.js @@ -8,6 +8,16 @@ function primeCreateNew() { return true; } +function triggerDuplicationDialog(sourceItemId) { + // Clear the form + $('.form-control').val(''); + const form = document.getElementById('ItemModalForm'); + document.getElementById('itemModifyModalLabel').innerText= "Duplicate an item"; + form.setAttribute('method', 'POST'); + getDataForEdit(sourceItemId); + return true; +} + function primeEdit() { const form = document.getElementById('ItemModalForm'); document.getElementById('itemModifyModalLabel').innerText = 'Edit an item'; diff --git a/static/js/itemPageHandler.js b/static/js/itemPageHandler.js index 7b9d3c6..90fe789 100644 --- a/static/js/itemPageHandler.js +++ b/static/js/itemPageHandler.js @@ -49,6 +49,9 @@ function dataResponseHandler(json) { + ` -- 2.39.5 From 77448a7401293f718c2675df01ca1140484a73c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Oesterwind?= Date: Wed, 19 Jun 2024 18:32:13 +0200 Subject: [PATCH 3/3] Dateien nach "static/js" hochladen --- static/js/confettiHeader.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 static/js/confettiHeader.js diff --git a/static/js/confettiHeader.js b/static/js/confettiHeader.js new file mode 100644 index 0000000..68a27c1 --- /dev/null +++ b/static/js/confettiHeader.js @@ -0,0 +1,13 @@ +function randomInRange(min, max) { + return Math.random() * (max - min) + min; +} + +function doTheConfetti() { + // Create confetti + confetti({ + angle: randomInRange(90, 110), + spread: randomInRange(70, 120), + particleCount: randomInRange(100, 200), + origin: { y: 0.6, x: randomInRange(0.4, 0.8) }, + }); +} -- 2.39.5