<commit_before>"use strict";
$(function() {

	// disclaimer: this code is ugly.

	var sent = false;

	function setProposalStatus(id, value) {
		if (sent) {
			return;
		}
		sent = true;
		$(".accept-buttons,.unaccept").addClass('disabled');
		$.post('', {
			issue : id,
			accepted : value,
			unaccept : '1',
		}, function(data) {
			history.back();
		});
	}

	function do_vote(vote_url, vote_value, elem) {
    }
    

	$(".proposal-action").click(function(event) {
		event.preventDefault();
		var el = $(this).closest('.proposal');
		setProposalStatus(el.data('id'), $(this).val());
		return false;
	});

	$(".unaccept").click(function(event) {
		event.preventDefault();
		var el = $(this).closest('.proposal');
		setProposalStatus(el.data('id'), $(this).data('value'));
		return false;
	});

	$(".container").on("click", "a[id|='vote']", function() {
    })

    
}); <commit_msg>added the missing functions from Amir<commit_after>"use strict";
$(function() {

	// disclaimer: this code is ugly.

	var sent = false;

	function setProposalStatus(id, value) {
		if (sent) {
			return;
		}
		sent = true;
		$(".accept-buttons,.unaccept").addClass('disabled');
		$.post('', {
			issue : id,
			accepted : value,
			unaccept : '1',
		}, function(data) {
			history.back();
		});
	}

	function do_vote(vote_url, vote_value, elem) {
		$.post(vote_url, {
			val : vote_value
		}, function(data) {
			if (data['result'] == 'ok') {
				var btn_div = elem.closest('div');
				btn_div.replaceWith(data['html']);
			}
		});
	}


	$(".proposal-action").click(function(event) {
		event.preventDefault();
		var el = $(this).closest('.proposal');
		setProposalStatus(el.data('id'), $(this).val());
		return false;
	});

	$(".unaccept").click(function(event) {
		event.preventDefault();
		var el = $(this).closest('.proposal');
		setProposalStatus(el.data('id'), $(this).data('value'));
		return false;
	});

	$(".container").on("click", "a[id|='vote']", function() {
		event.preventDefault();
		var vote_value = $(this).attr('id').substr(5);
		//console.log(' <============== ' + vote_value)
		var target = $(this).attr('href');
		do_vote(target, vote_value, $(this));
	});
});
{'fraction_non_alphanumeric': 0.22909930715935334, 'fraction_numerical': 0.0013856812933025404, 'mean_word_length': 3.889390519187359, 'pattern_counts': {'":': 0, '<': 4, '<?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': '2741719', 'n_tokens_mistral': 837, 'n_tokens_neox': 752, 'n_words': 136}