paper_nextpage.js 1.14 KB
Newer Older
Patrick's avatar
Patrick committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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)
}