1$(document).ready( function() { 2 3 /*----------------------------/ 4 /* TOP BAR COUNTRY-SELECTION 5 /*---------------------------*/ 6 7 //comment code below if you want to treat the selector as link 8 if($('.country-selector').length > 0) { 9 $('.country-selector a').click( function(e) { 10 $flagImg = $(this).clone(); 11 12 $btnToggle = $(this).parents('ul').siblings('.dropdown-toggle'); 13 $btnToggle.html('').append($flagImg).append(' <span class="caret"></span>'); 14 }); 15 } 16 17 18 /*----------------------------/ 19 /* HERO UNIT 20 /*---------------------------*/ 21 22 if($('#carousel-hero-animated').length > 0) { 23 $('#carousel-hero-animated').carousel({ 24 interval: 4000 25 }) 26 .on( 'slide.bs.carousel', function(slide) { 27 $(this).find('.item .hero-right img').removeClass('bounceOutRight'); 28 $(this).find('.item.active .hero-right img').addClass('bounceOutRight'); 29 }); 30 } 31 32 33 /*----------------------------/ 34 /* NAVBAR 35 /*---------------------------*/ 36 37 if($('.navbar-fixed-top.shrinkable').length > 0) { 38 $('.wrapper').css('padding-top', 97); 39 40 $(window).scroll(function() { 41 if($(document).scrollTop() > 300) { 42 $('.navbar-fixed-top').addClass('shrink-active'); 43 }else { 44 $('.navbar-fixed-top').removeClass('shrink-active'); 45 } 46 }); 47 } 48 49 50 /*----------------------------/ 51 /* CAROUSEL 52 /*---------------------------*/ 53 54 if($('.slick-carousel').length > 0) { 55 $('.recent-works.slick-carousel .container').slick({ 56 dots: true, 57 slidesToShow: 3, 58 cssEase: 'ease-in', 59 prevArrow: '<button type="button" data-role="none" class="btn slick-prev">Previous</button>', 60 nextArrow: '<button type="button" data-role="none" class="btn slick-next">Next</button>', 61 responsive: [ 62 { 63 breakpoint: 993, 64 settings: { 65 slidesToShow: 2 66 } 67 }, 68 { 69 breakpoint: 481, 70 settings: { 71 slidesToShow: 1 72 } 73 } 74 ] 75 }); 76 77 $('.testimonial').slick({ 78 speed: 500, 79 fade: true, 80 prevArrow: '<button type="button" data-role="none" class="btn slick-prev">Previous</button>', 81 nextArrow: '<button type="button" data-role="none" class="btn slick-next">Next</button>', 82 }); 83 84 $('#carousel-hero .carousel-inner').slick({ 85 speed: 800, 86 dots: true, 87 fade: true, 88 autoplay: true, 89 autoplaySpeed: 2500, 90 prevArrow: '<button type="button" data-role="none" class="carousel-control left slick-prev">Previous</button>', 91 nextArrow: '<button type="button" data-role="none" class="carousel-control right slick-next">Next</button>', 92 }); 93 } 94 95 96 /*----------------------------/ 97 /* PARALLAX 98 /*---------------------------*/ 99 100 if($('.parallax').length > 0) { 101 $('.parallax').stellar(); 102 } 103 104 105 /*----------------------------/ 106 /* PORTFOLIO ISOTOPE INIT 107 /*---------------------------*/ 108 109 if($('.portfolio-isotope').length > 0) { 110 $container = $('.portfolio-isotope'); 111 112 var $isoObj = $container.isotope({ 113 itemSelector: '.portfolio-item', 114 layoutMode: 'fitRows' 115 }); 116 117 $container.parent().height($container.height()); 118 119 $('.portfolio-item-filters a').click( function(e) { 120 e.preventDefault(); 121 122 var selector = $(this).attr('data-filter'); 123 $container.isotope({ 124 filter: selector 125 }); 126 127 $container.parent().height($container.height()); 128 129 $('.portfolio-item-filters a').removeClass('active'); 130 $(this).addClass('active'); 131 }); 132 } 133 134 if($('.media-carousel').length > 0) { 135 $('.media-carousel').slick({ 136 dots: true, 137 prevArrow: '<button type="button" data-role="none" class="btn slick-prev">Previous</button>', 138 nextArrow: '<button type="button" data-role="none" class="btn slick-next">Next</button>' 139 }); 140 } 141 142 143 /*----------------------------/ 144 /* BLOG 145 /*---------------------------*/ 146 147 if($('.featured-video').length > 0) { 148 $('.featured-video').fitVids(); 149 } 150 151 152 /*----------------------------/ 153 /* BOOTSTRAP MULTISELECT 154 /*---------------------------*/ 155 156 if($('.multiselect').length > 0) { 157 $('.multiselect').multiselect(); 158 } 159 160 161 /*--------------------------------/ 162 /* AJAX CALL FOR STATEFUL BUTTON 163 /*-------------------------------*/ 164 165 if( $('#loading-example-btn').length > 0 ) { 166 $('#loading-example-btn').click( function() { 167 var btn = $(this); 168 169 $.ajax({
170 url: 'php/ajax-response.php', 171 type: 'POST', 172 dataType: 'json', 173 cache: false, 174 beforeSend: function(){ 175 btn.button('loading'); 176 }, 177 success: function( data, textStatus, XMLHttpRequest ) { 178 // dummy delay for demo purpose only 179 setTimeout( function() { 180 $('#server-message').text(data['msg']).addClass('green-font'); 181 btn.button('reset'); 182 }, 1000 ); 183 }, 184 error: function( XMLHttpRequest, textStatus, errorThrown ) { 185 console.log("AJAX ERROR: \n" + errorThrown); 186 } 187 }); 188 189 190 }); 191 } 192 193 194 /*--------------------------------/ 195 /* SIDEBAR NAVIGATION TOGGLE 196 /*-------------------------------*/ 197 198 $('.submenu-toggle').click( function() { 199 if(!$(this).parent().hasClass('active')) { 200 $(this).parent().addClass('active'); 201 } else { 202 $(this).parent().removeClass('active'); 203 } 204 }); 205 206 $('.sidebar-nav a').click( function() { 207 $('.sidebar-nav a').removeClass('current'); 208 $(this).addClass('current'); 209 }); 210 211 212 /*--------------------------------/ 213 /* BOOTSTRAP TOOLTIP 214 /*-------------------------------*/ 215 216 if($('[data-toggle="tooltip"]').length > 0) { 217 $('[data-toggle="tooltip"]').tooltip({ 218 container: "body" 219 }); 220 } 221 222 223 /*--------------------------------/ 224 /* BOOTSTRAP POPOVER 225 /*-------------------------------*/ 226 227 if($('.btn-popover').length > 0) { 228 $('.btn-popover').popover(); 229 } 230 231 if($('.demo-popover').length > 0) { 232 $('.demo-popover #popover-title').popover({ 233 html: true, 234 title: '<i class="fa fa-info-circle"></i> Popover Title', 235 content: 'This popover has title and support HTML content. Quickly implement process-centric networks rather than compelling potentialities. Objectively reinvent competitive technologies after high standards in process improvements. Phosfluorescently cultivate 24/365.' 236 }); 237 238 $('.demo-popover #popover-hover').popover({ 239 html: true, 240 title: '<i class="fa fa-info-circle"></i> Popover Title', 241 trigger: 'hover', 242 content: 'Activate the popover on hover. Objectively enable optimal opportunities without market positioning expertise. Assertively optimize multidisciplinary benefits rather than holistic experiences. Credibly underwhelm real-time paradigms with.' 243 }); 244 } 245 246 247 /*--------------------------------/ 248 /* MASKED INPUT 249 /*-------------------------------*/ 250 251 if($('#masked-input-demo').length > 0) { 252 $('#phone').mask('(999) 999-9999'); 253 $('#phone-ex').mask('(999) 999-9999? x99999'); 254 $('#tax-id').mask('99-9999999'); 255 $('#ssn').mask('999-99-9999'); 256 $('#product-key').mask('a*-999-a999'); 257 } 258 259 260 /*--------------------------------/ 261 /* DATE PICKER 262 /*-------------------------------*/ 263 264 if($('#date-picker-demo').length > 0) { 265 var dtp = $('#datepicker').datepicker() 266 .on('changeDate', function(e) { dtp.datepicker('hide'); }); 267 268 $('#daterangepicker').daterangepicker({ 269 timePicker: true, 270 timePickerIncrement: 10, 271 format: 'MM/DD/YYYY h:mm A', 272 applyClass: "btn-primary" 273 }); 274 } 275 276 277 /*--------------------------------/ 278 /* TEXTAREA WITH COUNTER 279 /*-------------------------------*/ 280 281 if($('#textarea-demo').length > 0) { 282 var textMax = 99; 283 284 $('.js-textarea-help span').html(textMax + ' characters remaining'); 285 286 $('.textarea-counting').keyup(function() { 287 var textLength = $('.textarea-counting').val().length; 288 var textRemaining = textMax - textLength; 289 290 $('.js-textarea-help span').html(textRemaining + ' characters remaining'); 291 }); 292 } 293 294 295 /*--------------------------------/ 296 /* PIE CHART 297 /*-------------------------------*/ 298 299 if($('.pie-chart').length > 0) { 300 $('.pie-chart').easyPieChart({ 301 size: 180, 302 barColor: '#406DA4', 303 trackColor: '#eaeaea', 304 scaleColor: false, 305 lineWidth: 2, 306 lineCap: "square", 307 animate: 2000 308 }); 309 } 310 311 312 /*-----------------------------------/ 313 /* AJAX CALL FOR NEWSLETTER FUNCTION 314 /*----------------------------------*/ 315 316 $newsletter = $('.newsletter-form'); 317 $newsletter.find('.btn').click( function() { 318 $url = 'php/mailchimp.php'; 319 320 $attr = $newsletter.attr('action'); 321 if (typeof $attr !== typeof undefined && $attr !== false) { 322 if($newsletter.attr('action') != '') $url = $newsletter.attr('action'); 323 } 324 325 subscribe($newsletter, $url); 326 }); 327 328 function subscribe(newsletter, formUrl) { 329 $btn = newsletter.find('.btn'); 330 331 $.ajax({
332 333 url: formUrl, 334 type: 'POST', 335 dataType: 'json', 336 cache: false, 337 data: { 338 email: newsletter.find('input[name="email"]').val(), 339 }, 340 beforeSend: function(){ 341 $btn.addClass('loading'); 342 $btn.attr('disabled', 'disabled'); 343 }, 344 success: function( data, textStatus, XMLHttpRequest ){ 345 346 var className = ''; 347 348 if( data.result == true ){ 349 className = 'alert-success'; 350 }else { 351 className = 'alert-danger'; 352 } 353 354 newsletter.find('.alert').html( data.message ) 355 .removeClass( 'alert-danger alert-success' ) 356 .addClass( 'alert active ' + className ) 357 .slideDown(300); 358 359 $btn.removeClass('loading'); 360 $btn.removeAttr('disabled'); 361 }, 362 error: function( XMLHttpRequest, textStatus, errorThrown ){ 363 console.log("AJAX ERROR: \n" + XMLHttpRequest.responseText + "\n" + textStatus); 364 } 365 366 }); 367 } 368 369 370 /*-----------------------------------/ 371 /* AJAX CONTACT FORM 372 /*----------------------------------*/ 373 374 if($('#contact-form').length > 0) { 375 $('#contact-form').parsley(); 376 377 $('.contact-form-wrapper form').submit( function(e) { 378 e.preventDefault(); 379 380 381 if( !$(this).parsley('isValid') ) 382 return; 383 384 $theForm = $(this); 385 $btn = $(this).find('#submit-button'); 386 $btnText = $btn.text(); 387 $(this).parent().append('<div class="alert"></div>'); 388 $alert = $(this).parent().find('.alert'); 389 390 $btn.find('.loading-icon').addClass('fa-spinner fa-spin '); 391 $btn.prop('disabled', true).find('span').text("Sending..."); 392 393 $url = "php/contact.php"; 394 395 $attr = $(this).attr('action'); 396 if (typeof $attr !== typeof undefined && $attr !== false) { 397 if($(this).attr('action') != '') $url = $(this).attr('action'); 398 } 399 400 $.post($url, $(this).serialize(), function(data){ 401 402 $message = data.message; 403 404 if( data.result == true ){ 405 $theForm.slideUp('medium', function() { 406 $alert.removeClass('alert-danger'); 407 $alert.addClass('alert-success').html($message).slideDown('medium'); 408 }); 409 }else { 410 $alert.addClass('alert-danger').html($message).slideDown('medium'); 411 } 412 413 $btn.find('.loading-icon').removeClass('fa-spinner fa-spin '); 414 $btn.prop('disabled', false).find('span').text($btnText); 415 416 }) 417 .fail(function() { console.log('AJAX Error'); }); 418 }); 419 } 420 421 422 /*-----------------------------------/ 423 /* MISC 424 /*----------------------------------*/ 425 426 // fix portfolio item 427 $('.portfolio-item').on('click', function() { 428 // do nothing, somehow this triggering portfolio overlay on mobile Safari 429 }); 430 431 // indicate mobile browser 432 var ua = navigator.userAgent, 433 isMobileWebkit = /WebKit/.test(ua) && /Mobile/.test(ua); 434 435 if (isMobileWebkit) { 436 $('html').addClass('mobile'); 437 } 438 439}); 440 441 442function BindEvents() { 443 444 /*----------------------------/ 445 /* TOP BAR COUNTRY-SELECTION 446 /*---------------------------*/ 447 448 //comment code below if you want to treat the selector as link 449 if($('.country-selector').length > 0) { 450 $('.country-selector a').click( function(e) { 451 $flagImg = $(this).clone(); 452 453 $btnToggle = $(this).parents('ul').siblings('.dropdown-toggle'); 454 $btnToggle.html('').append($flagImg).append(' <span class="caret"></span>'); 455 }); 456 } 457 458 459 /*----------------------------/ 460 /* HERO UNIT 461 /*---------------------------*/ 462 463 if($('#carousel-hero-animated').length > 0) { 464 $('#carousel-hero-animated').carousel({ 465 interval: 4000 466 }) 467 .on( 'slide.bs.carousel', function(slide) { 468 $(this).find('.item .hero-right img').removeClass('bounceOutRight'); 469 $(this).find('.item.active .hero-right img').addClass('bounceOutRight'); 470 }); 471 } 472 473 474 /*----------------------------/ 475 /* NAVBAR 476 /*---------------------------*/ 477 478 if($('.navbar-fixed-top.shrinkable').length > 0) { 479 $('.wrapper').css('padding-top', 97); 480 481 $(window).scroll(function() { 482 if($(document).scrollTop() > 300) { 483 $('.navbar-fixed-top').addClass('shrink-active'); 484 }else { 485 $('.navbar-fixed-top').removeClass('shrink-active'); 486 } 487 }); 488 } 489 490 491 /*----------------------------/ 492 /* CAROUSEL 493 /*---------------------------*/ 494 495 if($('.slick-carousel').length > 0) { 496 $('.recent-works.slick-carousel .container').slick({ 497 dots: true, 498 slidesToShow: 3, 499 cssEase: 'ease-in', 500 prevArrow: '<button type="button" data-role="none" class="btn slick-prev">Previous</button>', 501 nextArrow: '<button type="button" data-role="none" class="btn slick-next">Next</button>', 502 responsive: [ 503 { 504 breakpoint: 993, 505 settings: { 506 slidesToShow: 2 507 } 508 }, 509 { 510 breakpoint: 481, 511 settings: { 512 slidesToShow: 1 513 } 514 } 515 ] 516 }); 517 518 $('.testimonial').slick({ 519 speed: 500, 520 fade: true, 521 prevArrow: '<button type="button" data-role="none" class="btn slick-prev">Previous</button>', 522 nextArrow: '<button type="button" data-role="none" class="btn slick-next">Next</button>', 523 }); 524 525 $('#carousel-hero .carousel-inner').slick({
526 speed: 800, 527 dots: true, 528 fade: true, 529 autoplay: true, 530 autoplaySpeed: 2500, 531 prevArrow: '<button type="button" data-role="none" class="carousel-control left slick-prev">Previous</button>', 532 nextArrow: '<button type="button" data-role="none" class="carousel-control right slick-next">Next</button>', 533 }); 534 } 535 536 537 /*----------------------------/ 538 /* PARALLAX 539 /*---------------------------*/ 540 541 if($('.parallax').length > 0) { 542 $('.parallax').stellar(); 543 } 544 545 546 /*----------------------------/ 547 /* PORTFOLIO ISOTOPE INIT 548 /*---------------------------*/ 549 550 if($('.portfolio-isotope').length > 0) { 551 $container = $('.portfolio-isotope'); 552 553 var $isoObj = $container.isotope({ 554 itemSelector: '.portfolio-item', 555 layoutMode: 'fitRows' 556 }); 557 558 $container.parent().height($container.height()); 559 560 $('.portfolio-item-filters a').click( function(e) { 561 e.preventDefault(); 562 563 var selector = $(this).attr('data-filter'); 564 $container.isotope({ 565 filter: selector 566 }); 567 568 $container.parent().height($container.height()); 569 570 $('.portfolio-item-filters a').removeClass('active'); 571 $(this).addClass('active'); 572 }); 573 } 574 575 if($('.media-carousel').length > 0) { 576 $('.media-carousel').slick({ 577 dots: true, 578 prevArrow: '<button type="button" data-role="none" class="btn slick-prev">Previous</button>', 579 nextArrow: '<button type="button" data-role="none" class="btn slick-next">Next</button>' 580 }); 581 } 582 583 584 /*----------------------------/ 585 /* BLOG 586 /*---------------------------*/ 587 588 if($('.featured-video').length > 0) { 589 $('.featured-video').fitVids(); 590 } 591 592 593 /*----------------------------/ 594 /* BOOTSTRAP MULTISELECT 595 /*---------------------------*/ 596 597 if($('.multiselect').length > 0) { 598 $('.multiselect').multiselect(); 599 } 600 601 602 /*--------------------------------/ 603 /* AJAX CALL FOR STATEFUL BUTTON 604 /*-------------------------------*/ 605 606 if( $('#loading-example-btn').length > 0 ) { 607 $('#loading-example-btn').click( function() { 608 var btn = $(this); 609 610 $.ajax({
611 url: 'php/ajax-response.php', 612 type: 'POST', 613 dataType: 'json', 614 cache: false, 615 beforeSend: function(){ 616 btn.button('loading'); 617 }, 618 success: function( data, textStatus, XMLHttpRequest ) { 619 // dummy delay for demo purpose only 620 setTimeout( function() { 621 $('#server-message').text(data['msg']).addClass('green-font'); 622 btn.button('reset'); 623 }, 1000 ); 624 }, 625 error: function( XMLHttpRequest, textStatus, errorThrown ) { 626 console.log("AJAX ERROR: \n" + errorThrown); 627 } 628 }); 629 630 631 }); 632 } 633 634 635 /*--------------------------------/ 636 /* SIDEBAR NAVIGATION TOGGLE 637 /*-------------------------------*/ 638 639 $('.submenu-toggle').click( function() { 640 if(!$(this).parent().hasClass('active')) { 641 $(this).parent().addClass('active'); 642 } else { 643 $(this).parent().removeClass('active'); 644 } 645 }); 646 647 $('.sidebar-nav a').click( function() { 648 $('.sidebar-nav a').removeClass('current'); 649 $(this).addClass('current'); 650 }); 651 652 653 /*--------------------------------/ 654 /* BOOTSTRAP TOOLTIP 655 /*-------------------------------*/ 656 657 if($('[data-toggle="tooltip"]').length > 0) { 658 $('[data-toggle="tooltip"]').tooltip({ 659 container: "body" 660 }); 661 } 662 663 664 /*--------------------------------/ 665 /* BOOTSTRAP POPOVER 666 /*-------------------------------*/ 667 668 if($('.btn-popover').length > 0) { 669 $('.btn-popover').popover(); 670 } 671 672 if($('.demo-popover').length > 0) { 673 $('.demo-popover #popover-title').popover({ 674 html: true, 675 title: '<i class="fa fa-info-circle"></i> Popover Title', 676 content: 'This popover has title and support HTML content. Quickly implement process-centric networks rather than compelling potentialities. Objectively reinvent competitive technologies after high standards in process improvements. Phosfluorescently cultivate 24/365.' 677 }); 678 679 $('.demo-popover #popover-hover').popover({ 680 html: true, 681 title: '<i class="fa fa-info-circle"></i> Popover Title', 682 trigger: 'hover', 683 content: 'Activate the popover on hover. Objectively enable optimal opportunities without market positioning expertise. Assertively optimize multidisciplinary benefits rather than holistic experiences. Credibly underwhelm real-time paradigms with.' 684 }); 685 } 686 687 688 /*--------------------------------/ 689 /* MASKED INPUT 690 /*-------------------------------*/ 691 692 if($('#masked-input-demo').length > 0) { 693 $('#phone').mask('(999) 999-9999'); 694 $('#phone-ex').mask('(999) 999-9999? x99999'); 695 $('#tax-id').mask('99-9999999'); 696 $('#ssn').mask('999-99-9999'); 697 $('#product-key').mask('a*-999-a999'); 698 } 699 700 701 /*--------------------------------/ 702 /* DATE PICKER 703 /*-------------------------------*/ 704 705 if($('#date-picker-demo').length > 0) { 706 var dtp = $('#datepicker').datepicker() 707 .on('changeDate', function(e) { dtp.datepicker('hide'); }); 708 709 $('#daterangepicker').daterangepicker({ 710 timePicker: true, 711 timePickerIncrement: 10, 712 format: 'MM/DD/YYYY h:mm A', 713 applyClass: "btn-primary" 714 }); 715 } 716 717 718 /*--------------------------------/ 719 /* TEXTAREA WITH COUNTER 720 /*-------------------------------*/ 721 722 if($('#textarea-demo').length > 0) { 723 var textMax = 99; 724 725 $('.js-textarea-help span').html(textMax + ' characters remaining'); 726 727 $('.textarea-counting').keyup(function() { 728 var textLength = $('.textarea-counting').val().length; 729 var textRemaining = textMax - textLength; 730 731 $('.js-textarea-help span').html(textRemaining + ' characters remaining'); 732 }); 733 } 734 735 736 /*--------------------------------/ 737 /* PIE CHART 738 /*-------------------------------*/ 739 740 if($('.pie-chart').length > 0) { 741 $('.pie-chart').easyPieChart({ 742 size: 180, 743 barColor: '#406DA4', 744 trackColor: '#eaeaea', 745 scaleColor: false, 746 lineWidth: 2, 747 lineCap: "square", 748 animate: 2000 749 }); 750 } 751 752 753 /*-----------------------------------/ 754 /* AJAX CALL FOR NEWSLETTER FUNCTION 755 /*----------------------------------*/ 756 757 $newsletter = $('.newsletter-form'); 758 $newsletter.find('.btn').click( function() { 759 $url = 'php/mailchimp.php'; 760 761 $attr = $newsletter.attr('action'); 762 if (typeof $attr !== typeof undefined && $attr !== false) { 763 if($newsletter.attr('action') != '') $url = $newsletter.attr('action'); 764 } 765 766 subscribe($newsletter, $url); 767 });
768 769 function subscribe(newsletter, formUrl) { 770 $btn = newsletter.find('.btn'); 771 772 $.ajax({ 773 774 url: formUrl, 775 type: 'POST', 776 dataType: 'json', 777 cache: false, 778 data: { 779 email: newsletter.find('input[name="email"]').val(), 780 }, 781 beforeSend: function(){ 782 $btn.addClass('loading'); 783 $btn.attr('disabled', 'disabled'); 784 }, 785 success: function( data, textStatus, XMLHttpRequest ){ 786 787 var className = ''; 788 789 if( data.result == true ){ 790 className = 'alert-success'; 791 }else { 792 className = 'alert-danger'; 793 } 794 795 newsletter.find('.alert').html( data.message ) 796 .removeClass( 'alert-danger alert-success' ) 797 .addClass( 'alert active ' + className ) 798 .slideDown(300); 799 800 $btn.removeClass('loading'); 801 $btn.removeAttr('disabled'); 802 }, 803 error: function( XMLHttpRequest, textStatus, errorThrown ){ 804 console.log("AJAX ERROR: \n" + XMLHttpRequest.responseText + "\n" + textStatus); 805 } 806 807 }); 808 } 809 810 811 /*-----------------------------------/ 812 /* AJAX CONTACT FORM 813 /*----------------------------------*/ 814 815 if($('#contact-form').length > 0) { 816 $('#contact-form').parsley(); 817 818 $('.contact-form-wrapper form').submit( function(e) { 819 e.preventDefault(); 820 821 822 if( !$(this).parsley('isValid') ) 823 return; 824 825 $theForm = $(this); 826 $btn = $(this).find('#submit-button'); 827 $btnText = $btn.text(); 828 $(this).parent().append('<div class="alert"></div>'); 829 $alert = $(this).parent().find('.alert'); 830 831 $btn.find('.loading-icon').addClass('fa-spinner fa-spin '); 832 $btn.prop('disabled', true).find('span').text("Sending..."); 833 834 $url = "php/contact.php"; 835 836 $attr = $(this).attr('action'); 837 if (typeof $attr !== typeof undefined && $attr !== false) { 838 if($(this).attr('action') != '') $url = $(this).attr('action'); 839 } 840 841 $.post($url, $(this).serialize(), function(data){ 842 843 $message = data.message; 844 845 if( data.result == true ){ 846 $theForm.slideUp('medium', function() { 847 $alert.removeClass('alert-danger'); 848 $alert.addClass('alert-success').html($message).slideDown('medium'); 849 }); 850 }else { 851 $alert.addClass('alert-danger').html($message).slideDown('medium'); 852 } 853 854 $btn.find('.loading-icon').removeClass('fa-spinner fa-spin '); 855 $btn.prop('disabled', false).find('span').text($btnText); 856 857 }) 858 .fail(function() { console.log('AJAX Error'); }); 859 }); 860 } 861 862 863 /*-----------------------------------/ 864 /* MISC 865 /*----------------------------------*/ 866 867 // fix portfolio item 868 $('.portfolio-item').on('click', function() { 869 // do nothing, somehow this triggering portfolio overlay on mobile Safari 870 }); 871 872 // indicate mobile browser 873 var ua = navigator.userAgent, 874 isMobileWebkit = /WebKit/.test(ua) && /Mobile/.test(ua); 875 876 if (isMobileWebkit) { 877 $('html').addClass('mobile'); 878 } 879 880}
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.