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 if(jQuery(window).width()<977){ 279 jQuery(".grid-listing").each(function(index, element) { 280 if(!jQuery(this).hasClass('owl-loaded')){ 281 jQuery(this).addClass('owl-carousel'); 282 jQuery(this).owlCarousel({ 283 rtl:check_rtl, 284 loop:true, 285 responsive:{ 286 0:{ 287 items:1 288 }, 289 768:{ 290 items:2 291 } 292 } 293 }); 294 } 295 }); 296 }else{ 297 jQuery(".grid-listing").each(function(index, element) { 298 if(jQuery(this).hasClass('owl-loaded')){ 299 var owl = jQuery(this).data('owlCarousel'); 300 jQuery(this).removeClass('owl-carousel'); 301 jQuery(this).trigger('destroy.owl.carousel'); 302 } 303 }); 304 } 305}); 306 307//Post scroller 308jQuery(document).ready(function(e) { 309 jQuery('.post-scroller-carousel').each(function(){ 310 //init 311 var this_scroller = jQuery(this); 312 var this_scroller_inner = jQuery('.post-scroller-carousel-inner',this_scroller); 313 314 var bottom_count = 0; 315 //calculate 316 var scroller_height = this_scroller.outerHeight(true); 317 var scroller_list_height = this_scroller_inner.outerHeight(true); 318 var scroller_distance = 0; 319 320 //action 321 jQuery('.post-scroller-item:first-child',this_scroller).addClass('active'); 322 323 jQuery(document).on('click',this_scroller.data('next'),function(){ 324 var scroller = jQuery(this).parent().parent().prev(); 325 var scroller_inner = jQuery('.post-scroller-carousel-inner',scroller); 326 scroller_height = scroller.outerHeight(true); 327 scroller_list_height = scroller_inner.outerHeight(true); 328 active_scroller_item = jQuery('.post-scroller-item.active',scroller); 329 if(active_scroller_item.next().length && scroller_distance < (scroller_list_height-scroller_height)){ 330 active_scroller_item.next().addClass('active') 331 active_scroller_item.removeClass('active'); 332 } 333 active_scroller_item = jQuery('.post-scroller-item.active',scroller); 334 //scroller_distance += active_scroller_item.outerHeight(); 335 scroller_distance = 0 336 active_scroller_item.prevAll().each(function() { 337 scroller_distance += scroller.outerHeight(true); 338 }); 339 if(scroller_distance >= (scroller_list_height-scroller_height)){ 340 scroller_distance=scroller_list_height-scroller_height; 341 //back to top 342 /* 343 bottom_count++; 344 if(bottom_count>2){ 345 bottom_count = 0; 346 scroller_distance = 0; 347 active_scroller_item.removeClass('active'); 348 jQuery('.post-scroller-item:first-child',scroller).addClass('active'); 349 }*/ 350 } 351 scroller_inner.css({ 352 'transform': 'translate3d(0px, -'+scroller_distance+'px, 0px)', 353 '-webkit-transform': 'translate3d(0px, -'+scroller_distance+'px, 0px)', 354 '-ms-transform': 'translateY(-'+scroller_distance+'px)', 355 }); 356 return false; 357 }); 358 jQuery(document).on('click',this_scroller.data('prev'),function(){ 359 var scroller = jQuery(this).parent().parent().prev(); 360 var scroller_inner = jQuery('.post-scroller-carousel-inner',scroller); 361 scroller_height = scroller.outerHeight(true); 362 scroller_list_height = scroller_inner.outerHeight(true); 363 active_scroller_item = jQuery('.post-scroller-item.active',scroller); 364 if(active_scroller_item.prev().length){ 365 active_scroller_item.prev().addClass('active') 366 active_scroller_item.removeClass('active'); 367 } 368 active_scroller_item = jQuery('.post-scroller-item.active',scroller); 369 scroller_distance = 0 370 active_scroller_item.prevAll().each(function() { 371 scroller_distance += scroller.outerHeight(true); 372 }); 373 if(scroller_distance >= (scroller_list_height-scroller_height)){ 374 scroller_distance=scroller_list_height-scroller_height; 375 } 376 scroller_inner.css({ 377 'transform': 'translate3d(0px, -'+scroller_distance+'px, 0px)',
378 '-webkit-transform': 'translate3d(0px, -'+scroller_distance+'px, 0px)', 379 '-ms-transform': 'translateY(-'+scroller_distance+'px)', 380 }); 381 return false; 382 }); 383 }); 384 385 /*Fix menu hover in mobile (add by vanna)*/ 386 jQuery('.navbar-nav li>a').bind('touchstart', function(e){ 387 if(jQuery(this).parents('li').find('ul').length > 0 && !jQuery(this).hasClass('no-go-to-touch')){ 388 jQuery(this).addClass('no-go-to-touch'); 389 return false; 390 }; 391 }); 392 /*Fix menu hover in mobile*/ 393}); 394jQuery(window).resize(function(e) { 395 jQuery('.post-scroller-carousel').each(function(){ 396 //init 397 var this_scroller = jQuery(this); 398 var this_scroller_inner = jQuery('.post-scroller-carousel-inner',this); 399 //calculate 400 var scroller_height = this_scroller.height(); 401 var scroller_list_height = this_scroller_inner.height(); 402 403 var active_scroller_item = jQuery('.post-scroller-item.active',this); 404 var scroller_distance = 0 405 active_scroller_item.prevAll().each(function() { 406 scroller_distance += jQuery(this).outerHeight(true); 407 }); 408 if(scroller_distance >= (scroller_list_height-scroller_height)){ 409 scroller_distance=scroller_list_height-scroller_height; 410 } 411 jQuery('.post-scroller-carousel-inner',this).css({ 412 'transform': 'translate3d(0px, -'+scroller_distance+'px, 0px)', 413 '-webkit-transform': 'translate3d(0px, -'+scroller_distance+'px, 0px)', 414 }); 415 }); 416}); 417//End Post scroller 418 419//Pre loading 420jQuery(window).load(function(e) { 421 jQuery("#pageloader").fadeOut(500); 422}); 423 424// Add some classes to body for CSS hooks 425// Get browser 426if(jQuery.browser){ 427 jQuery.each(jQuery.browser, function(i) { 428 jQuery('body').addClass(i); 429 return false; 430 }); 431} 432// Get OS 433var os = [ 434 'iphone', 435 'ipad', 436 'windows', 437 'mac', 438 'linux', 439 'android', 440 'mobile' 441]; 442var match = navigator.appVersion.toLowerCase().match(new RegExp(os.join('|'))); 443if (match) { 444 jQuery('body').addClass(match[0]); 445} 446if(typeof match[0] == 'undefined'){ 447 match[0]=''; 448} 449if ( (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'){ 450 jQuery('body').addClass('pc'); 451}else{ 452 jQuery('body').addClass('mobile'); 453} 454//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.