1jQuery(document).ready(function($) { 2 "use strict"; 3 4 // cache container 5 var $filterContainer = $('#gridblock-container,#gridblock-container-blog'); 6 var AjaxPortfolio; 7 var portfolio_height; 8 var portfolio_width; 9 var half_width; 10 var image_height; 11 var slideshow_active; 12 var AutoStart; 13 var ajax_image_height; 14 var ajax_window_height; 15 var $data; 16 var heart; 17 var post_id; 18 var parentPortfolio_id; 19 20 var lightgalleryTransition = kreativa_vars.lightbox_transition; 21 22 var deviceAgent = navigator.userAgent.toLowerCase(); 23 var isIOS = deviceAgent.match(/(iphone|ipod|ipad)/); 24 var ua = navigator.userAgent.toLowerCase(); 25 var isAndroid = ua.indexOf("android") > -1; 26 var curr_menu_item; 27 var percent; 28 29 function mobilecheck() { 30 var check = false; 31 (function(a) { 32 if (/(android|ipad|playbook|silk|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|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|phone)|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 )|sy(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))) check = true 33 })(navigator.userAgent || navigator.vendor || window.opera); 34 return check; 35 } 36 37 38 $.fn.centerDiv = function(options) { 39 var centerthis = this; 40 41 var leftadjustment = 356; 42 if ($('body').hasClass('menu-is-horizontal')) { 43 leftadjustment = 0; 44 } 45 var pageWidth = $(window).width(); 46 var pageHeight = $(window).height(); 47 48 if ( $('.responsive-menu-wrap').is(':visible') ) { 49 leftadjustment = 0; 50 } 51 52 $(centerthis).each(function() { 53 $(this).css({ 54 position: 'absolute', 55 left: ( pageWidth - $(this).outerWidth() + leftadjustment ) / 2, 56 top: ( pageHeight - $(this).outerHeight() - 100 ) / 2 57 }); 58 59 }); 60 } 61 $('.mtheme-vh-center,.fullscreen-protected #password-protected').centerDiv(); 62 $(window).bind('load resize', function() { 63 $('.mtheme-vh-center,.fullscreen-protected #password-protected').centerDiv(); 64 }); 65 66 function html5_video_resizer() { 67 var width = jQuery(window).width(); 68 var ratio = 16/9; 69 var pWidth; // player width, to be defined 70 var height = jQuery(window).height(); 71 var pHeight; // player height, tbd 72 var videojs_container = jQuery('#backgroundvideo'); 73 // when screen aspect ratio differs from video, video must center and underlay one dimension 74
75 if (width / ratio < height) { // if new video height < window height (gap underneath) 76 pWidth = Math.ceil(height * ratio); // get new player width 77 videojs_container.width(pWidth).height(height).css({left: (width - pWidth) / 2, top: 0}); // player width is greater, offset left; reset top 78 } else { // new video width < window width (gap to right) 79 pHeight = Math.ceil(width / ratio); // get new player height 80 videojs_container.width(width).height(pHeight).css({left: 0, top: (height - pHeight) / 2}); // player height is greater, offset top; reset left 81 } 82 83 } 84 html5_video_resizer(); 85 86 //Detect Orientaiton change 87 window.onload = orientationchange; 88 window.onorientationchange = orientationchange; 89 jQuery(window).bind("resize", orientationchange); 90 jQuery(window).bind("resize", html5_video_resizer); 91 92 function orientationchange() { 93 if (isIOS || isAndroid) {} else { 94 $('.mtheme-vh-center,.fullscreen-protected #password-protected').centerDiv(); 95 } 96 } 97 98 var gridblock_lightbox = $("#photowall-container,.attachment-page-image,#gridblock-container,.sidebar-widget,.shortcode-swiper-container,.lightbox-shortcode,.post-format-media,.gridblock-metro-wrap,.gridblock-owlcarousel-wrap,.thumbnails-grid-container,.vertical_images,.horizontal-carousel,.woocommerce-mtheme-product"); 99 gridblock_lightbox.lightGallery({ 100 mode: lightgalleryTransition, 101 selector: '.lightbox-active', 102 addClass: 'mtheme-lightbox', 103 download: true, 104 thumbnail: true, 105 exThumbImage: 'data-exthumbimage' 106 }); 107 108 gridblock_lightbox.on('onBeforeSlide.lg',function(){ 109 $('body .lg-sub-html').stop().fadeOut(); 110 }); 111 112 gridblock_lightbox.on('onBeforeNextSlide.lg',function(){ 113 $('body .lg-sub-html').stop().fadeOut(); 114 }); 115 116 gridblock_lightbox.on('onAfterSlide.lg',function(){ 117 $('body .lg-sub-html').stop().fadeIn(); 118 }); 119 120 $('#gridblock-filters a').first().addClass('is-active'); 121 122 function AjaxProofing() { 123 124 var proofing_count_total = $(".proofing-item-wrap > .mtheme-proofing-item").length; 125 var proofing_count_selected = $(".proofing-item-wrap > .proofing-item-selected").length; 126 127 $(".proofing-count-total").html(proofing_count_total); 128 $(".proofing-count-selected").html(proofing_count_selected); 129 130 jQuery(".mtheme-proofing-choice.mtheme-proofing-active").click(function() { 131 132 var proofing_item = jQuery(this); 133 var image_id = proofing_item.data("image_id"); 134 var proofing_status = $('#mtheme-proofing-item-' + image_id + '').data('proofing_status'); 135 136 jQuery.ajax({ 137 type: "post", 138 url: ajax_var.url, 139 data: "action=kreativa_proofing_checker&nonce=" + ajax_var.nonce + "&mtheme_proofing_status=" + proofing_status + "&image_id=" + image_id, 140 beforeSend: function() { 141 $('#mtheme-proofing-item-' + image_id + '').addClass("proofing-item-inprogress"); 142 $("#proofing-status-count").removeClass('pulse'); 143 }, 144 success: function(data) { 145 146 // Split and Get the values in data varaible that has been given as COUNT:POSTID 147 var substr = data.split(':'); 148 var checked = substr[0]; 149 var image_id = substr[1]; 150 151 if (checked == "checked") { 152 $('#mtheme-proofing-item-' + image_id + '').removeClass("proofing-item-inprogress").removeClass("proofing-item-unchecked").addClass("proofing-item-selected"); 153 $('#mtheme-proofing-item-' + image_id + '').find('.proofing-icon-status').removeClass("ion-ios-checkmark-outline").addClass("ion-ios-close-outline"); 154 $('#mtheme-proofing-item-' + image_id + '').data('proofing_status', 'selected'); 155 $('#mtheme-proofing-item-' + image_id + '').removeClass("filter-unchecked").addClass('filter-selected'); 156 } else { 157 $('#mtheme-proofing-item-' + image_id + '').removeClass("proofing-item-inprogress").addClass("proofing-item-unchecked").removeClass("proofing-item-selected"); 158 $('#mtheme-proofing-item-' + image_id + '').find('.proofing-icon-status').addClass("ion-ios-checkmark-outline").removeClass("ion-ios-close-outline"); 159 $('#mtheme-proofing-item-' + image_id + '').data('proofing_status', 'unchecked'); 160 $('#mtheme-proofing-item-' + image_id + '').removeClass("filter-selected").addClass('filter-unchecked'); 161 } 162 var proofing_count_total = $(".proofing-item-wrap > .mtheme-proofing-item").length; 163 var proofing_count_selected = $(".proofing-item-wrap > .proofing-item-selected").length; 164 $(".proofing-count-total").html(proofing_count_total); 165 $(".proofing-count-selected").html(proofing_count_selected); 166 $("#proofing-status-count").addClass('pulse'); 167 }, 168 error: function(jqXHR, textStatus, errorThrown) { 169 alert(jqXHR + " :: " + textStatus + " :: " + errorThrown); 170 } 171 }); 172 173 return false; 174 }); 175 176 } 177 178 function AjaxLike() { 179 180 $(document).on('click', ".mtheme-post-like .vote-ready", function() { 181 182 var heart = jQuery(this); 183 184 var post_id = heart.data("post_id"); 185 186 jQuery.ajax({ 187 type: "post", 188 url: ajax_var.url, 189 data: "action=kreativa_post_like_vote&nonce=" + ajax_var.nonce + "&post_id=" + post_id, 190 beforeSend: function() { 191 192 if (!heart.hasClass('voted')) { 193 heart.children("span.mtheme-like").removeClass("bounceIn"); 194 heart.children("span.mtheme-like").addClass("voteprogress"); 195 } 196 }, 197 success: function(data) { 198 // Split and Get the values in data varaible that has been given as COUNT:POSTID 199 200 var substr = data.split(':'); 201 var count = substr[0]; 202 var post_id = substr[1]; 203 console.log(data); 204 if (count != "already") { 205 206 jQuery('.mtheme-post-like span[data-post_id="' + post_id + '"]').removeClass("vote-ready").addClass("vote-disabled"); 207 jQuery('.mtheme-post-like span[data-post_id="' + post_id + '"]').find(".mtheme-like").removeClass("like-notvoted").addClass("voted").removeClass("voteprogress"); 208 jQuery('.mtheme-post-like span[data-post_id="' + post_id + '"]').find(".vote-like-icon").removeClass("ion-ios-heart-outline").addClass("ion-ios-heart"); 209 jQuery('.post-link-count-wrap[data-count_id="' + post_id + '"]').find("span.post-like-count").text(count); 210 } 211 }, 212 complete: function(){ 213 heart.children("span.mtheme-like").addClass("bounceIn"); 214 }, 215 error: function(jqXHR, textStatus, errorThrown) { 216 alert(jqXHR + " :: " + textStatus + " :: " + errorThrown); 217 } 218 }); 219 220 return false; 221 }); 222 223 } 224 225 function HoverEffect() { 226 //Ajax Hover 227 jQuery("div.gridblock-element").hover( 228 function() { 229 var GotImage = $(this).find(".preload-image"); 230 if (GotImage.is(':visible')) { 231 portfolio_height = jQuery(this).height() - 10; 232 portfolio_width = jQuery(this).width(); 233 234 jQuery(this).find("span.ajax-image-hover") 235 .css({ 236 "display": "block", 237 "left": "0", 238 "height": "" + portfolio_height + "px", 239 "width": "" + portfolio_width + "px" 240 }) 241 .stop().animate({ 242 "top": "0", 243 "opacity": "1" 244 }, "normal"); 245 } 246 }, 247 function() { 248 jQuery(this).find("span.ajax-image-hover").stop().animate({ 249 "top": "10px", 250 "opacity": "0" 251 }, "fast"); 252 }); 253 254 //Thumbnails shortcode hover 255 jQuery("div.thumbnails-shortcode ul li").hover( 256 function() { 257 258 var GotImage = $(this).find(".displayed-image"); 259 if (GotImage.is(':visible')) { 260 portfolio_height = $(this).find("img.displayed-image").height(); 261 portfolio_width = $(this).find("img.displayed-image").width(); 262 263 jQuery(this).find(".gridblock-image-icon") 264 .css({ 265 "display": "block", 266 "top": "0", 267 "left": "0", 268 "height": portfolio_height + "px" 269 }) 270 .stop().animate({ 271 "opacity": "1" 272 }, "normal"); 273 } 274 }, 275 function() { 276 jQuery(this).find(".gridblock-image-icon").stop().animate({ 277 "opacity": "0" 278 }, "fast"); 279 }); 280 281 } 282 283 HoverEffect(); 284 AjaxLike(); 285 AjaxProofing(); 286 287}); 288 289jQuery(window).bind("load", function(e) { 290 var AutoStart = false; 291 var SlideStarted = false; 292 jQuery('.ajax-next').addClass('ajax-nav-disabled').css('cursor', 'default'); 293 jQuery('.ajax-prev').addClass('ajax-nav-disabled').css('cursor', 'default'); 294 295}); 296 297jQuery(document).ready(function($) { 298
299 // cache container 300 var $filterContainer = $('#gridblock-container,#gridblock-container-blog,.thumbnails-grid-container'); 301 var AjaxPortfolio; 302 var portfolio_height; 303 var portfolio_width; 304 var half_width; 305 var image_height; 306 var slideshow_active; 307 var AutoStart; 308 var ajax_image_height; 309 var ajax_window_height; 310 var $data; 311 312 var lightgalleryTransition = kreativa_vars.lightbox_transition; 313 314 var ajaxLoading = 0; 315 var SlideStarted = false; 316 317 //variables to confirm window height and width 318 var lastWindowHeight = $(window).height(); 319 var lastWindowWidth = $(window).width(); 320 321 //Detect Orientaiton change 322 window.onload = orientationchange; 323 window.onorientationchange = orientationchange; 324 jQuery(window).bind("resize", orientationchange); 325 326 function orientationchange() { 327 isotopeInit(); 328 } 329 330 $(window).resize(function() { 331 332 $('.thumbnails-grid-container').each(function() { 333 $(this).find('.gridblock-element').removeClass('animation-action animated flipInX'); 334 $(this).find('.gridblock-element').removeClass('grid-animate-display-all'); 335 }); 336 $('.animation-standby-portfolio').removeClass('animation-standby-portfolio').addClass('animation-action'); 337 $('.gridblock-element').removeClass('animated animation-standby-portfolio animation-action'); 338 339 //confirm window was actually resized 340 if ($(window).height() != lastWindowHeight || $(window).width() != lastWindowWidth) { 341 342 //set this windows size 343 lastWindowHeight = $(window).height(); 344 lastWindowWidth = $(window).width(); 345 346 //call my function 347 if ($.fn.isotope) { 348 $filterContainer.isotope('layout'); 349 } 350 351 ajax_image_height = jQuery('.displayed-image').height(); 352 $('.ajax-image-selector').css({ 353 "height": ajax_image_height + "px" 354 }); 355 356 } 357 }); 358 359 // Toggle - Show and Hide displayed portfolio showcase item 360 jQuery("a.ajax-hide").click( 361 function() { 362 if (jQuery(".ajax-gridblock-window").is(':animated') || jQuery(".ajax-gridblock-image-wrap").is(':animated')) return; 363 if (SlideStarted == false) { 364 jQuery('.gridblock-ajax').eq(0).trigger('click'); 365 } 366 $('.ajax-gridblock-block-wrap').toggleClass('ajax-collapsed'); 367 jQuery('.ajax-gridblock-window').slideToggle(); 368 return false; 369 } 370 ); 371 372 AjaxPortfolio = function(e) { 373 // Initialize 374 var page = 1; 375 var loading = true; 376 var loaded = false; 377 var $window = jQuery(window); 378 var $content = jQuery("body #ajax-gridblock-wrap"); 379 var $contentData = jQuery("body #ajax-gridblock-content"); 380 var total = jQuery('#gridblock-container .gridblock-ajax').length; 381 var index; 382 var nextStatus = true; 383 var prevStatus = true; 384 385 var isiPhone = navigator.userAgent.toLowerCase().indexOf("iphone"); 386 var isiPad = navigator.userAgent.toLowerCase().indexOf("ipad"); 387 var isiPod = navigator.userAgent.toLowerCase().indexOf("ipod"); 388 389 var deviceAgent = navigator.userAgent.toLowerCase(); 390 var isIOS = deviceAgent.match(/(iphone|ipod|ipad)/); 391 var ua = navigator.userAgent.toLowerCase(); 392 var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile"); 393 394 var altTotal = total - 1; 395 396 397 jQuery(".gridblock-ajax").click(function() { 398 399 //Get postID from rel attribute of link 400 var postID = jQuery(this).attr("data-portfolioid"); 401 if (typeof postID === 'undefined') return; 402 403 AutoStart = false; 404 SlideStarted = true; 405 406 if ($(this).parent().hasClass('gridblock-displayed')) { 407 return false; 408 } 409 410 ajax_image_height = jQuery('.displayed-image').height(); 411 $('.ajax-image-selector').css({ 412 "height": ajax_image_height + "px" 413 }); 414 415 $('.ajax-gallery-navigation').fadeIn(); 416 $('span.ajax-loading').fadeIn('slow'); 417 //Get this index 418 index = jQuery(".gridblock-ajax").index(this); 419 //Store the navigation ID as the current element 420 jQuery('.ajax-gallery-navigation').attr('id', index); 421 422 //Grab the current displayed ID 423 var DisplayedID = jQuery('.ajax-gallery-navigation').attr("data-portfolioid"); 424 425 // Compare clicked and Displayed ID. Acts as Gatekeeper 426 427 428 if (postID != DisplayedID) { 429 430 $('.ajax-gridblock-block-wrap').addClass('ajax-active'); 431 // Remove previous displayed set class 432 jQuery('div').removeClass("gridblock-displayed"); 433 434 //Add portfolio post ID to attribute 435 jQuery('.ajax-gallery-navigation').attr('data-portfolioid', postID); 436 437 //Add the class to currently viewing 438 jQuery('[data-portfolio=portfolio-' + postID + ']').addClass('gridblock-displayed'); 439 440 441 var filtered_total = $('#gridblock-container div:visible').length; 442 var $got_current = $filterContainer.find(".gridblock-displayed"); 443 var $next_portfolio = $got_current.nextAll("div:visible").first(); 444 var $prev_portfolio = $got_current.prevAll("div:visible").first(); 445 446 if ($next_portfolio.length) { 447 $('.ajax-next').removeClass('ajax-nav-disabled').css('cursor', 'pointer'); 448 } else { 449 $('.ajax-next').addClass('ajax-nav-disabled').css('cursor', 'default'); 450 } 451 if ($prev_portfolio.length) { 452 $('.ajax-prev').removeClass('ajax-nav-disabled').css('cursor', 'pointer'); 453 } else { 454 $('.ajax-prev').addClass('ajax-nav-disabled').css('cursor', 'default'); 455 } 456 457 var sitewide = $('.top-menu-wrap').width(); 458 // If iphone then scroll to Ajax nav bar - otherwise top of page 459 if (sitewide == 470 || sitewide == 758) { 460 jQuery('html, body').stop().animate({ 461 scrollTop: jQuery(".ajax-gridblock-block-wrap").offset().top - 20 462 }, 1000); 463 } else { 464 jQuery('html, body').stop().animate({ 465 scrollTop: jQuery(".container").offset().top - 70 466 }, 1000); 467 } 468 469 jQuery('#ajax-gridblock-loading').show(); 470 471 var ajax_window_height; 472 473 jQuery.ajax({ 474 type: "post", 475 url: ajax_var.url, 476 data: "action=ajaxportfolio&post_id=" + postID, 477 beforeSend: function() { 478 ajax_window_height = $('#ajax-gridblock-content').height();
479 $('.ajax-gridblock-window').slideUp('slow'); 480 }, 481 success: function(data) { 482 loaded = true; 483 jQuery('#ajax-gridblock-loading').hide(); 484 jQuery("#ajax-gridblock-content").remove(); 485 $('span.ajax-loading').fadeOut('slow'); 486 $data = $(data); 487 488 if ($data.length) { 489 490 $content.append($data); 491 492 jQuery('.ajax-gridblock-window').delay(500).slideDown(500, function() { 493 jQuery(".ajax-gridblock-image-wrap").fadeTo(100, 1); 494 jQuery(".ajax-gridblock-data, .ajax-gridblock-contents-wrap").fadeIn(); 495 jQuery("#ajax-gridblock-content").fadeIn('slow'); 496 loading = false; 497 }); 498 jQuery('.ajax-gridblock-image-wrap img').bind('load', function() { 499 jQuery('.ajax-gridblock-image-wrap img').fadeTo(100, 1); 500 }); 501 502 if ($.fn.waypoint) { 503 504 //Skill Bar 505 $('.skillbar').waypoint(function() { 506 $('.skillbar').each(function() { 507 percent = $(this).attr('data-percent'); 508 $(this).find('.skillbar-bar').animate({ 509 'width': percent + '%' 510 }, 3000, 'easeInOutExpo').addClass('progressed'); 511 }); 512 }, { 513 offset: '90%' 514 }); 515 516 $('.animation-standby-portfolio').waypoint(function() { 517 $(this).removeClass('animation-standby-portfolio').addClass('animation-action'); 518 }, { 519 offset: '90%' 520 }); 521 522 $('.is-animated').waypoint(function() { 523 $(this).removeClass('is-animated').addClass('animation-action'); 524 }, { 525 offset: '90%' 526 }); 527 } 528 529 var sync1 = $("#owl-ajax"); 530 531 sync1.owlCarousel({ 532 items: 1, 533 autoplay: true, 534 lazyLoad: true, 535 nav: true, 536 autoHeight : true, 537 loop: true, 538 navText : ["",""], 539 singleItem : true, 540 animateOut: "fadeOut" 541 }); 542 543 } else { 544 jQuery('#ajax-gridblock-loading').hide(); 545 } 546 }, 547 error: function(jqXHR, textStatus, errorThrown) { 548 jQuery('#ajax-gridblock-loading').hide(); 549 alert(jqXHR + " :: " + textStatus + " :: " + errorThrown); 550 } 551 }); 552 553 return false; 554 } 555 }); 556 557 } 558 559 function AjaxNavigation() { 560 561 // Next Clicked 562 $('.ajax-next').click(function() { 563 564 if ($(".ajax-gridblock-window").is(':animated') || $(".ajax-gridblock-image-wrap").is(':animated')) return; 565 566 var $got_current = $filterContainer.find(".gridblock-displayed"); 567 var $next_portfolio = $got_current.nextAll("div:visible").first(); 568 569 if ($next_portfolio.length) { 570 $next_portfolio.find(".gridblock-ajax").trigger('click'); 571 } 572 573 $('.ajax-gridblock-block-wrap').removeClass('ajax-collapsed'); 574 575 return false; 576 577 }); 578 579 // Clicked Prev 580 581 $('.ajax-prev').click(function() { 582 583 if ($(".ajax-gridblock-window").is(':animated') || $(".ajax-gridblock-image-wrap").is(':animated')) return; 584 585 var $got_current = $filterContainer.find(".gridblock-displayed"); 586 var $prev_portfolio = $got_current.prevAll("div:visible").first(); 587 588 $prev_portfolio.find(".gridblock-ajax").trigger('click'); 589 590 $('.ajax-gridblock-block-wrap').removeClass('ajax-collapsed'); 591 592 return false; 593 }); 594 } 595 596 597 function isotopeInit() { 598 // initialize isotope 599 if ($.fn.isotope) { 600 601 $filterContainer.each(function(){ 602 var currContainer = $(this); 603 currContainer.imagesLoaded( function() { 604 605 currContainer.parent().addClass('isotope-container-displayed'); 606 607 var itemReveal = Isotope.Item.prototype.reveal; 608 Isotope.Item.prototype.reveal = function() { 609 itemReveal.apply(this, arguments); 610 $(this.element).removeClass('isotope-hidden'); 611 $(this.element).addClass('isotope-displayed'); 612 }; 613 614 var itemHide = Isotope.Item.prototype.hide; 615 Isotope.Item.prototype.hide = function() { 616 itemHide.apply(this, arguments); 617 $(this.element).addClass('isotope-hidden'); 618 $(this.element).removeClass('isotope-displayed'); 619 }; 620 621 if ($(currContainer).hasClass('gridblock-masonary')) { 622 623 var photow_window_width = $('.container').width(); 624 if (photow_window_width === null) { 625 photow_window_width = $('.container-edge-to-edge').width(); 626 } 627 var wallContainer_w = $(currContainer).width() - 0.5; 628 629 number_of_columns = $(currContainer).attr('data-columns'); 630 631 var fourcolumn = '23%', 632 threecolumn = '31%', 633 twocolumn = '48%', 634 onecolumn = '99%'; 635 636 if ($(currContainer).hasClass('thumnails-gutter-active')) { 637 fourcolumn = '25%'; 638 threecolumn = '33.3333%'; 639 twocolumn = '50%'; 640 onecolumn = '100%'; 641 wallContainer_w = $(currContainer).width() - 0.5; 642 } 643 644 if (number_of_columns == 4) { 645 $(currContainer).find('.gridblock-element').css('width', fourcolumn); 646 } 647 if (number_of_columns == 3) { 648 $(currContainer).find('.gridblock-element').css('width', threecolumn); 649 } 650 if (number_of_columns == 2) { 651 $(currContainer).find('.gridblock-element').css('width', twocolumn); 652 } 653 if (number_of_columns == 1) { 654 $(currContainer).find('.gridblock-element').css('width', onecolumn); 655 } 656 657 if (photow_window_width < 1035) { 658 number_of_columns = 3; 659 $(currContainer).find('.gridblock-element').css('width', threecolumn); 660 } 661 if (photow_window_width < 800) { 662 number_of_columns = 2; 663 $(currContainer).find('.gridblock-element').css('width', twocolumn); 664 } 665 if (photow_window_width < 500) { 666 number_of_columns = 2; 667 $(currContainer).find('.gridblock-element').css('width', onecolumn); 668 } 669 670 if ($('body.rtl').length == 1) { 671 currContainer.isotope({ 672 isOriginLeft: false, 673 resizable: false, // disable normal resizing 674 masonry: { 675 gutterWidth: 0, 676 columnWidth: wallContainer_w / number_of_columns 677 } 678 }); 679 } else { 680 currContainer.isotope({ 681 resizable: false, // disable normal resizing 682 masonry: { 683 gutterWidth: 0, 684 columnWidth: wallContainer_w / number_of_columns 685 } 686 }); 687 } 688 689 } else { 690 if ($('body.rtl').length == 1) { 691 currContainer.isotope({ 692 isOriginLeft: false, 693 animationEngine: 'best-available', 694 layoutMode: 'fitRows', 695 masonry: { 696 gutterWidth: 0 697 } 698 }); 699 } else { 700 701 currContainer.isotope({ 702 animationEngine: 'best-available', 703 layoutMode: 'fitRows', 704 masonry: { 705 gutterWidth: 0 706 } 707 }); 708 } 709 } 710 711 currContainer.isotope('on', 'layoutComplete', function(iso
711Instance, laidOutItems) { 712 if ($("#gridblock-container")[0]) { 713 if ( isotopeIsFiltering ) { 714 $("#gridblock-container").data('lightGallery').destroy(true); 715 716 $("#gridblock-container").lightGallery({ 717 mode: lightgalleryTransition, 718 selector: '.isotope-displayed .lightbox-active', 719 addClass: 'mtheme-lightbox', 720 download: true, 721 thumbnail: true, 722 exThumbImage: 'data-exthumbimage' 723 }); 724 } 725 isotopeIsFiltering = false; 726 } 727 if ($(".thumbnails-grid-container")[0]) { 728 if ( isotopeIsFiltering ) { 729 $(".thumbnails-grid-container").data('lightGallery').destroy(true); 730 731 $(".thumbnails-grid-container").lightGallery({ 732 mode: lightgalleryTransition, 733 selector: '.isotope-displayed .lightbox-active', 734 addClass: 'mtheme-lightbox', 735 download: true, 736 thumbnail: true, 737 exThumbImage: 'data-exthumbimage' 738 }); 739 } 740 isotopeIsFiltering = false; 741 } 742 }); 743 }); 744 }); 745 } 746 } 747 748 var isotopeIsFiltering = false; 749 function isotopeClicks() { 750 // filter items when filter link is clicked 751 $('#gridblock-filters a').click(function() { 752 753 isotopeIsFiltering = true; 754 $('.gridblock-element').removeClass('animated animation-standby-portfolio animation-action'); 755 $('.gridblock-element').removeClass('grid-animate-display-all'); 756 757 var selector = $(this).attr('data-filter'); 758 var filter_title = $(this).attr('data-title'); 759 $filterContainer.isotope({ 760 filter: selector 761 }); 762 763 if ($(this).parent('li').hasClass('filter-category-control')) { 764 $('.filter-subcat-control').hide(); 765 $(selector + '-of-parent').fadeIn('slow'); 766 } 767 if ($(this).parent('li').hasClass('filter-all-control')) { 768 $('.filter-subcat-control').fadeIn('slow'); 769 } 770 771 $('#gridblock-filters a').removeClass('is-active'); 772 $(this).addClass('is-active'); 773 774 $('.gridblock-filter-wrap h2').text(filter_title); 775 // Set index to zero and disable prev 776 $('.ajax-gallery-navigation').attr('id', '-1'); 777 $('.ajax-prev').css('cursor', 'default'); 778 779 return false; 780 }); 781 } 782 783 $('#gridblock-filter-links a').click(function() { 784 $('#gridblock-filter-links a').removeClass('is-active'); 785 $(this).addClass('is-active'); 786 }); 787 788 AjaxPortfolio(); 789 AjaxNavigation(); 790 isotopeInit(); 791 isotopeClicks(); 792 793 $("#owl-fullscreen-pagemeta").owlCarousel({ 794 responsive:{ 795 0:{ 796 items:1, 797 nav:true 798 }, 799 500:{ 800 items:1, 801 nav:true 802 }, 803 600:{ 804 items:2, 805 nav:true 806 }, 807 1024:{ 808 items:3, 809 nav:true 810 } 811 }, 812 items: 3, 813 autoplay: false, 814 dots: true, 815 nav: true, 816 autoHeight : true, 817 navText : ["",""], 818 animateOut: "fadeOut" 819 }); 820 });
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.