<commit_before>/**
 * Friendica people autocomplete
 *
 * require jQuery, jquery.textareas
 */
 
		
		
function ACPopup(elm,backend_url){
	this.idsel=-1;
	this.element = elm;
	this.searchText="";
	this.ready=true;
	this.kp_timer = false;
	this.url = backend_url;

	if(typeof elm.editorId == "undefined") {	
		style = $(elm).offset();
		w = $(elm).width();
		h = $(elm).height();
	}
	else {
		style = $(elm.container).offset();
		w = elm.container.offsetWidth;
		h = elm.container.offsetHeight;
		// Quick fix for chrome until I get a tool to inspect the dom
		// Chrome returns 0x0
		if(! w)
			w = 530;
		if(! h)
			h = 130;

	}

	style.top=style.top+h;
	style.width = w;
	style.position = 'absolute';
	/*	style['max-height'] = '150px';
		style.border = '1px solid red';
		style.background = '#cccccc';
	
		style.overflow = 'auto';
		style['z-index'] = '100000';
	*/
	style.display = 'none';
	
	this.cont = $("<div class='acpopup'></div>");
	this.cont.css(style);
	
	$("body").append(this.cont);
}
ACPopup.prototype.close = function(){
	$(this.cont).remove();
	this.ready=false;
}
ACPopup.prototype.search = function(text){
	var that = this;
	this.searchText=text;
	if (this.kp_timer) clearTimeout(this.kp_timer);
	this.kp_timer = setTimeout( function(){that._search();}, 500);
}
ACPopup.prototype._search = function(){	
	console.log("_search");<commit_msg>make autocomplete work with updated tinymce<commit_after>/**
 * Friendica people autocomplete
 *
 * require jQuery, jquery.textareas
 */
 
		
		
function ACPopup(elm,backend_url){
	this.idsel=-1;
	this.element = elm;
	this.searchText="";
	this.ready=true;
	this.kp_timer = false;
	this.url = backend_url;

	var w = 530;
	var h = 130;


	if(typeof elm.editorId == "undefined") {	
		style = $(elm).offset();
		w = $(elm).width();
		h = $(elm).height();
	}
	else {
		var container = elm.getContainer();
		if(typeof container != "undefined") {
			style = $(container).offset();
			w = $(container).width();
	    	h = $(container).height();
		}
	}

	style.top=style.top+h;
	style.width = w;
	style.position = 'absolute';
	/*	style['max-height'] = '150px';
		style.border = '1px solid red';
		style.background = '#cccccc';
	
		style.overflow = 'auto';
		style['z-index'] = '100000';
	*/
	style.display = 'none';
	
	this.cont = $("<div class='acpopup'></div>");
	this.cont.css(style);
	
	$("body").append(this.cont);
}
ACPopup.prototype.close = function(){
	$(this.cont).remove();
	this.ready=false;
}
ACPopup.prototype.search = function(text){
	var that = this;
	this.searchText=text;
	if (this.kp_timer) clearTimeout(this.kp_timer);
	this.kp_timer = setTimeout( function(){that._search();}, 500);
}
ACPopup.prototype._search = function(){	
	console.log("_search");
{'fraction_non_alphanumeric': 0.19138755980861244, 'fraction_numerical': 0.015458225984541774, 'mean_word_length': 3.8972972972972975, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6920641', 'n_tokens_mistral': 1090, 'n_tokens_neox': 988, 'n_words': 196}