-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathpublications.html
76 lines (65 loc) · 2.4 KB
/
publications.html
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
---
title: Publications
subnav: publications
layout: default
---
<link rel="stylesheet" href="{{ site.baseurl }}css/publications.css"></link>
<div class="intro">{{ site.data.data.publications.intro }}</div>
<ul class="toc" id="tags-toc"></ul>
<div class="publications">
{% for type in site.data.data.publications.publication_cards %}
<a class="anchor" name="{{ type.anchor }}"></a>
<h2 class="type">{{ type.type }}</h2>
{% for pub in type.publications %}
<div class="publication">
<a name="{{ pub.anchor }}"></a>
<div class="title"> {{ pub.title }} </div>
{% if pub.authors %}
{% assign authorNames = '' | split:':' %}
{% for author in pub.authors %}
{% assign authorNames = authorNames | push: author.name %}
{% endfor %}
<div class="authors">{{ authorNames | join: ', ' }}</div>
{% endif %}
{% if pub.booktitle %} <div class="booktitle">{{ pub.booktitle }}</div> {% endif %}
<div class="address-year">
{% if pub.address %} <span class="address">{{ pub.address }}, </span> {% endif %}
{% if pub.year %} <span class="year">{{ pub.year }}</span> {% endif %}
</div>
{% if pub.abstract %}
<div class="showAbstract"> <a href="javascript:void(0);">(abstract+)</a> </div>
{% endif %}
{% if pub.link %}
<div class="link">
<a href="{{ pub.link }}">(link)</a>
</div>
{% endif %}
{% if pub.abstract %}
<div class="abstract hidden"><p>
{{ pub.abstract }}
</p></div>
{% endif %}
</div>
{% endfor %}
{% endfor %}
</div>
<script>
function toggleAbstract(i){
var abstract = document.getElementsByClassName("abstract")[i];
if (abstract.classList.contains("hidden")) {
abstract.classList.remove("hidden");
abstract.classList.add("shown");
} else {
abstract.classList.remove("shown");
abstract.classList.add("hidden");
}
}
var links = document.getElementsByClassName('showAbstract');
for (var i = 0; i < links.length; i++) {
// since javascript won't close over i, pass it as a parameter to an anonymous function
// http://stackoverflow.com/questions/8214753/access-a-copied-integer-variable-in-javascript-anonymous-method
links[i].addEventListener('click', (function(j) { return function() { toggleAbstract(j); }})(i) );
}
</script>
<div id="action-flash" class="fade-out"></div>
<script src="{{ site.baseurl }}js/publication_tags.js"></script>