MediaWiki:Common.js: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m ritorno a Speciale:PermaLink/92937789 per investigare sul bug nel parsing JS |
refactoring WP:Live mirror (document.___location deprecato); ripristino refactoring mw-collapsible (stavolta strict ES5); +importScript ove possibile; dichiarazioni "var" spezzate nei loro blocchi |
||
Riga 15:
*/
( function () {
var
'wikipedia.sapere.alice.it',
'212.48.3.33',
Riga 22 ⟶ 21:
'213.92.16.218',
'it.wikipedia.net.ru'
if( badMirrors.indexOf( window.___location.host ) !== - 1 ) {
// redirect users to the same page on itwiki ▼
if ( isBad ) {▼
▲ // redirect users to the same page on itwiki
▲ //document.___location.href = '//it.wikipedia.org/wiki/' + mw.config.get( 'wgPageName' );
// redirect users to a landing page
}
} )();
Riga 52 ⟶ 45:
* Menu interprogetto nella sidebar, vedi anche [[Modulo:Interprogetto]]
*/
/**
Riga 87 ⟶ 80:
*/
function comboboxEdittools() {
var $specialChars = $( '#specialchars' )
if ( $specialChars.length ) {
var $select = $( '<select>' ).change( function () {
$specialChars.find( 'p' ).hide();
$specialChars.find( 'option:selected' ).data().show();
Riga 137 ⟶ 130:
}
var $realTitleBanner = $( '#RealTitleBanner' )
if ( $realTitleBanner.length && !$( '#DisableRealTitle' ).length ) {
var $realTitle = $realTitleBanner.find( '#RealTitle' );
var $firstH1 = $( 'h1:first' );
if ( $realTitle.length && $firstH1.length ) {
$realTitleBanner.hide();
Riga 167 ⟶ 160:
function initImageGroup() {
$( 'div.ImageGroup > div.ImageGroupUnits' ).each( function ( i, imageGroupUnits ) {
var
var $images = $( imageGroupUnits ).children( '.center' );
var $countInfo = $( '<kbd>' ).css( 'font-size', '110%' );
var $prevLink = $( '<a>' )
.attr( 'href', '#' ).attr( 'title', 'Immagine precedente' )
.text( '◀' ).css( 'text-decoration', 'none' )
Riga 177 ⟶ 170:
updateImageGroup( currImg -= 1, $images, $countInfo, $prevLink, $nextLink );
} );
var $nextLink = $( '<a>' )
.attr( 'href', '#' ).attr( 'title', 'Immagine successiva' )
.text( '▶' ).css( 'text-decoration', 'none' )
Riga 193 ⟶ 186:
/**
* Utilizzata con [[Template:Navbox]]: se presente più di una table
* con classi navbox e mw-collapsible, quelle con autocollapse si chiudono subito da sole.
* @author [[it:User:Rotpunkt]]
*/
function checkAutocollapse() {
if ( $( 'table.navbox.mw-collapsible' ).length > 1 ) {
$( 'table.navbox.mw-collapsible.autocollapse:not(.mw-collapsed)' ).each( function (
▲ // makeCollapsible a volte è eseguita prima, a volte successivamente al Common.js,
collapsible.collapse();
▲ if ( $( el ).data( 'mw-made-collapsible' ) ) {
▲ } else {
}
} );
Riga 218 ⟶ 207:
/* Normalizzazione dei caratteri particolari per l'ordinamento alfabetico nelle tabelle sortable.
In futuro potrebbe diventare default e non più necessario, vedi [[phab:T72157]] */
mw.config.set( 'tableSorterCollation', {'á':'a','à':'a','ă':'a','â':'a','ǎ':'a','å':'a','ä':'a','ã':'a','ā':'a','ȁ':'a',
|