-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpeople.html
70 lines (64 loc) · 1.84 KB
/
people.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
---
layout: default
title: People
---
<header class="intro">
<h1>People</h1>
</header>
<div class="people-body">
<ul class="listing">
{% assign people = site.people | sort: 'listing-priority' %}
{% for person in people %}
<li>
<p><a href="{{ site.baseurl }}{{ person.url }}">{{ person.name }}</a> - {{ person.role }}</p>
</li>
{% endfor %}
</ul>
</div>
<div id="redirectToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true"
style="position: absolute; top: 76px; right: 20px;">
<div class="toast-header">
<strong class="mr-auto">Going back</strong>
<small><span id="countdown"></span> seconds</small>
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="toast-body">
Dismiss to delay the redirect to the homepage
</div>
</div>
<!-- JavaScript part -->
<script type="text/javascript">
// Total seconds to wait
var seconds = 30;
function countdown() {
seconds = seconds - 1;
try {
if (seconds == 10) {
$('.toast').toast({
delay: 11000
});
$('#redirectToast').toast('show');
$('#redirectToast').on('hidden.bs.toast', function () {
seconds = 30;
});
}
} catch (error) {
console.error(error);
// expected output: ReferenceError: nonExistentFunction is not defined
// Note - error messages will vary depending on browser
}
if (seconds < 0) {
// Redirection link here
window.location = "{{ site.baseurl }}";
} else {
// Update remaining seconds
document.getElementById("countdown").innerHTML = seconds;
// Count down using javascript
window.setTimeout("countdown()", 1000);
}
}
// Run countdown function
countdown();
</script>