<commit_before>$(document).ready(function(){
	$.getJSON("/google-adsense.config.json", function (data){
			//If ad in header is enabled
			if(data.header_active == "on"){
				$(getInsCode(data.client_id, data.header_id, 'container', 'margin:0 auto;', 'auto')).insertBefore("#content");
				(adsbygoogle = window.adsbygoogle || []).push({});
			}

			//If ad in footer is enabled
			if(data.footer_active == "on"){
				$(getInsCode(data.client_id, data.footer_id, 'container', 'margin:0 auto;', 'auto')).insertBefore("footer");
				(adsbygoogle = window.adsbygoogle || []).push({});
			}
			$(window).on('action:ajaxify.end', function (e, url) {


				if (url.url.substring(0, 6) == "topic/") {
					if(data.first_post_active == "on"){
						switch(data.first_post_position){
							case 'bottom':
							$(".post-content").first().append(getInsCode(data.client_id, data.footer_id, '', 'margin:0 auto;', 'auto'));
							break;

							case 'top':
							$(".post-content").first().prepend(getInsCode(data.client_id, data.footer_id, '', 'margin:0 auto;', 'auto'));
							break;

							case 'left':
							var height = $(".post-content").first().height();
							if(height < 250){
								var type = "auto";
								var width = 250;
							}
							else{
								var width = 300;
								var type ="vertical";
							}
							$(".post-content").first().prepend(getInsCode(data.client_id, data.footer_id, 'pull-left', 'width:' + width + 'px;  margin-right:30px;', type));
							break;

							case 'right':
							var height = $(".post-content").first().height();
							if(height < 250){
								var type = "auto";
								var width = 250;
							}
							else{
								var width = 300;
								var type ="vertical";
							}
							$(".post-content").first().prepend(getInsCode(data.client_id, data.footer_id, 'pull-right', 'width:' + width + 'px; margin-left:30px;', type));
							break;

							default:
							break;
						}
						(adsbygoogle = window.adsbygoogle || []).push({});
					}
				}
			})
			(adsbygoogle = window.adsbygoogle || []).push({});
		})

})

function getInsCode(clientId, dataId, customClass, style, format){
	var ad = '<ins class="adsbygoogle ' + customClass + '" style="display:block; ' + style + ' margin-bottom:15px; " data-ad-format="' + format + '" data-ad-client="ca-' + clientId + '" data-ad-slot="' + dataId + '"></ins>';
	return ad;
}<commit_msg>fixes<commit_after>$(document).ready(function(){
	$.getJSON("/google-adsense.config.json", function (data){
			//If ad in header is enabled
			if(data.header_active == "on"){
				$(getInsCode(data.client_id, data.header_id, 'container', 'margin:0 auto;', 'auto')).insertBefore("#content");
				(adsbygoogle = window.adsbygoogle || []).push({});
			}

			//If ad in footer is enabled
			if(data.footer_active == "on"){
				$(getInsCode(data.client_id, data.footer_id, 'container', 'margin:0 auto;', 'auto')).insertBefore("footer");
				(adsbygoogle = window.adsbygoogle || []).push({});
			}
			$(window).on('action:ajaxify.end', function (e, url) {


				if (url.url.substring(0, 6) == "topic/") {
					if(data.first_post_active == "on"){
						switch(data.first_post_position){
							case 'bottom':
							$(".post-content").first().append(getInsCode(data.client_id, data.footer_id, '', 'margin:0 auto;', 'auto'));
							break;

							case 'top':
							$(".post-content").first().prepend(getInsCode(data.client_id, data.footer_id, '', 'margin:0 auto;', 'auto'));
							break;

							case 'left':
							var height = $(".post-content").first().height();
							if(height < 250){
								var type = "rectangle";
								var width = 250;
							}
							else{
								var width = 300;
								var type ="vertical";
							}
							$(".post-content").first().prepend(getInsCode(data.client_id, data.footer_id, 'pull-left', 'width:' + width + 'px;  margin-right:30px;', type));
							break;

							case 'right':
							var height = $(".post-content").first().height();
							if(height < 250){
								var type = "rectangle";
								var width = 250;
							}
							else{
								var width = 300;
								var type ="vertical";
							}
							$(".post-content").first().prepend(getInsCode(data.client_id, data.footer_id, 'pull-right', 'width:' + width + 'px; margin-left:30px;', type));
							break;

							default:
							break;
						}
						(adsbygoogle = window.adsbygoogle || []).push({});
					}
				}
			})
			(adsbygoogle = window.adsbygoogle || []).push({});
		})

})

function getInsCode(clientId, dataId, customClass, style, format){
	var ad = '<ins class="adsbygoogle ' + customClass + '" style="display:block; ' + style + ' margin-bottom:15px; " data-ad-format="' + format + '" data-ad-client="ca-' + clientId + '" data-ad-slot="' + dataId + '"></ins>';
	return ad;
}
{'fraction_non_alphanumeric': 0.20284995808885165, 'fraction_numerical': 0.012573344509639563, 'mean_word_length': 2.858528698464026, 'pattern_counts': {'":': 0, '<': 11, '<?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': '2828426', 'n_tokens_mistral': 2150, 'n_tokens_neox': 1570, 'n_words': 308}