<commit_before>/* General admin interface improvements */

import $ from 'jquery'
import Cookies from 'js-cookie'
import timeago from 'timeago.js'
window.Cookies = Cookies

;(function() {
	"use strict";

	// CSRF setup
	$.ajaxSetup({
		headers: { 'X-CSRF-TOKEN': $('meta[name="_token"]').attr("value") }
	});


	//delete buttons
	$(".delete-btn, .btn-danger").on("click", function(evt) {
		if ($(evt.target).closest("#form-view").length)
			return;
		
		var confirm = window.confirm("Are you sure?");
		if(!confirm) {
			evt.preventDefault();
		}
	});

	//index variable module
	var $indexVariableModule = $(".index-variable-module");<commit_msg>Fix csrf token for older code<commit_after>/* General admin interface improvements */

import $ from 'jquery'
import Cookies from 'js-cookie'
import timeago from 'timeago.js'
window.Cookies = Cookies

;(function() {
	"use strict";

	$.ajaxSetup({
		beforeSend: function(xhr, settings) {
			xhr.setRequestHeader("X-CSRFToken", $('meta[name="_token"]').attr("value") )
		}
	})

	//delete buttons
	$(".delete-btn, .btn-danger").on("click", function(evt) {
		if ($(evt.target).closest("#form-view").length)
			return;
		
		var confirm = window.confirm("Are you sure?");
		if(!confirm) {
			evt.preventDefault();
		}
	});

	//index variable module
	var $indexVariableModule = $(".index-variable-module");
{'fraction_non_alphanumeric': 0.18884758364312268, 'fraction_numerical': 0.0, 'mean_word_length': 4.2784313725490195, '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': '2816343', 'n_tokens_mistral': 478, 'n_tokens_neox': 442, 'n_words': 100}