<commit_before>(function($) {
	// using jQuery
	function getCookie(name) {
		var cookieValue = null;
		if (document.cookie && document.cookie != '') {
			var cookies = document.cookie.split(';');
			for (var i = 0; i < cookies.length; i++) {
				var cookie = $.trim(cookies[i]);
				// Does this cookie string begin with the name we want?
				if (cookie.substring(0, name.length + 1) == (name + '=')) {
					cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
					break;
				}
			}
		}
		return cookieValue;
	}
	var csrftoken = getCookie('csrftoken');

	function csrfSafeMethod(method) {
		// these HTTP methods do not require CSRF protection
		return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
	}
	$.ajaxSetup({
		crossDomain: false, // obviates need for sameOrigin test
		beforeSend: function(xhr, settings) {
			if (!csrfSafeMethod(settings.type)) {
				xhr.setRequestHeader("X-CSRFToken", csrftoken);
			}
		}
	});

	$.mobile.document.on("click", ".dnchange", function() {
		if (DATA_DIC.dn === 'day') {
			$("[data-theme='a']").attr('data-theme', 'b');
			$(".ui-page-theme-a").addClass("ui-page-theme-b");
			$(".ui-page-theme-a").removeClass("ui-page-theme-a");
			DATA_DIC.dn = 'night';
		} else {
			$("[data-theme='b']").attr('data-theme', 'a');
			$(".ui-page-theme-b").addClass("ui-page-theme-a");
			$(".ui-page-theme-b").removeClass("ui-page-theme-b");
			DATA_DIC.dn = 'day';
		}
	})

	// Login Form
	// $.mobile.document.on("submit", "#loginform", function() {
	// 	var data = $("#loginform").serializeArray();
	// 	var url = $("#loginform").attr('action');
	// 	$.post(url, data, function(data) {
	// 		if (data.success) {
	// 			console.log(data);
	// 			$.mobile.changePage(data.data.next);
	// 		} else {
	// 			$("#error_message").text("用户名或密码错误");
	// 		}
	// 	}, 'json');
	// 	return false;
	// })

	$.mobile.document.on("pagebeforeshow", "body", function() {
		//昼夜切换
		if (DATA_DIC.dn === 'day') {
			$("[data-theme='b']").attr('data-theme', 'a');
			$(".ui-page-theme-b").addClass("ui-page-theme-a");
			$(".ui-page-theme-b").removeClass("ui-page-theme-b");
		} else {
			$("[data-theme='a']").attr('data-theme', 'b');
			$(".ui-page-theme-a").addClass("ui-page-theme-b");
			$(".ui-page-theme-a").removeClass("ui-page-theme-a");
		}
		console.log(DATA_DIC);
	});

	$(window).on("swipeleft", function() {
		$.mobile.changePage($(".next_a").eq(0).attr('href'));
	});
	$(window).on("swiperight", function() {
		$.mobile.changePage($(".prev_a").eq(0).attr('href'));
	});

	// 添加书签<commit_msg>1. 修复滑动翻页BUG<commit_after>(function($) {
	// using jQuery
	function getCookie(name) {
		var cookieValue = null;
		if (document.cookie && document.cookie != '') {
			var cookies = document.cookie.split(';');
			for (var i = 0; i < cookies.length; i++) {
				var cookie = $.trim(cookies[i]);
				// Does this cookie string begin with the name we want?
				if (cookie.substring(0, name.length + 1) == (name + '=')) {
					cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
					break;
				}
			}
		}
		return cookieValue;
	}
	var csrftoken = getCookie('csrftoken');

	function csrfSafeMethod(method) {
		// these HTTP methods do not require CSRF protection
		return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
	}
	$.ajaxSetup({
		crossDomain: false, // obviates need for sameOrigin test
		beforeSend: function(xhr, settings) {
			if (!csrfSafeMethod(settings.type)) {
				xhr.setRequestHeader("X-CSRFToken", csrftoken);
			}
		}
	});

	$.mobile.document.on("click", ".dnchange", function() {
		if (DATA_DIC.dn === 'day') {
			$("[data-theme='a']").attr('data-theme', 'b');
			$(".ui-page-theme-a").addClass("ui-page-theme-b");
			$(".ui-page-theme-a").removeClass("ui-page-theme-a");
			DATA_DIC.dn = 'night';
		} else {
			$("[data-theme='b']").attr('data-theme', 'a');
			$(".ui-page-theme-b").addClass("ui-page-theme-a");
			$(".ui-page-theme-b").removeClass("ui-page-theme-b");
			DATA_DIC.dn = 'day';
		}
	})

	// Login Form
	// $.mobile.document.on("submit", "#loginform", function() {
	// 	var data = $("#loginform").serializeArray();
	// 	var url = $("#loginform").attr('action');
	// 	$.post(url, data, function(data) {
	// 		if (data.success) {
	// 			console.log(data);
	// 			$.mobile.changePage(data.data.next);
	// 		} else {
	// 			$("#error_message").text("用户名或密码错误");
	// 		}
	// 	}, 'json');
	// 	return false;
	// })

	$.mobile.document.on("pagebeforeshow", "body", function() {
		//昼夜切换
		if (DATA_DIC.dn === 'day') {
			$("[data-theme='b']").attr('data-theme', 'a');
			$(".ui-page-theme-b").addClass("ui-page-theme-a");
			$(".ui-page-theme-b").removeClass("ui-page-theme-b");
		} else {
			$("[data-theme='a']").attr('data-theme', 'b');
			$(".ui-page-theme-a").addClass("ui-page-theme-b");
			$(".ui-page-theme-a").removeClass("ui-page-theme-a");
		}
		console.log(DATA_DIC);
	});

	$.mobile.document.on("swipeleft", ".pagecontent", function() {
		$.mobile.changePage($(".next_a").eq(0).attr('href'));
	});
	$.mobile.document.on("swiperight", ".pagecontent", function() {
		$.mobile.changePage($(".prev_a").eq(0).attr('href'));
	});

	// 添加书签
{'fraction_non_alphanumeric': 0.24995114324799686, 'fraction_numerical': 0.0025405511041625955, 'mean_word_length': 3.431168831168831, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5987987', 'n_tokens_mistral': 2132, 'n_tokens_neox': 1984, 'n_words': 284}