PageSourceSearch

https://www.kstu.kz/wp-content/plugins/shortcodes-ultimate/assets/js/other-shortcodes.js?ver=4.9.9

js kstu.kz collected 2026-09-24 09:53:51 UTC 6,985 bytes, 232 lines download raw bytes

1jQuery(document).ready(function ($) {
2
3	// Spoiler
4	$('body:not(.su-other-shortcodes-loaded)').on('click', '.su-spoiler-title', function (e) {
5		var $title = $(this),
6			$spoiler = $title.parent(),
7			bar = ($('#wpadminbar').length > 0) ? 28 : 0;
8		// Open/close spoiler
9		$spoiler.toggleClass('su-spoiler-closed');
10		// Close other spoilers in accordion
11		$spoiler.parent('.su-accordion').children('.su-spoiler').not($spoiler).addClass('su-spoiler-closed');
12		// Scroll in spoiler in accordion
13		if ($(window).scrollTop() > $title.offset().top) $(window).scrollTop($title.offset().top - $title.height() - bar);
14		e.preventDefault();
15	});
16	$('.su-spoiler-content').removeAttr('style');
17	// Tabs
18	$('body:not(.su-other-shortcodes-loaded)').on('click', '.su-tabs-nav span', function (e) {
19		var $tab = $(this),
20			data = $tab.data(),
21			index = $tab.index(),
22			is_disabled = $tab.hasClass('su-tabs-disabled'),
23			$tabs = $tab.parent('.su-tabs-nav').children('span'),
24			$panes = $tab.parents('.su-tabs').find('.su-tabs-pane'),
25			$gmaps = $panes.eq(index).find('.su-gmap:not(.su-gmap-reloaded)');
26		// Check tab is not disabled
27		if (is_disabled) return false;
28		// Hide all panes, show selected pane
29		$panes.hide().eq(index).show();
30		// Disable all tabs, enable selected tab
31		$tabs.removeClass('su-tabs-current').eq(index).addClass('su-tabs-current');
32		// Reload gmaps
33		if ($gmaps.length > 0) $gmaps.each(function () {
34			var $iframe = $(this).find('iframe:first');
35			$(this).addClass('su-gmap-reloaded');
36			$iframe.attr('src', $iframe.attr('src'));
37		});
38		// Set height for vertical tabs
39		tabs_height();
40		// Open specified url
41		if (data.url !== '') {
42			if (data.target === 'self') window.location = data.url;
43			else if (data.target === 'blank') window.open(data.url);
44		}
45		e.preventDefault();
46	});
47
48	// Activate tabs
49	$('.su-tabs').each(function () {
50		var active = parseInt($(this).data('active')) - 1;
51		$(this).children('.su-tabs-nav').children('span').eq(active).trigger('click');
52		tabs_height();
53	});
54
55	// Activate anchor nav for tabs and spoilers
56	anchor_nav();
57
58	// Lightbox
59	$('.su-lightbox').each(function () {
60		$(this).on('click', function (e) {
61			e.preventDefault();
62			e.stopPropagation();
63			if ($(this).parent().attr('id') === 'su-generator-preview') $(this).html(su_other_shortcodes.no_preview);
64			else {
65				var type = $(this).data('mfp-type');
66				$(this).magnificPopup({
67					type: type,
68					tClose: su_magnific_popup.close,
69					tLoading: su_magnific_popup.loading,
70					gallery: {
71						tPrev: su_magnific_popup.prev,
72						tNext: su_magnific_popup.next,
73						tCounter: su_magnific_popup.counter
74					},
75					image: {
76						tError: su_magnific_popup.error
77					},
78					ajax: {
79						tError: su_magnific_popup.error
80					}
81				}).magnificPopup('open');
82			}
83		});
84	});
85	// Tables
86	$('.su-table tr:even').addClass('su-even');
87	// Frame
88	$('.su-frame-align-center, .su-frame-align-none').each(function () {
89		var frame_width = $(this).find('img').width();
90		$(this).css('width', frame_width + 12);
91	});
92	// Tooltip
93	$('.su-tooltip').each(function () {
94		var $tt = $(this),
95			$content = $tt.find('.su-tooltip-content'),
96			is_advanced = $content.length > 0,
97			data = $tt.data(),
98			config = {
99				style: {
100					classes: data.classes
101				},
102				position: {
103					my: data.my,
104					at: data.at,
105					viewport: $(window)
106				},
107				content: {
108					title: '',
109					text: ''
110				}
111			};
112		if (data.title !== '') config.content.title = data.title;
113		if (is_advanced) config.content.text = $content;
114		else config.content.text = $tt.attr('title');
115		if (data.close === 'yes') config.content.button = true;
116		if (data.behavior === 'click') {
117			config.show = 'click';
118			config.hide = 'click';
119			$tt.on('click', function (e) {
120				e.preventDefault();
121				e.stopPropagation();
122			});
123			$(window).on('scroll resize', function () {
124				$tt.qtip('reposition');
125			});
126		} else if (data.behavior === 'always') {
127			config.show = true;
128			config.hide = false;
129			$(window).on('scroll resize', function () {
130				$tt.qtip('reposition');
131			});
132		} else if (data.behavior === 'hover' && is_advanced) {
133			config.hide = {
134				fixed: true,
135				delay: 600
136			}
137		}
138		$tt.qtip(config);
139	});
140
141	// Expand
142	$('.su-expand').each(function () {
143		var $this = $(this),
144			$content = $this.children('.su-expand-content'),
145			$more = $this.children('.su-expand-link-more'),
146			$less = $this.children('.su-expand-link-less'),
147			data = $this.data(),
148			col = 'su-expand-collapsed';
149
150		$more.on('click', function (e) {
151			$content.css('max-height', 'none');
152			$this.removeClass(col);
153		});
154		$less.on('click', function (e) {
155			$content.css('max-height', data.height + 'px');
156			$this.addClass(col);
157		});
158	});
159
160	function is_transition_supported() {
161		var thisBody = document.body || document.documentElement,
162			thisStyle = thisBody.style,
163			support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined;
164
165		return support;
166	}
167
168	// Animations is supported
169	if (is_transition_supported()) {
170		// Animate
171		$('.su-animate').each(function () {
172			$(this).one('inview', function (e) {
173				var $this = $(this),
174					data = $this.data();
175				window.setTimeout(function () {
176					$this.addClass(data.animation);
177					$this.addClass('animated');
178					$this.css('visibility', 'visible');
179				}, data.delay * 1000);
180			});
181		});
182	}
183	// Animations isn't supported
184	else {
185		$('.su-animate').css('visibility', 'visible');
186	}
187
188	function tabs_height() {
189		$('.su-tabs-vertical').each(function () {
190			var $tabs = $(this),
191				$nav = $tabs.children('.su-tabs-nav'),
192				$panes = $tabs.find('.su-tabs-pane'),
193				height = 0;
194			$panes.css('min-height', $nav.outerHeight(true));
195		});
196	}
197
198	function anchor_nav() {
199		// Check hash
200		if (document.location.hash === '') return;
201		// Go through tabs
202		$('.su-tabs-nav span[data-anchor]').each(function () {
203			if ('#' + $(this).data('anchor') === document.location.hash) {
204				var $tabs = $(this).parents('.su-tabs'),
205					bar = ($('#wpadminbar').length > 0) ? 28 : 0;
206				// Activate tab
207				$(this).trigger('click');
208				// Scroll-in tabs container
209				window.setTimeout(function () {
210					$(window).scrollTop($tabs.offset().top - bar - 10);
211				}, 100);
212			}
213		});
214		// Go through spoilers
215		$('.su-spoiler[data-anchor]').each(function () {
216			if ('#' + $(this).data('anchor') === document.location.hash) {
217				var $spoiler = $(this),
218					bar = ($('#wpadminbar').length > 0) ? 28 : 0;
219				// Activate tab
220				if ($spoiler.hasClass('su-spoiler-closed')) $spoiler.find('.su-spoiler-title:first').trigger('click');
221				// Scroll-in tabs container
222				window.setTimeout(function () {
223					$(window).scrollTop($spoiler.offset().top - bar - 10);
224				}, 100);
225			}
226		});
227	}
228
229	if ('onhashchange' in window) $(window).on('hashchange', anchor_nav);
230
231	$('body').addClass('su-other-shortcodes-loaded');
232});

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.