<commit_before>'use strict';

(function() {
	chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {

		var actions = {
			pasteWord: function() {
				var selectedInput = $("form#comment_form div[id ^= 'comment']:visible > :input")[0];

				selectedInput.value += request.content;
			},

			postWord: function() {
				var selectedInput = $("form#comment_form div[id ^= 'comment']:visible > :input")[0];
				var postButton    = $('div#comment_input_view_02 button.btn')[0];

				selectedInput.value += request.content;
				postButton.click();
			}
		};

		if(request.action in actions) {
			actions[request.action]();
		}
	});
})();<commit_msg>set keyboard shortcut: ctrl+enter => post comment<commit_after>'use strict';

(function() {
	var selectedInput = $("form#comment_form div[id ^= 'comment']:visible > :input")[0];
	var postButton    = $('div#comment_input_view_02 button.btn')[0];

	chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {

		var actions = {
			pasteWord: function() {
				selectedInput.value += request.content;
			},

			postWord: function() {
				selectedInput.value += request.content;
				postButton.click();
			}
		};

		if(request.action in actions) {
			actions[request.action]();
		}
	});

	var onKeyClickHandler = function(e) {
		if(e.ctrlKey && e.which === 13) {
			postButton.click();
		}
	}

	$('body').on('keydown', onKeyClickHandler)
})();
{'fraction_non_alphanumeric': 0.17427969079409697, 'fraction_numerical': 0.007730147575544624, 'mean_word_length': 4.216117216117216, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6466576', 'n_tokens_mistral': 541, 'n_tokens_neox': 461, 'n_words': 82}