From 576b382f4f7a24111afc0e8b53b401560f2abce4 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 12 Mar 2021 15:05:17 +0100 Subject: [PATCH] update Paper again --- public/content/paper.json | 164 ++++++++++++++++++++++++++++++++++++++ public/content/team.json | 0 public/css/search.css | 6 +- public/index.html | 32 +++++--- public/js/add_content.js | 6 +- public/js/add_paper.js | 83 +++++++++++++++++++ public/js/search.js | 77 +++++++++++++++++- 7 files changed, 356 insertions(+), 12 deletions(-) create mode 100644 public/content/paper.json create mode 100644 public/content/team.json create mode 100644 public/js/add_paper.js diff --git a/public/content/paper.json b/public/content/paper.json new file mode 100644 index 0000000..1d6828a --- /dev/null +++ b/public/content/paper.json @@ -0,0 +1,164 @@ +[ + { + "item": { + "title": "3D SAFE ROUTING NAVIGATION APPLICATION FOR PEDESTRIANS AND CYCLISTS BASED ON OPEN SOURCE TOOLS", + "project": "Hackathon", + "authors": [ + { + "firstName": "T", + "lastName": "Santhanavanich." + },{ + "firstName": "P", + "lastName": "Wuerstle" + },{ + "firstName": "J", + "lastName": "Silberer" + },{ + "firstName": "V", + "lastName": "Loidl" + },{ + "firstName": "P", + "lastName": "Rodrigues" + },{ + "firstName": "V", + "lastName": "Coors" + } + ], + "imageLink":"imgs/publication/3droute.jpg", + "keywords":["CityGML","SensorThings API","Open Geospatial Consortium","pgRouting","Warning"], + "journal": { + "name":"ISPRS Annals of Photogrammetry, Remote Sensing & Spatial Information Sciences", + "volume":"VI-4/W2-2020", + "year":"2020", + "pages":"143-147" + }, + "DOI":"https://doi.org/10.5194/isprs-annals-VI-4-W2-2020-143-2020" + }, + "links": { + "pdf":"", + "url": "https://www.isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/VI-4-W2-2020/143/2020/", + "demo": "https://m4lab.hft-stuttgart.de/partizipation/" + } + }, + { + "item": { + "title": "3D SAFE ROUTING NAVIGATION APPLICATION FOR PEDESTRIANS AND CYCLISTS BASED ON OPEN SOURCE TOOLS", + "project": "Hackathon", + "authors": [ + { + "firstName": "T", + "lastName": "Santhanavanich." + },{ + "firstName": "P", + "lastName": "Wuerstle" + },{ + "firstName": "J", + "lastName": "Silberer" + },{ + "firstName": "V", + "lastName": "Loidl" + },{ + "firstName": "P", + "lastName": "Rodrigues" + },{ + "firstName": "V", + "lastName": "Coors" + } + ], + "imageLink":"imgs/publication/3droute.jpg", + "keywords":["CityGML","SensorThings API","Open Geospatial Consortium","pgRouting","Warning"], + "journal": { + "name":"ISPRS Annals of Photogrammetry, Remote Sensing & Spatial Information Sciences", + "volume":"VI-4/W2-2020", + "year":"2020", + "pages":"143--147" + }, + "DOI":"https://doi.org/10.5194/isprs-annals-VI-4-W2-2020-143-2020" + }, + "links": { + "pdf":"", + "url": "https://www.isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/VI-4-W2-2020/143/2020/", + "demo": "https://m4lab.hft-stuttgart.de/partizipation/" + } + }, + { + "item": { + "title": "3D SAFE ROUTING NAVIGATION APPLICATION FOR PEDESTRIANS AND CYCLISTS BASED ON OPEN SOURCE TOOLS", + "project": "Hackathon", + "authors": [ + { + "firstName": "T", + "lastName": "Santhanavanich." + },{ + "firstName": "P", + "lastName": "Wuerstle" + },{ + "firstName": "J", + "lastName": "Silberer" + },{ + "firstName": "V", + "lastName": "Loidl" + },{ + "firstName": "P", + "lastName": "Rodrigues" + },{ + "firstName": "V", + "lastName": "Coors" + } + ], + "imageLink":"imgs/publication/3droute.jpg", + "keywords":["CityGML","SensorThings API","Open Geospatial Consortium","pgRouting","Warning"], + "journal": { + "name":"ISPRS Annals of Photogrammetry, Remote Sensing & Spatial Information Sciences", + "volume":"VI-4/W2-2020", + "year":"2020", + "pages":"143--147" + }, + "DOI":"https://doi.org/10.5194/isprs-annals-VI-4-W2-2020-143-2020" + }, + "links": { + "pdf":"", + "url": "https://www.isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/VI-4-W2-2020/143/2020/" + + } + }, + { + "item": { + "title": "TEST 3D SAFE ROUTING NAVIGATION APPLICATION FOR PEDESTRIANS AND CYCLISTS BASED ON OPEN SOURCE TOOLS", + "project": "Hackathon", + "authors": [ + { + "firstName": "T", + "lastName": "Santhanavanich." + },{ + "firstName": "P", + "lastName": "Wuerstle" + },{ + "firstName": "J", + "lastName": "Silberer" + },{ + "firstName": "V", + "lastName": "Loidl" + },{ + "firstName": "P", + "lastName": "Rodrigues" + },{ + "firstName": "V", + "lastName": "Coors" + } + ], + "imageLink":"imgs/publication/3droute.jpg", + "keywords":["CityGML","SensorThings API","Open Geospatial Consortium","pgRouting","Warning"], + "conference":{ + "name":"Test", + "date":"20.03.2020" + }, + "DOI":"https://doi.org/10.5194/isprs-annals-VI-4-W2-2020-143-2020" + }, + "links": { + "url": "https://www.isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/VI-4-W2-2020/143/2020/", + "demo": "https://m4lab.hft-stuttgart.de/partizipation/" + } + } +] + diff --git a/public/content/team.json b/public/content/team.json new file mode 100644 index 0000000..e69de29 diff --git a/public/css/search.css b/public/css/search.css index f719760..844b6dc 100644 --- a/public/css/search.css +++ b/public/css/search.css @@ -142,4 +142,8 @@ body { left: 0px; top: 10px; } - \ No newline at end of file + + .linesearch { + display: flex; /* equal height of the children */ + } + \ No newline at end of file diff --git a/public/index.html b/public/index.html index 5a20f39..5dcd1d1 100644 --- a/public/index.html +++ b/public/index.html @@ -129,9 +129,22 @@ -->
-

Our Publication

-

Our Publication ...

- +
+
+

Our Publication

+

Our Publication ...

+
+
+
+
+
+ + +
+ +
+
+
-
+
@@ -384,6 +397,7 @@ + @@ -398,4 +412,4 @@ - + \ No newline at end of file diff --git a/public/js/add_content.js b/public/js/add_content.js index df50bf9..639f80b 100644 --- a/public/js/add_content.js +++ b/public/js/add_content.js @@ -1,6 +1,10 @@ function addcontent(item){ var new_row = document.getElementById("row_main") + if(item === undefined) { + }else{ + + // Prepare YouTube Link // var array_contains_youtube = true var YouTubeHTML = '' @@ -40,6 +44,6 @@ function addcontent(item){ '
' + '
' + '
' - +} } diff --git a/public/js/add_paper.js b/public/js/add_paper.js new file mode 100644 index 0000000..586b9fa --- /dev/null +++ b/public/js/add_paper.js @@ -0,0 +1,83 @@ +function addpaper(item){ + var new_row = document.getElementById("cont_paper") + + if(item === undefined) { + + }else{ + + 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 + } + var keywords = ""; + for (var i = 0; i < item.item.keywords.length; i++) { + console.log(i); + keywords += ''+ item.item.keywords[i] +'' + //Do something + } + authors = authors.substring(0, authors.length - 2); + // Prepare YouTube Link + // var array_contains_youtube = true + var YouTubeHTML = '' + if ('pdf' in item.links) { // to be replaced by if (item.YouTubelink) or so... + var YouTubelink = item.links.youtube // to be replaced by item.YouTubelink or so... + YouTubeHTML = `Link` + } + // Do Authors and Keywords + var doi + if ('journal' in item.item){ + doi = ' ' + item.item.journal.name + ',' + + item.item.journal.volume + ', ' + item.item.journal.pages + ', '+ item.item.DOI + } + if ('conference' in item.item){ + doi = ' ' + item.item.conference.name + ',' + item.item.conference.date + ', '+ item.item.DOI + + } + // Prepare Explore Link + // var array_contains_explore_link = true + var ExploreHTML = '' + if ('demo' in item.links) { // to be replaced by if (item.YouTubelink) or so... + var ExploreLink = item.links.demo // to be replaced by item.ExploreLink or so... + ExploreHTML = `PDF` + } + + new_row.innerHTML = new_row.innerHTML + '
' + + '
' + + '
' + + '...' + + '
'+ + '
' + + '
' + + '
' + + ''+ authors +'' + + '
' + + item.item.title + + '
' + + '' + + keywords + + '' + + '
' + + doi + + '
' + + ExploreHTML + + 'BIB' + + YouTubeHTML + + '
' + + '
@article{santhanavanich20203d,' +
+              'title={3D SAFE ROUTING NAVIGATION APPLICATION FOR PEDESTRIANS AND CYCLISTS BASED ON OPEN SOURCE TOOLS.},' +
+              'author={Santhanavanich, T and Wuerstle, P and Silberer, J and Loidl, V and Rodrigues, P and Coors, V},' +
+              'journal={ISPRS Annals of Photogrammetry, Remote Sensing \& Spatial Information Sciences},' +
+              'volume={6},' +
+              'year={2020}' +
+            '}' +
+          '}
' + + '
' + + '
' + + '
' + + '
' + + } +} + diff --git a/public/js/search.js b/public/js/search.js index ca6c01b..faaff1a 100644 --- a/public/js/search.js +++ b/public/js/search.js @@ -6,9 +6,16 @@ const options = { keys: ["item.title","item.keywords", "item.author.firstName", "item.author.lastName"] } +const options_paper = { + includeScore: true, + // Search in `author` and in `tags` array + keys: ["item.title","item.keywords", + "item.author.firstName", "item.author.lastName"] +} // start search var searchanswer +var searchanswer_paper function search(){ const fuse = new Fuse(stuff, options); searchanswer = fuse.search(document.getElementById("search-input").value) @@ -23,10 +30,24 @@ function search(){ // alert(searchanswer); console.log(searchanswer); } - +function search_paper(){ + const fuse = new Fuse(stuff_paper, options); + searchanswer_paper = fuse.search(document.getElementById("search-input_paper").value) + + var new_row = document.getElementById("cont_paper") + new_row.innerHTML = ""; + var searchLength = searchanswer_paper.length; + for (var i = 0; i < searchLength; i++) { + addpaper(searchanswer_paper[i].item); + //Do something + } + // alert(searchanswer); + console.log(searchanswer_paper); +} //get json // --- can be adapted if we load the content from the json var stuff = [] +var stuff_paper = [] // $.getJSON("./content/content.json", function(result){ // stuff = result; // var new_row = document.getElementById("row_main") @@ -49,6 +70,21 @@ $(document).ready(function(){ //Do something } }); + $.getJSON("./content/paper.json", function(result){ + stuff_paper = result; + 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) <= 2){ + console.log("close to " + i) + addpaper(stuff_paper[i]); + } + + //Do something + } + }); var userLang = navigator.language || navigator.userLanguage; console.log("The language is: " + userLang); if (userLang.includes("de")){ @@ -94,6 +130,36 @@ function searchToggle(obj, evt){ // addcontent(); } } +function searchToggle_paper(obj, evt){ + console.log("arrive") + var container = $(obj).closest('.search-wrapper'); + if(!container.hasClass('active')){ + container.addClass('active'); + evt.preventDefault(); + console.log("first") + } + else if(container.hasClass('active') && $(obj).closest('.input-holder').length == 0){ + container.removeClass('active'); + // clear input + console.log("second") + 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) <= 2){ + console.log("close to " + i) + addpaper(stuff_paper[i]); + } + + //Do something + } + container.find('#search-input_paper').val(''); + } else { + console.log("search") + search_paper(); + // addcontent(); + } +} // search on enter var input = document.getElementById("search-input"); @@ -103,4 +169,13 @@ input.addEventListener("keyup", function(event) { document.getElementById("search-button").click(); } +}); + +var input = document.getElementById("search-input_paper"); +input.addEventListener("keyup", function(event) { + if (event.keyCode === 13) { + event.preventDefault(); + + document.getElementById("search-button_paper").click(); + } }); \ No newline at end of file -- GitLab