[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/admin/js/ -> customizer-receiver-emails.js (source)

   1  /**
   2   * Customizer implementation for Email.
   3   *
   4   * If you're looking to add JS for every instance of a control, don't add it here.
   5   * The file only implements the Customizer controls for Emails.
   6   *
   7   * @since 2.5.0
   8   */
   9  
  10  (function( $ ) {
  11      wp.customize( 'bp_email_options[email_bg]', function( value ) {
  12          value.bind(function( newval ) {
  13              if ( newval.length ) {
  14                  $( '.email_bg' ).attr( 'bgcolor', newval );
  15                  $( 'hr' ).attr( 'color', newval );
  16              }
  17          });
  18      });
  19  
  20      wp.customize( 'bp_email_options[header_bg]', function( value ) {
  21          value.bind(function( newval ) {
  22              if ( newval.length ) {
  23                  $( '.header_bg' ).attr( 'bgcolor', newval );
  24              }
  25          });
  26      });
  27  
  28      wp.customize( 'bp_email_options[header_text_size]', function( value ) {
  29          value.bind(function( newval ) {
  30              if ( newval.length ) {
  31                  $( '.header_text_size' ).css( 'font-size', newval + 'px' );
  32              }
  33          });
  34      });
  35  
  36      wp.customize( 'bp_email_options[header_text_color]', function( value ) {
  37          value.bind(function( newval ) {
  38              if ( newval.length ) {
  39                  $( '.header_text_color' ).css( 'color', newval );
  40              }
  41          });
  42      });
  43  
  44      wp.customize( 'bp_email_options[highlight_color]', function( value ) {
  45          value.bind(function( newval ) {
  46              if ( newval.length ) {
  47                  $( '.header_bg' ).css( 'border-top-color', newval );
  48                  $( 'a' ).css( 'color', newval );
  49                  $( 'hr' ).attr( 'color', newval );
  50              }
  51          });
  52      });
  53  
  54      wp.customize( 'bp_email_options[body_bg]', function( value ) {
  55          value.bind(function( newval ) {
  56              if ( newval.length ) {
  57                  $( '.body_bg' ).attr( 'bgcolor', newval );
  58              }
  59          });
  60      });
  61  
  62      wp.customize( 'bp_email_options[body_text_size]', function( value ) {
  63          value.bind(function( newval ) {
  64              if ( newval.length ) {
  65                  // 1.618 = golden mean.
  66                  $( '.body_text_size' )
  67                      .css( 'font-size', newval + 'px' )
  68                      .css( 'line-height', Math.floor( newval * 1.618 ) + 'px' );
  69  
  70                  // 1.35 = default body_text_size multipler. Gives default heading of 20px.
  71                  $( '.welcome' ).css( 'font-size', Math.floor( newval * 1.35 ) + 'px' );
  72              }
  73          });
  74      });
  75  
  76      wp.customize( 'bp_email_options[body_text_color]', function( value ) {
  77          value.bind(function( newval ) {
  78              if ( newval.length ) {
  79                  $( '.body_text_color' ).css( 'color', newval );
  80              }
  81          });
  82      });
  83  
  84      wp.customize( 'bp_email_options[footer_bg]', function( value ) {
  85          value.bind(function( newval ) {
  86              if ( newval.length ) {
  87                  $( '.footer_bg' ).attr( 'bgcolor', newval );
  88              }
  89          });
  90      });
  91  
  92      wp.customize( 'bp_email_options[footer_text_size]', function( value ) {
  93          value.bind(function( newval ) {
  94              if ( newval.length ) {
  95                  $( '.footer_text_size' )
  96                      .css( 'font-size', newval + 'px' )
  97                      .css( 'line-height', Math.floor( newval * 1.618 ) + 'px' );
  98              }
  99          });
 100      });
 101  
 102      wp.customize( 'bp_email_options[footer_text_color]', function( value ) {
 103          value.bind(function( newval ) {
 104              if ( newval.length ) {
 105                  $( '.footer_text_color' ).css( 'color', newval );
 106              }
 107          });
 108      });
 109  
 110      wp.customize( 'bp_email_options[footer_text]', function( value ) {
 111          value.bind(function( newval ) {
 112              $( '.footer_text' ).html( newval );
 113          });
 114      });
 115  })( jQuery );


Generated: Fri Nov 22 01:00:56 2024 Cross-referenced by PHPXref 0.7.1