<commit_before>/* StorageTables v0.0.1
* Copyrights 2015 by <NAME> */
(function ($) {
	"use strict";
	$.fn.storageTable = function (options) {
	    var settings = $.extend({
	        // These are the defaults.
	        dataType: "json",
	        editable: false,
	        deletable: false,	        
	        inputBy: true,
	        focus: false,
	        columns: [],
            title: "test"
	    }, options);	    	    	    
	    
		if (this.is(':empty') || this.is('table')) {
		    return this.append(_fnTableTemplate());
		} else {
		    //TODO: attack handlers for ajax calls and other stuff.
		    //Add Inputs on clicks or &nbsp;
		    return this;		    
		}

	    //Editable Templates
	    function _fnTableTemplate(head, body) {
	        settings.title = typeof settings.title !== 'undefined' ? '<caption>' + settings.title + '</caption>' : "";

	        head = typeof head !== 'undefined' ? head : _fnCreateHeader();

	        body = typeof body !== 'undefined' ? body : _fnCreateColumn();

	        return '<table>' + settings.title + head + body + '</table>';
	    }

	    $.fn.storageTable.columns = function (template) {
	        template = typeof template !== 'undefined' ? template : "";
	        _fnCreateColumn();
	    };

	    function _fnCreateHeader() {
	        var colNum = 10;
	        var thead = '<thead><tr>';
	        for (var i = 1; i <= colNum; i++) {
	            thead += '<th>' + i + '</th>';
	        }
	        return thead + '</tr></thead>';
	    }

	    function _fnCreateColumn() {
	        var colNum = 10, tbody = '<tbody><tr>';     
	        //NOTES: Chrome by default wrapping with tbody.
	        for (var t = 1; t <= colNum; t++) {
	            tbody += '<td>' + t + '</td>';
	        }
	        return tbody + '</tr></tbody>';
	    }	
	};
}(jQuery));<commit_msg>Changed title to settings and attacked to function.<commit_after>/* StorageTables v0.0.1
* Copyrights 2015 by <NAME> */
(function ($) {
    "use strict";
    $.fn.storageTable = function (options) {
        var settings = $.extend({
            // These are the defaults.
            dataType: "json",
            data: [],
            editable: false,
            deletable: false,
            inputBy: true,
            focus: false,
            columns: [],
            title: "test"
        }, options);

        if (this.is(':empty') || this.is('table')) {
            return this.append(_fnTableTemplate());
        } else {
            //TODO: attack handlers for ajax calls and other stuff.
            //Add Inputs on clicks or &nbsp;
            return this;
        }

        //Editable Templates
        function _fnTableTemplate(head, body) {
            settings.title = typeof settings.title !== 'undefined' ? '<caption>' + settings.title + '</caption>' : "";

            head = typeof head !== 'undefined' ? head : _fnCreateHeader();

            body = typeof body !== 'undefined' ? body : _fnCreateColumn();

            return '<table>' + settings.title + head + body + '</table>';
        }

        $.fn.storageTable.columns = function (template) {
            template = typeof template !== 'undefined' ? template : "";
            _fnCreateColumn();
        };

        function _fnCreateHeader() {
            var colNum = 10;
            var thead = '<thead><tr>';
            for (var i = 1; i <= colNum; i++) {
                thead += '<th>' + i + '</th>';
            }
            return thead + '</tr></thead>';
        }

        function _fnCreateColumn() {
            var colNum = 10, tbody = '<tbody><tr>';
            //NOTES: Chrome by default wrapping with tbody.
            for (var t = 1; t <= colNum; t++) {
                tbody += '<td>' + t + '</td>';
            }
            return tbody + '</tr></tbody>';
        }
    };
}(jQuery));
{'fraction_non_alphanumeric': 0.15629942013705853, 'fraction_numerical': 0.006852925672113864, 'mean_word_length': 1.6895818568391212, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 37, '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': '2204124', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1030, 'n_words': 301}