//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 11918 v4 //var EmpresasPermitidas = ['116', '54', '1']; // IDs das empresas permitidas if (getCookie("PodeUsarNovoTema") != "1") { top.temaID = "0"; return; } var titulo = "Você foi convidado para usar o novo Tema"; var botao = "Trocar Tema"; var mensagens = [ 'Estamos animados para você testar.', 'Se deseja experimentá-lo clique em Trocar Tema.', ]; if (top.temaID == "1") { titulo = "Você está usando o novo Tema"; botao = "Voltar Tema"; mensagens = [ 'Clique abaixo para voltar ao tema anterior.', ]; } const dialogBackground = document.createElement('div'); dialogBackground.id = "dialogBackground"; document.body.appendChild(dialogBackground); dialogBackground.style.position = 'absolute'; dialogBackground.style.top = '100px'; dialogBackground.style.right = '20px'; dialogBackground.style.width = '330px'; 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 () { if (top.temaID=='1') setCookie("temaID", 0, 365); // Salva o tema nos cookies por 1 ano else setCookie("temaID", 1, 365); // Salva o tema nos cookies por 1 ano location.reload(); // Recarrega a página }; } function criarTema(id, texto, css) { var tema = document.createElement('div'); tema.id = "tema_" + id; tema.className = "tema " + css; tema.addEventListener("click", function () { selecionarTema(id); }); var textoTema = document.createElement('div'); textoTema.textContent = texto; tema.appendChild(textoTema); return tema; } function selecionarTema(id) { setCookie("temaID", id, 365); // Salva o tema nos cookies por 1 ano 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.temaID = getCookie("temaID");