Commit 5ac9f1cc authored by Patrick's avatar Patrick
Browse files

Merge branch 'master' of https://transfer.hft-stuttgart.de/gitlab/ugl/website.git

Conflicts:
	public/index.html
	readme.md
parents d47eca70 2f0ba2b5
Pipeline #3404 passed with stage
in 34 seconds
......@@ -407,25 +407,27 @@
<!-- /////////////////////////////////////// -->
<!-- Language selector -->
<!-- full jquery needed -->
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="js/jquery-3.1.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.6.2/js/bootstrap-select.min.js"></script>
<script src="./js/popper.min.js"></script>
<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>
<script src="js/parse_json_to_bib.js"></script>
<!-- search library -->
<script src="https://cdn.jsdelivr.net/npm/fuse.js/dist/fuse.js"></script>
<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>
<script src="js/citationSheetParse.js"></script>
</body>
</html>
......@@ -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
}
......
......@@ -4,16 +4,16 @@
var jsonContent = [];
var bibAuthors = "";
var bit1stAuthorLN ="";
var bit1stAuthorLN = "";
var url = "./content/CitationSheet3.xlsx";
var xmlHttpRequest = new XMLHttpRequest();
/* set up XMLHttpRequest */
var url = "./content/CitationSheet.xlsx";
var xmlHttpRequest = new XMLHttpRequest();
xmlHttpRequest.open("GET", url, true);
xmlHttpRequest.responseType = "arraybuffer";
xmlHttpRequest.onload = function (e) {
var load_excel_citation = function (cb) {
xmlHttpRequest.open("GET", url, true);
xmlHttpRequest.responseType = "arraybuffer";
xmlHttpRequest.onload = function (e) {
var arraybuffer = xmlHttpRequest.response;
// convert data to binary string //
......@@ -33,9 +33,13 @@ xmlHttpRequest.onload = function (e) {
var worksheet = workbook.Sheets[first_sheet_name];
var jsonOutput = XLSX.utils.sheet_to_json(worksheet);
// console.log(jsonOutput);
for (i = 0; i < jsonOutput.length; i++) {
var authors = jsonOutput[i].Authors.replace("and ", "").trim().split(",");
var authors;
if (jsonOutput[i].Authors != undefined) {
authors = jsonOutput[i].Authors.replace("and ", "").trim().split(",");
}
var bibAuthors;
var item = {
"item": {
......@@ -50,19 +54,30 @@ xmlHttpRequest.onload = function (e) {
"year": "",
"pages": ""
},
"DOI": ""
"conference": {
"name": "",
"place": "",
"date": ""
},
"DOI": "",
"publisher": "",
"type": "",
"project": "",
"reviewed": "",
"open": ""
},
"links": {
"pdf": "",
"url": "",
"demo": ""
},
"bibtex" : ""
"bibtex": ""
}
bibAuthors = "";
bit1stAuthorLN ="";
bit1stAuthorLN = "";
for (j = 0; j < authors.length; j++) {
var author = {
"firstName": "",
......@@ -72,17 +87,17 @@ xmlHttpRequest.onload = function (e) {
author["firstName"] = authors[j].trim().split(".")[0];
author["lastName"] = authors[j].trim().split(".")[1];
item["item"].authors.push(author);
bibAuthors+=authors[j].trim().split(".")[1] + ", "+ authors[j].trim().split(".")[0]+ " and ";
bibAuthors += authors[j].trim().split(".")[1] + ", " + authors[j].trim().split(".")[0] + " and ";
} else if (authors[j].trim().split(" ").length == 2) {
author["firstName"] = authors[j].trim().split(" ")[0];
author["lastName"] = authors[j].trim().split(" ")[1];
item["item"].authors.push(author);
bibAuthors+=authors[j].trim().split(" ")[1] + ", "+ authors[j].trim().split(" ")[0]+ " and ";
bibAuthors += authors[j].trim().split(" ")[1] + ", " + authors[j].trim().split(" ")[0] + " and ";
} else if (authors[j].trim().split(" ").length == 3) {
author["firstName"] = authors[j].trim().split(" ")[0];
author["lastName"] = authors[j].trim().split(" ")[2];
item["item"].authors.push(author);
bibAuthors+=authors[j].trim().split(" ")[2] + ", "+ authors[j].trim().split(" ")[0]+ " and ";
bibAuthors += authors[j].trim().split(" ")[2] + ", " + authors[j].trim().split(" ")[0] + " and ";
}
}
......@@ -93,11 +108,11 @@ xmlHttpRequest.onload = function (e) {
item["item"].keywords = jsonOutput[i].Keywords;
}
if (authors[0].split(" ").length == 3 ){
if (authors[0].split(" ").length == 3) {
bit1stAuthorLN = authors[0].split(" ")[2];
} else if (authors[0].split(" ").length == 2 ){
} else if (authors[0].split(" ").length == 2) {
bit1stAuthorLN = authors[0].split(" ")[1];
} else if (authors[0].split(" ").length == 1 ){
} else if (authors[0].split(" ").length == 1) {
bit1stAuthorLN = authors[0].split(" ")[0];
}
......@@ -107,37 +122,64 @@ xmlHttpRequest.onload = function (e) {
item["item"].journal.name = jsonOutput[i].Journal;
item["item"].journal.volume = jsonOutput[i].Volume;
item["item"].journal.year = jsonOutput[i].Year;
item["item"].journal.pages = jsonOutput[i].Pages;
item["item"].conference.name = jsonOutput[i].Conference;
item["item"].conference.place = jsonOutput[i]["City and Country"]
item["item"].conference.date = jsonOutput[i].Date;
item["item"].publisher = jsonOutput[i].Publisher;
item["item"].type = jsonOutput[i]["Type of Work"];
item["item"].project = jsonOutput[i].Project;
item["item"].reviewed = jsonOutput[i]["Peer-Reviewed"];
item["item"].open = jsonOutput[i]["Open Access"];
item["item"].DOI = jsonOutput[i].DOI;
item["links"].pdf = jsonOutput[i].URL;
item["links"].pdf = jsonOutput[i].PDF_Link;
item["links"].url = jsonOutput[i].URL;
item["links"].demo = jsonOutput[i].URL;
item["links"].demo = jsonOutput[i].Demo;
var month = "";
if (jsonOutput[i].Date != undefined) {
month = jsonOutput[i].Date.split(",")[0].trim();
}
//// BibTex /////////////////////
item["bibtex"] = "@article{"+ bit1stAuthorLN + jsonOutput[i].Year +","+
"title={"+ jsonOutput[i].Titel +
"},author={"+ bibAuthors.trim().substring(0, bibAuthors.trim().lastIndexOf(" ")) +
"},journal={"+ jsonOutput[i].Journal +
"},volume={"+ jsonOutput[i].Volume +
// "},number={"+ number
"},pages={"+ jsonOutput[i].Pages +
"},year={"+ jsonOutput[i].Year +
"},DOI ={"+ jsonOutput[i].DOI+
"},url ={"+ jsonOutput[i].URL+
item["bibtex"] = "@article{" + bit1stAuthorLN + jsonOutput[i].Year + "," +
"title={" + jsonOutput[i].Titel +
"},author={" + bibAuthors.trim().substring(0, bibAuthors.trim().lastIndexOf(" ")) +
"},journal={" + jsonOutput[i].Journal +
"},volume={" + jsonOutput[i].Volume +
"},month={" + month +
"},pages={" + jsonOutput[i].Pages +
"},year={" + jsonOutput[i].Year +
"},DOI ={" + jsonOutput[i].DOI +
"},url ={" + jsonOutput[i].URL +
"}}"
jsonContent.push(item);
if (i == jsonOutput.length - 1) {
cb() // callback
}
}
// console.log(jsonContent);
}
console.log(jsonContent);
xmlHttpRequest.send();
}
xmlHttpRequest.send();
// str = str.substring(0, lastIndex);
// get paper from the Sabo result
load_excel_citation(function () {
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++) {
//
// ending of xlsx to json coversion
//
if (Math.abs(arrayLength - i) <= max_paper_list) {
addpaper(stuff_paper[i]);
}
//Do something
}
})
\ No newline at end of file
This diff is collapsed.
var json_to_bib = function (json_content) {
// Sabo Add Script here
}
\ No newline at end of file
......@@ -94,21 +94,8 @@ $(document).ready(function () {
// }
// });
// 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 (Math.abs(arrayLength - i) <= max_paper_list) {
console.log("close to " + i)
addpaper(stuff_paper[i]);
}
//Do something
}
json_to_bib(stuff_paper)
var userLang = navigator.language || navigator.userLanguage;
......@@ -172,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]);
}
......
......@@ -21,13 +21,17 @@ Website for Geoinformatic Research Group (Prof. Coors)
- [ ] Currently, the "public\js\language.js" only translate some part of the webpage.(later..)
### Tasks for Joe:
- [ ] Upgrade the public/js/add_paper.js to support the "URL" and "PDF" link. (Joe)
- [ ] Team Section (Joe)
- [x] fixing the Callback Logic on the Publication Section
- [ ] Upgrade the `public/js/add_paper.js` to support the `URL` and `PDF` link.
- [ ] Team Section
- [ ] Combine all scripts together + maintaining the GIT.
- [ ]
### Tasks for Sabo:
- [ ] After Sushant had updated and added the "PDF_Link" to the citation sheet, you would have to update the script to convert "Sheet1.xlsx to the paper.json format" and correct the "pdf" key pair.
- [ ] Get in touch with Sushant regarding the issue you found on the citation sheet.
- [ ] JSON to BIBTEX. [public/js/parse_json_to_bib.js](public/js/parse_json_to_bib.js)
- [x] Citation Sheet to BIBTEX. [public/js/parse_json_to_bib.js](public/js/parse_json_to_bib.js)
## Issue
- [x] The GitLab Page does not load the image under the img folder correctly e.g. https://ugl.hft-stuttgart.de/img/Schneider_2018_02.jpg which is stored at as Schneider_2018_02.JPG (Fixed by saving as either .jpg or .JPG everywhere) [03-05-2021]
- [ ] The flag still does not work yet. May be we can use this feature: https://mojoaxel.github.io/bootstrap-select-country/index.html (To be observed)
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