1/* ========================================================= 2 Comment Form 3 ============================================================ */ 4jQuery(document).ready(function() { 5 6 if (jQuery("#contact-form").length > 0) { 7 // get front validate localization 8 var validateLocalization = kopa_custom_front_localization.validate; 9 10 jQuery('#contact-form').validate({ 11 rules: { 12 name: { 13 required: true, 14 minlength: 2 15 }, 16 email: { 17 required: true, 18 email: true 19 }, 20 message: { 21 required: true, 22 minlength: 10 23 } 24 }, 25 messages: { 26 name: { 27 required: validateLocalization.name.required, 28 minlength: jQuery.format(validateLocalization.name.minlength) 29 }, 30 email: { 31 required: validateLocalization.email.required, 32 email: validateLocalization.email.email 33 }, 34 url: { 35 required: validateLocalization.url.required, 36 url: validateLocalization.url.url 37 }, 38 message: { 39 required: validateLocalization.message.required, 40 minlength: jQuery.format(validateLocalization.message.minlength) 41 } 42 }, 43 submitHandler: function(form) { 44 jQuery("#submit-contact").attr("value", validateLocalization.form.sending); 45 jQuery(form).ajaxSubmit({ 46 success: function(responseText, statusText, xhr, $form) { 47 jQuery("#response").html(responseText).hide().slideDown("fast"); 48 jQuery("#submit-contact").attr("value", validateLocalization.form.submit); 49 jQuery(form).find('[name=name]').val(''); 50 jQuery(form).find('[name=email]').val(''); 51 jQuery(form).find('[name=url]').val(''); 52 jQuery(form).find('[name=message]').val(''); 53 } 54 }); 55 return false; 56 } 57 }); 58 59 60 } 61if (jQuery(".comment-form").length > 0) { 62 // get front validate localization 63 var validateLocalization = kopa_custom_front_localization.validate; 64 jQuery('.comment-form').validate({ 65 rules: { 66 author: { 67 required: true, 68 minlength: 2 69 }, 70 email: { 71 required: true, 72 email: true 73 }, 74 comment: { 75 required: true, 76 minlength: 10 77 } 78 }, 79 messages: { 80 author: { 81 required: validateLocalization.name.required, 82 minlength: jQuery.format(validateLocalization.name.minlength) 83 }, 84 email: { 85 required: validateLocalization.email.required, 86 email: validateLocalization.email.email 87 }, 88 url: { 89 required: validateLocalization.url.required, 90 url: validateLocalization.url.url 91 }, 92 comment: { 93 required: validateLocalization.message.required, 94 minlength: jQuery.format(validateLocalization.message.minlength) 95 } 96 } 97 98 }); 99 } 100}); 101 102/* ========================================================= 103 Search box 104 ============================================================ */ 105jQuery(document).ready(function() { 106 jQuery(".search-icon").click(function() { 107 jQuery(this).toggleClass("close-icon"); 108 jQuery("#header-top .search-box").toggle(300); 109 jQuery("#header-top .search-icon").toggleClass("search-active"); 110 });
111 112}); 113 114/* ========================================================= 115 Sticky 116 ============================================================ */ 117jQuery(document).ready(function() { 118 jQuery(function() { 119 jQuery(window).scroll(function() { 120 if (jQuery(this).scrollTop() > 41) { 121 jQuery('#header-bottom.cbp-af-header').addClass('sticky-header'); 122 } else { 123 jQuery('#header-bottom.cbp-af-header').removeClass('sticky-header'); 124 } 125 }); 126 }); 127 128}); 129 130/* ========================================================= 131 Show background when hover menu 132 ============================================================ */ 133 134(function($) { 135 136 "use strict"; 137 138 jQuery(document).ready(function() { 139 140 141 /* Navigation Hover 142 ================================================== */ 143 jQuery('#main-nav').bind('mouseenter', showBackGround).bind('mouseleave', hideBackGround); 144 145 var background = 'inactive', 146 hoverstate = 'inactive'; 147 148 function showBackGround() { 149 150 hoverstate = 'active'; 151 152 if (jQuery(window).scrollTop() > 41) { 153 background = 'active'; 154 jQuery(".kopa-background").height(jQuery(document).height()).stop(true, true).fadeIn(); 155 } 156 } 157 158 function hideBackGround() { 159 160 hoverstate = 'inactive'; 161 jQuery(".kopa-background").stop().fadeOut(); 162 163 } 164 165 jQuery(window).scroll(function() { 166 167 if (jQuery(this).scrollTop() > 0 && background === 'inactive' && hoverstate === 'active') { 168 169 showBackGround(); 170 background = 'active'; 171 172 } else { 173 174 background = 'inactive'; 175 hoverstate = 'inactive'; 176 } 177 178 }); 179 }); 180 181})(jQuery); 182 183 184/* ========================================================= 185 Sub menu 186 ==========================================================*/ 187(function($) { //create closure so we can safely use $ as alias for jQuery 188 189 jQuery(document).ready(function() { 190 191 // initialise plugin 192 jQuery('#main-menu').superfish({ 193 delay: 0, 194 speed: 'fast', 195 speedOut: 'fast', 196 disableHI: true 197 }); 198 }); 199 200})(jQuery); 201 202/* ========================================================= 203 Mobile menu 204 ============================================================ */ 205jQuery(document).ready(function() { 206 207 jQuery('#mobile-menu > span').click(function() { 208 209 var mobile_menu = jQuery('#toggle-view-menu'); 210 211 if (mobile_menu.is(':hidden')) { 212 mobile_menu.slideDown('300'); 213 jQuery(this).children('span').html('-'); 214 } else { 215 mobile_menu.slideUp('300'); 216 jQuery(this).children('span').html('+'); 217 } 218 219 220 221 }); 222 223 jQuery('#toggle-view-menu li').click(function() { 224 225 var text = jQuery(this).children('div.menu-panel'); 226 227 if (text.is(':hidden')) { 228 text.slideDown('300'); 229 jQuery(this).children('span').html('-'); 230 } else { 231 text.slideUp('300'); 232 jQuery(this).children('span').html('+'); 233 } 234 235 jQuery(this).toggleClass('active'); 236 237 }); 238 239}); 240 241/* ========================================================= 242 Carousel 243 ============================================================ */ 244jQuery(window).load(function() { 245 246 jQuery('.kopa-latest-work-carousel').each(function() { 247 var $this = jQuery(this), 248 prevID = $this.data('prev-id'), 249 nextID = $this.data('next-id'), 250 maxItems = $this.data('max-items'), 251 scrollItems = $this.data('scroll-items'); 252 253 $this.carouFredSel({ 254 responsive: true, 255 prev: prevID, 256 next: nextID, 257 width: '100%', 258 scroll: scrollItems, 259 auto: false, 260 items: { 261 width: 252, 262 height: 'auto', 263 visible: { 264 min: 1, 265 max: maxItems 266 } 267 } 268 }); 269 });
270 271 jQuery('.kopa-testimonial-carousel').each(function() { 272 var $this = jQuery(this), 273 prevID = $this.data('prev-id'), 274 nextID = $this.data('next-id'); 275 276 $this.carouFredSel({ 277 responsive: true, 278 prev: prevID, 279 next: nextID, 280 width: '100%', 281 scroll: 1, 282 auto: false, 283 items: { 284 width: 530, 285 height: 'auto', 286 visible: { 287 min: 1, 288 max: 2 289 } 290 } 291 }); 292 }); 293 294 jQuery('.kopa-featured-product-carousel').each(function() { 295 var $this = jQuery(this), 296 prevID = $this.data('prev-id'), 297 nextID = $this.data('next-id'), 298 maxItems = $this.data('max-items'), 299 scrollItems = $this.data('scroll-items'); 300 301 $this.carouFredSel({ 302 responsive: true, 303 prev: prevID, 304 next: nextID, 305 width: '100%', 306 scroll: scrollItems, 307 auto: false, 308 items: { 309 width: 252, 310 height: 'auto', 311 visible: { 312 min: 1, 313 max: maxItems 314 } 315 } 316 }); 317 }); 318 319 if (jQuery(".kopa-related-post-carousel").length > 0) { 320 jQuery('.kopa-related-post-carousel').carouFredSel({ 321 responsive: true, 322 prev: '#prev-4', 323 next: '#next-4', 324 width: '100%', 325 scroll: 1, 326 auto: false, 327 items: { 328 width: 390, 329 height: 'auto', 330 visible: { 331 min: 1, 332 max: 2 333 } 334 } 335 }); 336 } 337 338 if (jQuery(".kopa-related-products").length > 0) { 339 jQuery('.kopa-related-products').carouFredSel({ 340 responsive: true, 341 prev: '#prev-3', 342 next: '#next-3', 343 width: '100%', 344 scroll: 1, 345 auto: false, 346 items: { 347 width: 252, 348 height: 'auto', 349 visible: { 350 min: 1, 351 max: 3 352 } 353 } 354 }); 355 } 356 357}); 358 359/* ========================================================= 360 Set auto margin for client logo 361 ============================================================ */ 362jQuery(document).ready(function() { 363 364 var imgs = jQuery('div.auto-margin img'); 365 var img_height; 366 var div_height; 367 368 jQuery.each(imgs, function(index, value) { 369 img_height = parseInt(jQuery(this).height()); 370 371 div_height = parseInt(jQuery(this).parent().parent().height()); 372 373 number = div_height - img_height; 374 number = parseInt(number / 2); 375 376 jQuery(this).css('margin-top', number); 377 378 }); 379 380}); 381 382/* ========================================================= 383 BlogPost slider 384 ============================================================ */ 385jQuery(window).load(function() { 386 jQuery('.blogpost-slider').flexslider({ 387 animation: "slide", 388 start: function(slider) { 389 jQuery('body').removeClass('loading'); 390 } 391 }); 392}); 393 394/* ========================================================= 395 About page slider 396 ============================================================ */ 397jQuery(window).load(function() { 398 jQuery('.about-slider').flexslider({ 399 animation: "slide", 400 start: function(slider) { 401 jQuery('body').removeClass('loading'); 402 } 403 }); 404}); 405 406/* ========================================================= 407 Testimonials slider 408 ============================================================ */ 409jQuery(window).load(function() { 410 jQuery('.kopa-testimonial-slider').flexslider({ 411 animation: "slide", 412 start: function(slider) { 413 jQuery('body').removeClass('loading'); 414 } 415 });
416}); 417 418/* ========================================================= 419 Single post slider 420 ============================================================ */ 421jQuery(window).load(function() { 422 423 jQuery('.kp-single-carousel').flexslider({ 424 animation: "slide", 425 controlNav: false, 426 animationLoop: false, 427 slideshow: false, 428 itemWidth: 194, 429 itemMargin: 5, 430 asNavFor: '.kp-single-slider' 431 }); 432 433 jQuery('.kp-single-slider').flexslider({ 434 animation: "slide", 435 controlNav: false, 436 animationLoop: false, 437 slideshow: false, 438 sync: ".kp-single-carousel", 439 start: function(slider) { 440 jQuery('body').removeClass('loading'); 441 } 442 }); 443}); 444 445/* ========================================================= 446 prettyPhoto 447 ============================================================ */ 448jQuery(document).ready(function() { 449 init_image_effect(); 450}); 451 452jQuery(window).resize(function() { 453 init_image_effect(); 454}); 455 456function init_image_effect() { 457 458 var view_p_w = jQuery(window).width(); 459 var pp_w = 500; 460 var pp_h = 344; 461 462 if (view_p_w <= 479) { 463 pp_w = '120%'; 464 pp_h = '100%'; 465 } 466 else if (view_p_w >= 480 && view_p_w <= 599) { 467 pp_w = '100%'; 468 pp_h = '170%'; 469 } 470 471 jQuery("a[rel^='prettyPhoto']").prettyPhoto({ 472 show_title: false, 473 deeplinking: false, 474 social_tools: false, 475 default_width: pp_w, 476 default_height: pp_h 477 }); 478} 479 480/* ========================================================= 481 Flickr Feed 482 ============================================================ */ 483jQuery(document).ready(function() { 484 jQuery('.flickr-wrap').each(function() { 485 var $this = jQuery(this), 486 flickrID = $this.data('flickr-id'), 487 limit = $this.data('limit'); 488 489 $this.jflickrfeed({ 490 limit: limit, // user option 491 qstrings: { 492 id: flickrID // user option 493 }, 494 itemTemplate: 495 '<li class="flickr-badge-image">' + 496 '<a rel="prettyPhoto[kopa-flickr]" href="{{image}}" title="{{title}}">' + 497 '<img src="{{image_s}}" alt="{{title}}" width="73px" height="73px" />' + 498 '</a>' + 499 '</li>' 500 }, function(data) { 501 jQuery("a[rel^='prettyPhoto']").prettyPhoto({ 502 show_title: false, 503 deeplinking: false 504 }).mouseenter(function() { 505 //jQuery(this).find('img').fadeTo(500, 0.6); 506 }).mouseleave(function() { 507 //jQuery(this).find('img').fadeTo(400, 1); 508 }); 509 }); 510 }); 511}); 512 513/* ========================================================= 514 Tabs 515 ============================================================ */ 516jQuery(document).ready(function() { 517 518 if (jQuery(".tab-content-1").length > 0) { 519 //Default Action Product Tab 520 jQuery(".tab-content-1").hide(); //Hide all content 521 jQuery("ul.tabs-1 li:first").addClass("active").show(); //Activate first tab 522 jQuery(".tab-content-1:first").show(); //Show first tab content 523 //On Click Event Product Tab 524 jQuery("ul.tabs-1 li").click(function() { 525 jQuery("ul.tabs-1 li").removeClass("active"); //Remove any "active" class 526 jQuery(this).addClass("active"); //Add "active" class to selected tab 527 jQuery(".tab-content-1").hide(); //Hide all tab content 528 var activeTab = jQuery(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content 529 jQuery(activeTab).fadeIn(); //Fade in the active content 530 return false; 531 532 }); 533 } 534 535 if (jQuery(".tab-content-2").length > 0) { 536 //Default Action Product Tab 537 jQuery(".tab-content-2").hide(); //Hide all content 538 jQuery("ul.tabs-2 li:first").next().addClass("active").show(); //Activate first tab 539 jQuery(".tab-content-2:first").next().show(); //Show first tab content 540 //On Click Event Product Tab 541 jQuery("ul.tabs-2 li").click(function() { 542 jQuery("ul.tabs-2 li").removeClass("active"); //Remove any "active" class 543 jQuery(this).addClass("active"); //Add "active" class to selected tab 544 jQuery(".tab-content-2").hide(); //Hide all tab content 545 var activeTab = jQuery(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content 546 jQuery(activeTab).fadeIn(); //Fade in the active content 547 return false; 548 549 }); 550 } 551}); 552 553/* ========================================================= 554 Progress bar jQuery plugin 555 ==========================================================*/ 556jQuery(function() { 557 jQuery(".progress-bar > span").each(function() { 558 jQuery(this) 559 .data("origWidth", jQuery(this).width()) 560 .width(0) 561 .animate({ 562 width: jQuery(this).data("origWidth") 563 }, 1200); 564 });
565}); 566 567/* ========================================================= 568 Accordion 569 ========================================================= */ 570jQuery(document).ready(function() { 571 var acc_wrapper = jQuery('.acc-wrapper'); 572 if (acc_wrapper.length > 0) 573 { 574 575 jQuery('.acc-wrapper .accordion-container').hide(); 576 jQuery.each(acc_wrapper, function(index, item) { 577 jQuery(this).find(jQuery('.accordion-title')).first().addClass('active').next().show(); 578 579 }); 580 581 jQuery('.accordion-title').on('click', function(e) { 582 kopa_accordion_click(jQuery(this)); 583 e.preventDefault(); 584 }); 585 586 var titles = jQuery('.accordion-title'); 587 588 jQuery.each(titles, function() { 589 kopa_accordion_click(jQuery(this)); 590 }); 591 } 592 593}); 594 595function kopa_accordion_click(obj) { 596 if (obj.next().is(':hidden')) { 597 obj.parent().find(jQuery('.active')).removeClass('active').next().slideUp(300); 598 obj.toggleClass('active').next().slideDown(300); 599 600 } 601 jQuery('.accordion-title span').html('+'); 602 if (obj.hasClass('active')) { 603 obj.find('span').first().html('-'); 604 } 605} 606 607/* ========================================================= 608 Toggle Boxes 609 ============================================================ */ 610jQuery(document).ready(function() { 611 612 jQuery('#toggle-view li').click(function(event) { 613 614 var text = jQuery(this).children('div.panel'); 615 616 if (text.is(':hidden')) { 617 jQuery(this).addClass('active'); 618 text.slideDown('300'); 619 jQuery(this).children('span').html('-'); 620 } else { 621 jQuery(this).removeClass('active'); 622 text.slideUp('300'); 623 jQuery(this).children('span').html('+'); 624 } 625 626 }); 627 628}); 629 630/* ========================================================= 631 Direction-aware hover effect 632 ============================================================ */ 633jQuery(function() { 634 635 jQuery(' .da-thumbs > li ').each(function() { 636 jQuery(this).hoverdir(); 637 }); 638 639}); 640 641 642/* ========================================================= 643 Scroll to top 644 ============================================================ */ 645jQuery(document).ready(function() { 646 647 // hide #back-top first 648 jQuery("#back-top").hide(); 649 650 // fade in #back-top 651 jQuery(function() { 652 jQuery(window).scroll(function() { 653 if (jQuery(this).scrollTop() > 200) { 654 jQuery('#back-top').fadeIn(); 655 } else { 656 jQuery('#back-top').fadeOut(); 657 } 658 }); 659 660 // scroll body to 0px on click 661 jQuery('#back-top a').click(function() { 662 jQuery('body,html').animate({ 663 scrollTop: 0 664 }, 800); 665 return false; 666 }); 667 }); 668 669}); 670 671/* ========================================================= 672 Sequence Slider 673 ============================================================ */ 674jQuery(document).ready(function() { 675 if (jQuery('#sequence').length > 0) { 676 var options = { 677 nextButton: true, 678 prevButton: true, 679 animateStartingFrameIn: true, 680 autoPlayDelay: 3000, 681 preloader: true, 682 pauseOnHover: true, 683 preloadTheseFrames: [1] 684 }; 685 686 var sequence = jQuery("#sequence").sequence(options).data("sequence"); 687 688 sequence.afterLoaded = function() { 689 jQuery("#nav").fadeIn(100); 690 jQuery("#nav li:nth-child(" + (sequence.settings.startingFrameID) + ") img").addClass("active"); 691 }; 692 693 sequence.beforeNextFrameAnimatesIn = function() { 694 jQuery("#nav li:not(:nth-child(" + (sequence.nextFrameID) + ")) img").removeClass("active"); 695 jQuery("#nav li:nth-child(" + (sequence.nextFrameID) + ") img").addClass("active"); 696 }; 697 698 jQuery("#nav li").click(function() { 699 jQuery(this).children("img").removeClass("active").children("img").addClass("active"); 700 sequence.nextFrameID = jQuery(this).index() + 1; 701 sequence.goTo(sequence.nextFrameID); 702 }); 703 } 704});
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.