1/* 2*** 3*** 4Name: functions.js 5Written by: ThemeTrade 6Theme Version: 1.0.0 7*** 8*** 9*/ 10(function($) { 11 12 'use strict'; 13 14 var BasicFunction = function(){ 15 16 var checkSelectorExistence = function(selectorName) { 17 if(jQuery(selectorName).length > 0){return true;}else{return false;} 18 }; 19 20 var setCourseCarousel = function() { 21 if(!checkSelectorExistence('.courses-carousel')){return;} 22 jQuery('.courses-carousel').owlCarousel({ 23 loop:true, 24 autoplay:true, 25 margin:0, 26 nav:true, 27 dots: false, 28 navText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'], 29 responsive:{ 30 0:{ 31 items:1 32 }, 33 480:{ 34 items:2 35 }, 36 1024:{ 37 items:3 38 }, 39 1200:{ 40 items:4 41 } 42 } 43 }); 44 } 45 46 var setUpcomingEventCarousel = function() { 47 if(!checkSelectorExistence('.upcoming-event-carousel')){return;} 48 jQuery('.upcoming-event-carousel').owlCarousel({ 49 center: true, 50 autoplay:true, 51 items:3, 52 loop:true, 53 margin:0, 54 nav:false, 55 dots:true, 56 autoplaySpeed: 1000, 57 navSpeed: 1000, 58 paginationSpeed: 1000, 59 slideSpeed: 1000, 60 navText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'], 61 responsive:{ 62 0:{ 63 items:1 64 }, 65 650:{ 66 items:1.5 67 }, 68 1024:{ 69 items:2 70 }, 71 1200:{ 72 items:2 73 } 74 } 75 }); 76 } 77 78 var setRecentNewsCarousel = function() { 79 if(!checkSelectorExistence('.recent-news-carousel')){return;} 80 jQuery('.recent-news-carousel').owlCarousel({ 81 loop:true, 82 autoplay:true, 83 margin:30, 84 nav:false, 85 dots:true, 86 navText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'], 87 responsive:{ 88 0:{ 89 items:1 90 }, 91 480:{ 92 items:2 93 }, 94 1024:{ 95 items:3 96 }, 97 1200:{ 98 items:3 99 } 100 } 101 }); 102 } 103 104 var setTestimonialCarousel = function() { 105 if(!checkSelectorExistence('.testimonial-carousel')){return;} 106 jQuery('.testimonial-carousel').owlCarousel({ 107 loop:true, 108 autoplay:true, 109 margin:30, 110 nav:true, 111 dots:true, 112 navText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'], 113 responsive:{ 114 0:{ 115 items:1 116 }, 117 480:{ 118 items:1 119 }, 120 1024:{ 121 items:2 122 }, 123 1200:{ 124 items:2 125 } 126 } 127 }); 128 129 } 130 131 return { 132 initialHelper:function(){ 133 setCourseCarousel(); 134 setUpcomingEventCarousel(); 135 setRecentNewsCarousel(); 136 setTestimonialCarousel(); 137 } 138 } 139 140 }(jQuery); 141 142 143 var ThemeBuilder = function(){ 144 145 var windowSize = $( window ).width(); 146 147 var setWindowSizeVar = function() { 148 windowSize = $( window ).width(); 149 } 150 151 var checkMobileDevice = function() { 152 var isMobile = false; 153 (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
153sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) isMobile = true;})(navigator.userAgent||navigator.vendor||window.opera); 154 return isMobile; 155 }; 156 157 var checkSelectorExistence = function(selectorName) { 158 if(jQuery(selectorName).length > 0){return true;}else{return false;} 159 }; 160 161 162 /* To Get Search Bar*/ 163 var searchBar = function() { 164 jQuery("#quik-search-btn").on('click',function() {jQuery('.nav-search-bar').fadeIn(500).addClass('On');}); 165 jQuery("#search-remove").on('click',function() {jQuery('.nav-search-bar').fadeOut(500).removeClass('On');}); 166 } 167 168 /* Control One Page Layout */ 169 var scrollPageLayout = function() { 170 if(!checkSelectorExistence('.scroll-page')){return;} 171 $('.scroll-page').scroller(); 172 } 173 174 /* Set Header Height (Call On Resize Event Also) */ 175 var setHeaderHeight = function(){ 176 if(!checkSelectorExistence('.header')){return;} 177 var getActualHeaderRecentHeight = $('.header').height(); 178 var getActualHeaderFullHeight = $('.header').css({'max-height': 'auto', 'height': 'auto'}).height(); 179 $('.header').css({ 'height': getActualHeaderRecentHeight }).animate({ 'height': getActualHeaderFullHeight }, 200); 180 } 181 182 /* Magnific Popup ============ */ 183 var magnificPopupImageView = function(){ 184 185 /* magnificPopup function */ 186 if(checkSelectorExistence('.magnific-image')) { 187 jQuery('.magnific-image').magnificPopup({ 188 delegate: '.magnific-anchor', 189 type: 'image', 190 tLoading: 'Loading image #%curr%...', 191 mainClass: 'magnific-img-mobile', 192 gallery: { 193 enabled: true, 194 navigateByImgClick: true, 195 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 196 }, 197 image: { 198 tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', 199 titleSrc: function(item) { 200 return item.el.attr('title') + '<small></small>'; 201 } 202 } 203 }); 204 } 205 /* magnificPopup function end */ 206 207 /* magnificPopup for video function */ 208 if(checkSelectorExistence('.video')) { 209 jQuery('.video').magnificPopup({ 210 type: 'iframe', 211 iframe: { 212 markup: '<div class="mfp-iframe-scaler">'+ 213 '<div class="mfp-close"></div>'+ 214 '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+ 215 '<div class="mfp-title">Some caption</div>'+ 216 '</div>' 217 }, 218 callbacks: { 219 markupParse: function(template, values, item) { 220 values.title = item.el.attr('title'); 221 } 222 } 223 }); 224 } 225 /* magnificPopup for paly video function end*/ 226 if(checkSelectorExistence('.popup-youtube, .popup-vimeo, .popup-gmaps')) { 227 $('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({ 228 disableOn: 700, 229 type: 'iframe', 230 mainClass: 'mfp-fade', 231 removalDelay: 160, 232 preloader: false, 233 234 fixedContentPos: false 235 }); 236 } 237 } 238 239 240 /* Page Scroll To Top ============ */ 241 var pageScrollToTop = function (){ 242 /* page scroll top on click function */ 243 jQuery("button.back-to-top").on('click',function() { 244 jQuery('html').animate({ scrollTop: 0 }, 500); 245 return false; 246 }) 247 248 jQuery(window).on("scroll", function() { 249 var scrollWindowHeight = jQuery(window).scrollTop(); 250 if (scrollWindowHeight > 900) { 251 jQuery("button.back-to-top").slideDown(1000).fadeIn(1000); 252 } else { 253 jQuery("button.back-to-top").slideUp(1000).fadeOut(1000); 254 } 255 }); 256 /* page scroll top on click function end*/ 257 } 258 259 /* Set Div Same Height */ 260 var setDivSameHeight = function(container) { 261 if(!checkSelectorExistence(container)){return;} 262 var maxHeight = 0, firstElement = 0, elementArray = new Array(), element; 263 $(container).each(function() { 264 element = $(this); 265 $(element).height('auto'); 266 posTop = element.position().top; 267 268 if (firstElement != posTop) { 269 for (currElement = 0; currElement < elementArray.length; currElement++) { 270 elementArray[currElement].height(maxHeight); 271 } 272 elementArray.length = 0; 273 firstElement = posTop; 274 maxHeight = element.height(); 275 elementArray.push(element); 276 } else { 277 elementArray.push(element); 278 maxHeight = (maxHeight < element.height()) ? (element.height()) : (maxHeight); 279 } 280 for (currElement = 0; currElement < elementArray.length; currElement++) { 281 elementArray[currElement].height(maxHeight); 282 } 283 }); 284 } 285 286 /* Set Footer Height */ 287 var setFooterHeight = function() { 288 if(!checkSelectorExistence('.site-footer')){return;} 289 jQuery('.site-footer').css(['display:block','height:auto']); 290 var footerHeight = jQuery('.site-footer').outerHeight(); 291 if(windowSize > 1280){ 292 jQuery('.footer-fixed > .page-wraper').css('padding-bottom', footerHeight); 293 } 294 jQuery('.site-footer').css('height', footerHeight); 295 } 296 297 /* Set Sticky Header */ 298 var setStickyheader = function(){ 299 jQuery(window).on('scroll', function () { 300 if(!checkSelectorExistence('.sticky-header')){return;} 301 var header = jQuery('.sticky-header'); 302 if ($(window).scrollTop() > header.offset().top) { 303 header.addClass('is-fixed'); /*change is-fixed to fixed*/ 304 } else { 305 header.removeClass('is-fixed'); 306 } 307 }); 308 } 309 310 /* Set Masonry Layout */ 311 var masonryLayout = function(){ 312 if(!checkSelectorExistence('#masonry')){return;} 313 var self = $("#masonry"); 314 if(jQuery('.action-card').length) 315 { 316 self.imagesLoaded(function () { 317 self.masonry({ 318 gutterWidth: 15, 319 isAnimated: true, 320 itemSelector: ".action-card" 321 }); 322 }); 323 } 324 325 326 if(!checkSelectorExistence('.filters')){return;} 327 jQuery(".filters").on('click','li',function(e) { 328 e.preventDefault(); 329 var filter = $(this).attr("data-filter"); 330 self.masonryFilter({ 331 filter: function () { 332 if (!filter) return true; 333 return $(this).hasClass(filter); 334 } 335 }); 336 }); 337 } 338 339 /* Set Counter Up Function */ 340 var setCounterUp = function(){ 341 if(!checkSelectorExistence('.counter')){return;} 342 jQuery('.counter').counterUp({ 343 delay: 10, 344 time: 3000 345 }); 346 } 347 348 /* Set Bootstrap Drop Down */ 349 var setBootstrapDropDown = function(){ 350 if(!checkSelectorExistence('select')){return;} 351 jQuery('select').selectpicker(); 352 } 353 354 /* set Countdown */ 355 var setCountDown = function(){ 356 if(!checkSelectorExistence('.countdown')){return;} 357 var currentDate = new Date(); 358 var months = ["January", "February", 359 "March", "April", 360 "May", "June", 361 "July", "August", 362 "September", "October", 363 "November", "December"]; 364 currentDate.setDate(currentDate.getDate() + 10); 365 currentDate = currentDate.getDate() + " " + months[currentDate.getMonth()] + " " + currentDate.getFullYear(); 366 /*You can use this format : 01 January 2019 */ 367 $('.countdown').countdown({date: currentDate+' 23:5'}); 368 } 369 370 /* Stylish Scroll */ 371 var setStylishScroll = function(){ 372 if(!checkSelectorExistence('.content-scroll')){return;} 373 $(".content-scroll").mCustomScrollbar({ 374 setWidth:false, 375 setHeight:false, 376 axis:"y" 377 }); 378 } 379 380 /* WOW ANIMATION */ 381 var wowAnimation = function(){ 382 /*
383 boxClass: Class name that reveals the hidden box when user scrolls. 384 385 animateClass: Class name that triggers the CSS animations (âanimatedâ by default for the animate.css library) 386 387 offset: Define the distance between the bottom of browser viewport and the top of hidden box. 388 When the user scrolls and reach this distance the hidden box is revealed. 389 390 mobile: Turn on/off wow.js on mobile devices. 391 392 live: constantly check for new WOW elements on the page. 393 */ 394 if(!checkSelectorExistence('.wow')){return;} 395 var wow = new WOW( 396 { 397 boxClass: 'wow', 398 animateClass: 'animated', 399 offset: 10, 400 mobile: false, 401 live: true 402 }); 403 wow.init(); 404 } 405 406 /* Left Side Menu */ 407 var manageLeftSideMenu = function(){ 408 jQuery('.menuicon').unbind().on('click',function(){ 409 $(this).toggleClass('open'); 410 }); 411 412 if(windowSize <= 991 ){ 413 jQuery('.navbar-nav > li > a, .sub-menu > li > a').unbind().on('click', function(e){ 414 //e.preventDefault(); 415 if(jQuery(this).parent().hasClass('open')) 416 { 417 jQuery(this).parent().removeClass('open'); 418 } 419 else{ 420 jQuery(this).parent().parent().find('li').removeClass('open'); 421 jQuery(this).parent().addClass('open'); 422 } 423 }); 424 } 425 } 426 427 428 var managePlaceholderStyle = function() 429 { 430 if(!checkSelectorExistence('.placeani')){return;} 431 $('.placeani input, .placeani textarea').focus(function(){ 432 $(this).parents('.form-group').addClass('focused'); 433 }); 434 435 $('.placeani input, .placeani textarea').blur(function(){ 436 var inputValue = $(this).val(); 437 if ( inputValue == "" ) { 438 $(this).removeClass('filled'); 439 $(this).parents('.form-group').removeClass('focused'); 440 } else { 441 $(this).addClass('filled'); 442 } 443 }); 444 } 445 446 var manageLoader = function() { 447 setTimeout(function(){ 448 jQuery('#loading-icon-bx').remove(); 449 }, 0); 450 } 451 452 var codeSecurity = function() { 453 document.onkeydown = function(e) { 454 if (e.keyCode === 123 || (e.ctrlKey && 455 (e.keyCode === 67 || 456 e.keyCode === 115 || 457 e.keyCode === 99 || 458 e.keyCode === 85 || 459 e.keyCode === 117))) { 460 return false; 461 } else { 462 return true; 463 } 464 }; 465 466 /*document.addEventListener("contextmenu", function(e){ 467 e.preventDefault(); 468 }, false);*/ 469 470 $(document).keypress("u",function(e) { 471 if(e.ctrlKey){return false;} 472 else {return true;} 473 }); 474 } 475 476 /* Function ============ */ 477 return { 478 initialHelper:function(){ 479 wowAnimation(); 480 scrollPageLayout(); 481 setHeaderHeight(); 482 searchBar(); 483 magnificPopupImageView(); 484 pageScrollToTop(); 485 managePlaceholderStyle(); 486 setFooterHeight(); 487 setStickyheader(); 488 setCountDown(); 489 setStylishScroll(); 490 manageLeftSideMenu(); 491 codeSecurity(); 492 }, 493 494 afterLoadThePage:function(){ 495 setBootstrapDropDown(); 496 setDivSameHeight('.equal-height-container .equal-height-container-item'); 497 setCounterUp(); 498 masonryLayout(); 499 manageLoader(); 500 }, 501 502 changeTheScreen:function(){ 503 setWindowSizeVar(); 504 manageLeftSideMenu(); 505 setHeaderHeight(); 506 } 507 } 508 509 }(jQuery); 510 511 /* jQuery ready */ 512 jQuery(document).on('ready',function() {ThemeBuilder.initialHelper();BasicFunction.initialHelper();}); 513 /* jQuery Window Load */ 514 jQuery(window).on("load", function (e) {ThemeBuilder.afterLoadThePage();}); 515 /* Screen Resize */ 516 jQuery(window).on('resize',function(){ThemeBuilder.changeTheScreen();}); 517 518})(jQuery);
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.