1// JavaScript Document 2jQuery(document).ready(function(e) { 3 var check_rtl = false; 4 if (jQuery('body').hasClass('rtl')) { 5 check_rtl = true; 6 } 7 8 var woo_cart_update_buttons = function(){ 9 jQuery( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).addClass( 'buttons_added' ).append( '<input type="button" value="+" id="add1" class="plus" />' ).prepend( '<input type="button" value="-" id="minus1" class="minus" />' ); 10 jQuery('.buttons_added #minus1').click(function(e) { 11 var inputquantity = jQuery('.input-text.qty', jQuery(this).parent()); 12 var value = parseInt(inputquantity.val()) - 1; 13 if(value > 0){ 14 inputquantity.val(value); 15 jQuery('.woocommerce-cart table.cart input[name="update_cart"]').prop("disabled", false) 16 } 17 }); 18 jQuery('.buttons_added #add1').click(function(e) { 19 var inputquantity = jQuery('.input-text.qty', jQuery(this).parent()); 20 var value = parseInt(inputquantity.val()) + 1; 21 inputquantity.val(value); 22 jQuery('.woocommerce-cart table.cart input[name="update_cart"]').prop("disabled", false) 23 }); 24 } 25 26 woo_cart_update_buttons(); 27 28 jQuery( document.body ).on('updated_wc_div', function(){ 29 woo_cart_update_buttons(); 30 }); 31 32 jQuery('.lang_sel_sel.icl-en').click(function(e) { 33 if(jQuery(window).width()<767){ 34 if(jQuery('#lang_sel_click ul li ul').css('visibility') == 'visible'){ 35 jQuery('#lang_sel_click ul li ul').css('display','hidden'); 36 } else { 37 jQuery('#lang_sel_click ul li ul').css('display','visible'); 38 } 39 }; 40 }); 41 jQuery('textarea#comment').focus(function(){ 42 jQuery('.cm-form-info').addClass('cm_show'); 43 jQuery('p.form-submit').addClass('form_heig'); 44 }); 45 jQuery('#uni-project').change(function() { 46 var link = jQuery('#uni-project option:selected').val() 47 if(link !=undefined){ 48 window.location.href= link; 49 } 50 }); 51 //Submenu 52 jQuery('.menu-item-has-children.parent a').click(function(e) { 53 var get_att = jQuery( this ).attr('href'); 54 if (get_att == '#' ){ 55 jQuery(this).removeAttr('href', '#'); 56 } 57 }); 58 jQuery('.menu-item-has-children.parent').click(function(e) { 59 jQuery('.menu-item-has-children.parent').removeClass('show_submenu'); 60 jQuery('.menu-item-has-children.parent .sub-menu').removeClass('show_sub_menu'); 61 jQuery(this).addClass('show_submenu'); 62 jQuery('.menu-item-has-children.parent.show_submenu .sub-menu').addClass('show_sub_menu'); 63 });
64 //carousel 65 jQuery(".is-carousel").each(function(){ 66 var carousel_id = jQuery(this).attr('id'); 67 var auto_play = (jQuery(this).data('autoplay')) ? true : false; 68 var auto_play_time = jQuery(this).data('autoplay'); 69 var items = jQuery(this).data('items'); 70 var navigation = jQuery(this).data('navigation'); 71 if(jQuery(this).hasClass('single-carousel')){ //single style 72 jQuery(this).addClass('owl-carousel'); 73 jQuery(this).owlCarousel({ 74 items: 1, 75 autoplay:auto_play, 76 autoplayTimeout: auto_play_time, 77 rtl: check_rtl, 78 loop: true, 79 nav: navigation?true:false, 80 navText:["<i class='fa fa-angle-left'></i>","<i class='fa fa-angle-right'></i>"] 81 }); 82 }else{ 83 jQuery(this).addClass('owl-carousel'); 84 jQuery(this).owlCarousel({ 85 autoplay:auto_play, 86 autoplayTimeout: auto_play_time, 87 items: items?items:4, 88 loop: true, 89 rtl: check_rtl, 90 nav: navigation?true:false, 91 navText:["<i class='fa fa-angle-left'></i>","<i class='fa fa-angle-right'></i>"], 92 responsive:{ 93 0:{ 94 items:1 95 }, 96 768:{ 97 items:items?(items>=2?2:1):2 98 }, 99 992: { 100 items:items?items:4 101 } 102 } 103 }); 104 } 105 }); 106 //grid or carousel 107 if(jQuery(window).width()<977){ 108 jQuery(".grid-listing").addClass('owl-carousel'); 109 jQuery(".grid-listing").owlCarousel({ 110 rtl: check_rtl, 111 loop:true, 112 responsive:{ 113 0:{ 114 items:1 115 }, 116 768:{ 117 items:2 118 } 119 } 120 }); 121 } 122 123 //Countdown 124 jQuery('[data-countdown]').each(function() { 125 var $this = jQuery(this), finalDate = jQuery(this).data('countdown'); 126 var day_label = $this.data('daylabel'); 127 var hour_label = $this.data('hourlabel'); 128 var minute_label = $this.data('minutelabel'); 129 var second_label = $this.data('secondlabel'); 130 var show_second = $this.data('showsecond'); 131 $this.countdown(finalDate, function(event) { 132 $this.html(event.strftime('' 133 + '<span class="countdown-block"><span class="countdown-number main-color-1-bg dark-div minion">%D</span><span class="countdown-label main-color-1">'+day_label+'</span></span>' 134 + '<span class="countdown-block"><span class="countdown-number main-color-1-bg dark-div minion">%H</span><span class="countdown-label main-color-1">'+hour_label+'</span></span>' 135 + '<span class="countdown-block"><span class="countdown-number main-color-1-bg dark-div minion">%M</span><span class="countdown-label main-color-1">'+minute_label+'</span></span>' 136 + (show_second?'<span class="countdown-block"><span class="countdown-number main-color-1-bg dark-div minion">%S</span><span class="countdown-label main-color-1">'+second_label+'</span></span>':'') 137 )); 138 }); 139 }); 140 if(jQuery('.colorbox-grid').length){ 141 jQuery('.colorbox-grid').colorbox({ 142 rel: function(){ 143 return jQuery(this).data('rel'); 144 }, 145 inline:true, 146 href: function(){ 147 if(jQuery(this).data('isgallery')){ 148 return jQuery(this).data('content')+' .popup-data-gallery'; 149 }else{ 150 return jQuery(this).data('content')+' .popup-data:not(.popup-data-gallery)'; 151 } 152 }, 153 top: 110, 154 width: 690, 155 responsive: true, 156 onOpen: function(){ 157 jQuery('body').addClass('popup-active'); 158 }, 159 onClosed: function(){ 160 jQuery('body').removeClass('popup-active'); 161 }, 162 previous: '<i class="fa fa-chevron-left"></i>', 163 next: '<i class="fa fa-chevron-right"></i>', 164 close: '<i class="fa fa-times"></i>', 165 }); 166 } 167 168 if(jQuery('.colorbox-video-banner').length){ 169 jQuery('.colorbox-video-banner').colorbox({ 170 inline:true, 171 arrowKey: false, 172 href: function(){ 173 if(jQuery(this).data('isgallery')){ 174 return jQuery(this).data('content')+' .popup-data-gallery'; 175 }else{ 176 return jQuery(this).data('content')+' .popup-data:not(.popup-data-gallery)'; 177 } 178 }, 179 innerWidth:853, 180 innerHeight:480, 181 responsive: true, 182 onOpen: function(){ 183 jQuery('body').addClass('popup-active'); 184 }, 185 onClosed: function(){ 186 jQuery('body').removeClass('popup-active'); 187 }, 188 close: '<i class="fa fa-times"></i>', 189 }); 190 } 191 //smooth scroll anchor 192 jQuery('a[href*="#"]:not([href="#"]):not(.cf)').click(function() { 193 if(jQuery(this).hasClass('featured-tab') || jQuery(this).hasClass('popup-gallery-comment') || jQuery(this).parents('ul').hasClass('tabs') || jQuery(this).hasClass('comment-reply-link') || jQuery(this).hasClass('ui-tabs-anchor') || jQuery(this).data('vc-container') || jQuery(this).parents('div').hasClass('wpb_tour_next_prev_nav')){ 194 return true; 195 }else if(location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 196 || location.hostname == this.hostname) { 197 var target = jQuery(this.hash); 198 target = target.length ? target : jQuery('[name=' + this.hash.slice(1) +']'); 199 if (target.length) { 200 jQuery('html,body,#body-wrap').animate({ 201 scrollTop: target.offset().top - 50 202 }, 660); 203 return true; 204 } 205 } 206 }); 207 jQuery('.wpb_accordion_header a').click(function() { 208 thisa = jQuery(this); 209 setTimeout(function(){ 210 jQuery('html,body,#body-wrap').animate({ 211 scrollTop: thisa.offset().top - 120 212 }, 660); 213 }, 400); 214 return true; 215 }); 216 217 //search toggle focus 218 jQuery('#nav-search').on('shown.bs.collapse', function () { 219 jQuery('#nav-search .search-field').focus(); 220 }); 221 jQuery(document).mouseup(function(e){ 222 var container = jQuery("#nav-search"); 223 if (!container.is(e.target) && container.has(e.target).length === 0){ 224 jQuery('#nav-search.in').collapse('hide'); 225 } 226 }); 227 228 //mobile menu 229 jQuery('.mobile-menu-toggle').click(function(e) { 230 jQuery('body').toggleClass('enable-mobile-menu'); 231 jQuery('body').removeClass('scroll-mobile-menu'); 232 }); 233 jQuery('.mobile-menu').scroll(function(e) { 234 jQuery('body').addClass('scroll-mobile-menu'); 235 }); 236 237 //paralax 238 var $window = jQuery(window); 239 jQuery('.pc .u_paralax .wpb_row, .pc .is-paralax').each(function(){ 240 var $bgobj = jQuery(this); // assigning the object 241 var yPos = -( ($window.scrollTop()-$bgobj.offset().top) / 5); 242 var coords = 'background-position: 50% '+ yPos + 'px !important; transition: none;'; 243 $bgobj.attr('style', coords); 244 245 jQuery(window).scroll(function() { 246 var yPos = -( ($window.scrollTop()-$bgobj.offset().top) / 5); 247 // Put together our final background position 248 var coords = 'background-position: 50% '+ yPos + 'px !important; transition: none;'; 249 // Move the background 250 $bgobj.attr('style', coords); 251 }); 252 }); 253 254 //animation delay 255 jQuery('.wpb_animate_when_almost_visible').each(function(index, element) {
256 var delay = jQuery(this).data('delay'); 257 if(delay){ 258 var delay_css = 'transition-delay: '+delay+'s; -webkit-transition-delay: '+delay+'s; -moz-transition-delay: '+delay+'s; animation-delay: '+delay+'s; -webkit-animation-delay: '+delay+'s; -moz-animation-delay: '+delay+'s;'; 259 jQuery(this).attr('style',delay_css); 260 } 261 }); 262 263 //iOS fix 264 jQuery('.event-item').bind('touchstart', function(e) { 265 if(!jQuery(this).hasClass('hover_effect')){ 266 e.preventDefault(); 267 jQuery('.event-item').removeClass('hover_effect'); 268 jQuery(this).toggleClass('hover_effect'); 269 } 270 }); 271 jQuery('.event-item.hover_effect').bind('touchstart', function(e) { 272 return true; 273 }); 274 275});//document ready 276 277jQuery(window).resize(function(e) { 278 var check_rtl = false; 279 if (jQuery('body').hasClass('rtl')) { 280 check_rtl = true; 281 } 282 if(jQuery(window).width()<977){ 283 jQuery(".grid-listing").each(function(index, element) { 284 if(!jQuery(this).hasClass('owl-loaded')){ 285 jQuery(this).addClass('owl-carousel'); 286 jQuery(this).owlCarousel({ 287 rtl:check_rtl, 288 loop:true, 289 responsive:{ 290 0:{ 291 items:1 292 }, 293 768:{ 294 items:2 295 } 296 } 297 }); 298 } 299 }); 300 }else{ 301 jQuery(".grid-listing").each(function(index, element) { 302 if(jQuery(this).hasClass('owl-loaded')){ 303 var owl = jQuery(this).data('owlCarousel'); 304 jQuery(this).removeClass('owl-carousel'); 305 jQuery(this).trigger('destroy.owl.carousel'); 306 } 307 }); 308 } 309}); 310 311//Post scroller 312jQuery(document).ready(function(e) { 313 jQuery('.post-scroller-carousel').each(function(){ 314 //init 315 var this_scroller = jQuery(this); 316 var this_scroller_inner = jQuery('.post-scroller-carousel-inner',this_scroller); 317 318 var bottom_count = 0; 319 //calculate 320 var scroller_height = this_scroller.outerHeight(true); 321 var scroller_list_height = this_scroller_inner.outerHeight(true); 322 var scroller_distance = 0; 323 324 //action 325 jQuery('.post-scroller-item:first-child',this_scroller).addClass('active'); 326 327 jQuery(document).on('click',this_scroller.data('next'),function(){ 328 var scroller = jQuery(this).parent().parent().prev(); 329 var scroller_inner = jQuery('.post-scroller-carousel-inner',scroller); 330 scroller_height = scroller.outerHeight(true); 331 scroller_list_height = scroller_inner.outerHeight(true); 332 active_scroller_item = jQuery('.post-scroller-item.active',scroller); 333 if(active_scroller_item.next().length && scroller_distance < (scroller_list_height-scroller_height)){ 334 active_scroller_item.next().addClass('active') 335 active_scroller_item.removeClass('active'); 336 } 337 active_scroller_item = jQuery('.post-scroller-item.active',scroller); 338 //scroller_distance += active_scroller_item.outerHeight(); 339 scroller_distance = 0 340 active_scroller_item.prevAll().each(function() { 341 scroller_distance += scroller.outerHeight(true); 342 }); 343 if(scroller_distance >= (scroller_list_height-scroller_height)){ 344 scroller_distance=scroller_list_height-scroller_height; 345 //back to top 346 /* 347 bottom_count++; 348 if(bottom_count>2){ 349 bottom_count = 0; 350 scroller_distance = 0; 351 active_scroller_item.removeClass('active'); 352 jQuery('.post-scroller-item:first-child',scroller).addClass('active'); 353 }*/ 354 } 355 scroller_inner.css({ 356 'transform': 'translate3d(0px, -'+scroller_distance+'px, 0px)', 357 '-webkit-transform': 'translate3d(0px, -'+scroller_distance+'px, 0px)', 358 '-ms-transform': 'translateY(-'+scroller_distance+'px)', 359 }); 360 return false; 361 }); 362 jQuery(document).on('click',this_scroller.data('prev'),function(){ 363 var scroller = jQuery(this).parent().parent().prev(); 364 var scroller_inner = jQuery('.post-scroller-carousel-inner',scroller); 365 scroller_height = scroller.outerHeight(true); 366 scroller_list_height = scroller_inner.outerHeight(true); 367 active_scroller_item = jQuery('.post-scroller-item.active',scroller); 368 if(active_scroller_item.prev().length){ 369 active_scroller_item.prev().addClass('active') 370 active_scroller_item.removeClass('active'); 371 } 372 active_scroller_item = jQuery('.post-scroller-item.active',scroller); 373 scroller_distance = 0 374 active_scroller_item.prevAll().each(function() { 375 scroller_distance += scroller.outerHeight(true); 376 }); 377 if(scroller_distance >= (scroller_list_height-scroller_height)){ 378 scroller_distance=scroller_list_height-scroller_height; 379 } 380 scroller_inner.css({ 381 'transform': 'translate3d(0px, -'+scroller_distance+'px, 0px)', 382 '-webkit-transform': 'translate3d(0px, -'+scroller_distance+'px, 0px)', 383 '-ms-transform': 'translateY(-'+scroller_distance+'px)', 384 }); 385 return false;
386 }); 387 }); 388 389 /*Fix menu hover in mobile (add by vanna)*/ 390 jQuery('.navbar-nav li>a').bind('touchstart', function(e){ 391 if(jQuery(this).parents('li').find('ul').length > 0 && !jQuery(this).hasClass('no-go-to-touch')){ 392 jQuery(this).addClass('no-go-to-touch'); 393 return false; 394 }; 395 }); 396 /*Fix menu hover in mobile*/ 397}); 398jQuery(window).resize(function(e) { 399 jQuery('.post-scroller-carousel').each(function(){ 400 //init 401 var this_scroller = jQuery(this); 402 var this_scroller_inner = jQuery('.post-scroller-carousel-inner',this); 403 //calculate 404 var scroller_height = this_scroller.height(); 405 var scroller_list_height = this_scroller_inner.height(); 406 407 var active_scroller_item = jQuery('.post-scroller-item.active',this); 408 var scroller_distance = 0 409 active_scroller_item.prevAll().each(function() { 410 scroller_distance += jQuery(this).outerHeight(true); 411 }); 412 if(scroller_distance >= (scroller_list_height-scroller_height)){ 413 scroller_distance=scroller_list_height-scroller_height; 414 } 415 jQuery('.post-scroller-carousel-inner',this).css({ 416 'transform': 'translate3d(0px, -'+scroller_distance+'px, 0px)', 417 '-webkit-transform': 'translate3d(0px, -'+scroller_distance+'px, 0px)', 418 }); 419 }); 420}); 421//End Post scroller 422 423//Pre loading 424jQuery(window).load(function(e) { 425 jQuery("#pageloader").fadeOut(500); 426}); 427 428// Add some classes to body for CSS hooks 429// Get browser 430if(jQuery.browser){ 431 jQuery.each(jQuery.browser, function(i) { 432 jQuery('body').addClass(i); 433 return false; 434 }); 435} 436// Get OS 437var os = [ 438 'iphone', 439 'ipad', 440 'windows', 441 'mac', 442 'linux', 443 'android', 444 'mobile' 445]; 446var match = navigator.appVersion.toLowerCase().match(new RegExp(os.join('|'))); 447if (match) { 448 jQuery('body').addClass(match[0]); 449} 450if(typeof match[0] == 'undefined'){ 451 match[0]=''; 452} 453if ( (navigator.appVersion.indexOf("Win")!=-1 || navigator.appVersion.indexOf("Mac")!=-1 || navigator.appVersion.indexOf("X11")!=-1 || match[0]=='windows' || match[0]=='mac') && match[0]!='iphone' && match[0]!='ipad'){ 454 jQuery('body').addClass('pc'); 455}else{ 456 jQuery('body').addClass('mobile'); 457} 458//End body class
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.