MediaWiki:Common.js: Unterschied zwischen den Versionen

$( '.additional' ).each(function() {

   var $elem = $(this);
   var $toggle = $('<a href="#" class="bs-icon-info"></a>');
   $toggle.on( 'click', function( e ) {
       $elem.toggleClass( 'show' );
       e.defaultPrevented = true;
   });
   $toggle.insertBefore( $elem );

});

$( '.languageselector' ).each(function() {

                   var languages = [ 'de', 'en', 'cz', 'pl', 'hu' ];
   var $selector = $('<select>');
   for( var i = 0; i < languages.length; i++ ) {
       var language = languages[i];
       var $option = $('<option>');
       $option.html( language  );
       $option.val( language  );

            
                       $selector.append( $option );
   }
   $(this).append( $selector );

            

});

$( '.additional' ).each(function() {
        
            var $elem = $(this);
        
            var $toggle = $('<a href="#" class="bs-icon-info"></a>');
        
            $toggle.on( 'click', function( e ) {
        
                $elem.toggleClass( 'show' );
        
                e.defaultPrevented = true;
        
            });
        
            $toggle.insertBefore( $elem );
        
        });
            
            
            
            $( '.languageselector' ).each(function() {
            
                var languages = [ 'de', 'en', 'cz', 'pl', 'hu' ];
            
                var $selector = $('<select>');
            
                for( var i = 0; i < languages.length; i++ ) {
                
                        var language = languages[i];
                
                        var $option = $('<option>');
            
                    $option.html( language  );
            
                    $option.val( language  );
            
            
            
                    $selector.append( $option );
            
                }
            
                $(this).append( $selector );
            
            });
Zeile 7: Zeile 7:
 
     });
 
     });
 
     $toggle.insertBefore( $elem );
 
     $toggle.insertBefore( $elem );
 +
});
 +
 +
$( '.languageselector' ).each(function() {
 +
    var languages = [ 'de', 'en', 'cz', 'pl', 'hu' ];
 +
    var $selector = $('<select>');
 +
    for( var i = 0; i < languages.length; i++ ) {
 +
        var language = languages[i];
 +
        var $option = $('<option>');
 +
        $option.html( language  );
 +
        $option.val( language  );
 +
 +
        $selector.append( $option );
 +
    }
 +
    $(this).append( $selector );
 
});
 
});