Commit 01dca38e authored by Patrick's avatar Patrick
Browse files

update next button

parent eda8a3ba
...@@ -178,24 +178,50 @@ a:hover { ...@@ -178,24 +178,50 @@ a:hover {
} }
.previous { .previous {
background-color: #f1f1f1; background-color: #cccccc;
color: black; color: #0f0f0f;
margin-left:40%; margin-left:40%;
cursor: pointer; cursor: pointer;
border-radius: .2rem; border-radius: .2rem;
border: none;
border: 0px;
width: 6em;
height: 2em;
} }
.previous:disabled,
.previous[disabled]{
cursor: not-allowed;
background-color: #f1f1f1;
color: #666666;
}
.next:disabled,
.next[disabled]{
background-color: #0069d970;
color: #666666;
cursor: not-allowed;
}
#papercount{ #papercount{
text-align: center; text-align: center;
} }
.next { .next {
background-color: #2196f3 !important; /* background-color: #2196f3 !important; */
color: white; color: white;
cursor: pointer; cursor: pointer;
border-radius: .2rem; border-radius: .2rem;
color: #fff;
border: none;
border: 0px;
background-color: #0069d9;
width: 6em;
height: 2em;
} }
.next:hover{ .next:hover{
background-color: #007bff !important; background-color: #005bbd !important;
border: none;
border: 0px;
} }
.round { .round {
......
...@@ -265,8 +265,10 @@ ...@@ -265,8 +265,10 @@
</div> </div>
</div> </div>
<div class="container" style="margin-top:1em;"><p id="papercount">1 - 6 (45)</p><a onclick="pagecountback()" id="previousbutton" class="previous">&laquo; Previous</a> <div id="nextblock" class="container" style="margin-top:1em;"><p id="papercount">1 - 6 (45)</p>
<a onclick="pagecount()" id="nextbutton" class="next">Next &raquo;</a></div> <button onclick="pagecountback()" id="previousbutton" class="previous" type="button" disabled>&laquo; Previous</button>
<!-- <a onclick="pagecountback()" id="previousbutton" class="previous"> Previous</a> -->
<button onclick="pagecount()" id="nextbutton" class="next" type="button">Next &raquo;</button></div>
<hr> <hr>
<div class="container"> <div class="container">
......
...@@ -177,7 +177,7 @@ load_excel_citation(function () { ...@@ -177,7 +177,7 @@ load_excel_citation(function () {
var arrayLength = stuff_paper.length; var arrayLength = stuff_paper.length;
for (var i = 0; i < arrayLength; i++) { for (var i = 0; i < arrayLength; i++) {
if (Math.abs(arrayLength - i) <= max_paper_list) { if (i < max_paper_list && i <= arrayLength) {
addpaper(stuff_paper[i]); addpaper(stuff_paper[i]);
} }
//Do something //Do something
......
...@@ -8,7 +8,7 @@ nextpage() ...@@ -8,7 +8,7 @@ nextpage()
function pagecountback(){ function pagecountback(){
pagenumb = pagenumb - (max_paper_list) pagenumb = pagenumb - (max_paper_list)
if (pagenumb <= 0){ if (pagenumb <= 0){
pagenumb = -1 pagenumb = 0
} }
nextpage() nextpage()
} }
...@@ -25,15 +25,15 @@ var nextpage = function() { ...@@ -25,15 +25,15 @@ var nextpage = function() {
// //Do something // //Do something
// } // }
// }); // });
document.getElementById("previousbutton").disabled = false;
document.getElementById("nextbutton").disabled = false;
// get paper from the Sabo result // get paper from the Sabo result
stuff_paper = jsonContent; stuff_paper = jsonContent;
var new_row = document.getElementById("cont_paper") var new_row = document.getElementById("cont_paper")
new_row.innerHTML = ""; new_row.innerHTML = "";
var arrayLength = stuff_paper.length; var arrayLength = stuff_paper.length;
for (var i = 0; i < arrayLength; i++) { for (var i = 0; i < arrayLength; i++) {
if (i > pagenumb && i <= (pagenumb + max_paper_list) && i<= arrayLength){ if (i >= pagenumb && i < (pagenumb + max_paper_list) && i<= arrayLength){
// if (Math.abs(arrayLength - i) <= (max_paper_list)) { // if (Math.abs(arrayLength - i) <= (max_paper_list)) {
console.log("close to " + i) console.log("close to " + i)
addpaper(stuff_paper[i]); addpaper(stuff_paper[i]);
...@@ -41,11 +41,13 @@ var nextpage = function() { ...@@ -41,11 +41,13 @@ var nextpage = function() {
var endnumb = startnumb + max_paper_list var endnumb = startnumb + max_paper_list
if (pagenumb <= 0){ if (pagenumb <= 0){
startnumb = 0 startnumb = 0
document.getElementById("previousbutton").disabled = true;
} }
startnumb += 1 startnumb += 1
endnumb += 1 endnumb += 1
if (endnumb >= stuff_paper.length){ if (endnumb >= stuff_paper.length){
endnumb = stuff_paper.length endnumb = stuff_paper.length
document.getElementById("nextbutton").disabled = true;
} }
document.getElementById("papercount").innerHTML = startnumb + " - " + endnumb + " (" + stuff_paper.length + ")"; document.getElementById("papercount").innerHTML = startnumb + " - " + endnumb + " (" + stuff_paper.length + ")";
// } // }
......
...@@ -36,7 +36,7 @@ function search() { ...@@ -36,7 +36,7 @@ function search() {
function search_paper() { function search_paper() {
const fuse = new Fuse(stuff_paper, options_paper); const fuse = new Fuse(stuff_paper, options_paper);
searchanswer_paper = fuse.search(document.getElementById("search-input_paper").value) searchanswer_paper = fuse.search(document.getElementById("search-input_paper").value)
document.getElementById("nextblock").style.display = "none";
var new_row = document.getElementById("cont_paper") var new_row = document.getElementById("cont_paper")
new_row.innerHTML = ""; new_row.innerHTML = "";
var searchLength = searchanswer_paper.length; var searchLength = searchanswer_paper.length;
...@@ -158,7 +158,8 @@ function searchToggle_paper(obj, evt) { ...@@ -158,7 +158,8 @@ function searchToggle_paper(obj, evt) {
new_row.innerHTML = ""; new_row.innerHTML = "";
var arrayLength = stuff_paper.length; var arrayLength = stuff_paper.length;
for (var i = 0; i < arrayLength; i++) { for (var i = 0; i < arrayLength; i++) {
if (Math.abs(arrayLength - i) <= 2) { document.getElementById("nextblock").style.display = "block";
if (i <= max_paper_list) {
addpaper(stuff_paper[i]); addpaper(stuff_paper[i]);
} }
......
...@@ -16,7 +16,7 @@ Website for Geoinformatic Research Group (Prof. Coors) ...@@ -16,7 +16,7 @@ Website for Geoinformatic Research Group (Prof. Coors)
### Tasks for Patrick: ### 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) - [ ] 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) - [x] 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)
- [x] 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..) - [ ] Currently, the "public\js\language.js" only translate some part of the webpage.(later..)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment