<commit_before>/**
 * Lazy Loading Image Widget
 */
ib.widget("lazyimg", function(window, $, undefined) {
	var widget = {
		
		// The default values that are set behind init values.
		defaults : {
			// Selectors for finding and binding elements.
			selector : {
				'img'      : "img",
				'img-lazy' : "img.lazy-load",
			}
		},
		
		
		events   : {
			imageLoad : function() {
				$(widget.options.selector['img-lazy'], widget.$widget).each(function() {
					var $this = $(this);
					
					$this.removeClass("lazy-load");
					
					// Correct the source.
					this.src = $this.attr('data-src');
					
					// Call the postbox widget to check if the image can be played
					// before the user tries to click it.
					$this.trigger('media-check');
				});
			},
			
			windowScroll : function(event) {
				// Determine if the boundaries of this image are in the viewport.
				
				var $elem         = widget.$widget;
				var $window       = $(window);
				
				var docViewTop    = $window.scrollTop();
				var docViewBottom = docViewTop + $window.height();
				
				var viewPad = 200;
				
				var elemTop       = $elem.offset().top - viewPad;
				var elemBottom    = elemTop + $elem.height() + viewPad;
				
				// We don't need the entire image to be present, just either edge.
				
				// If the top boundary is present
				if ( ((elemTop <= docViewBottom) && (elemTop >= docViewTop)) ||
					((elemBottom <= docViewBottom) && (elemBottom >= docViewTop)) )
				{
					widget.events.imageLoad();
				}
			}
		},
		
		bind     : {
			widget : function() {
				$(widget.options.selector['img'], widget.$widget).each(function() {
					var $this = $(this);
					
					$this.addClass("lazy-load");
					$this.attr('data-src', this.src);
					this.src = "";
				});
				
				$(window)
					.on('scroll.ib-lazyimg', widget.events.windowScroll)
					.on('ready.ib-lazyimg', widget.events.windowScroll);
				
				widget.events.windowScroll();
			}
		}
	};
	
	return widget;
});<commit_msg>Disabling lazy loading for now.<commit_after>/**
 * Lazy Loading Image Widget
 */
ib.widget("lazyimg", function(window, $, undefined) {
	var widget = {
		
		// The default values that are set behind init values.
		defaults : {
			// Selectors for finding and binding elements.
			selector : {
				'img'      : "img",
				'img-lazy' : "img.lazy-load",
			}
		},
		
		
		events   : {
			imageLoad : function() {
				$(widget.options.selector['img-lazy'], widget.$widget).each(function() {
					var $this = $(this);
					
					$this.removeClass("lazy-load");
					
					// Correct the source.
					this.src = $this.attr('data-src');
					
					// Call the postbox widget to check if the image can be played
					// before the user tries to click it.
					$this.trigger('media-check');
				});
			},
			
			windowScroll : function(event) {
				// Determine if the boundaries of this image are in the viewport.
				
				var $elem         = widget.$widget;
				var $window       = $(window);
				
				var docViewTop    = $window.scrollTop();
				var docViewBottom = docViewTop + $window.height();
				
				var viewPad = 200;
				
				var elemTop       = $elem.offset().top - viewPad;
				var elemBottom    = elemTop + $elem.height() + viewPad;
				
				// We don't need the entire image to be present, just either edge.
				
				// If the top boundary is present
				if ( ((elemTop <= docViewBottom) && (elemTop >= docViewTop)) ||
					((elemBottom <= docViewBottom) && (elemBottom >= docViewTop)) )
				{
					widget.events.imageLoad();
				}
			}
		},
		
		bind     : {
			widget : function() {
				// Disabling this for now as it is broken.
				// 
				// $(widget.options.selector['img'], widget.$widget).each(function() {
				// 	var $this = $(this);
				// 	
				// 	$this.addClass("lazy-load");
				// 	$this.attr('data-src', this.src);
				// 	this.src = "";
				// });
				// 
				// $(window)
				// 	.on('scroll.ib-lazyimg', widget.events.windowScroll)
				// 	.on('ready.ib-lazyimg', widget.events.windowScroll);
				// 
				// widget.events.windowScroll();
			}
		}
	};
	
	return widget;
});
{'fraction_non_alphanumeric': 0.1571988246816846, 'fraction_numerical': 0.0014691478942213516, 'mean_word_length': 2.144726712856043, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7312270', 'n_tokens_mistral': 1709, 'n_tokens_neox': 1269, 'n_words': 314}