<commit_before>var ProductLister = (function () {

    // Define the variables used by module
    var init,
        callAjax,
        jsonToHTML,
        addHTMLToDom
		filters = document.getElementById('filters'),
		productsList = document.getElementById('products-list');

    // The "init" function, sets up event handlers
    init = function (d) {
		d.addEventListener("click", function(){
			
		}
    };

    // Function to run when a category button is clicked
    // Handler is assigned to parent, so we use event delegation!
    callAjax = function (event) {

        event.preventDefault();

    };

    // Function to convert data returned via ajax to HTML
    jsonToHTML = function (productData) {

    };

    // Function to add the HTML to the DOM
    addHTMLtoDOM = function (html) {

    };

    // All we need to return is the init function
    return {
        init: init
    };

})();

// Initialise "ProductLister"...
ProductLister.init(document);


<commit_msg>Weekly Commit<commit_after>var ProductLister = (function () {

    // Define the variables used by module
    var init,
        callAjax,
        jsonToHTML,
        addHTMLToDom,
		attr,
		api,
		filters = document.getElementById('filters'),
		productsList = document.getElementById('products-list');

    // The "init" function, sets up event handlers
    init = function () {
		filters.addEventListener("click", function(event) {
			callAjax(event)
		});
    };

    // Function to run when a category button is clicked
    // Handler is assigned to parent, so we use event delegation!
    callAjax = function (event) {
        event.preventDefault();
		console.log(event.target.getAttribute("data-category"));
		//attr = event.("data-category");
		
		api = $.ajax({
			url: "http://gerardluskin.com/city/service/products/?callback=&category=" + attr,
			dataType: "jsonp"
		}).done(function (data, text, api) {
			console.log("worked");
		}).fail(function (api, text, err) {
			console.log("Failed");
		});

    };

    // Function to convert data returned via ajax to HTML
    jsonToHTML = function (productData) {

    };

    // Function to add the HTML to the DOM
    addHTMLtoDOM = function (html) {

    };

    // All we need to return is the init function
    return {
        init: init
    };

})();

// Initialise "ProductLister"...
ProductLister.init(document);



{'fraction_non_alphanumeric': 0.1228293096145701, 'fraction_numerical': 0.0, 'mean_word_length': 2.650695517774343, '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': '2115292', 'n_tokens_mistral': 725, 'n_tokens_neox': 660, 'n_words': 205}