Git Repository Public Repository

CPE_learningsite

URLs

Copy to Clipboard

This repository has no backups
This repository's network speed is throttled to 100KB/sec

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
$(document).ready(function() {


    function getTimeRemaining(endtime) {
        var currentTime = Date.now();
        var t = endtime - currentTime;
    var seconds = Math.floor((t / 1000) % 60);
    var minutes = Math.floor((t / 1000 / 60) % 60);
    var hours = Math.floor((t / (1000 * 60 * 60)) % 24);
    return {
        'total': t,
        'hours': hours,
        'minutes': minutes,
        'seconds': seconds
    };
}

function initializeClock(id, endtime) {
    var clock = document.getElementById(id);
    var hoursSpan = clock.querySelector('.hours');
    var minutesSpan = clock.querySelector('.minutes');
    var secondsSpan = clock.querySelector('.seconds');

    function updateClock() {
        var t = getTimeRemaining(endtime);
        if (t.total >= 0) {
            hoursSpan.innerHTML = ('0' + t.hours).slice(-2);
            minutesSpan.innerHTML = ('0' + t.minutes).slice(-2);
            secondsSpan.innerHTML = ('0' + t.seconds).slice(-2);
        }
        if (t.total <= 0) {
            clearInterval(timeinterval);

            var meetingSessionKey = $("#clockdiv").data("meetingsessionkey");
            var email = $("#clockdiv").data("email");
            var cerificateid = $("#clockdiv").data("certid");

            window.location = "/rebroadcast/GotoContent/" + meetingSessionKey + "/" + encodeURIComponent(email) + "/" + cerificateid;
        }

    }

    updateClock();
    var timeinterval = setInterval(updateClock, 1000);
}


var lobbyDuration = $("#lobbyduration").text();
var deadline = Date.now() - lobbyDuration;

initializeClock("clockdiv", deadline);

});

Commits for CPE_learningsiteCPE/CPE.App/CPE.App.Web/static/js/rebroadcast/lobby.js

Diff revisions: vs.
Revision Author Commited Message
4cd176 ... v.shishlov Fri 27 Aug, 2021 14:33:17 +0000

initial commit