Commit d795d9f3 authored by Joe TS Dell's avatar Joe TS Dell
Browse files

update

parent 89b9dc1a
Pipeline #3150 passed with stage
in 24 seconds
...@@ -634,11 +634,8 @@ ...@@ -634,11 +634,8 @@
"lastName": "Coors" "lastName": "Coors"
} }
], ],
"journal": {}, "journal": {}
"keywords": [
"..."
]
}, },
"links": {} "links": {}
}, },
......
function addpaper(item){ function addpaper(item) {
var new_row = document.getElementById("cont_paper") var new_row = document.getElementById("cont_paper")
if(item === undefined) { if (item === undefined) {
}else{ } else {
var authors = ""; var authors = "";
for (var i = 0; i < item.item.authors.length; i++) { for (var i = 0; i < item.item.authors.length; i++) {
console.log(i); console.log(i);
authors += item.item.authors[i].lastName + ", " + item.item.authors[i].firstName.substring(0,1) + "., " authors += item.item.authors[i].lastName + ", " + item.item.authors[i].firstName.substring(0, 1) + "., "
//Do something //Do something
} }
var keywords = ""; var keywords = "";
// check if there is keywords in item
if ("keywords" in item.item) {
for (var i = 0; i < item.item.keywords.length; i++) { for (var i = 0; i < item.item.keywords.length; i++) {
console.log(i); console.log(i);
keywords += '<span class="badge badge-pill badge-light">'+ item.item.keywords[i] +'</span>' keywords += '<span class="badge badge-pill badge-light">' + item.item.keywords[i] + '</span>'
//Do something //Do something
} }
}
authors = authors.substring(0, authors.length - 2); authors = authors.substring(0, authors.length - 2);
// Prepare YouTube Link // Prepare YouTube Link
// var array_contains_youtube = true // var array_contains_youtube = true
...@@ -27,12 +31,12 @@ function addpaper(item){ ...@@ -27,12 +31,12 @@ function addpaper(item){
} }
// Do Authors and Keywords // Do Authors and Keywords
var doi var doi
if ('journal' in item.item){ if ('journal' in item.item) {
doi = '<small class="text-muted"> ' + item.item.journal.name + ',' + doi = '<small class="text-muted"> ' + item.item.journal.name + ',' +
item.item.journal.volume + ', ' + item.item.journal.pages + ', '+ item.item.DOI item.item.journal.volume + ', ' + item.item.journal.pages + ', ' + item.item.DOI
} }
if ('conference' in item.item){ if ('conference' in item.item) {
doi = '<small class="text-muted"> ' + item.item.conference.name + ',' + item.item.conference.date + ', '+ item.item.DOI doi = '<small class="text-muted"> ' + item.item.conference.name + ',' + item.item.conference.date + ', ' + item.item.DOI
} }
// Prepare Explore Link // Prepare Explore Link
...@@ -47,11 +51,11 @@ function addpaper(item){ ...@@ -47,11 +51,11 @@ function addpaper(item){
'<div class="row">' + '<div class="row">' +
'<div class="col-md-3">' + '<div class="col-md-3">' +
'<img src="' + item.item.imageLink + '" alt="..." style="width:100%">' + '<img src="' + item.item.imageLink + '" alt="..." style="width:100%">' +
'</div>'+ '</div>' +
'<div class="col-md-9">' + '<div class="col-md-9">' +
'<div class="card-body">' + '<div class="card-body">' +
'<h5 class="card-title" style="margin-bottom:0px">' + '<h5 class="card-title" style="margin-bottom:0px">' +
'<small>'+ authors +'</small>' + '<small>' + authors + '</small>' +
'<br>' + '<br>' +
item.item.title + item.item.title +
'<br>' + '<br>' +
...@@ -80,4 +84,3 @@ function addpaper(item){ ...@@ -80,4 +84,3 @@ function addpaper(item){
} }
} }
\ No newline at end of file
...@@ -77,10 +77,11 @@ $(document).ready(function(){ ...@@ -77,10 +77,11 @@ $(document).ready(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) <= 2){ // if(Math.abs(arrayLength - i) <= 2){
console.log("close to " + i) // console.log("close to " + i)
// addpaper(stuff_paper[i]);
// }
addpaper(stuff_paper[i]); addpaper(stuff_paper[i]);
}
//Do something //Do something
} }
......
Supports Markdown
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