Widget:MainPageChangelog

De Wiki Gla
Revisão de 14h19min de 10 de setembro de 2025 por Gurren1 (discussão | contribs)
Ir para navegação Ir para pesquisar

<style>

 .widget-changelog {
   max-height: 280px;
   overflow-y: auto;
   padding-right: 5px;
   box-sizing: border-box;
 }
 .notice-item {
   display: flex;
   align-items: flex-start;
   position: relative;
   gap: 0;
   background: #fff;
   border: 1px solid #ddd;
   border-left: 4px solid var(--notice-color, #999);
   padding: 10px 10px;
   border-radius: 6px;
   margin: 0 0 8px 0;
 }
 .notice-content { flex: 1; min-width: 0; }
 .notice-header {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 8px;
   margin-bottom: 6px;
 }
 .notice-header-left {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   min-width: 0;
 }
 .notice-title {
   font-weight: 700;
   font-size: 14px;
   line-height: 1.2;
   display: inline-flex;
   align-items: center;
   gap: 6px;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
   max-width: 100%;
 }
 .notice-title a {
   text-decoration: none;
 }
 .notice-date {
   font-size: 12px;
   color: #666;
   white-space: nowrap;
 }
 .notice-desc {
   margin: 0;
   font-size: 13px;
   color: #333;
 }
 /* Ícones — sem margin-right */
 .notice-icon {
   width: 32px;
   height: 32px;
   object-fit: contain;
   flex-shrink: 0;
   border-radius: 4px;
   background: transparent;
   margin-right: 0 !important; /* zera */
   margin-top: 2px;
   position: static;
   opacity: 0.9;
 }
 .notice-icon--inline {
   display: inline-block;
   width: 32px;
   height: 32px;
   margin-right: 0 !important; /* zera */
   position: static;
   opacity: 0.9;
 }
 .notice-icon--overlay { display: none !important; }

</style>

<script> document.addEventListener('DOMContentLoaded', function () {

 const root = document.querySelector('.widget-changelog');
 if (!root) return;
 // 1) Promove título -> <a href=... target=_blank>
 root.querySelectorAll('.notice-item').forEach(function (item) {
   const linkEl = item.querySelector('.notice-link');
   const titleEl = item.querySelector('.notice-title');
   if (!linkEl || !titleEl) return;
   // Normaliza URL (remove quebras e espaços)
   let url = (linkEl.textContent || ).replace(/[\r\n\t]/g, ).replace(/\s+/g, );
   if (!url) return;
   // Se já tiver <a>, não duplica
   if (titleEl.querySelector('a')) return;
   // Texto do título
   const textSpan = titleEl.querySelector('.notice-title-text');
   const text = (textSpan ? textSpan.textContent : titleEl.textContent).trim();
   titleEl.innerHTML = ;
   const a = document.createElement('a');
   a.href = url;
   a.target = '_blank';
   a.rel = 'noopener noreferrer';
   a.textContent = text || url;
   titleEl.appendChild(a);
 });
 // 2) Por segurança, garante target/_blank em qualquer link dentro do bloco
 root.querySelectorAll('a').forEach(function (a) {
   a.setAttribute('target', '_blank');
   a.setAttribute('rel', 'noopener noreferrer');
 });

}); </script>