1/* JavaScript Init # Colio Wordpress Plugin */ 2 3jQuery(document).ready(function($){ 4 5 6 // Equalize height of item titles in portfolio grid for proper flow 7 8 var h4 = { 9 max: 0, 10 all: $('.colio-list .colio-summary h4'), 11 equalize: function(){ 12 var h4 = this; 13 $.each(this.all, function(){ 14 $(this).css('min-height', 0); 15 if( $(this).height() > h4.max ) { 16 h4.max = $(this).height(); 17 } 18 }).css('min-height', this.max); 19 this.max = 0; 20 } 21 }; 22 23 $(window).load(function(){ 24 $(this).trigger('resize'); 25 }).resize(function(){ 26 h4.equalize(); 27 }); 28 29 30 // Fix problem with vertical centering of a button on ".colio-view" DIVs 31 32 $(window).bind('resize orientationchange', function(){ 33 $('.colio-list > li:visible').each(function(){ 34 var img = $('.colio-thumb img', this); 35 $('.colio-view', this).css('height', img.height()); 36 }); 37 }); 38 39 40 // "Colio jQuery Plugin" init for every portfolio 41 42 if(window.colio_options && typeof window.colio_options === "object") { 43 44 // loop every portfolio in configuration 45 for(var pid in window.colio_options) { 46 47 // replace html entity with '"' symbol 48 var json_opts = window.colio_options[pid].replace(/"/g,'"'); 49 50 // convert JSON options to JavaScript object 51 var opts = $.parseJSON(json_opts); 52 var id = "#colio_" + pid; 53 54 // skip if ".colio-wrap" div does not exist in document 55 if ( $(id).length === 0 ) { 56 continue; 57 } 58 59 // init "Colio jQuery" plugin 60 $.extend(opts, { 61 hiddenItems: ':hidden', 62 onExpand: $.proxy(function(id){ 63 $(id).find('.colio-filters').fadeTo('slow', 0, function(){ 64 $(this).css('visibility','hidden'); 65 }); 66 }, null, id), 67 onCollapse: $.proxy(function(id){ 68 $(id).find('.colio-filters').css('visibility','visible').fadeTo('slow',1); 69 }, null, id), 70 onContent: function(c){ 71 72 // fancybox 73 if(typeof $.fn.fancybox === 'function') { 74 $('.fancybox', c).each(function(){ 75 this.rel = '_' + this.rel; 76 }).fancybox({titlePosition: 'inside'}); 77 } 78 79 // flexslider 80 if(typeof $.fn.flexslider === 'function') { 81 $('.flexslider', c).flexslider({ 82 slideshow: true, 83 animationSpeed: 300, 84 smoothHeight: true, 85 easing: 'easeOutQuad', 86 controlNav: true, 87 after: function(){ 88 $('.colio').trigger('orientationchange'); // force resize 89 } 90 }).delay(opts.contentDelay + opts.contentFadeIn).queue(function(next){ 91 $(this).css('overflow', 'hidden'). 92 find('.flex-direction-nav, .flex-control-nav').fadeIn('fast'); 93 $(window).trigger('orientationchange'); // force resize 94 next(); 95 }); 96 } 97 98 } 99 }); 100 101 $(id + ' .colio-list').colio(opts); 102 103 // init "Isotope" plugin 104 (function(id, opts) { 105 106 // portfolio list and filters 107 var list = $(id + ' .colio-list'), filters = $(id + ' .colio-filters'); 108 109 // filters (links or select) 110 if( !filters.is(':input') ) { 111 // take #tag from href attr and then run isotope to filter items in portfolio 112 filters = filters.find('a'); 113 114 filters.click(function() { 115 var tag = $(this).attr('href').substr(1); 116 var f = tag ? 'li[data-tags~="' + tag + '"]' : '*'; 117 118 // Gets the number of elements with class colio-active-filter 119 var active_filter_count = $('.colio-active-filter').length; 120 121 if( active_filter_count > 2 ) { 122 filters.removeClass('colio-active-filter').filter(this).addClass('colio-active-filter'); 123 } else { 124 filters.filter(this).addClass('colio-active-filter'); 125 } 126 127 list.isotope({filter: f}); 128 129 return false; 130 }); 131 } else { 132 filters.change(function() { 133 var tag = $(this).find('option:selected').val(); 134 var f = tag ? 'li[data-tags~="' + tag + '"]' : '*'; 135 list.isotope({filter: f}); 136 }); 137 } 138 139 // use "imagesLoaded" plugin to init "Isotope" in right time 140 list.imagesLoaded(function(){ 141 // init "Isotope" plugin 142 list.isotope({layoutMode: opts.layout, transitionDuration: opts.transitionDuration/1000 + 's'}); 143 // for Colio plugin force exclude ":hidden" items after every layoutComplete event 144 list.isotope('on', 'layoutComplete', function(){ 145 window.setTimeout(function(){ 146 list.trigger('colio', 'excludeHidden'); 147 }, 50); 148 }); 149 150 }); 151 152 })(id, opts); // end closure 153 154 155 } // end loop 156 157 } // end "Colio jQuery Plugin" init 158 159 $('#colio_gallery .colio-filters a').eq(3).trigger('click'); 160 161});
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.