<commit_before>jQuery(function($) {
	
	// SORTABLE CLASS
	// ==============
	
	var AltText = function(el) {
		this.$el = $(el);
		this.originalText = this.$el.text();
		this.altText = this.$el.data('alt-text');
	}
	
	AltText.prototype.state = function(alt) {
		
		this.$el.text(alt ? this.altText : this.originalText);
		
	}
	
	// SORTABLE PLUGIN
	// ===============
	
	$.fn.altText = function(state) {
		return this.each(function() {
			var $this = $(this);
			var altText = $this.data('ui.altText');
			
			if (!altText) $this.data('ui.altText', (altText = new AltText(this)));
			
			altText.state(state);
		});
	}
	
	$.fn.altText.Constructor = AltText;
	
	// EVENT BINDINGS
	// ==============
	
	$(document).on('keydown.ui.altText', function(e) {
		if (e.which != 18) return;
		$('a[data-alt-text]').altText(true);
	});
	
	$(document).on('keyup.ui.altText', function(e) {
		if (e.which != 18) return;
		$('a[data-alt-text]').altText();
	});
	
});<commit_msg>Allowing alt-text plugin to work on any element<commit_after>jQuery(function($) {
	
	// SORTABLE CLASS
	// ==============
	
	var AltText = function(el) {
		this.$el = $(el);
		this.originalText = this.$el.text();
		this.altText = this.$el.data('alt-text');
	}
	
	AltText.prototype.state = function(alt) {
		
		this.$el.text(alt ? this.altText : this.originalText);
		
	}
	
	// SORTABLE PLUGIN
	// ===============
	
	$.fn.altText = function(state) {
		return this.each(function() {
			var $this = $(this);
			var altText = $this.data('ui.altText');
			
			if (!altText) $this.data('ui.altText', (altText = new AltText(this)));
			
			altText.state(state);
		});
	}
	
	$.fn.altText.Constructor = AltText;
	
	// EVENT BINDINGS
	// ==============
	
	$(document).on('keydown.ui.altText', function(e) {
		if (e.which != 18) return;
		$('[data-alt-text]').altText(true);
	});
	
	$(document).on('keyup.ui.altText', function(e) {
		if (e.which != 18) return;
		$('[data-alt-text]').altText();
	});
	
});
{'fraction_non_alphanumeric': 0.24795501022494887, 'fraction_numerical': 0.00408997955010225, 'mean_word_length': 3.2822757111597376, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1984265', 'n_tokens_mistral': 827, 'n_tokens_neox': 718, 'n_words': 115}