commit c7eb5d0f5a13abffec1ba5bd7f558ae5bf7ef4dd
Author: stepanekp <1stepanekpetr@gmail.com>
Date:   Mon Mar 14 13:16:38 2022 +0100

    CSS and JS moved to separate files

diff --git a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/spring/AppConfig.java b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/spring/AppConfig.java
index 0ff122b..5704fc9 100644
--- a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/spring/AppConfig.java
+++ b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/spring/AppConfig.java
@@ -48,4 +48,9 @@ public class AppConfig implements WebMvcConfigurer {
         viewResolver.setTemplateEngine(templateEngine());
         return viewResolver;
     }
+
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+        registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
+    }
 }
diff --git a/src/main/webapp/WEB-INF/templates/about.html b/src/main/webapp/WEB-INF/templates/about.html
index 0ab7e86..cb51087 100644
--- a/src/main/webapp/WEB-INF/templates/about.html
+++ b/src/main/webapp/WEB-INF/templates/about.html
@@ -4,6 +4,7 @@
     <title>Anti Pattern Detector - About</title>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
     <meta name="viewport" content="width=device-width, initial-scale=1">
+    <link rel="stylesheet" th:href="@{/resources/css/style.css}">
     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
diff --git a/src/main/webapp/WEB-INF/templates/anti-pattern.html b/src/main/webapp/WEB-INF/templates/anti-pattern.html
index 9c5d6c7..09959e0 100644
--- a/src/main/webapp/WEB-INF/templates/anti-pattern.html
+++ b/src/main/webapp/WEB-INF/templates/anti-pattern.html
@@ -5,22 +5,11 @@
     <title>Anti Pattern Detector - Anti Pattern details</title>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
     <meta name="viewport" content="width=device-width, initial-scale=1">
+    <link rel="stylesheet" th:href="@{/resources/css/style.css}">
     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
-
-    <style>
-        .card {
-            margin-top: 40px;
-            margin-left: 5%;
-            margin-right: 5%;
-        }
-
-        .container {
-            margin-top: 20px;
-        }
-    </style>
 </head>
 <body>
 <!-- Navigation bar imported -->
@@ -103,8 +92,8 @@
                        class="form-text text-danger"></small>
 
             </div>
-            <div class="analyze-button-container">
-                <button type="submit" class="btn btn-primary btn-lg btn-block">Save configuration</button>
+            <div class="save-configuration-button-container">
+                <button type="submit" class="btn btn-primary custom-button">Save configuration</button>
             </div>
             <!-- ./Anti pattern configuration form -->
         </form>
diff --git a/src/main/webapp/WEB-INF/templates/configuration.html b/src/main/webapp/WEB-INF/templates/configuration.html
index 73d5203..e6343d6 100644
--- a/src/main/webapp/WEB-INF/templates/configuration.html
+++ b/src/main/webapp/WEB-INF/templates/configuration.html
@@ -4,35 +4,11 @@
     <title>Anti Pattern Detector - Configuration</title>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
     <meta name="viewport" content="width=device-width, initial-scale=1">
+    <link rel="stylesheet" th:href="@{/resources/css/style.css}">
     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
-
-    <style>
-        .analyze-button-container {
-            margin: 20px 40% 40px;
-        }
-
-        .container {
-            margin-top: 20px;
-        }
-
-        #wrapper {
-            width: 800px;
-            overflow: hidden;
-        }
-
-        #first {
-            width: 500px;
-            float: left;
-        }
-
-        #second {
-            overflow: hidden;
-        }
-    </style>
-
 </head>
 <body>
 <!-- Navigation bar imported -->
@@ -119,13 +95,7 @@
 
 
 <!-- Scripts -->
-<script>
-    // script to popover
-    $(document).ready(function () {
-        $('[data-toggle="popover"]').popover();
-    });
-
-</script>
+<script th:src="@{/resources/js/core.js}"></script>
 <!-- ./Scripts -->
 
 </body>
diff --git a/src/main/webapp/WEB-INF/templates/index.html b/src/main/webapp/WEB-INF/templates/index.html
index 6b80a4f..a4b6db8 100644
--- a/src/main/webapp/WEB-INF/templates/index.html
+++ b/src/main/webapp/WEB-INF/templates/index.html
@@ -4,45 +4,12 @@
     <title>Anti Pattern Detector</title>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
     <meta name="viewport" content="width=device-width, initial-scale=1">
+    <link rel="stylesheet" th:href="@{/resources/css/style.css}">
     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
-
-    <style>
-        tbody tr:hover {
-            background-color: #F8F9FA;
-        }
-
-        .analyze-button-container {
-            margin: 20px 40% 40px;
-        }
-    </style>
-
-    <script>
-        function checkAllProjects(checkBox) {
-            var projects = document.querySelectorAll('*[id^="project_"]');
-            var i;
-            for (i = 0; i < projects.length; i++) {
-                projects[i].checked = !!checkBox.checked;
-            }
-        }
-
-        function checkAllAntiPatterns(checkBox) {
-            var antiPatterns = document.querySelectorAll('*[id^="anti-pattern"]');
-            var i;
-            for (i = 0; i < antiPatterns.length; i++) {
-                antiPatterns[i].checked = !!checkBox.checked;
-            }
-        }
-
-        function showProgressBar() {
-            $('#progressBar').css('display', '');
-            var analyzeButton = $('#analyzeButton');
-            analyzeButton.addClass('disabled');
-            analyzeButton.text('Analyzing...');
-        }
-    </script>
+    <script th:src="@{/resources/js/core.js}"></script>
 </head>
 <body>
 <!-- Navigation bar imported -->
diff --git a/src/main/webapp/WEB-INF/templates/project.html b/src/main/webapp/WEB-INF/templates/project.html
index 1607688..3003988 100644
--- a/src/main/webapp/WEB-INF/templates/project.html
+++ b/src/main/webapp/WEB-INF/templates/project.html
@@ -5,19 +5,11 @@
     <title>Anti Pattern Detector - Project details</title>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
     <meta name="viewport" content="width=device-width, initial-scale=1">
+    <link rel="stylesheet" th:href="@{/resources/css/style.css}">
     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
-
-    <style>
-        .card {
-            margin-top: 40px;
-            margin-left: 5%;
-            margin-right: 5%;
-
-        }
-    </style>
 </head>
 <body>
 <!-- Navigation bar imported -->
diff --git a/src/main/webapp/WEB-INF/templates/result.html b/src/main/webapp/WEB-INF/templates/result.html
index ad94bff..3e997eb 100644
--- a/src/main/webapp/WEB-INF/templates/result.html
+++ b/src/main/webapp/WEB-INF/templates/result.html
@@ -4,33 +4,11 @@
     <title>Anti Pattern Detector - Results</title>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
     <meta name="viewport" content="width=device-width, initial-scale=1">
+    <link rel="stylesheet" th:href="@{/resources/css/style.css}">
     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
-
-    <style>
-        .not-found-bg {
-            background-color: #D4EDDA;
-        }
-
-        .found-bg {
-            background-color: #F8D7DA;
-        }
-
-        .icon-style {
-            border-radius: 30px;
-        }
-
-        input, button, submit {
-            border: none;
-        }
-
-        .container {
-            margin-top: 20px;
-        }
-    </style>
-
 </head>
 <body>
 <!-- Navigation bar imported -->
@@ -138,32 +116,8 @@
 <!-- ./Result table container -->
 
 <!-- Scripts -->
-<script>
-    // script to popover
-    $(document).ready(function () {
-        $('[data-toggle="popover"]').popover();
-    });
-
-    // this code handling back browser button to result page
-    window.onload = function () {
-        if (typeof history.pushState === "function") {
-            history.pushState("jibberish", null, null);
-            window.onpopstate = function () {
-                history.pushState('newjibberish', null, null);
-            };
-        } else {
-            var ignoreHashChange = true;
-            window.onhashchange = function () {
-                if (!ignoreHashChange) {
-                    ignoreHashChange = true;
-                    window.location.hash = Math.random();
-                } else {
-                    ignoreHashChange = false;
-                }
-            };
-        }
-    }
-</script>
+<script th:src="@{/resources/js/core.js}"></script>
+<script th:src="@{/resources/js/result.js}"></script>
 <!-- ./Scripts -->
 
 </body>
diff --git a/src/main/webapp/resources/css/style.css b/src/main/webapp/resources/css/style.css
new file mode 100644
index 0000000..c069595
--- /dev/null
+++ b/src/main/webapp/resources/css/style.css
@@ -0,0 +1,72 @@
+
+.container {
+    margin-top: 20px;
+}
+
+/* ==========================================================================
+   index.html
+   ========================================================================== */
+
+tbody tr:hover {
+    background-color: #F8F9FA;
+}
+
+.analyze-button-container {
+    margin: 20px 40% 40px;
+}
+
+/* ==========================================================================
+   project.html & anti-pattern.html
+   ========================================================================== */
+
+.card {
+    margin-top: 40px;
+    margin-left: 5%;
+    margin-right: 5%;
+}
+
+/* ==========================================================================
+   anti-pattern.html
+   ========================================================================== */
+
+.custom-button{
+    width: 160px !important;
+}
+
+/* ==========================================================================
+   result.html
+   ========================================================================== */
+
+.not-found-bg {
+    background-color: #D4EDDA;
+}
+
+.found-bg {
+    background-color: #F8D7DA;
+}
+
+.icon-style {
+    border-radius: 30px;
+}
+
+input, button, submit {
+    border: none;
+}
+
+/* ==========================================================================
+   configuration.html
+   ========================================================================== */
+
+#wrapper {
+    width: 800px;
+    overflow: hidden;
+}
+
+#first {
+    width: 500px;
+    float: left;
+}
+
+#second {
+    overflow: hidden;
+}
\ No newline at end of file
diff --git a/src/main/webapp/resources/js/core.js b/src/main/webapp/resources/js/core.js
new file mode 100644
index 0000000..d735247
--- /dev/null
+++ b/src/main/webapp/resources/js/core.js
@@ -0,0 +1,28 @@
+// script to popover
+$(document).ready(function () {
+    $('[data-toggle="popover"]').popover();
+});
+
+// functions used in index page
+function checkAllProjects(checkBox) {
+    var projects = document.querySelectorAll('*[id^="project_"]');
+    var i;
+    for (i = 0; i < projects.length; i++) {
+        projects[i].checked = !!checkBox.checked;
+    }
+}
+
+function checkAllAntiPatterns(checkBox) {
+    var antiPatterns = document.querySelectorAll('*[id^="anti-pattern"]');
+    var i;
+    for (i = 0; i < antiPatterns.length; i++) {
+        antiPatterns[i].checked = !!checkBox.checked;
+    }
+}
+
+function showProgressBar() {
+    $('#progressBar').css('display', '');
+    var analyzeButton = $('#analyzeButton');
+    analyzeButton.addClass('disabled');
+    analyzeButton.text('Analyzing...');
+}
\ No newline at end of file
diff --git a/src/main/webapp/resources/js/result.js b/src/main/webapp/resources/js/result.js
new file mode 100644
index 0000000..670526a
--- /dev/null
+++ b/src/main/webapp/resources/js/result.js
@@ -0,0 +1,19 @@
+// this code handling back browser button to result page
+window.onload = function () {
+    if (typeof history.pushState === "function") {
+        history.pushState("jibberish", null, null);
+        window.onpopstate = function () {
+            history.pushState('newjibberish', null, null);
+        };
+    } else {
+        var ignoreHashChange = true;
+        window.onhashchange = function () {
+            if (!ignoreHashChange) {
+                ignoreHashChange = true;
+                window.location.hash = Math.random();
+            } else {
+                ignoreHashChange = false;
+            }
+        };
+    }
+}
\ No newline at end of file
