芝麻web文件管理V1.00
编辑当前文件:/home4/randall/public_html/sl/wp-content/themes/lorem-ipsum-books-media-store/js/theme.init.js
/* global jQuery:false */ /* global LOREM_IPSUM_BOOKS_MEDIA_STORE_STORAGE:false */ // Theme-specific first load actions //============================================== function lorem_ipsum_books_media_store_theme_ready_actions() { "use strict"; // Put here your init code with theme-specific actions // It will be called before core actions jQuery('.woocommerce div.quantity').on('click', 'span', function(e) { var f = jQuery(this).siblings('input'); f.change(); }); jQuery('.widget_nav_menu .menu-item-has-children > a').on('click', function(){ if (jQuery(window).width() < 768) { jQuery(this).siblings('.sub-menu').slideToggle(400, 'swing'); return false; } else { return false; }; }); // Comments //------------------------------------ // Checkbox with "I agree..." if (jQuery('input[type="checkbox"][name="i_agree_privacy_policy"]:not(.inited)').length > 0) { jQuery('input[type="checkbox"][name="i_agree_privacy_policy"]:not(.inited)') .addClass('inited') .on('change', function(e) { if (jQuery(this).get(0).checked) jQuery(this).parents('form').find('button,input[type="submit"]').removeAttr('disabled'); else jQuery(this).parents('form').find('button,input[type="submit"]').attr('disabled', 'disabled'); }).trigger('change'); } } // Theme-specific post-formats init //===================================================== function lorem_ipsum_books_media_store_theme_init_post_formats() { "use strict"; // Wrap select with .select_container jQuery('select:not(.esg-sorting-select)').each(function() { var s = jQuery(this); if (s.css('display') != 'none' && s.parents('.select_container').length == 0 && !s.next().hasClass('select2') && !s.hasClass('select2-hidden-accessible')) { s.wrap('
'); // Bubble submit() up for widget "Categories" if ( s.parents( '.widget_categories' ).length > 0 ) { s.parent().each( function (ind, item) { jQuery(item).get(0).submit = function() { jQuery(item).closest('form').submit(); }; }); } } }); // Tribe Events buttons decoration (add 'sc_button' class) jQuery('a.tribe-events-read-more,.tribe-events-button,.tribe-events-nav-previous a,.tribe-events-nav-next a,.tribe-events-widget-link a,.tribe-events-viewmore a') .addClass('sc_button sc_button_style_filled'); // All other buttons decoration (add 'hover' class) if (LOREM_IPSUM_BOOKS_MEDIA_STORE_STORAGE['button_hover'] && LOREM_IPSUM_BOOKS_MEDIA_STORE_STORAGE['button_hover']!='default') { jQuery('button:not(.search_submit):not([class*="sc_button_hover_"]),\ .sc_button:not(.sc_button_style_border):not([class*="sc_button_hover_"]),\ .woocommerce .button:not([class*="sc_button_hover_"]),.woocommerce-page .button:not([class*="sc_button_hover_"]),\ #buddypress a.button:not([class*="sc_button_hover_"])' ).addClass('sc_button_hover_'+LOREM_IPSUM_BOOKS_MEDIA_STORE_STORAGE['button_hover']); if (LOREM_IPSUM_BOOKS_MEDIA_STORE_STORAGE['button_hover']!='arrow') jQuery('input[type="submit"]:not([class*="sc_button_hover_"]),\ input[type="button"]:not([class*="sc_button_hover_"]),\ .isotope_filters_button,\ .scroll_to_top:not([class*="sc_button_hover_"]),\ .sc_slider_prev:not([class*="sc_button_hover_"]),.sc_slider_next:not([class*="sc_button_hover_"]),\ .tagcloud > a:not([class*="sc_button_hover_"])' ).addClass('sc_button_hover_'+LOREM_IPSUM_BOOKS_MEDIA_STORE_STORAGE['button_hover']); } // Mark field as 'filled' on keypress jQuery('[class*="sc_input_hover_"] input, [class*="sc_input_hover_"] textarea').each(function() { if (jQuery(this).val()!='') jQuery(this).addClass('filled'); else jQuery(this).removeClass('filled'); }); jQuery('[class*="sc_input_hover_"] input, [class*="sc_input_hover_"] textarea').on('keypress', function() { if (jQuery(this).val()!='') jQuery(this).addClass('filled'); else jQuery(this).removeClass('filled'); }); } // Theme-specific GoogleMap styles //===================================================== function lorem_ipsum_books_media_store_theme_googlemap_styles($styles) { "use strict"; // Put here your theme-specific code to add GoogleMap styles // It will be called before GoogleMap init when page is loaded $styles['greyscale'] = [ { "stylers": [ { "saturation": -100 } ] } ]; $styles['inverse'] = [ { "stylers": [ { "invert_lightness": true }, { "visibility": "on" } ] } ]; $styles['simple'] = [ { stylers: [ { hue: "#00ffe6" }, { saturation: -20 } ] }, { featureType: "road", elementType: "geometry", stylers: [ { lightness: 100 }, { visibility: "simplified" } ] }, { featureType: "road", elementType: "labels", stylers: [ { visibility: "off" } ] } ]; $styles['apple'] = [ { "featureType": "landscape.man_made", "elementType": "geometry", "stylers": [ {"color":"#f7f1df"} ] }, { "featureType": "landscape.natural", "elementType": "geometry", "stylers": [ {"color":"#d0e3b4"} ] }, { "featureType": "landscape.natural.terrain", "elementType": "geometry", "stylers": [ {"visibility":"off"} ] }, { "featureType": "poi", "elementType": "labels", "stylers": [ {"visibility":"off"} ] }, { "featureType": "poi.business", "elementType": "all", "stylers": [ {"visibility":"off"} ] }, { "featureType": "poi.medical", "elementType": "geometry", "stylers": [ {"color":"#fbd3da"} ] }, { "featureType": "poi.park", "elementType": "geometry", "stylers": [ {"color":"#bde6ab"} ] }, { "featureType": "road", "elementType": "geometry.stroke", "stylers": [ {"visibility":"off"} ] }, { "featureType": "road", "elementType": "labels", "stylers": [ {"visibility":"off"} ] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [ {"color":"#ffe15f"} ] }, { "featureType": "road.highway", "elementType":"geometry.stroke", "stylers": [ {"color":"#efd151"} ] }, { "featureType": "road.arterial", "elementType": "geometry.fill", "stylers": [ {"color":"#ffffff"} ] }, { "featureType": "road.local", "elementType": "geometry.fill", "stylers": [ {"color":"black"} ] }, { "featureType": "transit.station.airport", "elementType": "geometry.fill", "stylers": [ {"color":"#cfb2db"} ] }, { "featureType": "water", "elementType": "geometry", "stylers": [ {"color":"#a2daf2"} ] } ]; return $styles; }