commit 0486d642f1167a8d63975e4ac2ac42df1fe4ae85
Author: cagy <ml.cagy@seznam.cz>
Date:   Wed Aug 12 16:36:52 2020 +0200

    re #8155 - added spinner after press button to table generation

diff --git a/src/main/webapp/WEB-INF/templates/assembly.html b/src/main/webapp/WEB-INF/templates/assembly.html
index a096e04a..2c285353 100644
--- a/src/main/webapp/WEB-INF/templates/assembly.html
+++ b/src/main/webapp/WEB-INF/templates/assembly.html
@@ -200,9 +200,9 @@
                     </div>
 
                     <div class="buttons-wrap">
-                        <button type="submit" class="btn btn-secondary mb-2 " name="generateTable">Vygenerovat tabulku</button>
-                        <button type="submit" class="btn btn-secondary mb-2 " name="exportXls">Export do XLS</button>
-                        <button type="submit" class="btn btn-secondary mb-2 " name="exportPdf">Export do PDF</button>
+                        <button type="submit" class="btn btn-secondary mb-2 show-spinner" name="generateTable">Vygenerovat tabulku</button>
+                        <button type="submit" class="btn btn-secondary mb-2 show-spinner" name="exportXls">Export do XLS</button>
+                        <button type="submit" class="btn btn-secondary mb-2 show-spinner" name="exportPdf">Export do PDF</button>
                     </div>
                 </div>
             </div>
diff --git a/src/main/webapp/WEB-INF/templates/layouts/layout.html b/src/main/webapp/WEB-INF/templates/layouts/layout.html
index 0a32ef05..d5148c1d 100644
--- a/src/main/webapp/WEB-INF/templates/layouts/layout.html
+++ b/src/main/webapp/WEB-INF/templates/layouts/layout.html
@@ -28,7 +28,12 @@
 
     </head>
     <body>
-        <div th:if="${!#strings.isEmpty(errorText)}" >
+    <div id="spinner-overlay">
+        <div class="loader"></div>
+    </div>
+
+
+    <div th:if="${!#strings.isEmpty(errorText)}" >
             <div class="alert alert-danger">
                 <span th:text="${errorText}"></span>
             </div>
diff --git a/src/main/webapp/css/style.css b/src/main/webapp/css/style.css
index dd48c05a..a4cca94c 100644
--- a/src/main/webapp/css/style.css
+++ b/src/main/webapp/css/style.css
@@ -331,4 +331,87 @@ table .col-3-p { width:10%; }
 
 .exported-table {
   overflow: auto;
+}
+
+#spinner-overlay{
+  position:fixed;
+  width:100%;
+  height:100%;
+  top:0px;
+  left:0px;
+  background: rgba(0,0,0,0.5);
+  z-index: 9999;
+  display: none;
+}
+
+.loader {
+  color: #ffffff;
+  font-size: 20px;
+  top: 50%;
+  left: 50%;
+  margin: -15px 0 0 -15px;
+  width: 30px;
+  height: 30px;
+  border-radius: 50%;
+  position: absolute;
+  text-indent: -9999em;
+  -webkit-animation: load4 1.3s infinite linear;
+  animation: load4 1.3s infinite linear;
+  -webkit-transform: translateZ(0);
+  -ms-transform: translateZ(0);
+  transform: translateZ(0);
+}
+@-webkit-keyframes load4 {
+  0%,
+  100% {
+    box-shadow: 0 -3em 0 0.2em, 2em -2em 0 0em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 0;
+  }
+  12.5% {
+    box-shadow: 0 -3em 0 0, 2em -2em 0 0.2em, 3em 0 0 0, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em;
+  }
+  25% {
+    box-shadow: 0 -3em 0 -0.5em, 2em -2em 0 0, 3em 0 0 0.2em, 2em 2em 0 0, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em;
+  }
+  37.5% {
+    box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 0, 2em 2em 0 0.2em, 0 3em 0 0em, -2em 2em 0 -1em, -3em 0em 0 -1em, -2em -2em 0 -1em;
+  }
+  50% {
+    box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 0em, 0 3em 0 0.2em, -2em 2em 0 0, -3em 0em 0 -1em, -2em -2em 0 -1em;
+  }
+  62.5% {
+    box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 0, -2em 2em 0 0.2em, -3em 0 0 0, -2em -2em 0 -1em;
+  }
+  75% {
+    box-shadow: 0em -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0.2em, -2em -2em 0 0;
+  }
+  87.5% {
+    box-shadow: 0em -3em 0 0, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0, -2em -2em 0 0.2em;
+  }
+}
+@keyframes load4 {
+  0%,
+  100% {
+    box-shadow: 0 -3em 0 0.2em, 2em -2em 0 0em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 0;
+  }
+  12.5% {
+    box-shadow: 0 -3em 0 0, 2em -2em 0 0.2em, 3em 0 0 0, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em;
+  }
+  25% {
+    box-shadow: 0 -3em 0 -0.5em, 2em -2em 0 0, 3em 0 0 0.2em, 2em 2em 0 0, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em;
+  }
+  37.5% {
+    box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 0, 2em 2em 0 0.2em, 0 3em 0 0em, -2em 2em 0 -1em, -3em 0em 0 -1em, -2em -2em 0 -1em;
+  }
+  50% {
+    box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 0em, 0 3em 0 0.2em, -2em 2em 0 0, -3em 0em 0 -1em, -2em -2em 0 -1em;
+  }
+  62.5% {
+    box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 0, -2em 2em 0 0.2em, -3em 0 0 0, -2em -2em 0 -1em;
+  }
+  75% {
+    box-shadow: 0em -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0.2em, -2em -2em 0 0;
+  }
+  87.5% {
+    box-shadow: 0em -3em 0 0, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0, -2em -2em 0 0.2em;
+  }
 }
\ No newline at end of file
diff --git a/src/main/webapp/js/assemblyScripts.js b/src/main/webapp/js/assemblyScripts.js
index de886ec8..8f530b77 100644
--- a/src/main/webapp/js/assemblyScripts.js
+++ b/src/main/webapp/js/assemblyScripts.js
@@ -36,6 +36,8 @@ $(document).ready(function() {
     // init actions
     initParameters();
 
+    initSpinnerToButtons();
+
 });
 
 /**
@@ -251,4 +253,27 @@ function checkIfConfigurationNameIsNull() {
     if (configurationName.value == null || configurationName.value == "") {
         alert("Není vyplněn název šablony !");
     }
+}
+
+/**
+ * Set up listener to export buttons to show spinner
+ */
+function initSpinnerToButtons() {
+    hideSpinner();
+
+    document.querySelectorAll('.show-spinner').forEach(button => {
+        button.addEventListener('click', showSpinner);
+    })
+}
+
+function showSpinner() {
+    let spinner = document.getElementById('spinner-overlay');
+
+    spinner.style.display = 'block';
+}
+
+function hideSpinner() {
+    let spinner = document.getElementById('spinner-overlay');
+
+    spinner.style.display = 'none';
 }
\ No newline at end of file
