Add kiosk launcher downloads and player URL resolution
This commit is contained in:
@@ -773,10 +773,62 @@
|
||||
});
|
||||
}
|
||||
|
||||
function initKioskLauncherModal() {
|
||||
var modal = document.getElementById('dashboard-kiosk-launcher-modal');
|
||||
if (!modal) {
|
||||
return;
|
||||
}
|
||||
|
||||
var checkbox = modal.querySelector('[data-kiosk-launcher-confirm]');
|
||||
var downloadLinks = Array.prototype.slice.call(modal.querySelectorAll('[data-kiosk-launcher-download]'));
|
||||
|
||||
function setDownloadsEnabled(enabled) {
|
||||
downloadLinks.forEach(function (link) {
|
||||
if (!link) {
|
||||
return;
|
||||
}
|
||||
|
||||
link.classList.toggle('disabled', !enabled);
|
||||
link.setAttribute('aria-disabled', enabled ? 'false' : 'true');
|
||||
if (enabled) {
|
||||
link.removeAttribute('tabindex');
|
||||
} else {
|
||||
link.setAttribute('tabindex', '-1');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function resetModalState() {
|
||||
if (checkbox) {
|
||||
checkbox.checked = false;
|
||||
}
|
||||
setDownloadsEnabled(false);
|
||||
}
|
||||
|
||||
if (checkbox) {
|
||||
checkbox.addEventListener('change', function () {
|
||||
setDownloadsEnabled(Boolean(checkbox.checked));
|
||||
});
|
||||
}
|
||||
|
||||
modal.addEventListener('show.bs.modal', resetModalState);
|
||||
modal.addEventListener('hidden.bs.modal', resetModalState);
|
||||
modal.addEventListener('click', function (event) {
|
||||
var target = event.target && event.target.closest ? event.target.closest('[data-kiosk-launcher-download]') : null;
|
||||
if (target && target.classList.contains('disabled')) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
resetModalState();
|
||||
}
|
||||
|
||||
window.webHandleDashboardState = handleDashboardState;
|
||||
|
||||
initClientRenameHandler();
|
||||
initClientMoveHandler();
|
||||
initKioskLauncherModal();
|
||||
var screenCommandSelect = document.getElementById('screen-command-select');
|
||||
if (screenCommandSelect) {
|
||||
updateScreenCommandControls(latestDashboardState || readScreenCommandStateFromDom());
|
||||
|
||||
Reference in New Issue
Block a user