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