{"size": 1672, "ext": "js", "max_stars_repo_path": "vscode4teaching-extension/resources/dashboard/liveshareBoard.js", "max_stars_repo_name": "codeurjc-students/2019-VSCode4Teaching", "max_stars_repo_stars_event_min_datetime": "2019-10-21T18:15:24.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T08:29:37.000Z", "max_issues_repo_path": "vscode4teaching-extension/resources/dashboard/liveshareBoard.js", "max_issues_repo_name": "codeurjc-students/2019-VSCode4Teaching", "max_issues_repo_issues_event_min_datetime": "2019-10-12T11:40:31.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T07:06:04.000Z", "max_forks_repo_path": "vscode4teaching-extension/resources/dashboard/liveshareBoard.js", "max_forks_repo_name": "codeurjc-students/2019-VSCode4Teaching", "max_forks_repo_forks_event_min_datetime": "2019-10-16T20:48:21.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-24T09:12:13.000Z"}
{"max_stars_count": 16, "max_issues_count": 60, "max_forks_count": 8, "avg_line_length": 36.347826087, "max_line_length": 136, "alphanum_fraction": 0.5562200957}
// For security reasons, we must keep the VS Code API object private and make sure it is never leaked into the global scope.
(function () {
    const vscode = acquireVsCodeApi();
    const selectTimeReload = document.getElementById("time-reload");

    document.querySelectorAll(".liveshare-send").forEach((row) => {
        row.addEventListener("click", () => {
            const username = Array.from(row.parentElement.parentElement.children).find(e => e.classList.contains('username')).innerHTML;
            sendVSLSMessage(username);
        });
    });

    document.querySelectorAll("#search-send").forEach(button => {
        button.addEventListener("click", () => {
            const username = Array.from(button.parentElement.children).find(e => e.id == "username-search").value;
            sendVSLSMessage(username);
        });
    })

    function sendVSLSMessage(username) {
        if (username)
            vscode.postMessage({
                type: "start-liveshare",
                username: username
            })
    }

    document.querySelectorAll(".sorter-ls").forEach(
        (header, i) => {
            header.addEventListener("click", () => {
                let order = header.classList.toggle('active');
                const courseIndex = header.parentElement.parentElement.parentElement.parentElement.getAttribute("data-courseIndex");
                if (courseIndex)
                    vscode.postMessage({
                        type: "sort-ls",
                        column: i,
                        desc: order,
                        courseIndex: courseIndex,
                    });
            });
        }
    );

}());

