1/** 2 * @package WordPress 3 * @subpackage Medical Clinic 4 * @version 1.2.4 5 * 6 * Modes & Functions for jQuery Isotope Plugin 7 * Created by CMSMasters 8 * 9 */ 10 11 12"use strict"; 13 14/* iLightbox Settings */ 15var ilightbox_settings = { 16 skin : cmsmasters_isotope_mode.ilightbox_skin, 17 path : cmsmasters_isotope_mode.ilightbox_path, 18 infinite : (cmsmasters_isotope_mode.ilightbox_infinite == '1') ? true : false, 19 keepAspectRatio : (cmsmasters_isotope_mode.ilightbox_aspect_ratio == '1') ? true : false, 20 mobileOptimizer : (cmsmasters_isotope_mode.ilightbox_mobile_optimizer == '1') ? true : false, 21 maxScale : Number(cmsmasters_isotope_mode.ilightbox_max_scale), 22 minScale : Number(cmsmasters_isotope_mode.ilightbox_min_scale), 23 innerToolbar : (cmsmasters_isotope_mode.ilightbox_inner_toolbar == '1') ? true : false, 24 smartRecognition : (cmsmasters_isotope_mode.ilightbox_mobile_optimizer == '1') ? true : false, 25 fullAlone : (cmsmasters_isotope_mode.ilightbox_fullscreen_one_slide == '1') ? true : false, 26 fullViewPort : cmsmasters_isotope_mode.ilightbox_fullscreen_viewport, 27 controls : { 28 toolbar : (cmsmasters_isotope_mode.ilightbox_controls_toolbar == '1') ? true : false, 29 arrows : (cmsmasters_isotope_mode.ilightbox_controls_arrows == '1') ? true : false, 30 fullscreen : (cmsmasters_isotope_mode.ilightbox_controls_fullscreen == '1') ? true : false, 31 thumbnail : (cmsmasters_isotope_mode.ilightbox_controls_thumbnail == '1') ? true : false, 32 keyboard : (cmsmasters_isotope_mode.ilightbox_controls_keyboard == '1') ? true : false, 33 mousewheel : (cmsmasters_isotope_mode.ilightbox_controls_mousewheel == '1') ? true : false, 34 swipe : (cmsmasters_isotope_mode.ilightbox_controls_swipe == '1') ? true : false, 35 slideshow : (cmsmasters_isotope_mode.ilightbox_controls_slideshow == '1') ? true : false 36 }, 37 text : { 38 close : cmsmasters_isotope_mode.ilightbox_close_text, 39 enterFullscreen : cmsmasters_isotope_mode.ilightbox_enter_fullscreen_text, 40 exitFullscreen : cmsmasters_isotope_mode.ilightbox_exit_fullscreen_text, 41 slideShow : cmsmasters_isotope_mode.ilightbox_slideshow_text, 42 next : cmsmasters_isotope_mode.ilightbox_next_text, 43 previous : cmsmasters_isotope_mode.ilightbox_previous_text 44 }, 45 errors : { 46 loadImage : cmsmasters_isotope_mode.ilightbox_load_image_error, 47 loadContents : cmsmasters_isotope_mode.ilightbox_load_contents_error, 48 missingPlugin : cmsmasters_isotope_mode.ilightbox_missing_plugin_error 49 } 50}; 51 52 53 54/* Isotope Timeline Layout Mode */ 55(function(window, factory) { 56 factory(window.Isotope.LayoutMode); 57} (window, function factory(LayoutMode) { 58 'use strict'; 59 60 61 var Timeline = LayoutMode.create('Timeline'), 62 proto = Timeline.prototype; 63 64 65 proto._resetLayout = function () { 66 this.Timeline = { 67 colA : 0, 68 colB : 0, 69 arrayLeft : [], 70 arrayRight : [], 71 postMargin : 40, 72 dateHeight : 110 73 }; 74 }; 75 76 77 proto._getItemLayoutPosition = function (item) { 78 item.getSize(); 79 80 81 var props = this.Timeline, 82 centerX = Math.round(this.isotope.size.innerWidth / 2), 83 isColA = props.colA <= props.colB, 84 x = isColA ? 85 centerX - item.size.outerWidth : // left side 86 centerX, // right side 87 yCache = isColA ? props.colA : props.colB, 88 y = yCache, 89 minMargin = props.postMargin; 90 91 92 if (isColA) { 93 jQuery(item.element).addClass('cmsmasters_timeline_left'); 94 jQuery(item.element).removeClass('cmsmasters_timeline_right'); 95 96 97 if (props.arrayRight.length > 0) { 98 for (var i = 0, il = props.arrayRight.length; i < il; i += 1) { 99 if (y < props.arrayRight[i] + props.dateHeight) { 100 minMargin = props.dateHeight; 101 102 103 y = props.arrayRight[i] + minMargin; 104 } else { 105 y = yCache + minMargin; 106 } 107 } 108 } 109 110 111 props.arrayLeft.push(y); 112 } else { 113 jQuery(item.element).addClass('cmsmasters_timeline_right'); 114 jQuery(item.element).removeClass('cmsmasters_timeline_left'); 115 116 117 if (props.arrayLeft.length > 0) { 118 for (var j = 0, jl = props.arrayLeft.length; j < jl; j += 1) { 119 if (y < props.arrayLeft[j] + props.dateHeight) { 120 minMargin = props.dateHeight; 121 122 123 y = props.arrayLeft[j] + minMargin; 124 } else { 125 y = yCache + minMargin; 126 } 127 } 128 } 129 130 131 props.arrayRight.push(y);
132 } 133 134 135 props[(isColA ? 'colA' : 'colB')] = item.size.outerHeight + y; 136 137 138 var position = { 139 x: x, 140 y: y 141 }; 142 143 144 return position; 145 }; 146 147 148 proto._getContainerSize = function () { 149 var size = {}; 150 151 152 size.height = this.Timeline[(this.Timeline.colB > this.Timeline.colA ? 'colB' : 'colA')]; 153 154 155 return size; 156 }; 157 158 159 return Timeline; 160})); 161 162 163 164/* ========== Isotope Run ========== */ 165 166/* Get Columns Width Function */ 167function getNumbColumns(container) { 168 var containerWidth = container.width(), 169 firstPost = container.find('> article:eq(0), .cmsmasters_gallery_item:eq(0)'), 170 postMinWidth = Number(firstPost.css('minWidth').replace('px', '')), 171 maxColumnNumb = Math.floor(containerWidth / postMinWidth), 172 columnNumb = 1, 173 layoutGrid = false; 174 175 176 if ( 177 container.parent().data('layoutMode') === 'perfect' || 178 container.parent().data('layoutMode') === 'grid' || 179 container.parent().data('type') === 'grid' 180 ) { 181 layoutGrid = true; 182 } 183 184 185 maxColumnNumb = (maxColumnNumb !== 0) ? maxColumnNumb : 1; 186 187 188 if (container.hasClass('cmsmasters_5')) { 189 columnNumb = 5; 190 } else if (container.hasClass('cmsmasters_4')) { 191 columnNumb = 4; 192 } else if (container.hasClass('cmsmasters_3')) { 193 columnNumb = 3; 194 } else if (container.hasClass('cmsmasters_2')) { 195 columnNumb = 2; 196 } 197 198 199 if (maxColumnNumb < columnNumb) { 200 if (layoutGrid && columnNumb == 4 && maxColumnNumb == 3) { 201 columnNumb = 2; 202 } else if (layoutGrid && columnNumb == 3 && maxColumnNumb == 2) { 203 columnNumb = 1; 204 } else { 205 columnNumb = maxColumnNumb; 206 } 207 } 208 209 210 return columnNumb; 211} 212 213 214 215/* Set Columns Width Function */ 216function setColumnWidth(container) { 217 var containerWidth = container.width(), 218 columnNumb = getNumbColumns(container), 219 postWidth = Math.floor(containerWidth / columnNumb) - 1; 220 221 222 container.find('> article, .cmsmasters_gallery_item').each(function () { 223 jQuery(this).css( { 224 width : postWidth + 'px' 225 } ); 226 } ); 227} 228 229 230 231/* Rearrange Posts Function */ 232function reArrangePosts(blog, blogColumns) { 233 if (blogColumns) { 234 setColumnWidth(blog); 235 } 236 237 238 blog.isotope('layout'); 239} 240 241 242 243/* Set Puzzle Columns Width Function */ 244function setPuzzleColumnWidth(container) { 245 var containerWidth = container.width(), 246 firstPost = container.find('> article:eq(0)'), 247 postMinWidth = Number(firstPost.css('minWidth').replace('px', '')), 248 postPaddingLeft = Number(firstPost.css('paddingLeft').replace('px', '')), 249 postPaddingRight = Number(firstPost.css('paddingRight').replace('px', '')), 250 postStaticWidth = Math.floor(containerWidth / 4), 251 postStaticHeight = Math.floor((postStaticWidth / 100) * (cmsmasters_isotope_mode.project_puzzle_proportion * 100)/* preloader padding bottom in % */), 252 postStaticPadding = Math.floor(((postPaddingLeft + postPaddingRight) / 100) * (cmsmasters_isotope_mode.project_puzzle_proportion * 100)/* preloader padding bottom in % */), 253 postWidth = postStaticWidth, 254 postHeight = postStaticHeight; 255 256 257 if (containerWidth < postMinWidth * 4) { 258 container.addClass('resp_portfolio_puzzle'); 259 } else { 260 container.removeClass('resp_portfolio_puzzle'); 261 } 262 263 264 container.find('article.project').each(function () { 265 if (jQuery(this).hasClass('four_x_four')) { 266 postWidth = postStaticWidth * 4; 267 postHeight = (postStaticHeight * 4) - postStaticPadding; 268 } else if (jQuery(this).hasClass('three_x_three')) { 269 if (containerWidth > postMinWidth * 4) { 270 postWidth = postStaticWidth * 3; 271 postHeight = (postStaticHeight * 3) - postStaticPadding; 272 } else if (containerWidth > postMinWidth * 2) { 273 postWidth = postStaticWidth * 2; 274 postHeight = (postStaticHeight * 2) - postStaticPadding; 275 } else { 276 postWidth = postStaticWidth * 4; 277 postHeight = (postStaticHeight * 4) - postStaticPadding; 278 } 279 } else if (jQuery(this).hasClass('three_x_two')) { 280 if (containerWidth > postMinWidth * 4) { 281 postWidth = postStaticWidth * 3; 282 postHeight = (postStaticHeight * 2) - postStaticPadding; 283 } else if (containerWidth > postMinWidth * 2) { 284 postWidth = postStaticWidth * 2; 285 postHeight = Math.floor((postStaticHeight * 4) / 3) - postStaticPadding; 286 } else { 287 postWidth = postStaticWidth * 4; 288 postHeight = Math.floor((postStaticHeight * 8) / 3) - postStaticPadding; 289 } 290 } else if (jQuery(this).hasClass('three_x_one')) { 291 if (containerWidth > postMinWidth * 4) { 292 postWidth = postStaticWidth * 3; 293 postHeight = postStaticHeight - postStaticPadding; 294 } else if (containerWidth > postMinWidth * 2) { 295 postWidth = postStaticWidth * 2; 296 postHeight = Math.floor((postStaticHeight * 2) / 3) - postStaticPadding; 297 } else { 298 postWidth = postStaticWidth * 4; 299 postHeight = Math.floor((postStaticHeight * 4) / 3) - postStaticPadding; 300 } 301 } else if (jQuery(this).hasClass('two_x_three')) { 302 if (containerWidth > postMinWidth * 2) { 303 postWidth = postStaticWidth * 2; 304 postHeight = (postStaticHeight * 3) - postStaticPadding; 305 } else { 306 postWidth = postStaticWidth * 4; 307 postHeight = (postStaticHeight * 6) - postStaticPadding; 308 } 309 } else if (jQuery(this).hasClass('two_x_two')) { 310 if (containerWidth > postMinWidth * 2) { 311 postWidth = postStaticWidth * 2; 312 postHeight = (postStaticHeight * 2) - postStaticPadding; 313 } else { 314 postWidth = postStaticWidth * 4; 315 postHeight = (postStaticHeight * 4) - postStaticPadding; 316 } 317 } else if (jQuery(this).hasClass('two_x_one')) { 318 if (containerWidth > postMinWidth * 2) { 319 postWidth = postStaticWidth * 2; 320 postHeight = postStaticHeight - postStaticPadding; 321 } else { 322 postWidth = postStaticWidth * 4; 323 postHeight = (postStaticHeight * 2) - postStaticPadding; 324 } 325 } else if (jQuery(this).hasClass('one_x_three')) { 326 if (containerWidth > postMinWidth * 4) { 327 postWidth = postStaticWidth; 328 postHeight = (postStaticHeight * 3) - postStaticPadding; 329 } else if (containerWidth > postMinWidth * 2) { 330 postWidth = postStaticWidth * 2; 331 postHeight = (postStaticHeight * 6) - postStaticPadding; 332 } else { 333 postWidth = postStaticWidth * 4; 334 postHeight = (postStaticHeight * 12) - postStaticPadding; 335 } 336 } else if (jQuery(this).hasClass('one_x_two')) { 337 if (containerWidth > postMinWidth * 4) { 338 postWidth = postStaticWidth; 339 postHeight = (postStaticHeight * 2) - postStaticPadding; 340 } else if (containerWidth > postMinWidth * 2) { 341 postWidth = postStaticWidth * 2; 342 postHeight = (postStaticHeight * 4) - postStaticPadding; 343 } else { 344 postWidth = postStaticWidth * 4; 345 postHeight = (postStaticHeight * 8) - postStaticPadding; 346 } 347 } else if (jQuery(this).hasClass('one_x_one')) { 348 if (containerWidth > postMinWidth * 4) { 349 postWidth = postStaticWidth; 350 postHeight = postStaticHeight - postStaticPadding; 351 } else if (containerWidth > postMinWidth * 2) { 352 postWidth = postStaticWidth * 2; 353 postHeight = (postStaticHeight * 2) - postStaticPadding; 354 } else { 355 postWidth = postStaticWidth * 4; 356 postHeight = (postStaticHeight * 4) - postStaticPadding; 357 } 358 } 359 360 361 jQuery(this).css( { 362 width : postWidth + 'px' 363 } ); 364 365 366 jQuery(this).find('.project_outer').css( { 367 height : postHeight + 'px' 368 } ); 369 370 371 jQuery(this).find('.preloader').css( { 372 paddingBottom : postHeight + 'px' 373 } ); 374 } ); 375} 376 377 378 379/* Rearrange Projects Function */ 380function reArrangeProjects(portfolio, portfolioGrid, portfolioPuzzle) { 381 if (portfolioGrid) { 382 setColumnWidth(portfolio); 383 } else if (portfolioPuzzle) { 384 setPuzzleColumnWidth(portfolio); 385 } 386 387 388 portfolio.isotope('layout'); 389} 390 391 392 393/* Start Blog Isotope Function */ 394function startBlog(id, layout, layoutMode, url, orderby, order, count, categories, metadata) { 395 var blogContainer = jQuery(id), 396 blog = blogContainer.find('> .blog'), 397 blogColumns = (layout === 'columns') ? true : false; 398 399 400 if (blogContainer.find('article').length == 0) { 401 return false; 402 } 403 404 405 if (blogColumns) { 406 setColumnWidth(blog); 407 } 408 409 410 blog.imagesLoaded(function () { 411 blog.isotope( { 412 itemSelector : 'article.post' 413 } ); 414 415 416 if (!blog.hasClass('isotope')) { 417 blog.addClass('isotope'); 418 } 419 420 421 if (layout === 'columns' && (layoutMode === 'grid' || layoutMode === 'puzzle')) { 422 blog.isotope( { 423 layoutMode : 'fitRows', 424 resizable : false 425 } ); 426 } else if (layout === 'columns' && layoutMode === 'masonry') { 427 blog.isotope( { 428 layoutMode : 'masonry', 429 resizable : true 430 } ); 431 } else if (layout === 'timeline') { 432 blog.isotope( { 433 layoutMode : 'Timeline', 434 resizable : true 435 } ); 436 } 437 } ); 438 439 440 blogContainer.find('.cmsmasters_post_filter_block .cmsmasters_post_filter_list a').on('click', function () { 441 var filter = jQuery(this), 442 filterSelector = filter.attr('data-filter'); 443 444 445 filter.parent().parent().find('> li.current').removeClass('current'); 446 447 448 filter.parent().addClass('current'); 449 450 451 blog.isotope( { 452 filter : filterSelector 453 } ); 454 455 456 setTimeout(function () { 457 reArrangePosts(blog, blogColumns); 458 }, 300); 459 460 461 return false; 462 } ); 463 464 465 blogContainer.find('.cmsmasters_post_loader').on('click', function () { 466 blogContainer.find('.cmsmasters_wrap_more_items').addClass('cmsmasters_loading cmsmasters_theme_icon_spinner').find('.cmsmasters_wrap_items_loader').slideUp('fast'); 467 468 jQuery.ajax( { 469 type : 'POST', 470 dataType : 'html', 471 url : url + 'inc/post/posts-loader.php', 472 data : { 473 layout : layout, 474 layoutmode: layoutMode, 475 orderby : orderby, 476 order : order, 477 count : count, 478 categories : categories, 479 metadata : metadata, 480 offset : blog.find('.post').length 481 }, 482 success : function (data) { 483 if (data !== '') { 484 var newHTML = '', 485 lightboxVars = []; 486 487 488 if (data.slice(0, 6) === 'finish') { 489 newHTML = jQuery(data.replace(/cmsmasters_post_timeline/g, 'cmsmasters_post_timeline shortcode_animated').replace(/cmsmasters_post_masonry/g, 'cmsmasters_post_masonry shortcode_animated').replace(/cmsmasters_puzzle_type/g, 'cmsmasters_puzzle_type shortcode_animated').slice(6, -1)); 490 491 492 blogContainer.find('.cmsmasters_wrap_more_items').hide(); 493 } else { 494 newHTML = jQuery(data.replace(/cmsmasters_post_timeline/g, 'cmsmasters_post_timeline shortcode_animated').replace(/cmsmasters_post_masonry/g, 'cmsmasters_post_masonry shortcode_animated').replace(/cmsmasters_puzzle_type/g, 'cmsmasters_puzzle_type shortcode_animated')); 495 496 blogContainer.find('.cmsmasters_wrap_more_items').removeClass('cmsmasters_loading cmsmasters_theme_icon_spinner').find('.cmsmasters_wrap_items_loader').slideDown('fast'); 497 } 498 499 500 newHTML.find('a[rel^="ilightbox["]').each(function () { 501 if (jQuery.inArray(jQuery(this).attr('rel'), lightboxVars) === -1) { 502 lightboxVars.push(jQuery(this).attr('rel')); 503 } 504 } ); 505 506 507 newHTML.imagesLoaded(function () { 508 blogContainer.find('.blog').isotope('insert', newHTML); 509 510 511 setTimeout(function () { 512 jQuery('body').trigger('debouncedresize'); 513 514 515 reArrangePosts(blog, blogColumns); 516 517 518 var settings = {}; 519 520 521 if (typeof _wpmejsSettings !== 'undefined') { 522 settings.pluginPath = _wpmejsSettings.pluginPath; 523 } 524 525 526 jQuery('.wp-audio-shortcode, .wp-video-shortcode').filter(':not(.mejs-container)').mediaelementplayer(settings); 527 528 529 for (var i = 0, il = lightboxVars.length; i < il; i += 1) { 530 blogContainer.find('a[rel="' + lightboxVars[i] + '"]').iLightBox(ilightbox_settings); 531 } 532 }, 300); 533 } ); 534 } 535 } 536 } ); 537 538 539 return false; 540 } ); 541 542 543 jQuery(window).on('debouncedresize', function () { 544 reArrangePosts(blog, blogColumns); 545 } ); 546} 547 548 549 550/* Start Portfolio Isotope Function */ 551function startPortfolio(id, layout, layoutMode, url, orderby, order, count, categories, metadata) { 552 var portfolioContainer = jQuery(id), 553 portfolio = portfolioContainer.find('> .portfolio'), 554 portfolioGrid = (layout === 'grid') ? true : false, 555 portfolioPuzzle = (layout === 'puzzle') ? true : false; 556 557 558 if (portfolioContainer.find('article').length == 0) { 559 return false; 560 } 561 562 563 if (portfolioGrid) { 564 setColumnWidth(portfolio); 565 } else if (portfolioPuzzle) { 566 setPuzzleColumnWidth(portfolio); 567 } 568 569 570 portfolio.imagesLoaded(function () { 571 if (!portfolio.hasClass('isotope')) { 572 portfolio.addClass('isotope'); 573 } 574 575 576 if (portfolioGrid) { 577 portfolio.isotope( { 578 itemSelector : 'article.project', 579 getSortData : { 580 project_name : function (el) { 581 return jQuery(el).find('.entry-title > a').text(); 582 }, 583 project_date : function (el) {
584 return parseInt(jQuery(el).find('.meta-date').text()); 585 } 586 } 587 } ); 588 589 590 if (layoutMode === 'perfect') { 591 portfolio.isotope( { 592 layoutMode : 'fitRows', 593 resizable : false 594 } ); 595 } else if (layoutMode === 'masonry') { 596 portfolio.isotope( { 597 layoutMode : 'masonry', 598 resizable : true 599 } ); 600 } 601 } else if (portfolioPuzzle) { 602 portfolio.isotope( { 603 itemSelector : 'article.project', 604 layoutMode : 'masonry', 605 resizable : false, 606 masonry : { 607 columnWidth : Math.floor(portfolio.width() / 4) 608 } 609 } ); 610 } 611 612 613 if ( 614 !checker.os.iphone && 615 !checker.os.ipod && 616 !checker.os.ipad && 617 !checker.os.blackberry && 618 !checker.os.android 619 ) { 620 portfolio.waypoint(function (dir) { 621 if (dir === 'down') { 622 var el = jQuery(this), 623 items = el.find('article.project'), 624 delay = 200, 625 i = 1; 626 627 628 items.each(function () { 629 var item = jQuery(this); 630 631 632 setTimeout(function () { 633 item.addClass('shortcode_animated'); 634 }, delay * i); 635 636 637 i += 1; 638 } ); 639 } 640 }, { 641 offset : '100%' 642 } ).waypoint(function (dir) { 643 if (dir === 'up') { 644 var el = jQuery(this), 645 items = el.find('article.project'), 646 delay = 200, 647 i = 1; 648 649 650 items.each(function () { 651 var item = jQuery(this); 652 653 654 setTimeout(function () { 655 item.addClass('shortcode_animated'); 656 }, delay * i); 657 658 659 i += 1; 660 } ); 661 } 662 }, { 663 offset : '25%' 664 } ); 665 } else { 666 portfolio.find('article.project').addClass('shortcode_animated'); 667 } 668 669 670 setTimeout(function () { 671 reArrangeProjects(portfolio, portfolioGrid, portfolioPuzzle); 672 }, 300); 673 } ); 674 675 676 portfolioContainer.find('.cmsmasters_project_filter_block .cmsmasters_project_filter_list a').on('click', function () { 677 var filter = jQuery(this), 678 filterSelector = filter.attr('data-filter'); 679 680 681 filter.parent().parent().find('> li.current').removeClass('current'); 682 683 684 filter.parent().addClass('current'); 685 686 687 portfolio.isotope( { 688 filter : filterSelector 689 } ); 690 691 692 setTimeout(function () { 693 reArrangeProjects(portfolio, portfolioGrid, portfolioPuzzle); 694 }, 300); 695 696 697 return false; 698 } ); 699 700 701 portfolioContainer.find('.cmsmasters_project_sort_block .cmsmasters_project_sort_but').on('click', function () { 702 var type = jQuery(this).attr('name'), 703 asc = (type === 'project_name') ? true : false, 704 current = (jQuery(this).hasClass('current')) ? true : false, 705 reversed = (jQuery(this).hasClass('reversed')) ? true : false; 706 707 708 if (current) { 709 if (reversed) { 710 jQuery(this).removeClass('reversed'); 711 712 asc = true; 713 } else { 714 jQuery(this).addClass('reversed'); 715 716 asc = false; 717 } 718 } else { 719 jQuery(this).parent().find('.current').removeClass('current'); 720 721 jQuery(this).parent().find('.reversed').removeClass('reversed'); 722 723 724 if (type === 'project_name') { 725 jQuery(this).addClass('current'); 726 } else { 727 jQuery(this).addClass('current reversed'); 728 } 729 } 730 731 732 portfolio.isotope( { 733 sortBy : type, 734 sortAscending : asc 735 } ); 736 737 738 setTimeout(function () { 739 reArrangeProjects(portfolio, portfolioGrid, portfolioPuzzle); 740 }, 300); 741 742 743 return false; 744 } ); 745 746 747 portfolioContainer.find('.cmsmasters_project_loader').on('click', function () { 748 portfolioContainer.find('.cmsmasters_wrap_more_items').addClass('cmsmasters_loading cmsmasters_theme_icon_spinner').find('.cmsmasters_wrap_items_loader').slideUp('fast'); 749 750 jQuery.ajax( { 751 type : 'POST', 752 dataType : 'html', 753 url : url + 'inc/project/projects-loader.php', 754 data : { 755 layout : layout, 756 layoutmode: layoutMode, 757 orderby : orderby, 758 order : order, 759 count : count, 760 categories : categories, 761 metadata : metadata, 762 offset : portfolio.find('.project').length 763 }, 764 success : function (data) { 765 if (data !== '') { 766 var newHTML = '', 767 lightboxVars = []; 768 769 770 if (data.slice(0, 6) === 'finish') { 771 newHTML = jQuery(data.replace(/type-project/g, 'type-project shortcode_animated').slice(6, -1)); 772 773 774 portfolioContainer.find('.cmsmasters_wrap_more_items').hide(); 775 } else { 776 newHTML = jQuery(data.replace(/type-project/g, 'type-project shortcode_animated')); 777 778 portfolioContainer.find('.cmsmasters_wrap_more_items').removeClass('cmsmasters_loading cmsmasters_theme_icon_spinner').find('.cmsmasters_wrap_items_loader').slideDown('fast'); 779 } 780 781 782 newHTML.find('a[rel^="ilightbox["]').each(function () { 783 if (jQuery.inArray(jQuery(this).attr('rel'), lightboxVars) === -1) { 784 lightboxVars.push(jQuery(this).attr('rel')); 785 } 786 } ); 787 788 789 newHTML.imagesLoaded(function () { 790 portfolioContainer.find('.portfolio').isotope('insert', newHTML); 791 792 793 setTimeout(function () { 794 reArrangeProjects(portfolio, portfolioGrid, portfolioPuzzle); 795 796 797 var settings = {}; 798 799 800 if (typeof _wpmejsSettings !== 'undefined') { 801 settings.pluginPath = _wpmejsSettings.pluginPath; 802 } 803 804 805 jQuery('.wp-audio-shortcode, .wp-video-shortcode').filter(':not(.mejs-container)').mediaelementplayer(settings); 806 807 808 for (var i = 0, il = lightboxVars.length; i < il; i += 1) { 809 portfolioContainer.find('a[rel="' + lightboxVars[i] + '"]').iLightBox(ilightbox_settings); 810 } 811 }, 300); 812 } ); 813 } 814 } 815 } ); 816 817 818 return false; 819 } ); 820 821 822 jQuery(window).on('debouncedresize', function () { 823 reArrangeProjects(portfolio, portfolioGrid, portfolioPuzzle); 824 825 826 if (portfolioPuzzle) { 827 portfolio.isotope( { 828 masonry : { 829 columnWidth : Math.floor(portfolio.width() / 4) 830 } 831 } ); 832 } 833 } ); 834} 835 836 837 838/* Start Gallery Isotope Function */ 839function startGallery(id, gallery_type, gallery_count) { 840 var galleryContainer = jQuery(id), 841 gallery = galleryContainer.find('> .cmsmasters_gallery'), 842 gallery_hidden = galleryContainer.find('> .cmsmasters_hidden_gallery'), 843 gallery_count = gallery_count, 844 gallery_arr = [], 845 gallery_items = '', 846 gallery_rel = '', 847 ilightbox_run = ''; 848 849 850 if (galleryContainer.find('.cmsmasters_gallery_item').length == 0) { 851 return false; 852 } 853 854 855 gallery_hidden.find('.cmsmasters_gallery_item').each(function () { 856 gallery_arr.push(this); 857 } ); 858 859 860 setColumnWidth(gallery); 861 862 863 gallery.imagesLoaded(function () { 864 gallery.isotope( { 865 itemSelector : '.cmsmasters_gallery_item' 866 } ); 867 868 869 if (!gallery.hasClass('isotope')) { 870 gallery.addClass('isotope'); 871 } 872 873 874 if (gallery_type === 'grid') { 875 gallery.isotope( { 876 layoutMode : 'fitRows', 877 resizable : false 878 } ); 879 } else if (gallery_type === 'masonry') { 880 gallery.isotope( { 881 layoutMode : 'masonry', 882 resizable : true 883 } ); 884 } 885 } ); 886 887 888 ilightbox_run = gallery.find('[rel^="ilightbox["]').iLightBox(ilightbox_settings); 889 890 gallery_rel = gallery.find('[rel^="ilightbox["]').attr('rel'); 891 892 if (gallery_arr.length > 0) { 893 galleryContainer.find('.cmsmasters_gallery_items_loader').on('click', function () { 894 galleryContainer.find('.cmsmasters_wrap_more_items').addClass('cmsmasters_loading cmsmasters_theme_icon_spinner').find('.cmsmasters_wrap_items_loader').slideUp('fast'); 895 896 gallery_items = gallery_arr.splice(0, gallery_count); 897 898 899 jQuery(gallery_items).each(function () { 900 gallery.isotope('insert', jQuery(this)); 901 902 903 jQuery(this).addClass('shortcode_animated'); 904 905 906 if (gallery_rel !== undefined) { 907 jQuery(this).find('a').attr('rel', gallery_rel); 908 } 909 910 911 jQuery(this).imagesLoaded(function () { 912 reArrangePosts(gallery, true); 913 } ); 914 } ); 915 916 917 ilightbox_run.destroy(); 918 919 ilightbox_run = gallery.find('[rel^="ilightbox["]').iLightBox(ilightbox_settings); 920 921 922 if (gallery_arr.length == 0) { 923 galleryContainer.find('.cmsmasters_wrap_more_items').hide(); 924 } else { 925 galleryContainer.find('.cmsmasters_wrap_more_items').removeClass('cmsmasters_loading cmsmasters_theme_icon_spinner').find('.cmsmasters_wrap_items_loader').slideDown('fast'); 926 } 927 } ); 928 } 929 930 931 jQuery(window).on('debouncedresize', function () { 932 reArrangePosts(gallery, true); 933 } ); 934} 935
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.