From d47eca706fdf1b877481b20e8ab0e5939451ba4a Mon Sep 17 00:00:00 2001
From: Patrick <patrick.wuerstle@gmx.de>
Date: Tue, 4 May 2021 13:45:45 +0200
Subject: [PATCH] update next function

---
 public/css/main.css         |  9 ++++++-
 public/index.html           |  5 ++--
 public/js/paper_nextpage.js | 47 +++++++++++++++++++++++++++++++++++++
 readme.md                   |  2 +-
 4 files changed, 59 insertions(+), 4 deletions(-)
 create mode 100644 public/js/paper_nextpage.js

diff --git a/public/css/main.css b/public/css/main.css
index 435fcd3..39b3e09 100644
--- a/public/css/main.css
+++ b/public/css/main.css
@@ -181,12 +181,19 @@ a:hover {
   background-color: #f1f1f1;
   color: black;
   margin-left:42%;
+  cursor: pointer;
+  border-radius: .2rem;
   
 }
 
 .next {
-  background-color: #04AA6D;
+  background-color: #2196f3 !important;
   color: white;
+  cursor: pointer;
+  border-radius: .2rem;
+}
+.next:hover{
+  background-color: #007bff !important;
 }
 
 .round {
diff --git a/public/index.html b/public/index.html
index 8c5abed..fa6cfff 100644
--- a/public/index.html
+++ b/public/index.html
@@ -265,8 +265,8 @@
       </div>
       
     </div>
-    <div class="container" style="margin-top:1em;"><a href="#" class="previous">&laquo; Previous</a>
-    <a href="#" class="next">Next &raquo;</a></div>
+    <div class="container" style="margin-top:1em;"><a onclick="pagecountback()" class="previous">&laquo; Previous</a>
+    <a onclick="pagecount()" class="next">Next &raquo;</a></div>
     
     <hr>
     <div class="container">
@@ -424,6 +424,7 @@
   <link rel="stylesheet" href="./css/search.css">
   <link rel="stylesheet" href="./css/language.css">
   <script src="js/search.js"></script>
+  <script src="js/paper_nextpage.js"></script>
 
 </body>
 
diff --git a/public/js/paper_nextpage.js b/public/js/paper_nextpage.js
new file mode 100644
index 0000000..a26010b
--- /dev/null
+++ b/public/js/paper_nextpage.js
@@ -0,0 +1,47 @@
+var pagenumb = 0
+function pagecount(){
+pagenumb = pagenumb + max_paper_list
+nextpage()
+}
+
+
+function pagecountback(){
+pagenumb = pagenumb - (max_paper_list)
+if (pagenumb <= 0){
+    pagenumb = -1
+}
+nextpage()   
+}
+
+
+var nextpage = function() {
+    // $.getJSON("./content/content.json", function (result) {
+    //     stuff = result;
+    //     var new_row = document.getElementById("row_main")
+    //     new_row.innerHTML = "";
+    //     var arrayLength = stuff.length;
+    //     for (var i = 0; i < arrayLength; i++) {
+    //         addcontent(stuff[i]);
+    //         //Do something
+    //     }
+    // });
+
+
+    // get paper from the Sabo result
+    stuff_paper = jsonContent;
+    var new_row = document.getElementById("cont_paper")
+    new_row.innerHTML = "";
+    var arrayLength = stuff_paper.length;
+    for (var i = 0; i < arrayLength; i++) {
+        if (i > pagenumb && i <= (pagenumb + max_paper_list) && i<= arrayLength){
+            // if (Math.abs(arrayLength - i) <= (max_paper_list)) {
+            console.log("close to " + i)
+            addpaper(stuff_paper[i]);
+        // }   
+    }
+
+        //Do something
+    }
+
+    json_to_bib(stuff_paper)
+}
\ No newline at end of file
diff --git a/readme.md b/readme.md
index 0196e9f..6a150bd 100644
--- a/readme.md
+++ b/readme.md
@@ -17,7 +17,7 @@ Website for Geoinformatic Research Group (Prof. Coors)
 ### Tasks for Patrick:
 - [ ] In the current "add_paper.js", all BIBTEX buttons share the same ID and not work yet. I will hide this feature for now and add it back when the BIBTEX is read made. (for later)
 - [ ] Currently, I have set in the public/js/config.js the max number of the paper lists. We have to implement the "show more"/ "Pagination" feature. (Patrick) 
-- [ ] Make sure the Search feature works. (Patrick)
+- [x] Make sure the Search feature works. (Patrick)
 - [ ] Currently, the "public\js\language.js" only translate some part of the webpage.(later..)
 
 ### Tasks for Joe:
-- 
GitLab