//Task 11918 - NOVO LAYOUT function getCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; } function HideTemaContainer() { try { document.getElementById("dialogBackground").style.display = "none"; // document.getElementById("temaContainer").style.display = "none"; } catch (e) { } } function CriaSelectTema() { //Task 13829 - Componentes mobile //Correcao Mobile if (top.isAppMobile) return; //task 12164 shellcore - validar todo codigo desse metodo ao publicar na producao if ((getCookie("PodeUsarNovoTema") != "1") && (top.PodeUsarNovoLayout != "1")) { return; } var titulo = ""; var botao = ""; var mensagens = [ '', '', ]; if (top.PodeUsarNovoLayout == "1") { //alternancia entre o cinza e novo layout top.temaID = "1"; //alternancia entre o cinza e novo layout if (top.novoLayout == "1") { titulo = "Você está usando o novo Layout"; botao = "Trocar Layout"; mensagens = [ 'Estamos animados para você testar.', 'Clique abaixo para voltar ao Layout anterior.', ]; } else { titulo = "Você foi convidado para usar a novo Layout"; botao = "Usar Novo Layout"; mensagens = [ 'Estamos animados para você testar.', 'Se deseja experimentá-lo clique em Usar Novo Layout.', ]; } } else { //alternancia entre o azul e cinza top.novoLayout = "0"; if (top.temaID == "1") { titulo = "Você está usando o novo Tema"; botao = "Trocar Tema"; mensagens = [ 'Estamos animados para você testar.', 'Clique abaixo para voltar ao tema anterior.', ]; } else { titulo = "Você foi convidado para usar a novo Tema"; botao = "Trocar Tema"; mensagens = [ 'Estamos animados para você testar.', 'Se deseja experimentá-lo clique em Usar Novo Tema.', ]; } } //if (top.novoLayout == "1") { // titulo = "Você está usando o novo Layout"; // botao = "Voltar Layout"; // mensagens = [ // 'Clique abaixo para voltar ao Layout anterior.', // ]; //} const dialogBackground = document.createElement('div'); dialogBackground.id = "dialogBackground"; document.body.appendChild(dialogBackground); dialogBackground.style.position = 'absolute'; //task 12164 shellcore dialogBackground.style.zIndex = '2'; dialogBackground.style.top = '100px'; dialogBackground.style.right = '20px'; dialogBackground.style.width = '350px'; dialogBackground.style.padding = '20px'; dialogBackground.style.border = "solid 1px #ddd"; dialogBackground.style.backgroundColor = '#fff'; dialogBackground.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.1)'; dialogBackground.style.borderRadius = '10px'; dialogBackground.style.fontFamily = 'Arial, sans-serif'; // Cria o cabeçalho da janela de diálogo const header = document.createElement('h4'); header.textContent =titulo; dialogBackground.appendChild(header); header.style.margin = '0'; header.style.marginBottom = '20px'; header.style.paddingBottom = '10px'; header.style.color = '#4b4f56'; header.style.fontWeight = 'bold'; header.style.borderBottom = "1px solid #ddd"; header.style.fontSize = '15px'; // Cria a lista de recursos const featureList = document.createElement('ul'); dialogBackground.appendChild(featureList); featureList.style.listStyle = 'none'; featureList.style.padding = '0'; featureList.style.margin = '0'; featureList.style.textAlign = "center"; // Adiciona recursos à lista mensagens.forEach(text => { const feature = document.createElement('li'); feature.textContent = text; featureList.appendChild(feature); feature.style.marginBottom = '10px'; feature.style.fontSize = '14px'; feature.style.color = '#4b4f56'; }); // Cria o botão para experimentar const button = document.createElement('button'); button.textContent = botao; dialogBackground.appendChild(button); button.style.width = '100%'; button.style.padding = '10px'; button.style.marginTop = '20px'; button.style.border = 'none'; button.style.borderRadius = '5px'; button.style.backgroundColor = '#0d58c5'; button.style.color = 'white'; button.style.cursor = 'pointer'; // Evento de clique no botão button.onclick = function () { //pode usar o novo layout if (top.PodeUsarNovoLayout == '1') { //nao pode usar o novo layout if (top.novoLayout == "1") setCookie("NovoLayout", 0, 365); else setCookie("NovoLayout", 1, 365); } else { //nao pode usar o novo layout if (top.temaID=="1") setCookie("temaID", 0, 365); else setCookie("temaID", 1, 365); } location.reload(); // Recarrega a página }; } // Funções para manipulação de cookies function setCookie(name, value, days) { var expires = ""; if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + (value || "") + expires + "; path=/"; } // Verifica se há um tema salvo nos cookies top.novoLayout = getCookie("NovoLayout"); top.temaID = getCookie("temaID"); top.PodeUsarNovoLayout = getCookie("PodeUsarNovoLayout");