Skip to content

Commit b580279

Browse files
committed
Restore carousel functionality
Move the carousel code into its own javascript file, and reference it appropriately. Similarly, stop embedding javascript in the footer of each page.
1 parent 0afdce1 commit b580279

File tree

5 files changed

+25
-26
lines changed

5 files changed

+25
-26
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*~
2+
_site

_layouts/carousel.html

+1-12
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,8 @@
1212
</div>
1313
<!-- Placed at the end of the document so the pages load faster -->
1414
{% include common-scripts.html %}
15+
<script src="/assets/js/start-carousel.js"></script>
1516
<script>
16-
document.getElementById("not-signed-in").addEventListener("click", function (e) {
17-
e.preventDefault();
18-
getTicket().then(function(session) {
19-
updateLoginControls();
20-
});
21-
});
22-
document.getElementById("log-out").addEventListener("click", function (e) {
23-
e.preventDefault();
24-
destroyCachedTicket();
25-
updateLoginControls();
26-
});
27-
updateLoginControls();
2817
</script>
2918
</body>
3019
</html>

_layouts/default.html

-14
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,5 @@
1212
{% include footer.html %}
1313
<!-- Placed at the end of the document so the pages load faster -->
1414
{% include common-scripts.html %}
15-
<script>
16-
document.getElementById("not-signed-in").addEventListener("click", function (e) {
17-
e.preventDefault();
18-
getTicket().then(function(session) {
19-
updateLoginControls();
20-
});
21-
});
22-
document.getElementById("log-out").addEventListener("click", function (e) {
23-
e.preventDefault();
24-
destroyCachedTicket();
25-
updateLoginControls();
26-
});
27-
updateLoginControls();
28-
</script>
2915
</body>
3016
</html>

assets/js/start-carousel.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
!function ($) {
2+
$(function(){
3+
$('#myCarousel').carousel({interval: 10000})
4+
})
5+
}(window.jQuery)

assets/webathena-sql/core.js

+17
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,20 @@ function updateLoginControls() {
8080
}
8181
}
8282

83+
document.getElementById("not-signed-in").addEventListener("click", function (e) {
84+
e.preventDefault();
85+
getTicket().then(function(session) {
86+
updateLoginControls();
87+
});
88+
});
89+
document.getElementById("log-out").addEventListener("click", function (e) {
90+
e.preventDefault();
91+
destroyCachedTicket();
92+
updateLoginControls();
93+
});
94+
95+
!function ($) {
96+
$(function() {
97+
updateLoginControls();
98+
})
99+
}(window.jQuery)

0 commit comments

Comments
 (0)