$(function() { $('html').removeClass('client-nojs'); $('#page-contents a').click(function(e){ e.preventDefault(); var $target = $(this).attr('href'); $(document).scrollTop( $($target).offset().top-100 ); }); $( document ).on('change', '#subnav-select', function() { window.location = $(this).val(); }); $('table') .not('#toc') .not('.mw-specialpages-table') .each(function() { var $el = $(this); if( $el.closest('form').length == 0 ) { if ( $el.hasClass('info-box') ) { $el.addClass('table') .addClass('table-bordered'); } else { $el.addClass('table') .addClass('table-striped') .addClass('table-bordered'); }//end else }//end if }); $('pre:not([data-raw="true"])').addClass('prettyprint linenums'); $('.jumbotron pre').removeClass('prettyprint linenums'); $('.editButtons').addClass('well'); $('input[type=submit],input[type=button],input[type=reset]').addClass('btn'); $('input[type=submit]').addClass('btn-primary'); $('input[type=checkbox],input[type=radio]').each(function() { var $el = $(this); var id = $el.attr('id'); $( 'label[for=' + id + ']' ).each(function() { var $label = $(this); if( $.trim( $label.text() ) != '' ) { $el.prependTo( $label ); }//end if $label.wrap( '
' ); }); $el.closest('label').addClass($el.attr('type')); }); $('.tip').tooltip(); $('[data-toggle="popover"]').popover(); if ( $('.toc-sidebar').length > 0 ) { if ( 0 === $('#toc').length ) { $('.toc-sidebar').remove(); $('.wiki-body-section').removeClass('col-md-9').addClass('col-md-12'); } else { $('.toc-sidebar').append('

Contents

'); $('#toc').each(function() { $(this).find('ul:first').appendTo( '.toc-sidebar' ); $(this).remove(); }); $('.toc-sidebar').attr('id', 'toc'); }//end else } else { $('#toc').each(function() { var $toc = $(this); var $title = $toc.find('.toctitle'); var $links = $title.siblings('ul').find( 'a' ); $.each( $links.find( '.tocnumber' ), function() { var $el = $( this ); var numDots = ( $el.text().match( /\./g ) || [] ).length; var prefix = ''; for ( var i = 0; i < numDots; i++ ) { prefix += '  '; } $el.prepend( prefix ); } ); $links.addClass( 'dropdown-item' ); var toc_html = [ '' ]; $('.page-header').prepend( toc_html.join( ' ' ) ); $('.page-header #page-contents').find('.dropdown-menu').html( $links ); }); if( $('.page-header .nav').length === 0 ) { $('.page-header').prepend(''); }//end if var $header = $('.page-header'); var $hero = $('.jumbotron'); var $edit = $('.navbar .content-actions .edit'); if( $edit.length > 0 ) { var $editListItem = $( '