<commit_before>var app = {};

(function($) {
	app.func = {
		ajax : _ajax,
		link : _link,
		stop : _stop,
		trim : _trim,
		query : _query,
		byteFormat: _byteFormat,
		relativeTime: _relativeTime,
		hash : _hash
	};
	app.storage = {
		set : _set,
		get : _get
	};
	$(document).ready(function () {
		app.prefix = $('#api-path-prefix').val();
	});

	function _ajax(arg) {
		var dt = arg.dataType ? arg.dataType : 'json';
		$.ajax({
			url: app.prefix+arg.url, type: arg.type ? arg.type : 'GET',
			data: arg.data, dataType: dt,
			success: function (data) {
				arg.success && arg.success(data);
			},
			error: function (xhr, status, err) {
				if (arg.error) {
					arg.error(xhr, status, err);
					return;
				}
				console.log(arg.url, status, err.toString());
			}
		});
	}
	function _link(href, e) {
		e = e || window.event;
		if (!e)
			return false;
		if (e && (e.ctrlKey || e.metaKey)) {
			window.open(app.prefix+href, '_blank');
		} else {
			location.href = app.prefix+href;
		}
	}
	function _stop(e) {
		e = e || window.event;
		if (!e)
			return false;
		e.cancelBubble = true;
		if (e.stopPropagation)
			e.stopPropagation();
		e.returnValue = false;
		if (e.preventDefault)
			e.preventDefault();
		return e;
	}
	function _trim(value) {
		return value.replace(/\s/g,'').replace(/　/g,'')
	}
	function _query(key, def) {
		key = key.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
		def = def ? def : "";
		var regex = new RegExp("[\\?&]" + key + "=([^&#]*)"),
				results = regex.exec(location.search);
		return results === null ? def : decodeURIComponent(results[1].replace(/\+/g, " "));
	}<commit_msg>fix js undefined path prefix bug<commit_after>var app = {};

(function($) {
	app.func = {
		ajax : _ajax,
		link : _link,
		stop : _stop,
		trim : _trim,
		query : _query,
		byteFormat: _byteFormat,
		relativeTime: _relativeTime,
		hash : _hash
	};
	app.storage = {
		set : _set,
		get : _get
	};

	function _ajax(arg) {
		var dt = arg.dataType ? arg.dataType : 'json',
		    prefix = $('#api-path-prefix').val();
		$.ajax({
			url: prefix+arg.url, type: arg.type ? arg.type : 'GET',
			data: arg.data, dataType: dt,
			success: function (data) {
				arg.success && arg.success(data);
			},
			error: function (xhr, status, err) {
				if (arg.error) {
					arg.error(xhr, status, err);
					return;
				}
				console.log(arg.url, status, err.toString());
			}
		});
	}
	function _link(href, e) {
		var prefix = $('#api-path-prefix').val();
		e = e || window.event;
		if (!e)
			return false;
		if (e && (e.ctrlKey || e.metaKey)) {
			window.open(prefix+href, '_blank');
		} else {
			location.href = prefix+href;
		}
	}
	function _stop(e) {
		e = e || window.event;
		if (!e)
			return false;
		e.cancelBubble = true;
		if (e.stopPropagation)
			e.stopPropagation();
		e.returnValue = false;
		if (e.preventDefault)
			e.preventDefault();
		return e;
	}
	function _trim(value) {
		return value.replace(/\s/g,'').replace(/　/g,'')
	}
	function _query(key, def) {
		key = key.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
		def = def ? def : "";
		var regex = new RegExp("[\\?&]" + key + "=([^&#]*)"),
				results = regex.exec(location.search);
		return results === null ? def : decodeURIComponent(results[1].replace(/\+/g, " "));
	}
{'fraction_non_alphanumeric': 0.20560172360726378, 'fraction_numerical': 0.0006155740227762388, 'mean_word_length': 2.90625, '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': '4470693', 'n_tokens_mistral': 1401, 'n_tokens_neox': 1247, 'n_words': 269}