diff --git a/public/index.html b/public/index.html index e8495d0f6d44468e97d6a268f6d9c4e0b1f3692f..7953f03fe353916a656d94423d61493bd6c038f3 100644 --- a/public/index.html +++ b/public/index.html @@ -413,7 +413,6 @@ <script src="js/bootstrap.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/0.8.2/css/flag-icon.min.css"> <script src="js/config.js"></script> - <script src="js/citationSheetParse.js"></script> <script src="js/language.js"></script> <script src="js/add_content.js"></script> <script src="js/add_paper.js"></script> @@ -423,6 +422,7 @@ <link rel="stylesheet" href="./css/search.css"> <link rel="stylesheet" href="./css/language.css"> <script src="js/search.js"></script> + <script src="js/citationSheetParse.js"></script> </body> diff --git a/public/js/add_paper.js b/public/js/add_paper.js index 065995f06bcc9a73d4c6a5f02baa7e7ebd6e01e8..0d434e3512e98dcc3671494016924fd9128984bd 100644 --- a/public/js/add_paper.js +++ b/public/js/add_paper.js @@ -7,7 +7,6 @@ function addpaper(item) { var authors = ""; for (var i = 0; i < item.item.authors.length; i++) { - console.log(i); authors += item.item.authors[i].lastName + ", " + item.item.authors[i].firstName.substring(0, 1) + "., " //Do something } @@ -15,7 +14,6 @@ function addpaper(item) { // check if there is keywords in item if (item.item.keywords !== undefined) { for (var i = 0; i < item.item.keywords.length; i++) { - console.log(i); keywords += '<span class="badge badge-pill badge-light">' + item.item.keywords[i] + '</span>' //Do something } diff --git a/public/js/citationSheetParse.js b/public/js/citationSheetParse.js index 28f8b2a07736882e0c88cdb81b8c85912871efcc..5f73cae84f51bb8448cfd04c8744e28b23dfee35 100644 --- a/public/js/citationSheetParse.js +++ b/public/js/citationSheetParse.js @@ -158,13 +158,15 @@ var load_excel_citation = function (cb) { "}}" jsonContent.push(item); - + if (i == jsonOutput.length - 1) { + cb() // callback + } } // console.log(jsonContent); - + } xmlHttpRequest.send(); - cb() // callback + } // get paper from the Sabo result @@ -176,7 +178,6 @@ load_excel_citation(function () { for (var i = 0; i < arrayLength; i++) { if (Math.abs(arrayLength - i) <= max_paper_list) { - console.log("close to " + i) addpaper(stuff_paper[i]); } //Do something diff --git a/public/js/search.js b/public/js/search.js index 6c597e243a48def163d05d10ae73fc5d06d409fd..d4b7575c822cf6155ca1dd082ed0fd32d9b7cb64 100644 --- a/public/js/search.js +++ b/public/js/search.js @@ -159,7 +159,6 @@ function searchToggle_paper(obj, evt) { var arrayLength = stuff_paper.length; for (var i = 0; i < arrayLength; i++) { if (Math.abs(arrayLength - i) <= 2) { - console.log("close to " + i) addpaper(stuff_paper[i]); }