<commit_before>$("#twitter-login").click(function(e){
	console.log("open");
	window.open("/twitter/login.php", "_temp",'resizable=yes,width=600,height=600');
});

$(document).ready(function(){

var params={};
window.location.search
  .replace(/[?&]+([^=&]+)=([^&]*)/gi, function(str,key,value) {
    params[key] = value;
  }
);

console.log("query", params["query"]);

if(params["query"] != "" && params["query"] != undefined){

	$("#image-url").val(decodeURIComponent(params["query"]));
	$('#download-into-canvas').click();
	$("#media").hide();
}

var twitter_login = setInterval(function(){
	$.get("/twitter/check.php", function(data){
		if(!data["login"]){
			$("#twitter-post").hide();
		} else {
			$("#twitter-login").hide();
			$("#twitter-post").show();

			clearTimeout(twitter_login);
		}
	});
}, 500);
//clearTimeout(twitter_login);

$("#results").masonry({ itemSelector: '.grid-item', columnWidth: 220 });

$("#search").submit(function(e){
	$("#results").empty();

	// $grid.imagesLoaded().progress( function() {
	// 	$grid.masonry('layout');
	// });


	$.get("/api/fetch.php", { "query" : $("#query").val() },function(data){
		//console.log(data);
		console.log(data[0]["img"]);

		$.each(data, function(idx){
			result = data[idx];
			console.log(result["img"]);

			$content = $("<div class=\"grid-item\"><a href=\"/create.php?query="+encodeURIComponent(result["img"])+"\"><img src=\""+result["thumb"]+"\" /></a></div>");

			$("#results")
				.append($content)
				.masonry( 'appended', $content );
		});

		
		$("#results").imagesLoaded().progress(function(){
			$("#results").masonry('layout');
		});<commit_msg>Fix form being posted when clicking Twitter button.<commit_after>$("#twitter-login").click(function(e){
	e.preventDefault();
	window.open("/twitter/login.php", "_temp",'resizable=yes,width=600,height=600');
});

$(document).ready(function(){

var params={};
window.location.search
  .replace(/[?&]+([^=&]+)=([^&]*)/gi, function(str,key,value) {
    params[key] = value;
  }
);

console.log("query", params["query"]);

if(params["query"] != "" && params["query"] != undefined){

	$("#image-url").val(decodeURIComponent(params["query"]));
	$('#download-into-canvas').click();
	$("#media").hide();
}

var twitter_login = setInterval(function(){
	$.get("/twitter/check.php", function(data){
		if(!data["login"]){
			$("#twitter-post").hide();
		} else {
			$("#twitter-login").hide();
			$("#twitter-post").show();

			clearTimeout(twitter_login);
		}
	});
}, 500);
//clearTimeout(twitter_login);

$("#results").masonry({ itemSelector: '.grid-item', columnWidth: 220 });

$("#search").submit(function(e){
	$("#results").empty();

	// $grid.imagesLoaded().progress( function() {
	// 	$grid.masonry('layout');
	// });


	$.get("/api/fetch.php", { "query" : $("#query").val() },function(data){
		//console.log(data);
		console.log(data[0]["img"]);

		$.each(data, function(idx){
			result = data[idx];
			console.log(result["img"]);

			$content = $("<div class=\"grid-item\"><a href=\"/create.php?query="+encodeURIComponent(result["img"])+"\"><img src=\""+result["thumb"]+"\" /></a></div>");

			$("#results")
				.append($content)
				.masonry( 'appended', $content );
		});


		$("#results").imagesLoaded().progress(function(){
			$("#results").masonry('layout');
		});
{'fraction_non_alphanumeric': 0.2898330804248862, 'fraction_numerical': 0.007890743550834597, 'mean_word_length': 5.207156308851224, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2082974', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1134, 'n_words': 141}