PageSourceSearch

https://www.hazirticaretsitesi.com/wp-content/themes/platinum/assets/js/custom.js?ver=5.7.19

js hazirticaretsitesi.com collected 2026-09-26 06:47:53 UTC 11,865 bytes, 415 lines download raw bytes

1(function($){
2	"use strict";
3	$(document).ready(function($){
4
5		function dynamic_menu(){
6			// Returns width of browser viewport
7			var ww = $( window ).width();
8			$('.dropdown-menu .dropdown-submenu').off('mouseover').on('mouseover', function () {
9				//get position of current
10				var rect = this.getBoundingClientRect();
11
12				if(ww - rect.left - $(this).width()*2 > 20 ){
13					$(this).addClass('menu-sub-right');
14					$(this).removeClass('menu-sub-left');
15				}else{
16					$(this).removeClass('menu-sub-right');
17					$(this).addClass('menu-sub-left');
18				}
19
20			});
21		}
22		
23		dynamic_menu();
24
25
26		$(window).on('resize', function() {
27
28	    	dynamic_menu();
29
30	    });
31		
32		
33
34		document.mainMenu = $('body');
35		document.mainHeader = $('header.header');
36		$(
37		'.king-sidebar .widget_categories,.king-sidebar .widget_archive,'+
38		'.king-sidebar .widget_pages,.king-sidebar .widget_meta,'+
39		'.king-sidebar .widget_recent_entries,'+
40		'.king-sidebar .widget_product_categories,'+
41		'.king-sidebar .widget_nav_menu').each(function(){
42
43			$(this).find('ul').addClass('arrows_list1');
44			$(this).find('li a').prepend('<i class="fa fa-caret-right"></i>');
45
46		});
47
48		$('ul.nav>li.current-menu-item>a').addClass('active');
49
50		$(".custom_width").each(function (index){
51			var cw = $(this).data("width");
52			if( cw !=='')
53				$( this ).closest('.dropdown-menu').css({width:cw.toString(), left:'auto'});
54		});
55
56		$('#tabs ul.tabs li').on( 'click', function(e){
57			$('#tabs .tab_container').css({display:'none'});
58			$( $(this).find('a').attr('href') ).css({display:'block'});
59			$('#tabs ul.tabs li.active').removeClass('active');
60			$(this).addClass('active');
61			e.preventDefault();
62		});
63
64		$('#scrollup').on( 'click', function(e){
65			$('html,body').animate({ 'scroll-top' : 0 });
66			e.preventDefault();
67		});
68
69		$( '.navbar-toggle' ).on( 'click', function( e ){
70			var targ = $( this ).attr( 'data-target' );
71
72			e.preventDefault();
73
74			if( $( targ ).get( 0 ) )
75			{
76				if( document.mainMenu.hasClass( 'slide-menu' ) && targ != '#bs-example-navbar-collapse-1' )
77				{
78					var showmenu = $( targ ).attr( "data_show" );
79					if( typeof showmenu == 'undefined' )
80					{
81						showmenu = 0;
82					}
83					if( showmenu == 0 )
84					{
85						document.mainMenu.toggleClass( "menu-active" );
86						$( targ ).attr( "data_show", '1' );
87					}
88					else
89					{
90						document.mainMenu.toggleClass( "menu-active" );
91
92						$( targ ).attr( "data_show", '0' );
93					}
94				}
95				else
96				{
97					$( targ ).slideToggle();
98				}
99			}
100		});
101
102		if( document.mainMenu.hasClass( 'slide-menu' ) )
103		{
104			$( '#navbar-collapse-1, #bs-onepage-navbar-collapse-1' ).append( '<div class="slide-menu-close fa fa-close"></div>' );
105			$('.header .menu_main .navbar, .fixednav3 .navbar').append( '<div class="overlay_menu"></div>' );
106			//hide menu
107			$( '.slide-menu-close, .overlay_menu' ).on('click', function( e ){
108				hideMenu();
109			});
110		}
111
112		$('a').on( 'click', function(e){
113			if( $(this).attr('href') == '#' ){
114				e.preventDefault();
115			}
116		});
117
118		$('.close-but').on( 'click', function(){
119			$(this).parent().parent().hide('slow',function(){$(this).remove();});
120		});
121
122		$('.video-player .video-close').on( 'click', function(){
123			$(this).parent().find('iframe').remove();
124			$(this).parent().animate({opacity:0}
124,function(){$(this).hide();});
125		});
126
127		$('.king-video-play-wrapper .play-button').on( 'click', function(){
128			var url = $(this).data('video');
129			var height = $(this).data('height');
130			if( url.indexOf('youtube.com') > -1 ){
131				var id = url.split('v=')[1].replace('/','');
132				id = 'https://www.youtube.com/embed/'+id+'?autoplay=1&controls=0&showinfo=0';
133			}else if( url.indexOf('vimeo.com') > -1 ){
134				var id = url.split('vimeo.com/')[1].replace('/','');
135				id = 'https://player.vimeo.com/video/'+id+'?autoplay=1&title=0&byline=0&portrait=0';
136			}
137			var w = $(window).width();
138			var h = parseInt(w*0.5609);
139			var mt = -parseInt((h-height)/2);
140			$(this).closest('.king-video-play-wrapper')
141					.find('.video-player')
142					.append('<iframe style="height:'+h+'px;width:'+w+'px;margin-top:'+mt+'px" src="'+id+'"></iframe')
143					.css({display:'block', opacity:0})
144					.animate({opacity:1});
145		});
146
147		$('.king-preload').each(function(){
148
149			var rel = $(this).attr('data-option').split('|');
150
151			(function( elm ){
152				$.post( site_uri+'/index.php', {
153						'control'	: 'ajax',
154						'task'		: rel[0],
155						'id'		: rel[1],
156						'amount'	: rel[2]
157					}, function (result) {
158
159					elm.innerHTML = result;
160					$(elm).addClass('animated fadeIn');
161
162				})
163			})(this);
164
165		});
166
167		$('.navbar-nav li.yamm-fw a.active').each(function(){
168			$(this).closest('li.yamm-fw').find('>a').addClass('active');
169		});
170
171		var act = false;
172		$('#king-mainmenu>li').each(function(){
173			if( $(this).hasClass('current-menu-parent') || $(this).find('>a').hasClass('active') ){
174				if( act == false ){
175					act = true;
176				}else{
177					$(this).removeClass('current-menu-parent');
178					$(this).find('>a.active').removeClass('active');
179				}
180			}
181		});
182
183		// Menu OnePage
184		$('#menu-onepage .navbar-toggle').on( 'click', function(){
185			if($(this).hasClass('active')){
186				$(this).removeClass('active');
187				$('#menu-onepage .navbar-collapse').removeClass('opened').addClass('closed');
188			}
189			else{
190				$(this).addClass('active');
191				$('#menu-onepage .navbar-collapse').removeClass('closed').addClass('opened');
192			}
193			$('#menu-onepage .navbar-collapse').slideToggle();
194		});
195
196		$('#menu-onepage a, #navbar-collapse-1 a').on( 'click', function() {
197			if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
198				var target = $(this.hash);
199				var target_path = this.hash.slice(1);
200				
201				if(target_path != ''){
202					
203					target = target.length ? target : $("[name='" + this.hash.slice(1) +"']");
204					if (target.length) {
205						$('#menu-onepage li.active, #navbar-collapse-1 li.active ').removeClass('active');
206						$(this).parent().addClass('active');
207						$('.nav-collapse').attr({style:''});
208
209						$('html,body').animate({
210							scrollTop: target.offset().top-80
211						}, 1000);
212
213						return false;
214					}
215				}
216			}
217		});
218
219
220		$('#king-mainmenu li a').on( 'click', function(e){
221			if( !$(this.parentNode).find('ul').get(0) || $('body').width() > 1000 ){
222				return true;
223			}
224			if( $(this.parentNode).hasClass('open') ){
225				$(this.parentNode).removeClass('open');
226				return true;
227			}else $(this.parentNode).addClass('open');
228
229			e.preventDefault();
230			
231			return false;
232		});
233
234		// Modal close
235		$('.simplePopupClose,.simplePopupBackground').on( 'click', function(){
236			$('.simplePopupBackground,.simplePopup').animate({'opacity':0}, function(){$('.simplePopupBackground,.simplePopup').remove();});
237		});
238
239		//enable scroll for map
240		$('.fgmapfull').on( 'click', function () {
241			$('.fgmapfull iframe').css("pointer-events", "auto");
242		});
243
244		videos_gallery( jQuery );
245
246
247		$(function() {
248			$('#sidebar ul.children').hide();
249			$('#sidebar .arrows_list1 > li > a').on( 'click', function(event) {
250				if($(this).parent().hasClass('page_item_has_children')){
251					event.preventDefault();
252					$(this).next('.children').slideToggle("slow");
253				}
254			});
255		});
256
257		$('.retina-support').each(function(){
258			$(this).find('img').each(function(){
259				if( $(this).attr('width') ){
260					$(this).removeAttr('height').attr({ width : ( $(this).attr('width')/2) });
261				}
262			});
263		});
264
265		$( '.vps-slides' ).each( function( index ){
266			var options        = $( this ).data('vps-options');
267			var items          = $( this ).data('vps-items');
268			var per          = $( this ).data('per');
269			var cost_txt          = '';
270			var wrapper_values = $( this ).parent().next('.vps_bot_part').children(".vps_display");
271			var vps_slider = $( this ).slider(options);
272			
273			vps_slider.on('change', function (){
274				
275				var index = $( this ).val();
276
277				$(".cpu .vps_value", $(wrapper_values)).html( items[ index - 1].cpu);
278				$(".disk_space .vps_value", $(wrapper_values)).html( items[ index - 1].disk_space);
279				$(".ram .vps_value", $(wrapper_values)).html( items[ index - 1].ram);
280				$(".bandwidth .vps_value", $(wrapper_values)).html( items[ index - 1].bandwidth);
281				cost_txt = items[ index - 1].cost;
282				if( per != '')
283				{
284					cost_txt += '<span class="per_text">' + per + '</span>';
285				}
286				$(".pricing .vps_value", $(wrapper_values)).html( cost_txt );
287				$(".pricing a", $(wrapper_values)).attr("href", items[ index - 1].link );
288
289			});
290		});
291
292		$( ".ui-tabs" ).on( "tabscreate", function( event, ui ) {
293				$( '.vps-slides', $(this) ).each( function( index ){
294					$( this ).slider('refresh');
295				});
296		} );
297		
298		$( ".ui-tabs" ).on( "tabsactivate", function( event, ui ) {
299				$( '.vps-slides', $(this) ).each( function( index ){
300					$( this ).slider('refresh');
301				});
302		} );
303		
304		
305
306	});
307
308})( jQuery );
309
310function hideMenu()
311{
312	var container = jQuery( ".navbar-collapse" );
313	container.attr( "data_show", '0' );
314	jQuery('body').removeClass( "menu-active" );
315}
316
317function timelineLoadmore( index, cat, btn ){
318
319	jQuery( btn ).html('<i class="fa fa-spinner fa-spin"></i>').get(0).disabled = true;
320	jQuery.post( site_uri+'/wp-admin/admin-ajax.php', {
321			'action' : 'loadPostsTimeline',
322			'index'  : index,
323			'cat'    : cat,
324		}, function (result) {
325			jQuery( btn ).remove();
326			jQuery('#cd-timeline').append( result );
327	});
328	return false;
329}
330
331
332function videos_gallery($){
333
334	$('.videos-gallery-list').each(function(){
335		$(this).find('iframe').each(function(){
336			$(this).parent().find('br').remove();
337			var yid = this.src;
338			yid = yid.split('embed')[1].replace(/\//g,'');
339			$(this).closest('.wpb_text_column').attr({'data-yid':yid}).on( 'click', function(){
340				var yid = $(this).attr('data-yid');
341				$(this).closest('.wpb_row').find('.videos-gallery-player .wpb_wrapper').html('<iframe src="https://www.youtube.com/embed/'+yid+'?autoplay=1"></iframe>');
342			});
343			$(this).after('<img src="https://i.ytimg.com/vi/'+yid+'/default.jpg" />').remove();
344		});
345	});
346
347}
348
349
350function king_modal_ready(){
351
352	var $ = jQuery;
353
354	$('.simplePopupBackground,.simplePopup').css({'display':'block'}).animate({'opacity':1});
355
356	var width = $('#pop-modal').width()+10;
357	var height = $('#pop-modal').height()+10;
358	$('#pop-modal').css({ width: width+'px', marginLeft : -(width/2)+'px', marginTop : -(height/2)+'px' });
359	if( $('#pop-modal').width() > $(window).width() -100 ){
360		$('#pop-modal').css({ width: ($(window).width() - 100)+'px', marginLeft : -(($(window).width() - 100)/2)+'px' });
361	}
362
363	if( $('#pop-modal').height() > $(window).height() - 100 ){
364		$('#pop-modal').css({ marginTop: -(($(window).height() - 100)/2)+'px' });
365	}
366
367	$('html,body').animate({ scrollTop: 0 });
368
369}
370
371
372function vps_changes(){
373
374}
375
376(function() {
377  var supportsPassive = eventListenerOptionsSupported();  
378
379  if (supportsPassive) {
380    var addEvent = EventTarget.prototype.addEventListener;
381    overwriteAddEvent(addEvent);
382  }
383
384  function overwriteAddEvent(superMethod) {
385    var defaultOptions = {
386      passive: true,
387      capture: false
388    };
389
390    EventTarget.prototype.addEventListener = function(type, listener, options) {
391      var usesListenerOptions = typeof options === 'object';
392      var useCapture = usesListenerOptions ? options.capture : options;
393
394      options = usesListenerOptions ? options : {};
395      options.passive = options.passive !== undefined ? options.passive : defaultOptions.passive;
396      options.capture = useCapture !== undefined ? useCapture : defaultOptions.capture;
397
398      superMethod.call(this, type, listener, options);
399    };
400  }
401
402  function eventListenerOptionsSupported() {
403    var supported = false;
404    try {
405      var opts = Object.defineProperty({}, 'passive', {
406        get: function() {
407          supported = true;
408        }
409      });
410      window.addEventListener("test", null, opts);
411    } catch (e) {}
412
413    return supported;
414  }
415})();

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.