<commit_before>(function(Factlink) {
	var timeout;
	// Function which will return the Selection object
	//@TODO: Add rangy support for IE

	// Load the needed prepare menu & put it in a container
	var urlToLoad,
	$prepare = $('<div />')
	.attr('id', 'fl-prepare')
	.appendTo("body");

	if (FactlinkConfig.modus === "default") {
		urlToLoad = '//' + FactlinkConfig.api + 'factlink/prepare/new';
	} else if (FactlinkConfig.modus === "addToFact") {
		urlToLoad = '//' + FactlinkConfig.api + 'factlink/prepare/evidence';
	}

	$.ajax({
		url: urlToLoad,
		dataType: "jsonp",
		crossDomain: true,
		cache: false,
		success: function(data) {
			$prepare.html( data );

			bindPrepareClick( $prepare );
		}
	});

	Factlink.addSelection = function(){
		var selInfo = Factlink.getSelectionInfo();
		if (FactlinkConfig.modus === "default") {
			Factlink.remote.createFactlink(selInfo.text, selInfo.passage, location.href,selInfo.title);
		} else {
			if ( Factlink.prepare.factId ) {
				Factlink.remote.createEvidence(Factlink.prepare.factId, FactlinkConfig.url, this.id, selInfo.title);
			} else {
				Factlink.remote.createNewEvidence(selInfo.text, selInfo.passage, FactlinkConfig.url, this.id, selInfo.title);
			}
		}
	}


	function bindPrepareClick( $element ) {
		$element.find('a')
		.bind('mouseup', function( e ) {
			e.stopPropagation();
		})
		.bind('click', function( e ) {
			e.preventDefault();
			Factlink.addSelection()
			$element.hide();
		});
	}<commit_msg>fixes needed for the new factbubble<commit_after>(function(Factlink) {
	var timeout;
	// Function which will return the Selection object
	//@TODO: Add rangy support for IE

	// Load the needed prepare menu & put it in a container
	var urlToLoad,
	$prepare = $('<div />')
	.attr('id', 'fl-prepare')
	.appendTo("body");

	if (FactlinkConfig.modus === "default") {
		urlToLoad = '//' + FactlinkConfig.api + 'factlink/prepare/new';
	} else if (FactlinkConfig.modus === "addToFact") {
		urlToLoad = '//' + FactlinkConfig.api + 'factlink/prepare/evidence';
	}

	$.ajax({
		url: urlToLoad,
		dataType: "jsonp",
		crossDomain: true,
		cache: false,
		success: function(data) {
			$prepare.html( data );

			bindPrepareClick( $prepare );
		}
	});

	Factlink.addSelection = function(elem){
		var selInfo = Factlink.getSelectionInfo();
		debugger;
		if (FactlinkConfig.modus === "default") {
			Factlink.remote.createFactlink(selInfo.text, selInfo.passage, location.href,selInfo.title);
		} else {
			if ( Factlink.prepare.factId ) {
				Factlink.remote.createEvidence(Factlink.prepare.factId, FactlinkConfig.url, elem.currentTarget.id, selInfo.title);
			} else {
				Factlink.remote.createNewEvidence(selInfo.text, selInfo.passage, FactlinkConfig.url, elem.currentTarget.id, selInfo.title);
			}
		}
	}


	function bindPrepareClick( $element ) {
		$element.find('a')
		.bind('mouseup', function( e ) {
			e.stopPropagation();
		})
		.bind('click', function( e ) {
			e.preventDefault();
			Factlink.addSelection(e)
			$element.hide();
		});
	}
{'fraction_non_alphanumeric': 0.15961346217927358, 'fraction_numerical': 0.0, 'mean_word_length': 3.945634266886326, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7630179', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1030, 'n_words': 204}