<commit_before>"use strict";

$('document').ready(function() {
	//todo: experiment with pre-loading this info on ajaxify.start
	$(window).on('action:ajaxify.end', function(err, data) {
		var url = data.url, tid;

		if (tid = data.url.match(/^topic\/(\d*)/)) {
			tid = tid[1];

			getEventsData({tid: tid});
		}
	});

	socket.on('event:topic_pinned', getEventsData);
	socket.on('event:topic_unpinned', getEventsData);


	function getEventsData(data) {
		tid = data.tid;

		$.get(RELATIVE_PATH + '/api/events/tid/' + tid, function(events) {<commit_msg>update events during inifinte scrolling<commit_after>"use strict";

$('document').ready(function() {
	//todo: experiment with pre-loading this info on ajaxify.start
	$(window).on('action:ajaxify.end', function(err, data) {
		var url = data.url, tid;

		if (tid = data.url.match(/^topic\/(\d*)/)) {
			tid = tid[1];

			getEventsData({tid: tid});
		}
	});

	$(window).trigger('action:posts.loaded', getEventsData);

	socket.on('event:topic_pinned', getEventsData);
	socket.on('event:topic_unpinned', getEventsData);


	function getEventsData(data) {
		tid = data.tid || ajaxify.variables.get('topic_id');

		$.get(RELATIVE_PATH + '/api/events/tid/' + tid, function(events) {
{'fraction_non_alphanumeric': 0.19117647058823528, 'fraction_numerical': 0.0016339869281045752, 'mean_word_length': 4.645161290322581, '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': '722933', 'n_tokens_mistral': 462, 'n_tokens_neox': 426, 'n_words': 81}