 /**
   * The Customize Theme Script.
   *
   *
   * @package   ospersonality WordPress Theme
   * @copyright Copyright (C) 2015, OrdaSoft
   * @license  http://www.gnu.org/licenses/gpl-2.0.html  GNU General Public License v2 or later
   * @author    AUTHOR <www.ordasoft.com>
   * themeslug is distributed under the terms of the GNU GPL
   */
( function( $ ) {

     // Site title.
    wp.customize( 'blogname', function( value ) {
        value.bind( function( to ) {
            $( '.site-title a' ).text( to );
        } );
    } );

    // Site tagline.
    wp.customize( 'blogdescription', function( value ) {
        value.bind( function( to ) {
            $( '.site-description' ).text( to );
        } );
    } );

    //--------------------Logo
    wp.customize( 'osbase_logo_img', function( value ) {
        value.bind( function( newval ) {
            $('body').html('img', newval );
        } );
    } );

//***********************General*********************

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.widget_title_content_top').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.title').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.page-numbers').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.add_to_cart_button').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.button').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.more-button').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.product-category h3').css('color', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.title-home-page').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('#myTab .active').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.wpcf7-submit').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('#myTab a').css('color', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.page-content h3').css('color', newval );
        } );
    } );

//----------------------Body font
    wp.customize( 'ospersonality_body_font', function( value ) {
        value.bind( function( newval ) {
            $('body').css('font-family', newval );
        } );
    } );

//-------------------Body font size
    wp.customize( 'ospersonality_font_size', function( value ) {
        value.bind( function( newval ) {
            $('body').css('font-size', newval+'px' );
        } );
    } );

//---------------------Body font color
    wp.customize( 'ospersonality_font_color', function( value ) {
        value.bind( function( newval ) {
            $('body').css('color', newval );
        } );
    } );

//----------------------Theme Color
    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.widget_title').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.theme-color').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.more-button').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.add_to_cart_button').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('input[type="submit"]').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.page-numbers').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.button').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.onsale').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('#wp-calendar caption').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.menu-item-has-children ul').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.shadow').css('text-shadow', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.desc').css('border-left-color', newval );
        } );
    } );

    wp.customize( 'ospersonality_theme_color', function( value ) {
        value.bind( function( newval ) {
            $('.menu-item:before').css('border-color', newval );
        } );
    } );

    wp.customize( 'ospersonality_custom_css', function( value ) {
        value.bind( function( newval ) {
          $( '#ospersonality-custom-css' ).html( newval );
        } );
      } );

    wp.customize( 'header_layout_home', function( value ) {
        value.bind( function( newval ) {
          $( '.header' ).html( newval );
        } );
      } );


//---------------------header title
    wp.customize( 'ospersonality_header_title_top', function( value ) {
        value.bind( function( newval ) {
          $( ".header-title .top-text" ).html( newval );
        } );
      } );

    wp.customize( 'ospersonality_header_title_center', function( value ) {
        value.bind( function( newval ) {
          $( ".header-title .color-text" ).html( newval );
        } );
      } );

    wp.customize( 'ospersonality_header_title_bottom', function( value ) {
        value.bind( function( newval ) {
          $( '.bottom-text' ).html( newval );
        } );
      } );
//----------------------Body link size
    wp.customize( 'ospersonality_link_size', function( value ) {
        value.bind( function( newval ) {
            $('body a').css('font-size', newval );
        } );
    } );

//----------------------Body links color
    wp.customize( 'ospersonality_link_color', function( value ) {
        value.bind( function( newval ) {
            $('body a').css('color', newval );
        } );
    } );

//---------------Body link hover color
    wp.customize( 'ospersonality_link_hover_color', function( value ) {
        value.bind( function( newval ) {
            $('body a:hover').css('color', newval );
        } );
    } );

//------------------Body link decoration
    wp.customize( 'ospersonality_link_underline', function( value ) {
        value.bind( function( newval ) {
            $('body a').css('text-decoration', newval );
        } );
    } );

//--------------------Body link hover decoration
    wp.customize( 'ospersonality_link_underline_hover', function( value ) {
        value.bind( function( newval ) {
            $('body a:hover').css('text-decoration', newval );
        } );
    } );

//--------------------Custom CSS
    wp.customize( 'ospersonality_custom_css', function( value ) {
        value.bind( function( newval ) {
            $('body').text(' ', newval );
        } );
    } );


//--------------------Logo
    wp.customize( 'ospersonality_logo_img', function( value ) {
        value.bind( function( newval ) {
            $('body').html('img', newval );
        } );
    } );

    wp.customize( 'ospersonality_soc_size', function( value ) {
        value.bind( function( newval ) {
            $('#social a').css('font-size', newval );
        } );
    } );


//--------------------------------typography------------------------------------------

wp.customize( 'ospersonality_h1_font', function( value ) {
        value.bind( function( newval ) {
            $('body h1').css('font-family', newval );
        } );
    } );
wp.customize( 'ospersonality_h1_color', function( value ) {
        value.bind( function( newval ) {
            $('body h1').css('color', newval );
        } );
    } );

wp.customize( 'ospersonality_h2_font', function( value ) {
        value.bind( function( newval ) {
            $('body h2').css('font-family', newval );
        } );
    } );
wp.customize( 'ospersonality_h2_color', function( value ) {
        value.bind( function( newval ) {
            $('body h2').css('color', newval );
        } );
    } );

wp.customize( 'ospersonality_h3_font', function( value ) {
        value.bind( function( newval ) {
            $('body h3').css('font-family', newval );
        } );
    } );
wp.customize( 'ospersonality_h3_color', function( value ) {
        value.bind( function( newval ) {
            $('body h3').css('color', newval );
        } );
    } );

wp.customize( 'ospersonality_h4_font', function( value ) {
        value.bind( function( newval ) {
            $('body h4').css('font-family', newval );
        } );
    } );
wp.customize( 'ospersonality_h4_color', function( value ) {
        value.bind( function( newval ) {
            $('body h4').css('color', newval );
        } );
    } );

wp.customize( 'ospersonality_h5_font', function( value ) {
        value.bind( function( newval ) {
            $('body h5').css('font-family', newval );
        } );
    } );
wp.customize( 'ospersonality_h5_color', function( value ) {
        value.bind( function( newval ) {
            $('body h5').css('color', newval );
        } );
    } );

wp.customize( 'ospersonality_h6_font', function( value ) {
        value.bind( function( newval ) {
            $('body h6').css('font-family', newval );
        } );
    } );
wp.customize( 'ospersonality_h6_color', function( value ) {
        value.bind( function( newval ) {
            $('body h6').css('color', newval );
        } );
    } );


//-----------------------------menu-------------------------------------------
    wp.customize( 'ospersonality_menu_font', function( value ) {
        value.bind( function( newval ) {
            $('.nav-menu ul li a').css('font-family', newval );
        } );
    } );

    wp.customize( 'ospersonality_menu_font', function( value ) {
        value.bind( function( newval ) {
            $('#menu-menu li a').css('font-family', newval );
        } );
    } );

    wp.customize( 'ospersonality_menu_font_size', function( value ) {
        value.bind( function( newval ) {
            $('.nav-menu ul li a').css('font-size', newval+'px');
        } );
    } );

    wp.customize( 'ospersonality_menu_font_size', function( value ) {
        value.bind( function( newval ) {
            $('#menu-menu li a').css('font-size', newval+'px');
        } );
    } );

    wp.customize( 'ospersonality_menu_margin', function( value ) {
        value.bind( function( newval ) {
            $('.nav-menu ul li').css('margin', newval+'px');
        } );
    } );

    wp.customize( 'ospersonality_menu_margin', function( value ) {
        value.bind( function( newval ) {
            $('#menu-menu li').css('margin', newval+'px');
        } );
    } );

    wp.customize( 'ospersonality_menu_color', function( value ) {
        value.bind( function( newval ) {
            $('.nav-menu ul li a').css('color', newval );
        } );
    } );

    wp.customize( 'ospersonality_menu_hover_color', function( value ) {
        value.bind( function( newval ) {
            $('.nav-menu ul li a:hover').css('color', newval  );
        } );
    } );

    wp.customize( 'ospersonality_menu_underline', function( value ) {
        value.bind( function( newval ) {
            $('.nav-menu ul li a').css('text-decoration', newval  );
        } );
    } );

    wp.customize( 'ospersonality_menu_underline_hover', function( value ) {
        value.bind( function( newval ) {
            $('.nav-menu ul li a:hover').css('text-decoration', newval  );
        } );
    } );

    wp.customize( 'ospersonality_submenu_color', function( value ) {
        value.bind( function( newval ) {
            $('.children li a').css('color', newval  );
        } );
    } );

    wp.customize( 'ospersonality_submenu_hover_color', function( value ) {
        value.bind( function( newval ) {
            $('.children li a:hover').css('color', newval  );
        } );
    } );

//soc icons---------------------------------------------------------------------------------------------------------------------------------------------------

    wp.customize( 'ospersonality_soc_size', function( value ) {
        value.bind( function( newval ) {
            $('#social a').css('font-size', newval+'px' );
        } );
    } );

    wp.customize( 'ospersonality_soc_color', function( value ) {
        value.bind( function( newval ) {
            $('#social a').css('color', newval );
        } );
    } );

    wp.customize( 'ospersonality_soc_color_hover', function( value ) {
        value.bind( function( newval ) {
            $('#social a:hover').css('color', newval );
        } );
    } );



    wp.customize( 'ospersonality_home_width', function( value ) {
        value.bind( function( newval ) {
          $( '#content' ).removeClass("container").addClass( newval );
        } );
    } );


    wp.customize( 'ospersonality_products_column', function( value ) {
        value.bind( function( newval ) {
          $( 'div[row="one-product"]' ).removeClass().addClass( newval );
        } );
    } );

    wp.customize( 'ospersonality_shop_show', function( value ) {
        value.bind( function( newval ) {
          $( '#shop-section' ).attr( 'style', newval );
        } );
    } );

    wp.customize( 'ospersonality_any_section_show', function( value ) {
        value.bind( function( newval ) {
          $( '#any-section' ).attr( 'style', newval );
        } );
    } );

    wp.customize( 'ospersonality_content_show', function( value ) {
        value.bind( function( newval ) {
          $( '.page-content' ).attr( 'style', newval );
        } );
    } );


//-----------------------header layout -------------------------------------------------

    wp.customize( 'ospersonality_button_text', function( value ) {
        value.bind( function( newval ) {
          $( '.button-about' ).html( newval );
        } );
      } );

    wp.customize( 'ospersonality_more_button', function( value ) {
        value.bind( function( newval ) {
          $( '.more-button' ).html( newval );
        } );
      } );


    wp.customize( 'ospersonality_header_layout_home', function( value ) {
            value.bind( function( newval ) {
              $( '.header' ).attr("id", newval);
            } );
        } );

     wp.customize( 'ospersonality_home_blog_title', function( value ) {
        value.bind( function( newval ) {
          $( '.title' ).html( newval );
        } );
    } );

     wp.customize( 'ospersonality_home_blog_desc', function( value ) {
        value.bind( function( newval ) {
          $( '.title-desc' ).html( newval );
        } );
    } );

     wp.customize( 'ospersonality_home_shop_title', function( value ) {
        value.bind( function( newval ) {
          $( '.title' ).html( newval );
        } );
    } );

     wp.customize( 'ospersonality_home_shop_desc', function( value ) {
        value.bind( function( newval ) {
          $( '.title-desc' ).html( newval );
        } );
    } );

     wp.customize( 'ospersonality_any_section_title', function( value ) {
        value.bind( function( newval ) {
          $( '.title' ).html( newval );
        } );
    } );

     wp.customize( 'ospersonality_any_section_desc', function( value ) {
        value.bind( function( newval ) {
          $( '.title-desc' ).html( newval );
        } );
    } );


    //Footer-------------------

    wp.customize( 'ospersonality_footer_background', function( value ) {
        value.bind( function( newval ) {
            $('.site-footer').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_copyright_text', function( value ) {
        value.bind( function( newval ) {
            $('.site-footer').css('background', newval );
        } );
    } );

    wp.customize( 'ospersonality_copyright_font', function( value ) {
        value.bind( function( newval ) {
            $('#copyright p').css('font-family', newval );
        } );
    } );

    wp.customize( 'ospersonality_copyright_font', function( value ) {
        value.bind( function( newval ) {
            $('#copyright a').css('font-family', newval );
        } );
    } );

    wp.customize( 'ospersonality_copyright_font_size', function( value ) {
        value.bind( function( newval ) {
            $('#copyright a').css('font-size', newval+'px' );
        } );
    } );

    wp.customize( 'ospersonality_copyright_font_size', function( value ) {
        value.bind( function( newval ) {
            $('#copyright p').css('font-size', newval+'px' );
        } );
    } );

    wp.customize( 'ospersonality_copyright_color', function( value ) {
        value.bind( function( newval ) {
            $('#copyright p').css('color', newval );
        } );
    } );

    wp.customize( 'ospersonality_copyright_color', function( value ) {
        value.bind( function( newval ) {
            $('#copyright a').css('color', newval );
        } );
    } );

    wp.customize( 'ospersonality_copyright_hover_color', function( value ) {
        value.bind( function( newval ) {
            $('#copyright a:hover').css('color', newval );
        } );
    } );

    wp.customize( 'ospersonality_copyright_underline', function( value ) {
        value.bind( function( newval ) {
            $('#copyright a').css('text-decoration', newval );
        } );
    } );

    wp.customize( 'ospersonality_copyright_underline_hover', function( value ) {
        value.bind( function( newval ) {
            $('#copyright a:hover').css('text-decoration', newval );
        } );
    } );

    wp.customize( 'ospersonality_copyright_text', function( value ) {
        value.bind( function( newval ) {
          $( '#copyright p' ).html( newval );
        } );
    } );


} )( jQuery );

