Histórico da Página
| HTML |
|---|
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Release Notes</title> </head> <body style="margin:0; padding:0-- Confluence/TDN: Cole este HTML no macro "HTML" (não em bloco de código/preformatado). Este arquivo é um SNIPPET (sem <html>/<head>/<body>) para reduzir quebra por sanitização. --> <div style="max-width:1200px; margin:0 auto; padding:16px; font-family: Arial, Helvetica, sans-serif; background:#ffffff;"> <div style="max-width:1200px; margin:0 auto; padding:16px;"> <div style="border:1px solid #dfe1e6; border-radius:8px; overflow:hidden;"> <!-- Cor do header: era #0052CC; ajustado para um azul mais claro --> <div style="background:#0052CC#2684FF; color:#fff; padding:14px 16px;"> <div style="display:flex; align-items:center; gap:12px;"> <!-- TOTVS logo (anexo do Confluence/TDN): - Nome do anexo: "totvs logo.jpg" - O JS abaixo tenta carregar primeiro do pageId atual, e cai em fallback se não achar --> <img id="totvs-logo" alt="TOTVS" style="display:none; height:28px; width:auto; background:#ffffff; border-radius:6px; padding:4px; border:1px solid rgba(255,255,255,0.35);" /> <div id="page-title" style="font-size:18px; font-weight:700;">Dicionário de Dados</div> </div> </div> <div style="background:#f4f5f7; border-top:1px solid #dfe1e6; padding:12px 16px; display:flex; gap:12px; align-items:center; flex-wrap:wrap;"> <div style="display:flex; gap:8px; align-items:center;"> <div style="font-weight:700; color:#172b4d;">Versão:</div> <div id="version-display" style="background:#fff; border:1px solid #dfe1e6; border-radius:6px; padding:4px 10px; font-weight:700; color:#172b4d;">-</div> </div> <div style="display:flex; gap:8px; align-items:center;"> <div style="font-weight:700; color:#172b4d;">Atualizado:</div> <div id="last-update" style="background:#fff; border:1px solid #dfe1e6; border-radius:6px; padding:4px 10px; color:#172b4d;">-</div> <!-- Link removido por solicitação: sem botão externo --> </div> <a id="doc-link" href="#" target="_blank" style="display:none; margin-left:auto; text-decoration:none; background:#ffffff; color:#0052CC; border:1px solid #0052CC; border-radius:6px; padding:6px 10px; font-weight:700;"> Abrir no Drive </a> </div> <div id="widget-container" style="min-height:520px; background:#ffffff;"> <div style="padding:18px; color:#6b778c;">Carregando documento...</div> </div> </div> </div> <script> (function() { // Fonte: GitHub (RAW) // Repo: https://github.com/Juansimeoni/ReleaseDatasul // Arquivo esperado: {versao}.txt (ex: 12.1.2503.15.txt) const GITHUB_RAW_BASE = 'https://raw.githubusercontent.com/Juansimeoni/ReleaseDatasul/main/'; function getPageVersion() { const versionPattern = /(\d+\.\d+\.\d+(?:\.\d+)?)/; const pageTitleElement = document.querySelector('h1#title-text, .page-title, h1, [data-page-title]'); if (pageTitleElement) { <!-- const titleText = (pageTitleElement.textContent || '').trim(); const match = titleText.match(versionPattern); if (match) return match[1]; } const metaTitle = document.querySelector('meta[property="og:title"], meta[name="title"]'); if (metaTitle) { const titleText = metaTitle.getAttribute('content') || ''; const match = titleText.match(versionPattern); if (match) return match[1]; } const titleMatch = (document.title || '').match(versionPattern); if (titleMatch) return titleMatch[1]; return null; } function getPageId() { try { const qs = new URLSearchParams(window.location.search); const fromQuery = qs.get('pageId'); if (fromQuery) return String(fromQuery); } catch (e) { /* ignore */ } // Confluence costuma expor isso quando AJS está disponível try { if (window.AJS && AJS.params && AJS.params.pageId) return String(AJS.params.pageId);IMPORTANTE (TDN/Confluence): } catch (e) { /* ignore */ } return null; } function setTotvsLogo() { const logoEl = document.getElementById('totvs-logo'); Se o HTML for colado if (!logoEl) return; const pageId = getPageId(); const filename = 'totvs logo.jpg'; const encodedName = encodeURIComponent(filename); const candidates = []; if (pageId) { // thumbnails costuma funcionar melhor no Confluence candidates.push('/download/thumbnails/' + pageId + '/' + encodedName + '?api=v2'); candidates.push('/download/attachments/' + pageId + '/' + encodedName); } dentro de um bloco PRE/CODE, o Confluence pode inserir </pre> no final. // fallback: página “principal” antigaIsso (sequebra existir o anexoJavaScript láe também) fica preso candidates.push('/download/attachments/649987902/' + encodedName); let idx = 0; function tryNext() { if (idx >= candidates.length) return; const url = candidates[idx++]; const probe = new Image(); probe.onload = function() { logoEl.src = url;em "Carregando...". logoEl.style.display = 'inline-block'; }; probe.onerror = function() { --> tryNext(); }; probe.src = url; } tryNext(); } // Tenta resolver o logo mesmo antes de identificar versão/documento setTotvsLogo(); function renderNotAvailable() { // Mantém o link (se existir) para permitir abrir manualmente no GitHub container.innerHTML = '<div style="padding:18px; border-left:4px solid #FFAB00; background:#FFFAE6; color:#172b4d;">' + '<div style="font-weight:700;">Esse documento ainda não está disponível no momento#6b778c;">Carregando documento...</div>' + '</div>'; } function getVersionOverrideFromQuery() {</div> try { const qs = new URLSearchParams(window.location.search);</div> const v = qs.get('version') || qs.get('versao');<!-- if (v && /^\d+\.\d+\.\d+(?:\.\d+)?$/.test(v)) return v;IMPORTANTE: }- catchO (e)TDN {está /* ignore */ } return null; } const version = getPageVersion(); const container = document.getElementById('widget-container'); const docLink = document.getElementById('doc-link'); const versionResolved = getVersionOverrideFromQuery() || version; if (!versionResolved) { container.innerHTML = '<div style="padding:18px; border-left:4px solid #DE350B; background:#FFEBE6; color:#172b4d;">' + '<div style="font-weight:700; margin-bottom:6px;">Versão não identificada</div>' + '<div>Coloque a versão no título da página, ex: <b>Dicionário de Dados 12.1.2503.14</b></div>' + '</div>'; return; } document.getElementById('version-display').textContent = versionResolved; document.getElementById('page-title').textContent = 'Dicionário de Dados ' + versionResolved; document.getElementById('last-update').textContent = new Date().toLocaleString('pt-BR'); const rawUrl = GITHUB_RAW_BASE + versionResolved + '.txt'; const blobUrl = 'https://github.com/Juansimeoni/ReleaseDatasul/blob/main/' + versionResolved + '.txt'; // Link para o GitHub (visual) docLink.href = blobUrl; docLink.textContent = 'Abrir no GitHub'; docLink.style.display = 'inline-block'; container.innerHTML = '<div style="padding:18px; color:#6b778c;">Carregando conteúdo do GitHub...</div>'; fetch(rawUrl, { cache: 'no-store' }) .then(function(resp) {injetando </pre> no final de <script> inline (isso aparece no view-source e quebra o JS). - Solução estável: carregar o JS via SRC (arquivo público no GitHub RAW), sem JS inline. - Este arquivo `tdn_release_widget.js` precisa existir no repo `Juansimeoni/ReleaseDatasul` (na raiz) para funcionar. --> <!-- IMPORTANT: do NOT use raw.githubusercontent.com for JS <script src>. GitHub RAW if (!resp.ok) return ''; return resp.text(); }) .then(function(txt) { txt = (txt || '').trim();serves JS as text/plain with nosniff, so browsers refuse to execute it (strict MIME). Use ifjsDelivr (!txt) { renderNotAvailable(); return; } // Renderiza texto em <pre> preservando formatação const pre = document.createElement('pre'); pre.style.whiteSpace = 'pre-wrap';or another CDN) which serves application/javascript. --> <!-- Dica: para evitar pre.style.margin = '0'; pre.style.padding = '16px'; pre.style.borderTop = '1px solid #dfe1e6'; pre.style.fontFamily = 'Consolas, Menlo, Monaco, \"Courier New\", monospace'; pre.textContent = txt; cache do CDN, pode "pin"ar por commit SHA (imutável). --> container.innerHTML = ''; container.appendChild(pre); }) .catch(function() { renderNotAvailable(); }); })(); </script> </body> </html><script src="https://cdn.jsdelivr.net/gh/Juansimeoni/ReleaseDatasul@aacbab7efc799ce5204d55a142412e3631ddf87c/tdn_release_widget.js"></script> |
Visão Geral
Import HTML Content
Conteúdo das Ferramentas
Tarefas