1var gallery_hover_timeout = false; 2var gallery_navigation_hover = false; 3 4(function($) { 5 codeus_init_gallery = function() { 6 var gallery = this; 7 var num = 6; 8 if($(this).hasClass('small')) { 9 num = 4; 10 } 11 var thumbsEl = $('ul.thumbs', this).get(0); 12 var previewEl = $('ul.preview', this).get(0); 13 var temp = $('<div/>'); 14 $('li:first-child',thumbsEl).addClass('first'); 15 $('li:last-child',thumbsEl).addClass('last'); 16 $('li:first-child',previewEl).addClass('first'); 17 $('li:last-child',previewEl).addClass('last'); 18 $('li',thumbsEl).appendTo(temp);$(thumbsEl).css('margin', 0).html('');$('li',temp).appendTo(thumbsEl); 19 $('li',previewEl).appendTo(temp);$(previewEl).css('margin', 0).html('');$('li',temp).appendTo(previewEl); 20 $('li',thumbsEl).each(function() { 21 $(this).attr('data-num', $('li',thumbsEl).index($(this))); 22 }); 23 $('li',previewEl).each(function() { 24 $(this).attr('data-num', $('li',previewEl).index($(this))); 25 }); 26 $('li',thumbsEl).first().addClass('selected'); 27 $(thumbsEl).carouFredSel({ 28 width: '100%', 29 circular: false, 30 infinite: false, 31 align: 'center', 32 auto: false, 33 scroll : { 34 easing : 'swing', 35 duration : 1000, 36 onBefore : function(data){ 37 $(thumbsEl).closest('.thumbs_wrapper').find('.navigation').hide(); 38 }, 39 onAfter: function(data) { 40 $(thumbsEl).closest('.thumbs_wrapper').find('.navigation').show(); 41 if (data.items.visible.index($('li.last',thumbsEl))!=-1) $(thumbsEl).closest('.thumbs_wrapper').find('.navigation').children('.next').addClass('disable'); 42 else $(thumbsEl).closest('.thumbs_wrapper').find('.navigation').children('.next').removeClass('disable'); 43 44 if (data.items.visible.index($('li.first',thumbsEl))!=-1) $(thumbsEl).closest('.thumbs_wrapper').find('.navigation').children('.prev').addClass('disable'); 45 else $(thumbsEl).closest('.thumbs_wrapper').find('.navigation').children('.prev').removeClass('disable'); 46 } 47 }, 48 onCreate: function(data) { 49 if(data.items.length < 2) { 50 $(thumbsEl).closest('.thumbs_wrapper').hide(); 51 } 52 var el_width = $('li:first',thumbsEl).width(); 53 var box_width = $(thumbsEl).parent().width(); 54 55 var disable = ''; 56 if (parseInt(box_width/el_width) >= $('li',thumbsEl).length) disable='disable'; 57 $(thumbsEl).closest('.thumbs_wrapper').find('.navigation').remove(); 58 var navigationThumbs = $('<div class="navigation"/>'); 59 $(thumbsEl).closest('.thumbs_wrapper').append(navigationThumbs); 60 $('<a href="javascript:void(0);" class="prev disable">Prev</a>') 61 .appendTo(navigationThumbs) 62 .click(function() { 63 $(thumbsEl).trigger('prevPage'); 64 }); 65 $('<a href="javascript:void(0);" class="next '+disable+'">Next</a>') 66 .appendTo(navigationThumbs) 67 .click(function() { 68 $(thumbsEl).trigger('nextPage'); 69 }); 70 } 71 72 }); 73 //$('li', previewEl).width($(previewEl).width()); 74 $(previewEl).carouFredSel({ 75 responsive: true, 76 width: '100%', 77 circular: false, 78 infinite: false, 79 align: 'center', 80 auto: false, 81 items : {visible: 1}, 82 scroll : { 83 items : 1, 84 easing : 'swing', 85 duration : 1000, 86 onBefore : function(data){ 87 var current = data.items.visible.get(0); 88 var active = $('li[data-num="'+$(current).attr('data-num')+'"]', thumbsEl).get(0); 89 if($(thumbsEl).triggerHandler('currentVisible').index(active) == -1) { 90 $(thumbsEl).trigger('slideTo', active); 91 } 92 $('li.selected',thumbsEl).removeClass('selected'); 93 }, 94 onAfter: function(data) { 95 var current = data.items.visible.get(0); 96 var active = $('li[data-num="'+$(current).attr('data-num')+'"]', thumbsEl).get(0); 97 $(active).addClass('selected'); 98 $(window).on('resize', function(){ 99 $(previewEl).height($(current).height()); 100 $(previewEl).parent().height($(current).height()); 101 }).trigger('resize'); 102 103 if (data.items.visible.index($('li.last',previewEl))!=-1) $(previewEl).siblings('.navigation').children('.next').addClass('disable'); 104 else $(previewEl).siblings('.navigation').children('.next').removeClass('disable'); 105 106 if (data.items.visible.index($('li.first',previewEl))!=-1) $(previewEl).siblings('.navigation').children('.prev').addClass('disable'); 107 else $(previewEl).siblings('.navigation').children('.prev').removeClass('disable'); 108 } 109 }, 110 onCreate: function(data) { 111 $(window).on('resize', function(){ 112 $(previewEl).height($('> li:first-child', previewEl).height()); 113 $(previewEl).parent().height($(data.items[0]).height()); 114 }).trigger('resize'); 115 116 var el_width = $('li:first',thumbsEl).width(); 117 var box_width = $(thumbsEl).parent().width(); 118 119 var disable = ''; 120 //if (parseInt(box_width/el_width) >= $('li',thumbsEl).length) disable='disable'; 121 if($('li',previewEl).length < 2) { 122 disable='disable'; 123 } 124 var navigationPreview = $('<div class="navigation preview-navigation"/>').insertAfter(previewEl); 125 $('<a href="javascript:void(0);" class="prev disable">Prev</a>') 126 .appendTo(navigationPreview) 127 .click(function() { 128 $(previewEl).trigger('prevPage'); 129 }); 130 $('<a href="javascript:void(0);" class="next '+disable+'">Next</a>') 131 .appendTo(navigationPreview) 132 .click(function() { 133 $(previewEl).trigger('nextPage'); 134 }); 135 $('li a',thumbsEl).click(function() { 136 $(previewEl).trigger('slideTo', $('li[data-num="'+$(this).parent('li').attr('data-num')+'"]', previewEl).get(0)); 137 return false;
138 }); 139 140 } 141 }); 142 143 $('li a',thumbsEl).click(function() { 144 $(this).parent().siblings('li').removeClass('selected'); 145 $(this).parent().addClass('selected'); 146 return false; 147 }); 148 149 $('.preview-navigation a', gallery).unbind('hover'); 150 $('.preview-navigation a', gallery).hover( 151 function() { 152 if (gallery_hover_timeout) 153 clearTimeout(gallery_hover_timeout); 154 }, 155 function() { 156 var self = this; 157 gallery_navigation_hover = setTimeout(function() { 158 $(self).parent().siblings('ul.preview').find('li.hover').trigger('mouseleave'); 159 }, 50); 160 } 161 ); 162 163 $('ul.preview li', gallery).unbind('hover'); 164 $('ul.preview li', gallery).hover( 165 function() { 166 var self = $(this); 167 168 if (gallery_navigation_hover) 169 clearTimeout(gallery_navigation_hover); 170 if ($(self).hasClass('hover')) 171 return; 172 173 $('.overlay .p-icon', this).stop(true, true).css({'top': '-50%'}); 174 $('.overlay', this).stop(true, true).animate({ opacity: 'show' }, 200); 175 prof_background_handler = setTimeout(function() { 176 if ($.browser.mozilla) { 177 $('.overlay .p-icon', self).css({'top': '50%', '-moz-transition': 'all 150ms ease'}); 178 } else { 179 $('.overlay .p-icon', self).animate({'top': '50%'}, 150); 180 } 181 $(self).addClass('hover'); 182 $(self).parents('ul').siblings('.navigation').find('a').not('.disable').fadeIn(400); 183 }, 100); 184 }, 185 function() { 186 var self = $(this); 187 gallery_hover_timeout = setTimeout(function() { 188 if (prof_background_handler) 189 clearTimeout(prof_background_handler); 190 if ($.browser.mozilla) { 191 $('.overlay .p-icon', self).css({'top': '-50%', '-moz-transition': 'all 150ms ease'}); 192 } else { 193 $('.overlay .p-icon', self).stop(true, true).animate({'top': '-50%'}, 150); 194 } 195 $(self).parents('ul').siblings('.navigation').find('a').fadeOut(400); 196 $(self).removeClass('hover'); 197 prof_overlay_handler = setTimeout(function() { 198 $('.overlay', self).animate({ opacity: 'hide' }); 199 }, 100); 200 }, 50); 201 } 202 ); 203 } 204 205 $('.tabs').on('noscript-loaded', function() { 206 $('.tab_wrapper:visible', this).each(function() { 207 $('.gallery', this).trigger('gallery-init'); 208 }); 209 }); 210 211 $('.accordion').on('noscript-loaded', function() { 212 $('.ui-accordion-content:visible', this).each(function() { 213 $('.gallery', this).trigger('gallery-init'); 214 }); 215 }); 216 217 $('.gallery').each(function() { 218 $(this).on('gallery-init', codeus_init_gallery); 219 if ($(this).closest('.tabs').size() > 0) 220 return; 221 $(this).on('noscript-loaded', codeus_init_gallery); 222 }); 223 224 $(window).load(function() { 225 $('.gallery-three-columns ul.preview li, .gallery-four-columns ul.preview li').hover( 226 function() { 227 var self = $(this); 228 229 if (gallery_navigation_hover) 230 clearTimeout(gallery_navigation_hover); 231 232 $('.overlay .p-icon', this).stop(true, true).css({'top': '-50%'}); 233 $('.overlay', this).stop(true, true).animate({ opacity: 'show' }, 200); 234 prof_background_handler = setTimeout(function() { 235 if ($.browser.mozilla) { 236 $('.overlay .p-icon', self).css({'top': '50%', '-moz-transition': 'all 150ms ease'}); 237 } else { 238 $('.overlay .p-icon', self).animate({'top': '50%'}, 150); 239 } 240 }, 100); 241 }, 242 function() { 243 var self = $(this); 244 if (prof_background_handler) 245 clearTimeout(prof_background_handler); 246 if ($.browser.mozilla) { 247 $('.overlay .p-icon', self).css({'top': '-50%', '-moz-transition': 'all 150ms ease'}); 248 } else { 249 $('.overlay .p-icon', self).stop(true, true).animate({'top': '-50%'}, 150); 250 } 251 prof_overlay_handler = setTimeout(function() { 252 $('.overlay', self).animate({ opacity: 'hide' }); 253 }, 100); 254 } 255 ); 256 }); 257 258})(jQuery);
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.