-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpublications.html
More file actions
261 lines (226 loc) · 11.5 KB
/
Copy pathpublications.html
File metadata and controls
261 lines (226 loc) · 11.5 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
---
title: Publications
permalink: /publications/
---
<!-- create the main variables -->
{% assign publications_sorted = site.data.publications | sort: 'date' | reverse %}
{% assign years = "" | split: "," %}
{% for publication in publications_sorted %}
{% assign currYear = publication.date | date: "%Y" %}
{% unless years contains currYear %}
{% assign years = years | push: currYear %}
{% endunless %}
{% endfor %}
<!-- Create the variables to store the publications of each type sorted by date -->
{% assign journals = "" | split: "," %}
{% assign conferences = "" | split: "," %}
{% assign workshops = "" | split: "," %}
{% assign theses = "" | split: "," %}
{% for publication in publications_sorted %}
{% if publication.type == "journal" %}
{% assign journals = journals | push: publication %}
{% elsif publication.type == "conference" %}
{% assign conferences = conferences | push: publication %}
{% elsif publication.type == "workshop" %}
{% assign workshops = workshops | push: publication %}
{% elsif publication.type == "thesis" %}
{% assign theses = theses | push: publication %}
{% endif %}
{% endfor %}
{% assign journals_sorted = journals | sort: "date" | reverse %}
{% assign conferences_sorted = conferences | sort: "date" | reverse %}
{% assign workshops_sorted = workshops | sort: "date" | reverse %}
{% assign theses_sorted = theses | sort: "date" | reverse %}
<!-- We loop over the years, then entries of each type in the data/publications file and display the publications -->
<div class="row justify-content-">
<div class="input-group mb-3">
<input type="text" class="form-control w-auto" placeholder="Search publications: author, title, ..." id="search-input">
<select class="form-select" id="year-select" style="width: 50;">
<option value="">All Years</option>
{% for year in years %}
<option value="{{ year }}">{{ year }}</option>
{% endfor %}
</select>
<button class="btn btn-primary" type="button" id="search-button"><i class="bi bi-search"></i></button>
</div>
</div>
<div class="paper_websites_info mb-4">
<span>
You can find the papers with dedicated websites <a href="{% link paper_websites_view.html %}" target="_blank">here</a>.
</span>
</div>
<div class="publication-container" id="publication-container">
{% assign counter = publications_sorted | size %}
{% assign j_counter = publications_sorted | where: 'type',"journal" | size %}
{% assign c_counter = publications_sorted | where: 'type',"conference" | size %}
{% assign w_counter = publications_sorted | where: 'type',"workshop" | size %}
{% assign t_counter = publications_sorted | where: 'type',"thesis" | size %}
{% assign o_counter = publications_sorted | where: 'type',"other" | size %}
<!-- Loop over the years, then print only the publications of each type if the year is the same -->
{% for year in years %}
<h3 class="archive-year border-bottom">{{ year }}</h3>
{% for publication in journals_sorted %}
{% assign currYear = publication.date | date: "%Y" %}
{% if currYear == year %}
{% assign counter = counter | minus: 1 %}
{% capture counter_to_show %}J{{ j_counter }}{% endcapture %}
{% assign j_counter = j_counter | minus: 1 %}
<div class="publication-item">
{% include publication_item.html publication=publication id=counter show_id=counter_to_show %}
</div>
{% endif %}
{% endfor %}
{% for publication in conferences_sorted %}
{% assign currYear = publication.date | date: "%Y" %}
{% if currYear == year %}
{% assign counter = counter | minus: 1 %}
{% capture counter_to_show %}C{{ c_counter }}{% endcapture %}
{% assign c_counter = c_counter | minus: 1 %}
<div class="publication-item">
{% include publication_item.html publication=publication id=counter show_id=counter_to_show %}
</div>
{% endif %}
{% endfor %}
{% for publication in workshops_sorted %}
{% assign currYear = publication.date | date: "%Y" %}
{% if currYear == year %}
{% assign counter = counter | minus: 1 %}
{% capture counter_to_show %}W{{ w_counter }}{% endcapture %}
{% assign w_counter = w_counter | minus: 1 %}
<div class="publication-item">
{% include publication_item.html publication=publication id=counter show_id=counter_to_show %}
</div>
{% endif %}
{% endfor %}
{% for publication in theses_sorted %}
{% assign currYear = publication.date | date: "%Y" %}
{% if currYear == year %}
{% assign counter = counter | minus: 1 %}
{% capture counter_to_show %}T{{ t_counter }}{% endcapture %}
{% assign t_counter = t_counter | minus: 1 %}
<div class="publication-item">
{% include publication_item.html publication=publication id=counter show_id=counter_to_show %}
</div>
{% endif %}
{% endfor %}
{% for publication in publications_sorted %}
{% assign currYear = publication.date | date: "%Y" %}
{% if currYear == year %}
{% if publication.type != "journal" and publication.type != "conference" and publication.type != "workshop" and publication.type != "thesis" %}
{% assign counter = counter | minus: 1 %}
{% capture counter_to_show %}O{{ o_counter }}{% endcapture %}
{% assign o_counter = o_counter | minus: 1 %}
<div class="publication-item">
{% include publication_item.html publication=publication id=counter show_id=counter_to_show %}
</div>
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
</div>
<div class="patents mt-5">
<h1>Patents</h1>
<div class="patents-list">
<span class="amr-color fw-bold">P07. </span><span>Compact omnidirectional vision sensor, US patent, 2014, led.</span><br>
<span class="amr-color fw-bold">P06. </span><span> Shared control of autonomous vehicles, US patent, 2014, led.</span><br>
<span class="amr-color fw-bold">P05. </span><span> Automated charging for aerial vehicles, US patent, 2014, led.</span><br>
<span class="amr-color fw-bold">P04. </span><span> Omnidirectional Spherical Blimp, International patent, 2012, led.</span><br>
<span class="amr-color fw-bold">P03. </span><span> Robotic Textures, US patent, 2012, led.</span><br>
<span class="amr-color fw-bold">P02. </span><span> Display with robotic pixels - divisorial, US patent, 2011, led.</span><br>
<span class="amr-color fw-bold">P01. </span><span> Display with robotic pixels, US patent 8723872.</span><br>
</div>
</div>
<!-- Search script. Just manages the visibility of the publications items depending on the search. probably very inefficient but works directly with the html -->
<script>
var searchInput = document.getElementById('search-input');
var searchButton = document.getElementById('search-button');
var yearSelect = document.getElementById('year-select');
// Function to perform the search based on input values
function performSearch() {
var searchValue = searchInput.value.toLowerCase();
var yearValue = yearSelect.value;
var publicationItems = document.getElementsByClassName('publication-item');
var archiveYears = document.getElementsByClassName('archive-year');
// Update URL with search parameters
updateUrlHash(searchValue, yearValue);
// Filter publication items
for (var i = 0; i < publicationItems.length; i++) {
var publicationTitle = publicationItems[i].querySelector('.publication-title').textContent.toLowerCase();
var publicationAuthor = publicationItems[i].querySelector('.author-names').textContent.toLowerCase();
var publicationVenue = publicationItems[i].querySelector('.publication-venue').textContent.toLowerCase();
var publicationYear = publicationItems[i].querySelector('.publication-date').textContent.toLowerCase();
if ((publicationTitle.includes(searchValue) || publicationAuthor.includes(searchValue) ||
publicationVenue.includes(searchValue) || publicationYear.includes(searchValue)) &&
(yearValue === "" || publicationYear.includes(yearValue))) {
publicationItems[i].style.display = "block";
} else {
publicationItems[i].style.display = "none";
}
}
// Show/hide year headers based on visible publications
for (var j = 0; j < archiveYears.length; j++) {
var year = archiveYears[j].textContent.trim();
var yearItems = document.getElementsByClassName('publication-date');
var showYear = false;
for (var k = 0; k < yearItems.length; k++) {
var itemYear = yearItems[k].textContent.trim();
if (itemYear.includes(year) && publicationItems[k].style.display !== "none") {
showYear = true;
break;
}
}
archiveYears[j].style.display = showYear ? "block" : "none";
}
}
// Function to update URL hash
function updateUrlHash(search, year) {
if (search === "" && year === "") {
// Clear hash if no filters
history.pushState("", document.title, window.location.pathname + window.location.search);
} else {
// Format: #search_string#year
var hashValue = "#" + encodeURIComponent(search);
if (year !== "") {
hashValue += "#" + year;
}
window.location.hash = hashValue.substring(1); // Remove the first # to avoid ##
}
}
// Function to parse URL hash and set search parameters
function parseUrlHash() {
if (window.location.hash) {
var hashParts = window.location.hash.substring(1).split('#');
if (hashParts.length >= 1) {
var searchQuery = decodeURIComponent(hashParts[0]);
searchInput.value = searchQuery;
}
if (hashParts.length >= 2) {
var yearValue = hashParts[1];
// Check if year exists in dropdown
var yearOptions = yearSelect.options;
for (var i = 0; i < yearOptions.length; i++) {
if (yearOptions[i].value === yearValue) {
yearSelect.value = yearValue;
break;
}
}
}
// Perform search with the parameters from URL
performSearch();
}
}
// Event listeners
searchInput.addEventListener('keyup', function(event) {
if (event.key === 'Enter') {
performSearch();
}
});
yearSelect.addEventListener('change', function() {
performSearch();
});
searchButton.addEventListener('click', performSearch);
// Handle browser back/forward navigation
window.addEventListener('hashchange', parseUrlHash);
// Initialize on page load
document.addEventListener('DOMContentLoaded', parseUrlHash);
</script>