PageSourceSearch

https://www.altares.com/wp-content/plugins/wp_glossary/assets/js/scripts.js?ver=7.1.2

js altares.com collected 2026-09-24 09:19:49 UTC 4,308 bytes, 154 lines download raw bytes

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					
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				
80				if( $keyword == '' ) {
81					$elem.find('.wpg-list-block').show();
82					$elem.find('.wpg-list-item').show();
83				}
84			});
85			
86			$('.wpg-list-search-form input').val('');
87		}
88	}
89	
90	// ToolTipSter
91	if( wpg.is_tooltip ) {
92		
93		// Initiate Tooltipster
94		$('.wpg-tooltip').tooltipster({
95			//trigger: 'click',
96			contentAsHTML: true,
97			interactive: true,
98			theme: 'tooltipster-' + wpg.tooltip_theme,
99			animation: wpg.tooltip_animation,
100			arrow: wpg.tooltip_is_arrow,
101			minWidth: parseInt( wpg.tooltip_min_width ),
102			maxWidth: parseInt( wpg.tooltip_max_width ),
103			position: wpg.tooltip_position,
104			speed: parseInt( wpg.tooltip_speed ),
105			delay: parseInt( wpg.tooltip_delay ),
106			touchDevices: wpg.tooltip_is_touch_devices,
107			functionReady: function(origin) {
108				$('img').load(function() {
109					origin.tooltipster('reposition');
110				});
111			}
112		});
113		
114		// Fix: Tootltip requires double click sometimes to trigger click
115		$('.wpg-tooltip').click(function(e) {
116			if( typeof $(this).attr('href') != 'undefined' ) {
117				if( typeof $(this).attr('target') != 'undefined' ) {
118					e.preventDefault();
119					window.open( $(this).attr('href'), $(this).attr('target') );
120				}
121			}
122		});
123		
124		// Touch Device Double Click Hack 
125		if( wpg.tooltip_is_touch_devices ) {
126			if ( wpg_glossary_touch_device() ) {
127				var touchtime = 0;
128				$('.wpg-tooltip').on('click', function(e) {
129					if( touchtime == 0 ) {
130						e.preventDefault();
131						touchtime = new Date().getTime();
132					} else {
133						if( ( ( new Date().getTime() )-touchtime ) < 800 ) {
134							touchtime = 0;
135						} else {
136							e.preventDefault();
137							touchtime = new Date().getTime();
138						}
139					}
140				});
141			}
142		
143			function wpg_glossary_touch_device() {
144				if( 'ontouchstart' in window || navigator.maxTouchPoints ) {
145					return true;
146				} else {
147					return false;
148				}
149			}
150		}
151		
152	}
153
154});

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.