1(function($, window, document, undefined) { 2 'use strict'; 3 4 var gridContainer = $('#grid-container'), 5 filtersContainer = $('#filters-container'), 6 wrap, filtersCallback; 7 8 9 /******************************* 10 init cubeportfolio 11 ****************************** */ 12 gridContainer.cubeportfolio({ 13 layoutMode: 'grid', 14 rewindNav: true, 15 scrollByPage: false, 16 mediaQueries: [{ 17 width: 1100, 18 cols: 3 19 }, { 20 width: 800, 21 cols: 3 22 }, { 23 width: 500, 24 cols: 2 25 }, { 26 width: 320, 27 cols: 1 28 }], 29 defaultFilter: '*', 30 animationType: 'fadeOut', 31 gapHorizontal: 10, 32 gapVertical: 10, 33 gridAdjustment: 'responsive', 34 caption: 'overlayBottomPush', 35 displayType: 'sequentially', 36 displayTypeSpeed: 100, 37 38 // lightbox 39 lightboxDelegate: '.cbp-lightbox', 40 lightboxGallery: true, 41 lightboxTitleSrc: 'data-title', 42 43 // singlePage popup 44 singlePageDelegate: '.cbp-singlePage', 45 singlePageDeeplinking: true, 46 singlePageStickyNavigation: true, 47 singlePageCallback: function(url, element) { 48 // to update singlePage content use the following method: this.updateSinglePage(yourContent) 49 }, 50 51 // singlePageInline 52 singlePageInlineDelegate: '.cbp-singlePageInline', 53 singlePageInlinePosition: 'below', 54 singlePageInlineInFocus: true, 55 singlePageInlineCallback: function(url, element) { 56 // to update singlePageInline content use the following method: this.updateSinglePageInline(yourContent) 57 var t = this; 58 59 $.ajax({ 60 url: url, 61 type: 'GET', 62 dataType: 'html', 63 timeout: 5000 64 }) 65 .done(function(result) { 66 67 t.updateSinglePageInline(result); 68 69 }) 70 .fail(function() { 71 t.updateSinglePageInline("Error! Please refresh the page!"); 72 }); 73 } 74 }); 75 76 77 /********************************* 78 add listener for filters 79 *********************************/ 80 if (filtersContainer.hasClass('cbp-l-filters-dropdown')) { 81 wrap = filtersContainer.find('.cbp-l-filters-dropdownWrap'); 82 83 wrap.on({ 84 'mouseover.cbp': function() { 85 wrap.addClass('cbp-l-filters-dropdownWrap-open'); 86 }, 87 'mouseleave.cbp': function() { 88 wrap.removeClass('cbp-l-filters-dropdownWrap-open'); 89 } 90 }); 91 92 filtersCallback = function(me) { 93 wrap.find('.cbp-filter-item').removeClass('cbp-filter-item-active'); 94 wrap.find('.cbp-l-filters-dropdownHeader').text(me.text()); 95 me.addClass('cbp-filter-item-active'); 96 wrap.trigger('mouseleave.cbp'); 97 }; 98 } else { 99 filtersCallback = function(me) { 100 me.addClass('cbp-filter-item-active').siblings().removeClass('cbp-filter-item-active'); 101 }; 102 } 103 104 filtersContainer.on('click.cbp', '.cbp-filter-item', function() { 105 var me = $(this); 106 107 if (me.hasClass('cbp-filter-item-active')) { 108 return; 109 } 110 111 // get cubeportfolio data and check if is still animating (reposition) the items. 112 if (!$.data(gridContainer[0], 'cubeportfolio').isAnimating) { 113 filtersCallback.call(null, me); 114 } 115 116 // filter the items 117 gridContainer.cubeportfolio('filter', me.data('filter'), function() {}); 118 }); 119 120 121 /********************************* 122 activate counter for filters 123 *********************************/ 124 gridContainer.cubeportfolio('showCounter', filtersContainer.find('.cbp-filter-item'), function() { 125 // read from url and change filter active 126 var match = /#cbpf=(.*?)([#|?&]|$)/gi.exec(location.href), 127 item; 128 if (match !== null) { 129 item = filtersContainer.find('.cbp-filter-item').filter('[data-filter="' + match[1] + '"]'); 130 if (item.length) { 131 filtersCallback.call(null, item); 132 } 133 } 134 }); 135 136})(jQuery, window, document);
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.