1jQuery( function ( $ ) { 2 'use strict'; 3 4 var $body = $( 'body' ), 5 clickEvent = 'ontouchstart' in window ? 'touchstart' : 'click', 6 iOS = false, 7 ieMobile = false, 8 isMac = false; 9 10 function platformDetect() { 11 ieMobile = ! ! navigator.userAgent.match( /Windows Phone/i ); 12 iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; 13 isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0; 14 } 15 16 /** 17 * Superfish Menu 18 */ 19 function superfishMenu() { 20 21 var $menu = $( '.main-navigation .menu' ), 22 $classMenu = 'ul'; 23 if ( $menu.hasClass( 'edupro-max-megamenu' ) ) { 24 $classMenu = '.mega-sub-menu-lever-1'; 25 } 26 27 $menu.supersubs( {} ).superfish( { 28 popUpSelector: $classMenu, 29 animation: {height: 'show'}, 30 animationOut: {height: 'hide'}, 31 cssArrows: false, 32 speed: 300, 33 delay: 10 34 } ); 35 } 36 37 /** 38 * Toggle search form in the header. 39 */ 40 function toggleHeaderSearchForm() { 41 $( '.header__search > a' ).on( 'click', function () { 42 $( this ).siblings( 'form' ).slideToggle(); 43 } ); 44 } 45 46 /** 47 * Make header sticky. 48 */ 49 function stickyHeader() { 50 var $body = $( 'body' ); 51 if ( ! $body.hasClass( 'is-sticky' ) ) { 52 return; 53 } 54 55 var $sticky = $( '#masthead' ), 56 offset = $( '#wpadminbar' ).length && $(window).width() > 480 ? $( '#wpadminbar' ).height() : 0; 57 58 // Header style 1. @link http://demo.featherlayers.com/ 59 if ( $sticky.hasClass( 'header--s3' ) ) { 60 $sticky = $sticky.find( '.container__navbar' ); 61 62 } 63 64 $sticky.sticky( {topSpacing: offset, className: 'header-sticky', zIndex : '999' } ); 65 } 66 67 /** 68 * Toggle mobile sidebar 69 */ 70 function toggleMobileSidebar() { 71 var $button = $( '.navbar-toggle' ), 72 sidebarClass = 'mobile-sidebar-open'; 73 74 // Click to show mobile menu 75 $button.on( clickEvent, function ( e ) { 76 event.preventDefault(); 77 event.stopPropagation(); // Do not trigger click event on '.wrapper' below. 78 if ( $body.hasClass( sidebarClass ) ) { 79 $body.removeClass( sidebarClass ); 80 $button.removeClass( 'active' ); 81 return; 82 } 83 $body.addClass( sidebarClass ); 84 $button.addClass( 'active' ); 85 } ); 86 // When mobile menu is open, click on page content will close it 87 $( '.site' ).on( clickEvent, function ( e ) { 88 if ( ! $body.hasClass( sidebarClass ) ) { 89 return; 90 } 91 e.preventDefault(); 92 $body.removeClass( sidebarClass ); 93 $button.removeClass( 'active' ); 94 } ); 95} 96 97 /** 98 * Wrap image in <figure> tag for effect. 99 */ 100 function wrapImage( $container ) { 101 $( $container ).each( function () { 102 var $img = $( this ); 103 if ( $img.parent().is( 'figure' ) || $img.hasClass( 'rev-slidebg' ) ) { 104 return; 105 } 106 107 var classAttribute = $img.attr( 'class' ); 108 classAttribute = classAttribute ? ' class="' + classAttribute + '"' : ''; 109 $img.wrap( '<figure' + classAttribute + '></figure>' ); 110 $img.removeAttr( 'class' ); 111 112 $img.addClass( function () { 113 return this.width / this.height > 1 ? 'wide' : 'tall'; 114 } ); 115 } ); 116 } 117 118 /** 119 * Change input number when pressing up/down arrow. 120 */ 121 function changeInputNumber() { 122 var $body = $( 'body' ); 123 $body.on( 'click', '.quantity .up', function () { 124 var $input = $( this ).siblings( 'input' ), 125 value = parseInt( $input.val() ); 126 value = isNaN( value ) ? 0 : value + 1; 127 $input.val( value ); 128 } ); 129 $body.on( 'click', '.quantity .down', function () { 130 var $input = $( this ).siblings( 'input' ), 131 value = parseInt( $input.val() ); 132 value = isNaN( value ) || ! value ? 0 : value - 1; 133 $input.val( value ); 134 } ); 135 } 136 137 /** 138 * Portfolio isotope 139 */ 140 function portfolio() { 141 var $projects = $( '.projects' ); 142 143 // Masonry layout with filter using Isotope library. 144 // Layout is triggered when images are loaded. 145 $projects.imagesLoaded( function () { 146 $projects.isotope( { 147 filter: '*', 148 itemSelector: '.project', 149 percentPosition: true, 150 masonry: { 151 columnWidth: '.project' 152 } 153 } ); 154 155 // Filter projects 156 $( '.portfolio-filter' ).on( 'click', 'li', function ( e ) { 157 e.preventDefault(); 158 var $this = $( this ), 159 selector = $this.attr( 'data-filter' ); 160 $this.addClass( 'active' ).siblings().removeClass( 'active' ); 161 $projects.isotope( { 162 filter: selector 163 } ); 164 } ); 165 } ); 166 } 167 168 /** 169 * Multi Teammembers 170 */ 171 $( '.multi-teammembers' ).slick({ 172 slidesToShow: 3, 173 slidesToScroll: 1, 174 autoplay: true, 175 autoplaySpeed: 2000, 176 nextArrow: '<button class="slick-next"><i class="fa fa-angle-right"></i></button>', 177 prevArrow: '<button class="slick-prev"><i class="fa fa-angle-left"></i></button>', 178 responsive: [ 179 { 180 breakpoint: 992, 181 settings: { 182 slidesToShow: 3 183 } 184 }, 185 { 186 breakpoint: 768, 187 settings: { 188 slidesToShow: 1 189 } 190 } 191 ] 192 }); 193 194 /** 195 * Scroll to top 196 */ 197 function scrollToTop() { 198 var $window = $( window ), 199 $button = $( '#scroll-to-top' ); 200 $window.scroll( function () { 201 if ( $window.scrollTop() > 100 ) { 202 $button.addClass( 'active' ); 203 } 204 else { 205 $button.removeClass( 'active' ); 206 } 207 } ); 208 $button.on( 'click', function ( e ) { 209 e.preventDefault(); 210 $( 'body, html' ).animate( { 211 scrollTop: 0 212 }, 500 ); 213 } ); 214 } 215 216 /** 217 * Sticky Sidebar 218 */ 219 function stickySidebar() { 220 221 if ( ! $( 'body' ).hasClass( 'is-sticky-sidebar' ) || $(window).width() < 1030 ) { 222 return false; 223 } 224 225 var offset = 0; 226 227 if ( $( '#wpadminbar' ).length ) { 228 offset = offset + $( '#wpadminbar' ).height(); 229 } 230 231 offset = offset + ( $body.hasClass( 'is-sticky' ) ? 60 : 0 ) + 30; 232
233 $( '.main__content-sticky,.add_sticky_sidebar' ).theiaStickySidebar( { 234 additionalMarginTop: offset 235 } ); 236 237 } 238 239 /** 240 * Load more ajax 241 */ 242 function infiniteScroll( ) { 243 244 var $posts = $( '.edupro-infinite-scroll' ), 245 $handle = $( '#infinite-handle' ); 246 247 $posts.on( 'click', '#infinite-handle a', function ( e ) 248 { 249 var $this = $( this ), 250 $handle = $this.closest( '#infinite-handle' ), 251 url = $this.attr( 'href' ); 252 253 if( $this.hasClass( 'no_post' ) ) { 254 255 var mes = $this.data( 'mes' ); 256 $this.find( ".ajax-more-text" ).text( mes ); 257 258 setTimeout(function(){ 259 $handle.remove(); 260 }, 1200); 261 262 return false; 263 } 264 265 if ( ! $handle.hasClass( 'click' ) && ! $handle.hasClass( 'scroll' ) ) 266 { 267 return false; 268 } 269 270 e.preventDefault(); 271 272 $handle.addClass( 'loading' ); 273 274 $.get( url, function ( res ) 275 { 276 var $content = $( res ).find( '#content-posts' ), 277 $items = $content.children( '.post' ), 278 $link = $content.find( '#infinite-handle' ); 279 280 $posts.append( $items ); 281 282 $handle.remove(); 283 284 if ( $link.length ) 285 { 286 $posts.append( $link ); 287 } 288 } ); 289 } ); 290 291 // Infinity scroll 292 if ( $handle.hasClass( 'scroll' ) ) 293 { 294 $( window ).on( 'scroll', function () 295 { 296 if ( $( window ).scrollTop() >= ( $( document ).height() - $( window ).height() - $( '#colophon' ).height() - $( '.footer-widgets' ).height() ) ) 297 { 298 if ( ! $handle.hasClass( 'loading' ) ) { 299 $handle.find( 'a' ).click(); 300 } 301 } 302 } ).scroll(); 303 } 304 } 305 306 // Masonry shortcode Popular Courses 307 $( '.popular_courses' ).masonry(); 308 309 // Mega menu 310 function megaMenu() { 311 $( '#site-navigation .edupro-mega-child-categories a' ).mouseenter( function () { 312 if ( !$( this ).hasClass( 'cat-active' ) ) { 313 var $this = $( this ), 314 $row_active = $this.data( 'id' ), 315 $parentA = $this.parent().children( 'a' ), 316 $parent = $this.closest( '.edupro-megamenu' ), 317 $rows = $this.closest( '.edupro-megamenu' ).find( '.edupro-mega-latest-posts' ).children( '.edupro-mega-row' ); 318 $parentA.removeClass( 'cat-active' ); 319 $this.addClass( 'cat-active' ); 320 $rows.hide(); 321 $parent.find( '.' + $row_active ).fadeIn( 'normal' ).css( 'display', 'inline-block' ); 322 } 323 } ); 324 } 325 326 327 function tabSingleCourses() { 328 329 330 $( '.courses-nav-tabs li' ).each(function( index ) { 331 332 var $this = $( this ); 333 334 var $findA = $this.find('a').attr('href'), 335 $getUl = $(this).closest('.courses-nav-tabs'), 336 $tabContent = $getUl.next( '.tab-content' ); 337 338 if( $( this ).hasClass( 'active' ) ) { 339 340 $tabContent.find( $findA ).addClass( 'get_content' ); 341 $tabContent.find( '.tab-pane' ).hide(); 342 $tabContent.find( $findA ).show(); 343 } 344 345 $( this ).on( 'click', function () { 346 347 var $findA = $this.find('a').attr('href'); 348 349 $( '.courses-nav-tabs li' ).removeClass( 'active' ); 350 $( this ).addClass( 'active' ); 351 352 $getUl = $(this).closest('.courses-nav-tabs'), 353 $tabContent = $getUl.next( '.tab-content' ); 354 355 $tabContent.find( '.tab-pane' ).removeClass( 'get_content' ); 356 $tabContent.find( '.tab-pane' ).removeClass( 'active' ); 357 $tabContent.find( '.tab-pane' ).hide(); 358 359 $tabContent.find( $findA ).addClass( 'get_content active' ); 360 $tabContent.find( $findA ).show(); 361 362 } ); 363 364 }); 365 } 366 367 /** 368 * Add toggle dropdown icon for mobile menu. 369 * @param $container 370 * @param $aHasChildren 371 */ 372 function dropdownNavigation( $container, $ahasChildren, $subMenu ) { 373 // Add dropdown toggle that displays child menu items. 374 var $dropdownToggle = $( '<i class="dropdown-toggle fa fa-angle-down"></i>' ); 375 376 $container.find( $ahasChildren + ' > a' ).after( $dropdownToggle ); 377 378 // Toggle buttons and sub menu items with active children menu items. 379 $container.find( '.current-menu-ancestor > .dropdown-toggle' ).addClass( 'toggled-on' ); 380 $container.find( '.current-menu-ancestor > ' + $subMenu ).show(); 381 $container.find( '.dropdown-toggle' ).click( function ( e ) { 382 e.preventDefault(); 383 var $this = $( this ); 384 $this.toggleClass( 'toggled-on' ); 385 $this.next( '.children, ' + $subMenu ).slideToggle(); 386 $this.next().next( '.children,' + $subMenu ).slideToggle(); 387 } ); 388 } 389 390 platformDetect(); 391 dropdownNavigation( $( '.primary-menu-mobile' ), '.menu-item-has-children', '.sub-menu' ); 392 dropdownNavigation( $( '.mobile-sidebar .edupro-max-megamenu' ), '.mega-menu-item-has-children', '.mega-sub-menu' ); 393 toggleHeaderSearchForm(); 394 stickyHeader(); 395 toggleMobileSidebar(); 396 scrollToTop(); 397 wrapImage( '.woocommerce-LoopProduct-link img' ); 398 wrapImage( '.product .images img' ); 399 changeInputNumber(); 400 superfishMenu(); 401 portfolio(); 402 stickySidebar(); 403 infiniteScroll(); 404 megaMenu(); 405 tabSingleCourses(); 406} ); 407 408
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.