"मेडियाविकि:Gadget-switcher.js" के अवतरणसभमे अन्तर

Content deleted Content added
अनुवाद
Update per enwiki
 
पङ्क्त्ति १:
'use strict';
$( function ( $ ) {
'use strict';
$.each( document.querySelectorAll( '.switcher-container' ), function ( i ) {
ifvar ( !activeElement ) {,
$( '.switcher-container' ).each( function ( i ) {
switchers = [], container = this, radioName = 'switcher-' + i;
var activeElement, $showRadio, $showAllRadio;
$.each( this ).children().each(, function () {
var elements = [], container = this;
var radioName$radio, = 'switcher-' += i;this,
var $labelContainer = $( this )switcher.findquerySelector( '.switcher-label') );,
$( this ).children().each( function () {
var $labelText = $labelContainer.contents();
var self = this;
if ( !$labelText.length ) {
var $labelContainer = $( this ).find( '.switcher-label' );
return;
var $labelText = $labelContainer.contents();
}
if ( !$labelText.length ) {
switchers.push( switcher );
return;
$showRadioradio = $( '<input type="radio" />' ).attr( 'name', radioName ).click( function () {
}
elements.push$( thisactiveElement ).hide();
$( selfswitcher ).show();
$showRadio = $( '<input type="radio" />' ).attr( 'name', radioName ).click( function () {
$( activeElement ).hide()= switcher;
$( self ).show();
activeElement = self;
} );
$( '<label style="display:block"></label>' ).append( $showRadio ).append( $labelText ).appendTo( container );
if ( !activeElement ) {
activeElement = this;
$showRadio.prop( 'checked', true );
} else if ( $labelContainer.is( '[data-switcher-default]' ) ) {
$showRadio.click();
} else {
$( this ).hide();
}
$labelContainer.remove();
} );
if ( elements.length > 1!activeElement ) {
// Mark the first one as selected
$showAllRadio = $( '<input type="radio" />' ).attr( 'name', radioName ).click( function () {
activeElement = thisswitcher;
$( elements ).show();
$showRadioradio.prop( 'checked', true );
activeElement = elements;
} else if ( $labelContainer.isattr( '[data-switcher-default]' ) !== undefined ) {
} );
// Custom default
$( '<label style="display:block">सभ देखी</label>' ).prepend( $showAllRadio ).appendTo( container );
$showRadioradio.click();
} else if ( elements.length === 1 ) {
} else {
$showRadio.remove();
// Hide non-default
$( thisswitcher ).hide();
}
$( '<label style="display:block"></label>' ).append( $showRadio ).append(radio, $labelText ).appendTo( container );
$labelContainer.remove();
} );
if ( switchers.length > 1 ) {
$( '<label style="display:block">सभ देखी</label>' ).prepend( $showAllRadio ).appendTo( container );
$showAllRadio = $( '<input type="radio" />' ).attr( 'name', radioName ).click( function () {
$( elementsswitchers ).show();
activeElement = selfswitchers;
} );
).appendTo( container );
}
} else if ( elementsswitchers.length === 1 ) {
$showRadioradio.remove();
}
} );
} )( jQuery );