1(function($){ 2 function resizeThickbox(){ 3 4 var window_height = window.innerHeight 5 || (document.documentElement && document.documentElement.clientHeight) 6 || document.body.clientHeight; 7 8 window_height -= 100; 9 10 $('.thickbox').each(function(index, elem){ 11 12 var href = $(elem).attr('href'); 13 14 if ( ! href || typeof href !== 'string' ) { 15 return true;//jQuery continue 16 } 17 18 var splited_href = href.split('&height='); 19 20 if ( ! splited_href[1] ) { 21 return true;//jQuery continue 22 } 23 24 var latter_half_array = splited_href[1].split('&'); 25 var thickbox_height = latter_half_array.shift(); 26 27 if ( ! thickbox_height.match(/^\d*$/g) ) { 28 return true;//jQuery continue 29 } 30 31 var origin_height = $(elem).attr('data-origin-height'); 32 33 if ( Number(thickbox_height) < origin_height ) { 34 thickbox_height = origin_height; 35 } 36 if ( Number(thickbox_height) <= window_height ) { 37 return true; 38 } 39 40 thickbox_height = window_height; 41 var former_half_href = splited_href[0]; 42 var latter_half_href = latter_half_array.join('&'); 43 44 $(elem).attr('href', function(){ 45 46 var new_href = former_half_href + '&height=' + thickbox_height; 47 48 if ( latter_half_href && latter_half_href.match(/\S/g) ) { 49 new_href += '&' + latter_half_href; 50 } 51 return new_href; 52 }); 53 }); 54 } 55 resizeThickbox(); 56 57 var resize_timeout = false; 58 59 $(window).resize(function(){ 60 if ( resize_timeout !== false ) { 61 clearTimeout(resize_timeout); 62 } 63 resize_timeout = setTimeout(function(){ 64 resizeThickbox(); 65 }, 200); 66 }); 67})(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.