From 7d7bbbe714a58895e6c8cb46be0da745fa5ab7c3 Mon Sep 17 00:00:00 2001 From: Julian Ophals Date: Wed, 26 Mar 2025 11:26:54 -0700 Subject: [PATCH 1/3] [story/CITE-231] added loading animation upon upload success --- .../webapp/WEB-INF/views/auth/group/item.html | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/citesphere/src/main/webapp/WEB-INF/views/auth/group/item.html b/citesphere/src/main/webapp/WEB-INF/views/auth/group/item.html index e55bf9880..fbf0e235b 100644 --- a/citesphere/src/main/webapp/WEB-INF/views/auth/group/item.html +++ b/citesphere/src/main/webapp/WEB-INF/views/auth/group/item.html @@ -110,7 +110,10 @@ data: formData, success: function(data) { document.getElementById('uploadFileInput').value = ''; - $("#uploadFileModal").modal('hide'); + showSuccessLoader(); + setTimeout(function(){ + $("#uploadFileModal").modal('hide'); + }, 2000); } }); @@ -284,6 +287,27 @@ }); } + function showSuccessLoader() { + const loader = document.createElement('div'); + loader.classList.add('loader'); + + loader.style.border = '6px solid #f3f3f3'; + loader.style.borderTop = '6px solid #3498db'; + loader.style.borderRadius = '50%'; + loader.style.width = '30px'; + loader.style.height = '30px'; + loader.style.animation = 'spin 2s linear infinite'; + loader.style.display = 'inline-block'; + + const message = document.createElement('p'); + message.textContent = 'upload started...'; + message.style.display = 'inline-block'; + + const uploadFileBody = document.getElementById('uploadFileBody'); + uploadFileBody.append(loader); + uploadFileBody.append(message); + } + @@ -640,9 +664,9 @@ -