<commit_before>/**
	paginateIt by <NAME> 2015
**/
$.paginateIt = function ($target, $count) {
    var self = this;
    this.fullData = $target.children().clone();
    this.visibleData = "";
    this.total = this.fullData.length;
    this.page = 1;
    this.count = $count || 10;
    this.totalPages = Math.ceil(this.total / this.count);
    //PAGINATOR
    this.paginatorTemplate = '<div class="row paginator">'+
                        '<div class="col-lg-9 col-md-8 col-sm-7 col-xs-6"></div>'+
                        '<div class="col-lg-3 col-md-4 col-sm-5 col-xs-6">'+
                           '<div class="pull-right">'+
                                '<a class="paginator-prev">&lt; </a> '+
                                '<span>pagina</span> <span class="currentPage"></span>'+
                                '<span>di</span><span class="totalPages"></span>'+
                                '<a class="paginator-next">&gt;</a>'+
                            '</div>'+
                        '</div>'+
                    '</div>';
    $(this.paginatorTemplate).insertAfter($target);
    this.paginator = $target.next();
    this.pagCurrent = self.paginator.find(".currentPage");
    this.pagTotal = self.paginator.find(".totalPages");
    this.pagNext = self.paginator.find(".paginator-next");
    this.pagPrev = self.paginator.find(".paginator-prev");
    this.pagNext.on("click", function () {
        self.nav("next");
    });
    this.pagPrev.on("click", function () {
        self.nav("prev");
    });
    this.nav = function (action) {
        switch (action) {
            case "prev":
                if (this.page > 1) {
                    this.page--;
                    self.visibleData = self.fullData.slice((self.page - 1) * self.count, self.page * self.count);
                    $target.empty().append(self.visibleData);
                    self.pagCurrent.text(self.page);
                    self.pagTotal.text(self.totalPages);
                }
                break;
            case "next":
                if (this.page < this.totalPages) {
                    this.page++;
                    self.visibleData = self.fullData.slice((self.page - 1) * self.count, self.page * self.count);
                    $target.empty().append(self.visibleData);
                    self.pagCurrent.text(self.page);
                    self.pagTotal.text(self.totalPages);
                }
                break;
            case "boot":
                self.visibleData = self.fullData.slice((self.page - 1) * self.count, self.page * self.count);
                $target.empty().append(self.visibleData);
                self.pagCurrent.text(self.page);
                self.pagTotal.text(self.totalPages);
				break;
            default:
                console.error("WRONG ACTION!");
                break;
        }
    };
    self.nav("boot");
};

$(document).ready(function(){
    $("[paginate]").each(function(){
        if (isNaN(parseInt($(this).attr("paginate")))) {
            console.error("invalid \"paginate\" attribute at [paginate]", $(this));
            //SKIP TO NEXT ITERATION
            return true;
        }
        var $count = parseInt($(this).attr("paginate"));
        var doPag = new $.paginateIt($(this), $count);
    });
});<commit_msg>v 1.0.1<commit_after>/**
 *	paginateIt by <NAME> 2018
 */
var style = "\
 div.paginator {\
	display: block;\
	float: left;\
	width: 100%;\
	clear: both;\
 }\
 \
 div.paginator:after {\
	display: table;\
 }\
 \
 span.paginator-prev,\
 span.paginator-next {\
	cursor: pointer;\
	color: #18bc9c;\
 }\
 \
 span.paginator-prev:hover,\
 span.paginator-next:hover {\
	font-weight: bold;\
 }\
";
 
"undefined" != typeof document && function(e, t) {
    var n = e.createElement("style");
    if (e.getElementsByTagName("head")[0].appendChild(n),
    n.styleSheet)
        n.styleSheet.disabled || (n.styleSheet.cssText = t);
    else
        try {
            n.innerHTML = t
        } catch (e) {
            n.innerText = t
        }
}(document, style);
 
$.paginateIt = function ($target, $count) {
    var self = this;
    this.fullData = $target.children().clone();
    this.visibleData = "";
    this.total = this.fullData.length;
    this.page = 1;
    this.count = $count || 10;
    this.totalPages = Math.ceil(this.total / this.count);
    //PAGINATOR
    this.paginatorTemplate = '<div class="row paginator">'+
                        '<div class="col-lg-9 col-md-8 col-sm-7 col-xs-6"></div>'+
                        '<div class="col-lg-3 col-md-4 col-sm-5 col-xs-6">'+
                           '<div class="pull-right">'+
                                '<span class="paginator-prev">&lt; </span> '+
                                '<span>page</span> <span class="currentPage"></span>'+
                                '<span>&nbsp;of&nbsp;</span><span class="totalPages"></span>'+
                                '<span class="paginator-next"> &gt;</span>'+
                            '</div>'+
                        '</div>'+
                    '</div>';
    $(this.paginatorTemplate).insertAfter($target);
    this.paginator = $target.next();
    this.pagCurrent = self.paginator.find(".currentPage");
    this.pagTotal = self.paginator.find(".totalPages");
    this.pagNext = self.paginator.find(".paginator-next");
    this.pagPrev = self.paginator.find(".paginator-prev");
    this.pagNext.on("click", function () {
        self.nav("next");
    });
    this.pagPrev.on("click", function () {
        self.nav("prev");
    });
    this.nav = function (action) {
        switch (action) {
            case "prev":
                if (this.page > 1) {
                    this.page--;
                    self.visibleData = self.fullData.slice((self.page - 1) * self.count, self.page * self.count);
                    $target.empty().append(self.visibleData);
                    self.pagCurrent.text(self.page);
                    self.pagTotal.text(self.totalPages);
                }
                break;
            case "next":
                if (this.page < this.totalPages) {
                    this.page++;
                    self.visibleData = self.fullData.slice((self.page - 1) * self.count, self.page * self.count);
                    $target.empty().append(self.visibleData);
                    self.pagCurrent.text(self.page);
                    self.pagTotal.text(self.totalPages);
                }
                break;
            case "boot":
                self.visibleData = self.fullData.slice((self.page - 1) * self.count, self.page * self.count);
                $target.empty().append(self.visibleData);
                self.pagCurrent.text(self.page);
                self.pagTotal.text(self.totalPages);
				$target.css("minHeight", $target.height());
				break;
            default:
                console.error("WRONG ACTION!");
                break;
        }
    };
    self.nav("boot");
};

$(document).ready(function(){
    $("[paginate]").each(function(){
        if (isNaN(parseInt($(this).attr("paginate")))) {
            console.error("invalid \"paginate\" attribute at [paginate]", $(this));
            //SKIP TO NEXT ITERATION
            return true;
        }
        var $count = parseInt($(this).attr("paginate"));
        var doPag = new $.paginateIt($(this), $count);
    });
});
{'fraction_non_alphanumeric': 0.16848121937942298, 'fraction_numerical': 0.0065323897659227, 'mean_word_length': 1.6540267244492597, 'pattern_counts': {'":': 6, '<': 47, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2702359', 'n_tokens_mistral': 2197, 'n_tokens_neox': 2125, 'n_words': 352}