summaryrefslogtreecommitdiff
path: root/frontend/index.js
blob: e05b25c9eee15fef04e3c47ec782a234b1e9232a (plain)
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
/// <reference path="scripts/jquery-3.5.1.min.js"/>

(function() {
    function main() {

		// Retrieve the navbar
        $.get('/navbar.html', function(pData) {
            $('nav').html(pData);                 
            
            // Set selected tab as selected            
            $('nav').find('a').removeClass('nav-selected');
            $('nav').find('a[href="' + window.location.pathname + '"').addClass('nav-selected');
        });

		// Set up show/hide functionality on the play/stop buttons
		$('.play_button').on('click', function() {
			$(this).hide();
			$(this).parent().find('.stop_button').show();
		});

		$('.stop_button').on('click', function() {
			$(this).hide();
			$(this).parent().find('.play_button').show();
		});
    }
    
    $(document).ready(main);
})()