<commit_before>'use strict';

jQuery(function($) {
	var ArtApp = {
		gridID: '#image-grid',
		jsondata : {},
		modalID : 'artModal',	

		init: function(){
			$(document).foundation();
		
			var $grid = $(this.gridID).masonry({
				itemSelector: this.gridID + ' li'
			});	

			ArtApp.imageBlocks();
		},

		reloadMasonry: function(){
			$(this.gridID).masonry('reloadItems');
			$(this.gridID).masonry();
		},

		showImages: function(){
			var that = this;
			$(this.gridID + ' img').on('load', function() {
		    	$(this).closest('li').addClass('loaded');
		    	$(this).fadeIn(600);
		    	that.reloadMasonry();
			});
		},

		setModals: function(){
			var that = this;

			$('[data-reveal-id]').on('click', function() {
			  var targetModal = $('#' + $(this).data('revealId'));
			  var key = $(this).data('imgkey');
			  $('#' + that.modalID + ' img').attr('src', '/images/pottery/' + that.jsondata[key].filename);
			  $('#' + that.modalID + ' #modal-caption').text(that.jsondata[key].desc);
			  $('#' + that.modalID + ' #modal-title').text(that.jsondata[key].title);
			});
		},

		imageBlocks: function(){
			var that = this;


			$.getJSON( '/data/pottery.json', function(data) {
				$.each(data, function( key, val ) {
			  		$(that.gridID).append('<li><a href="#" data-reveal-id="' + that.modalID + '" data-imgkey="'+ key +'""><img src=/images/pottery/' + val.filename + '></a></li>');			  		
				});
				that.jsondata = data;
			}).done(function(){
				that.showImages();
				that.setModals();
			});


		}
	}
	ArtApp.init();
});<commit_msg>Fix path on json request<commit_after>'use strict';

jQuery(function($) {
	var ArtApp = {
		gridID: '#image-grid',
		jsondata : {},
		modalID : 'artModal',

		init: function(){
			$(document).foundation();

			var $grid = $(this.gridID).masonry({
				itemSelector: this.gridID + ' li'
			});

			ArtApp.imageBlocks();
		},

		reloadMasonry: function(){
			$(this.gridID).masonry('reloadItems');
			$(this.gridID).masonry();
		},

		showImages: function(){
			var that = this;
			$(this.gridID + ' img').on('load', function() {
		    	$(this).closest('li').addClass('loaded');
		    	$(this).fadeIn(600);
		    	that.reloadMasonry();
			});
		},

		setModals: function(){
			var that = this;

			$('[data-reveal-id]').on('click', function() {
			  var targetModal = $('#' + $(this).data('revealId'));
			  var key = $(this).data('imgkey');
			  $('#' + that.modalID + ' img').attr('src', '/images/pottery/' + that.jsondata[key].filename);
			  $('#' + that.modalID + ' #modal-caption').text(that.jsondata[key].desc);
			  $('#' + that.modalID + ' #modal-title').text(that.jsondata[key].title);
			});
		},

		imageBlocks: function(){
			var that = this;


			$.getJSON( '/data/pottery.json', function(data) {
				$.each(data, function( key, val ) {
			  		$(that.gridID).append('<li><a href="#" data-reveal-id="' + that.modalID + '" data-imgkey="'+ key +'""><img src=/images/pottery/' + val.filename + '></a></li>');
				});
				that.jsondata = data;
			}).done(function(){
				that.showImages();
				that.setModals();
			});


		}
	}
	ArtApp.init();
});
{'fraction_non_alphanumeric': 0.24082421120412106, 'fraction_numerical': 0.0019317450096587251, 'mean_word_length': 3.1760752688172045, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '4519085', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1112, 'n_words': 172}