Mudanças entre as edições de "Widget:MainPageChangelog"

De Wiki Gla
Ir para navegação Ir para pesquisar
m
m
 
(23 revisões intermediárias pelo mesmo usuário não estão sendo mostradas)
Linha 1: Linha 1:
<!-- Widget:MainPageChangelog -->
<style>
<div class="mp-changelog" style="
   .widget-changelog {
  --changelog-max-height: {{{max_height|280px}}};
    max-height: 280px;
  --changelog-padding-right: {{{padding_right|5px}}};
    overflow-y: auto;
">
    padding-right: 5px;
   <style>
    box-sizing: border-box;
    .widget-changelog {
  }
      max-height: var(--changelog-max-height);
 
      overflow-y: auto;
  .notice-item {
      padding-right: var(--changelog-padding-right);
    display: flex;
      box-sizing: border-box;
    align-items: flex-start;
    }
    position: relative;
    .notice-item {
    gap: 0;
      display: flex;
    background: #fff;
      align-items: flex-start;
    border: 1px solid #ddd;
      background: #fff;
    border-left: 4px solid var(--notice-color, #999);
      border: 1px solid #ddd;
    padding: 5px 10px;
      border-radius: 6px;
    border-radius: 6px;
      margin-bottom: 10px;
    margin: 0 0 8px 0;
      padding: 8px 10px;
  }
      box-sizing: border-box;
 
      border-left: 5px solid var(--notice-color, #f5b700);
  .notice-content { flex: 1; min-width: 0; }
     }
 
     .notice-content { flex: 1; }
  .notice-header {
    .notice-title {
    display: flex;
      display: block;
    align-items: center;
      font-size: 1.3em;
    justify-content: space-between;
      font-weight: bold;
    gap: 8px;
      color: #333;
    margin-bottom: 6px;
      text-decoration: none;
  }
       margin: 0;
 
  .notice-header-left {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    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;
 
  root.querySelectorAll('.notice-item').forEach(function (item) {
    const linkEl  = item.querySelector('.notice-link');
    const titleEl = item.querySelector('.notice-title');
    if (!linkEl || !titleEl) return;
 
    let url = (linkEl.getAttribute('data-url') || '')
      .replace(/[\r\n\t]/g, '')
       .trim();
    if (!url) return;
 
    if (!titleEl.querySelector('a')) {
      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);
     }
     }
    .notice-title:hover { text-decoration: underline; }
    .notice-date { font-size: 0.9em; color: #888; margin: -5px 0; }
    .notice-desc { color: #555; line-height: 1.3; margin: 0; }
    .notice-icon { object-fit: contain; flex-shrink: 0; }


     @media (prefers-color-scheme: dark) {
     // remove o marcador para não sobrar lixo no DOM
      .notice-item { background: #1b1b1b; border-color: #333; }
    linkEl.remove();
      .notice-title { color: #e6e6e6; }
  });
      .notice-date { color: #aaa; }
      .notice-desc { color: #ccc; }
    }
  </style>


   <!-- wrapper pra aplicar o CSS da widget -->
   // blindagem: qualquer link abre em nova aba
   <div class="widget-changelog">
   root.querySelectorAll('a').forEach(function (a) {
     {{{body}}}
    a.setAttribute('target', '_blank');
  </div>
     a.setAttribute('rel', 'noopener noreferrer');
</div>
  });
});
</script>

Edição atual tal como às 14h28min de 10 de setembro de 2025

<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: 5px 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: 1px;
   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;
 root.querySelectorAll('.notice-item').forEach(function (item) {
   const linkEl  = item.querySelector('.notice-link');
   const titleEl = item.querySelector('.notice-title');
   if (!linkEl || !titleEl) return;
   let url = (linkEl.getAttribute('data-url') || )
     .replace(/[\r\n\t]/g, )
     .trim();
   if (!url) return;
   if (!titleEl.querySelector('a')) {
     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);
   }
   // remove o marcador para não sobrar lixo no DOM
   linkEl.remove();
 });
 // blindagem: qualquer link abre em nova aba
 root.querySelectorAll('a').forEach(function (a) {
   a.setAttribute('target', '_blank');
   a.setAttribute('rel', 'noopener noreferrer');
 });

}); </script>