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

Por equipe do Dicionário de Favelas Marielle Franco
Sem resumo de edição
Sem resumo de edição
Linha 4: Linha 4:
 
 


/* Google Analytics
var imported = document.createElement('script');
imported.src = 'https://www.googletagmanager.com/gtag/js?id=UA-162806132-1';
document.head.appendChild(imported);
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
ggtag('config', 'UA-162806132-1');
 


/* Sidebar
/* Sidebar

Edição das 11h09min de 9 de abril de 2020

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

 


/* Sidebar

function ModifySidebar( action, section, name, link ) { try { switch ( section ) { case 'languages': var target = 'p-lang'; break; case 'toolbox': var target = 'p-tb'; break; case 'navigation': var target = 'p-navigation'; break; default: var target = 'p-' + section; break; }

if ( action == 'add' ) { var node = document.getElementById( target ) .getElementsByTagName( 'div' )[0] .getElementsByTagName( 'ul' )[0];

var aNode = document.createElement( 'a' ); var liNode = document.createElement( 'li' );

aNode.appendChild( document.createTextNode( name ) ); aNode.setAttribute( 'href', link ); liNode.appendChild( aNode ); liNode.className = 'plainlinks'; node.appendChild( liNode ); }

if ( action == 'remove' ) { var list = document.getElementById( target ) .getElementsByTagName( 'div' )[0] .getElementsByTagName( 'ul' )[0];

var listelements = list.getElementsByTagName( 'li' );

for ( var i = 0; i < listelements.length; i++ ) { if ( listelements[i].getElementsByTagName( 'a' )[0].innerHTML == name || listelements[i].getElementsByTagName( 'a' )[0].href == link ) { list.removeChild( listelements[i] ); } } }

} catch( e ) { // let's just ignore what's happened return; } }

function CustomizeModificationsOfSidebar() { // adds [[Especial:Árvore_de_categorias|Special:CategoryTree]] to toolbox ModifySidebar( 'add', 'toolbox', 'CategoryTree', '[https://en.wikipedia.org/wiki/Special:CategoryTree' https://en.wikipedia.org/wiki/Special:CategoryTree'] ); // removes [[Especial:Carregar_arquivo|Special:Upload]] from toolbox ModifySidebar( 'remove', 'toolbox', 'Upload file', '[https://en.wikipedia.org/wiki/Special:Upload' https://en.wikipedia.org/wiki/Special:Upload'] ); }

jQuery( CustomizeModificationsOfSidebar )

document.getElementById('p-tb').remove()

*/