Ir para o conteúdo

MediaWiki:Common.js: mudanças entre as edições

De Cine Linux Wiki
Sem resumo de edição
Etiqueta: Revertido
Sem resumo de edição
Etiqueta: Reversão manual
 
(16 revisões intermediárias pelo mesmo usuário não estão sendo mostradas)
Linha 1: Linha 1:
/* Códigos JavaScript aqui colocados serão carregados por todos aqueles que acessarem alguma página deste wiki */
/* Códigos JavaScript aqui colocados serão carregados por todos aqueles que acessarem alguma página deste wiki */
/* Fontes Externas */
mw.loader.using('mediawiki.util', function () {
    var link = document.createElement('link');
    link.rel = 'stylesheet';
    link.href = 'https://fonts.googleapis.com/css2?family=Gemunu+Libre:wght@200..800&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap';
    document.head.appendChild(link);
});
/* Alterar Texto Logo no Vector 2022 */
$(document).ready(function () {
  const $wordmark = $('.mw-logo-wordmark');
  if ($wordmark.length) {
    $wordmark.html(`WIKI`);
  }
});


/* Esse script seleciona todos os links na barra lateral que começam com http (ou seja, links externos) e adiciona target="_blank", fazendo com que abram em nova aba. */   
/* Esse script seleciona todos os links na barra lateral que começam com http (ou seja, links externos) e adiciona target="_blank", fazendo com que abram em nova aba. */   
Linha 7: Linha 23:
});
});


/* SOFTWARE INFOBOX */
/* Listar Categorias */
.software-infobox {
fetch('/api.php?action=query&list=allcategories&aclimit=100&format=json&origin=*')
   float: right;
   .then(res => res.json())
  margin: 0 0 1em 1em;
   .then(data => {
  width: 300px;
    const ul = document.getElementById('categories-list');
  border: 2px solid #ccc;
    data.query.allcategories.forEach(cat => {
  border-radius: 12px;
      const li = document.createElement('li');
  background-color: #f9f9f9;
      const link = document.createElement('a');
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
      const catName = cat['*'];
   overflow: hidden;
      link.href = '/index.php/Category:' + encodeURIComponent(catName);
}
      link.textContent = catName;
 
      li.appendChild(link);
.software-infobox th {
      ul.appendChild(li);
  font-size: 16px;
    });
  font-weight: bold;
   });
  text-align: center;
  padding: 20px;
  background: #E8E6F4;
}
 
.software-infobox td,
.software-infobox th {
  padding-top: 10px;
  paddin-bottom: 10px;
  border-bottom: 1px solid #ddd;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  vertical-align: top;
}
 
.software-infobox .highlight {
  background: #fedbd2;
  font-weight: bold;
   text-align: center;
}
 
.software-infobox .image-cell {
  text-align: center;
  border-bottom: none;
}

Edição atual tal como às 16h56min de 2 de julho de 2025

/* Códigos JavaScript aqui colocados serão carregados por todos aqueles que acessarem alguma página deste wiki */

/* Fontes Externas */
mw.loader.using('mediawiki.util', function () {
    var link = document.createElement('link');
    link.rel = 'stylesheet';
    link.href = 'https://fonts.googleapis.com/css2?family=Gemunu+Libre:wght@200..800&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap';
    document.head.appendChild(link);
});

/* Alterar Texto Logo no Vector 2022 */
$(document).ready(function () {
  const $wordmark = $('.mw-logo-wordmark');
  if ($wordmark.length) {
    $wordmark.html(`WIKI`);
  }
});

/* Esse script seleciona todos os links na barra lateral que começam com http (ou seja, links externos) e adiciona target="_blank", fazendo com que abram em nova aba. */   
$(document).ready(function () {
  // Alvo: links externos na barra lateral
  $('#mw-site-navigation a[href^="http"]').attr('target', '_blank');
});

/* Listar Categorias */
fetch('/api.php?action=query&list=allcategories&aclimit=100&format=json&origin=*')
  .then(res => res.json())
  .then(data => {
    const ul = document.getElementById('categories-list');
    data.query.allcategories.forEach(cat => {
      const li = document.createElement('li');
      const link = document.createElement('a');
      const catName = cat['*'];
      link.href = '/index.php/Category:' + encodeURIComponent(catName);
      link.textContent = catName;
      li.appendChild(link);
      ul.appendChild(li);
    });
  });