1jQuery.noConflict(); 2jQuery(document).ready(function($){ 3 "use strict"; 4 5 var currentWidth = window.innerWidth || document.documentElement.clientWidth; 6 7 // Loader 8 if( dttheme_urls.loadingbar === "enable") { 9 Pace.on("done", function(){ 10 $(".loader").fadeOut(500); 11 $(".pace").remove(); 12 }); 13 } 14 15 // Sticky Row 16 if( $("#header-wrapper .apply-sticky-header").length > 0 ){ 17 $("#header-wrapper .apply-sticky-header").sticky({ topSpacing: 0 }); 18 } 19 20 // Mega Menu 21 if ( $('li.has-mega-menu').length>0 && $('.dt-no-header-builder-content').length==0 ) { 22 23 jQuery.fn.liCenter = function () { 24 25 var w = $('#header .container').width(), 26 a = $(window).width(), 27 c = $('.dt-header-menu').parents('.wpb_column'), 28 ol = $('.dt-header-tpl').offset().left; 29 30 c.addClass("dt-col-static-position"); 31 $('.mega-menu-page-equal li.has-mega-menu:not(.mega-menu-custom-width) > ul > li.menu-item-object-dt_mega_menus').css("width", w+"px"); 32 33 return this; 34 }; 35 36 $('.mega-menu-page-equal li.has-mega-menu:not(.mega-menu-custom-width) > ul').liCenter(); 37 38 $(window).resize(function(){ 39 $('.mega-menu-page-equal li.has-mega-menu:not(.mega-menu-custom-width) > ul').liCenter(); 40 }); 41 } 42 43 $("body").on("click", ".reviews_tab a", function() { 44 setTimeout(function() { 45 $("html, body").getNiceScroll().resize(); 46 }, 100); 47 }); 48 49 50 // Mobile Menu 51 52 // Move Nav as Mobile Nav 53 $("div.dt-header-menu").each(function(){ 54 var d = $(this).data('menu'), 55 c = $(this).find('ul[data-menu="'+d+'"]').clone(), 56 m = $('body').find('.mobile-menu[data-menu="'+d+'"]'); 57 58 // To Remove animation classes 59 $('[data-animation]', c ).each(function(ix, ele ){ 60 var $classes = $(ele).attr("class"), 61 $animation = $(ele).attr("data-animation"); 62 63 $classes = $classes.replace($animation, ''); 64 $(ele).attr("class", $classes); 65 }); 66 67 c.prependTo(m); 68 }); 69 70 // Opening Mobile Nav 71 $('.menu-trigger').on('click', function( event ){ 72 $(this).next('.mobile-menu').toggleClass('nav-is-visible'); 73 $(this).parent('.mobile-nav-container').find('.overlay').toggleClass('is-visible'); 74 $('body').toggleClass('nav-is-visible'); 75 }); 76 77 // Closing Mobile Nav 78 function closeMobNav() { 79 $('body').removeClass('nav-is-visible'); 80 $('.overlay').removeClass('is-visible'); 81 $('.mobile-menu').removeClass('nav-is-visible'); 82 $('.menu-item-has-children a').removeClass('selected'); 83 $('.menu-item-has-children ul.sub-menu').addClass('is-hidden'); 84 } 85 86 $('li.close-nav').on('click', function(event){ 87 closeMobNav(); 88 }); 89 90 $('.mobile-nav-container > .overlay').on('click', function(event){ 91 closeMobNav(); 92 }); 93 94 // Sub Menu in Mobile Menu 95 $('.menu-item-has-children > a, .page_item_has_children > a').on('click', function(event) { 96 97 if ( $('body').hasClass('nav-is-visible') ) { 98 event.preventDefault(); 99 var a = $(this).clone(); 100 $(this).next('.sub-menu').find('.see-all').html(a); 101 } 102 103 var selected = $(this); 104 if( selected.next('ul').hasClass('is-hidden') ) { 105 selected.addClass('selected').next('ul.sub-menu').removeClass('is-hidden'); 106 } else { 107 selected.removeClass('selected').next('ul.sub-menu').addClass('is-hidden'); 108 } 109 }); 110 111 // Go Back in Mobile Menu 112 $('.go-back').on('click', function(){ 113 $(this).parent('ul:not(.menu)').addClass('is-hidden'); 114 }); 115 116 // Visual Nav Menu 117 if( $('ul.visual-nav').length > 0 ) { 118 119 $('ul.visual-nav').visualNav({ 120 selectedClass : 'current_page_item', 121 externalLinks : 'external', 122 useHash : false, 123 // offsetTop : 100 124 }); 125 } 126 127 if( $("div.dt-video-wrap").length ) { 128 $("div.dt-video-wrap").fitVids(); 129 } 130 131 if( $('a.video-image').length ) { 132 $('a.video-image').prettyPhoto({ 133 animation_speed:'normal', 134 theme:'facebook', 135 slideshow:3000, 136 autoplay_slideshow: false, 137 social_tools: false, 138 deeplinking:false 139 }); 140 } 141 142 // Container 143 if( currentWidth > 767 ){ 144 if( $('#primary').hasClass('with-both-sidebar') ) { 145 if( ( $('#secondary-left > div').is(':empty') && $('#secondary-right > div').is(':empty')) ){ 146 $('#primary').addClass("content-full-width").removeClass("page-with-sidebar with-right-sidebar with-left-sidebar"); 147 } else if( $('#secondary-left > div').is(':empty') ){ 148 $('#primary').addClass("with-right-sidebar").removeClass("with-both-sidebar"); 149 } else if( $('#secondary-right > div').is(':empty') ){ 150 $('#primary').addClass("with-left-sidebar").removeClass("with-both-sidebar"); 151 } 152 } else if( $('#primary').hasClass('with-left-sidebar') ) { 153 if( $('#secondary-left > div').is(':empty') ){ 154 $('#primary').addClass("content-full-width").removeClass("page-with-sidebar with-left-sidebar"); 155 } 156 } else if( $('#primary').hasClass('with-right-sidebar') ) { 157 if( $('#secondary-right > div').is(':empty') ){ 158 $('#primary').addClass("content-full-width").removeClass("page-with-sidebar with-right-sidebar"); 159 } 160 } 161 } 162 163 if($('#main .sidebar-as-sticky').length) { 164 $('#main .sidebar-as-sticky').theiaStickySidebar({ 165 additionalMarginTop: 70, 166 containerSelector: $('#primary').parent('.container') 167 }); 168 } 169 170 if($('.sidenav-sticky').length){ 171 $('.sidenav-sticky .side-navigation').theiaStickySidebar({ 172 additionalMarginTop: 90, 173 containerSelector: $('#primary') 174 }); 175 } 176 177 // <select> 178 $("select").each(function(){ 179 if($(this).css('display') != 'none') { 180 $(this).wrap( '<div class="selection-box"></div>' ); 181 } 182 }); 183 184 $('.activity-type-tabs > ul >li:first').addClass('selected'); 185 $('.dir-form > .item-list-tabs > ul > li:first').addClass('selected'); 186 187 $('.downcount').each(function(){ 188 var el = $(this); 189 el.downCount({ 190 date : el.attr('data-date'), 191 offset : el.attr('data-offset') 192 }); 193 }); 194 195 $('p:empty').each(function (){ 196 $(this).next('br').remove(); 197 $(this).remove(); 198 }); 199 200 //Smart Resize 201 $(window).on("resize", function() { 202 203 //Blog Template 204 if( $(".apply-isotope").length ) { 205 $(".apply-isotope").isotope({itemSelector : '.column',transformsEnabled:false,masonry: { columnWidth: '.grid-sizer' } }); 206 } 207 }); 208 209 // Window Load Start 210 $(window).on('load', function(){ 211 212 //Gallery Post Slider 213 if( ($("ul.entry-gallery-post-slider").length) && ( $("ul.entry-gallery-post-slider li").length > 1 ) ){ 214 $("ul.entry-gallery-post-slider").bxSlider({auto:false, video:true, useCSS:false, pager:'', autoHover:true, adaptiveHeight:true}); 215 } 216 217 //Blog Template 218 if( $(".apply-isotope").length ) { 219 $(".apply-isotope").isotope({itemSelector : '.column',transformsEnabled:false,masonry: { columnWidth: '.grid-sizer' } }); 220 } 221 }); 222 223 $(".dt-like-this").on('click', function(){ 224 225 var el = jQuery(this); 226 227 if( el.hasClass('liked') ) { 228 return false;
229 } 230 231 var post = { 232 action: 'kalvi_likes_ajax', 233 post_id: el.attr('data-id') 234 }; 235 236 $.post(dttheme_urls.ajaxurl, post, function(data){ 237 el.find('span').html(data); 238 el.addClass('liked'); 239 }); 240 return false; 241 }); 242 243 if( $('input, textarea').length ) { 244 $('input, textarea').placeholder(); 245 } 246 247 // Toggle store locator advacned options 248 $("a.dt-sc-toggle-advanced-options").on('click', function( event ){ 249 event.preventDefault(); 250 var $this = $(this); 251 $this.parents('.wpsl-search').find( "div.dt-sc-advanced-options" ).slideToggle( "slow", function() { 252 $this.toggleClass('expanded'); 253 if($this.hasClass('expanded')) { 254 $this.html(dttheme_urls.advOptions + ' <span class="fa fa-angle-up"></span>'); 255 } else { 256 $this.html(dttheme_urls.advOptions + ' <span class="fa fa-angle-down"></span>'); 257 } 258 }); 259 }); 260 261 //Sinle post like btn 262 if( $(".single-post").length ) { 263 $(".dt_like_btn a").on("click",function() { 264 var btn = $(this); 265 var post_id = btn.data("postid"); 266 var act = btn.data("action"); 267 268 $.ajax({ 269 type: "post", 270 url: dttheme_urls.ajaxurl, 271 data: { action: 'kalvi_post_rating_like', 272 nonce: dttheme_urls.wpnonce, 273 post_id: post_id, 274 doaction: act 275 }, 276 success: function(data, textStatus, XMLHttpRequest){ 277 btn.find('i').text(data); 278 }, 279 error: function(MLHttpRequest, textStatus, errorThrown){ 280 //alert(textStatus); 281 } 282 }); 283 return false; 284 }); 285 } 286 287 //Scroll down animate 288 $(".dt_scroll_down a").on('click', function(a){ 289 a.preventDefault(); 290 291 var st = 0; 292 if(dttheme_urls.stickynav === 'enable') { 293 st = 90; 294 } 295 296 $("html, body").stop(); 297 $("html, body").animate({ 298 scrollTop: $('.entry-details.within-image').offset().top - st 299 }, { 300 duration: 1000, 301 easing: "easeInOutQuart" 302 }); 303 }); 304 305 306 // Go To Top 307 $().UItoTop({ easingType: 'easeOutQuart' }); 308 309 if( $('.dt-sc-icon-box-type9').length ) { 310 setTimeout(function(){ 311 $('.dt-sc-icon-box-type9').each(function(){ 312 $(this).find('.icon-wrapper').css('height', $(this).find('.icon-content').outerHeight(true) ); 313 }); 314 },1000); 315 } 316 317 if( $('ul.dt-sc-tabs-vertical-frame').length ) { 318 $('ul.dt-sc-tabs-vertical-frame').each(function(){ 319 $(this).css('min-height', $(this).height() ); 320 }); 321 } 322 323 if( $('ul.dt-sc-tabs-vertical').length ) { 324 $('ul.dt-sc-tabs-vertical').each(function(){ 325 $(this).css('min-height', $(this).height() ); 326 }); 327 } 328 329 330 $('.alignfull').each(function () { 331 if($(this).parents('#primary').hasClass('content-full-width')) { 332 333 if($(this).parents('body').hasClass('layout-boxed')) { 334 335 if($('body').hasClass('single-post') && $(this).parents('.blog-entry').hasClass('post-left-date')) { 336 337 var containerWidth = $('.layout-boxed .wrapper').width(); 338 $(this).css('width', containerWidth); 339 340 var mainLeft = $('#main').offset().left; 341 var primaryLeft = $('#primary').offset().left; 342 343 var $containerPadding = $(this).parents('.blog-entry.post-left-date').css('padding-left'); 344 $containerPadding = $containerPadding.replace('px', ''); 345 346 var sectionMargin = parseInt(primaryLeft, 10) - parseInt(mainLeft, 10) + parseInt($containerPadding, 10); 347 348 var offset = 0 - sectionMargin; 349 $(this).css('left', offset); 350 351 } else { 352 353 var containerWidth = $('.layout-boxed .wrapper').width(); 354 $(this).css('width', containerWidth); 355 356 var mainLeft = $('#main').offset().left; 357 var primaryLeft = $('#primary').offset().left; 358 359 var sectionMargin = parseInt(primaryLeft, 10) - parseInt(mainLeft, 10); 360 361 var offset = 0 - sectionMargin; 362 $(this).css('left', offset); 363 364 } 365 366 } else { 367 368 if($('body').hasClass('single-post') && $(this).parents('.blog-entry').hasClass('post-left-date')) { 369 370 var windowWidth = $(window).width(); 371 $(this).css('width', windowWidth); 372 373 var $container = ''; 374 $container = $(this).parents('.blog-entry'); 375 376 if( !$container.length ) { 377 $container = $(this).parents('.type-page'); 378 } 379 var $containerPadding = $(this).parents('.blog-entry.post-left-date').css('padding-left'); 380 $containerPadding = $containerPadding.replace('px', ''); 381 382 var offset = 0 - $container.offset().left - $containerPadding; 383 $(this).css('left', offset); 384 385 } else { 386 387 var windowWidth = $(window).width(); 388 $(this).css('width', windowWidth); 389 390 var $container = ''; 391 $container = $(this).parents('.blog-entry'); 392 393 if( !$container.length ) { 394 $container = $(this).parents('.type-page'); 395 } 396 397 var offset = 0 - $container.offset().left; 398 $(this).css('left', offset); 399 400 } 401 402 } 403 404 } 405 }); 406 407 // Gutenberg - WP Category Widget Fix 408 if($('.wp-block-categories-list').length) { 409 410 loopCategories($('.wp-block-categories-list')); 411 function loopCategories(item) { 412 413 item.find('li').each(function() { 414 415 var span_text = $(this).find('span:first').html(); 416 $(this).find('span:first').remove() 417 $('<span>'+span_text+'</span>').insertAfter($(this).find('a:first')); 418 419 if($(this).find('ul.children').length) { 420 loopCategories($(this).find('ul.children')); 421 } 422 }); 423 424 } 425 426 } 427 428});
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.