/** * Functions in this bpq variable can be reused outside of this file. */ var bpq = { /** * Shortcut function to resize all potential stripes. */ resize_all_stripes: function() { jQuery( '.stripe' ).each( function() { bpq.resize_stripe( jQuery( this ) ); }); }, /** * Give this function the element with a class of .stripe and it will * resize it so that it hits the left and right edges of the window. */ resize_stripe: function( stripe ) { // The stripe's background has no dimension, but the stripe itself does. // Use this information to give the background proper dimension. var background = stripe.find( '.background' ); background.css( 'width', stripe.css( 'width' ) ); background.css( 'height', stripe.outerHeight() + 'px' ); // Note: The +1 handles a weird case where there is a 1-pixel gap between stripes // For specific span formats, the width should span the screen. var body = stripe.closest( 'body.bleed-wide, body.bleed-narrow' ); if ( body.length > 0 ) { background.css( 'width', jQuery( window ).width() ); background.css( 'margin-left', +stripe.offset().left * -1 ); } }, }; /** * Event for when the page markup is loaded. */ jQuery( document ).ready( function( $ ) { /** * Event for when the page content is completely loaded. */ $( window ).load( function() { /** * The comment_form() template function from WP does NOT offer a * way to set a class to the submit button - as such, the workaround * is to add the class after the fact. */ $( '#comment-submit' ).addClass( 'btn btn-default' ); /** * The form provided by SendPress is not styled like Bootstrap - * so add the appropriate classes after it has been displayed. */ $( 'div.sendpress input[class^="sp_"]' ).addClass( 'form-control' ); $( 'div.sendpress input.sendpress-submit' ).addClass( 'btn btn-default' ); /** * The login page is very funky - the overrides that the system provides * are simply not enough. As a result, classes must be inserted into * specific elements to make things a bit more BluePrint-Q/Bootstrap. */ $( '#login #wp-submit' ).addClass( 'btn btn-primary' ); $( '#user_login, #user_pass, #rememberme' ).addClass( 'form-control' ); $( 'p.message' ).before( '