1jQuery( document ).ready(function($) { 2 3 // MixItUp 4 if( $('.wpg-list-wrapper').length ) { 5 $('.wpg-list-wrapper').each(function() { 6 var $elem = $(this); 7 8 var $active_filter = $elem.find('.wpg-list-filter .filter.active').data('filter'); 9 if( $active_filter == '' || typeof $active_filter == 'undefined' ) { 10 $active_filter = 'all'; 11 } 12 13 mixitup($elem, { 14 animation: { 15 enable: wpg.animation 16 }, 17 load: { 18 filter: $active_filter 19 }, 20 controls: { 21 scope: 'local' 22 }, 23 callbacks: { 24 onMixEnd: function(state) { 25 $('#'+state.container.id).find('.wpg-list-block.wpg-removed').hide(); 26 } 27 } 28 }); 29 }); 30 31 if( $('.wpg-list-search-form').length ) { 32 $('.wpg-list-search-form input').on('input',function(e) { 33 var $elem = $(this).closest('.wpg-list-wrapper'); 34 var $keyword = $(this).val().toLowerCase(); 35 if( $keyword != '' ) { 36 $elem.find('.wpg-list-block').each(function() { 37 var $elem_list_block = $(this); 38 var $block_visible_items = 0; 39 40 $elem_list_block.find('.wpg-list-item').each(function() { 41 if( $(this).text().toLowerCase().match( $keyword ) ) { 42 $(this).show(); 43 $block_visible_items++; 44 } else { 45 $(this).hide(); 46 } 47 }); 48 49 var $filter_base = $elem_list_block.data('filter-base'); 50 var $filter_source = $elem.find('.wpg-list-filter a[data-filter=".wpg-filter-'+$filter_base+'"]'); 51 var $active_block = $elem.find('.wpg-list-filter a.mixitup-control-active').data('filter'); 52 53 if ( $block_visible_items > 0 ) { 54 $elem_list_block.removeClass('wpg-removed'); 55 56 if ( $active_block != 'all' ) { 57 if ( $elem_list_block.is( $elem.find( $active_block ) ) ) { 58 $elem.find( $active_block ).show(); 59 } 60 } else { 61 $elem_list_block.show(); 62 } 63 64 $filter_source.removeClass('filter-disable').addClass('filter'); 65 } else { 66 $elem_list_block.addClass('wpg-removed'); 67 68 if ( $active_block != 'all' ) { 69 if ( $elem_list_block.is( $elem.find( $active_block ) ) ) { 70 $elem.find( $active_block ).hide(); 71 } 72 } else { 73 $elem_list_block.hide(); 74 } 75 76 $filter_source.removeClass('filter').addClass('filter-disable'); 77 } 78 }); 79 } else { 80 $elem.find('.wpg-list-block').show(); 81 $elem.find('.wpg-list-item').show(); 82 } 83 }); 84 85 $('.wpg-list-search-form input').val(''); 86 } 87 } 88 89 // ToolTipSter 90 if( wpg.is_tooltip ) { 91 92 // Initiate Tooltipster 93 $('.wpg-tooltip').tooltipster({ 94 //trigger: 'click', 95 contentAsHTML: true, 96 interactive: true, 97 theme: 'tooltipster-' + wpg.tooltip_theme, 98 animation: wpg.tooltip_animation, 99 arrow: wpg.tooltip_is_arrow, 100 minWidth: parseInt( wpg.tooltip_min_width ), 101 maxWidth: parseInt( wpg.tooltip_max_width ), 102 position: wpg.tooltip_position, 103 speed: parseInt( wpg.tooltip_speed ), 104 delay: parseInt( wpg.tooltip_delay ), 105 touchDevices: wpg.tooltip_is_touch_devices, 106 functionReady: function(origin) { 107 $('img').load(function() { 108 origin.tooltipster('reposition'); 109 }); 110 } 111 }); 112 113 // Fix: Tootltip requires double click sometimes to trigger click 114 $('.wpg-tooltip').click(function(e) { 115 if( typeof $(this).attr('href') != 'undefined' ) { 116 e.preventDefault(); 117 118 if( typeof $(this).attr('target') != 'undefined' ) { 119 window.open( $(this).attr('href'), $(this).attr('target') ); 120 } else { 121 window.location.href = $(this).attr('href'); 122 } 123 } 124 }); 125 126 // Touch Device Double Click Hack 127 if( wpg.tooltip_is_touch_devices ) { 128 if ( wpg_glossary_touch_device() ) { 129 var touchtime = 0; 130 $('.wpg-tooltip').on('click', function(e) { 131 if( touchtime == 0 ) { 132 e.preventDefault(); 133 touchtime = new Date().getTime(); 134 } else { 135 if( ( ( new Date().getTime() )-touchtime ) < 800 ) { 136 touchtime = 0; 137 } else { 138 e.preventDefault(); 139 touchtime = new Date().getTime(); 140 } 141 } 142 }); 143 } 144 145 function wpg_glossary_touch_device() { 146 if( 'ontouchstart' in window || navigator.maxTouchPoints ) { 147 return true; 148 } else { 149 return false; 150 } 151 } 152 } 153 154 } 155 156});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.