<commit_before>//
// functions for adding/removing/selecting categories
//


var prototypePLURL = document.location.protocol == 'file:' ? "https://www.zoovy.com/biz/ajax/prototype.pl" : "/biz/ajax/prototype.pl"

/*


###############################

This section came from: http://www.zoovy.com/biz/ajax/navcat-20121110.js

###############################
*/

//
// Product Finder Get Results
//		id is the id of the product finder (probably PF/$src)
//		btn is the button which was clicked ex: current, recent, csv, all, search
function PFGetResults(id,btn,txt) {

	// alert('id: '+id+' btn: '+btn);
	if ((btn != 'fromlist') && (btn != 'fromcat')) {
		// note: fromlist and fromcategory don't change the button state.
		jQuery('#'+selectorEscapeExpression(id+'!button:current')).prop("class",'button');
		jQuery('#'+selectorEscapeExpression(id+'!button:recent')).prop("class",'button');
		jQuery('#'+selectorEscapeExpression(id+'!button:all')).prop("class",'button');
		jQuery('#'+selectorEscapeExpression(id+'!button:showlist')).prop("class",'button');
		jQuery('#'+selectorEscapeExpression(id+'!button:showcat')).prop("class",'button');
		jQuery('#'+selectorEscapeExpression(id+'!button:showmore')).prop("class",'button');
		jQuery('#'+selectorEscapeExpression(id+'!button:search')).prop("class",'button');
		jQuery('#'+selectorEscapeExpression(id+'!button:csv')).prop("class",'button');

		if (jQuery('#'+selectorEscapeExpression(id+'!button:'+btn))) {
			jQuery('#'+selectorEscapeExpression(id+'!button:'+btn)).prop("class",'button2');
			}
		}

	var div = jQuery('#'+selectorEscapeExpression(id+'!results'));
	div.html('<table height=200 width=250"><tr><td align="center" valign="middle"><img border=0 src="/biz/loading.gif"></td></tr></table>');

	if (btn == 'showlist') {
		var postBody = 'm=PRODFINDER/ShowList&id='+id+'&btn='+btn;
		jQuery.ajax(prototypePLURL+'/PRODFINDER/ShowList', { dataType:"text",data: postBody,async: 1,success: function(data, textStatus, jqXHR){ jHandleResponse(data);} } ) ;
		}
	else if (btn == 'showcat') {
		var postBody = 'm=PRODFINDER/ShowCat&id='+id+'&btn='+btn;
		jQuery.ajax(prototypePLURL+'/PRODFINDER/ShowCat', { dataType:"text",data: postBody,async: 1,success: function(data, textStatus, jqXHR){ jHandleResponse(data);} } ) ;
		}
	else if (btn == 'showmore') {
		var postBody = 'm=PRODFINDER/ShowMore&id='+id+'&btn='+btn;
		jQuery.ajax(prototypePLURL+'/PRODFINDER/ShowMore', { dataType:"text",data: postBody,async: 1,success: function(data, textStatus, jqXHR){ jHandleResponse(data);} } ) ;
		}
	else {
		// alert('id: '+id+' button:'+btn+' txt:'+txt);
		var postBody = 'm=PRODFINDER/Load&id='+id+'&btn='+btn+'&txt='+encodeURIComponent(txt);
		jQuery.ajax(prototypePLURL+'/PRODFINDER/Load', { dataType:"text",data: postBody,async: 1,success: function(data, textStatus, jqXHR){ jHandleResponse(data);} } ) ;
		}

	}


//
//
function ProductFinder(src,div) {
//	alert('productfinder: '+div+' src:'+src);
//	alert(jQuery('#'+selectorEscapeExpression('PF/'+src)).val());
//	alert(jQuery('#'+selectorEscapeExpression(div)));

	if (jQuery('#'+selectorEscapeExpression('PF/'+src)).val() == 1) {
		// products are already displayed, so go hide them.
		jQuery('#'+selectorEscapeExpression(div)).html('');
		}
	else {
		//
		var postBody = 'm=PRODFINDER/New&src='+src+'&div='+div;
		jQuery.ajax(prototypePLURL+'/PRODFINDER/New', { dataType:"text",data: postBody,async: 1,success: function(data, textStatus, jqXHR){ jHandleResponse(data);} } ) ;
		}

	}


function showNavcatProducts(safe) {

	if (jQuery('#'+selectorEscapeExpression('show_products_navcat:'+safe)).val() == 1) {
		// products are already displayed, so go hide them.
		jQuery('#'+selectorEscapeExpression('~'+safe)).html('');
		}
	else {
		//
		var postBody = 'm=NAVCAT/ShowProducts&safe='+safe;
		jQuery.ajax(prototypePLURL+'/NAVCAT/ShowProducts', { dataType:"text",data: postBody,async: 1,success: function(data, textStatus, jqXHR){ jHandleResponse(data);} } ) ;
		}
	}

//
//
//
function PFupdown(cb,direction) {<commit_msg>legacy product finder no longer needed<commit_after>//
// functions for adding/removing/selecting categories
//


var prototypePLURL = document.location.protocol == 'file:' ? "https://www.zoovy.com/biz/ajax/prototype.pl" : "/biz/ajax/prototype.pl"

/*


###############################

This section came from: http://www.zoovy.com/biz/ajax/navcat-20121110.js

###############################
*/

//
// Product Finder Get Results
//		id is the id of the product finder (probably PF/$src)
//		btn is the button which was clicked ex: current, recent, csv, all, search
function PFGetResults(id,btn,txt) {

	// alert('id: '+id+' btn: '+btn);
	if ((btn != 'fromlist') && (btn != 'fromcat')) {
		// note: fromlist and fromcategory don't change the button state.
		jQuery('#'+selectorEscapeExpression(id+'!button:current')).prop("class",'button');
		jQuery('#'+selectorEscapeExpression(id+'!button:recent')).prop("class",'button');
		jQuery('#'+selectorEscapeExpression(id+'!button:all')).prop("class",'button');
		jQuery('#'+selectorEscapeExpression(id+'!button:showlist')).prop("class",'button');
		jQuery('#'+selectorEscapeExpression(id+'!button:showcat')).prop("class",'button');
		jQuery('#'+selectorEscapeExpression(id+'!button:showmore')).prop("class",'button');
		jQuery('#'+selectorEscapeExpression(id+'!button:search')).prop("class",'button');
		jQuery('#'+selectorEscapeExpression(id+'!button:csv')).prop("class",'button');

		if (jQuery('#'+selectorEscapeExpression(id+'!button:'+btn))) {
			jQuery('#'+selectorEscapeExpression(id+'!button:'+btn)).prop("class",'button2');
			}
		}

	var div = jQuery('#'+selectorEscapeExpression(id+'!results'));
	div.html('<table height=200 width=250"><tr><td align="center" valign="middle"><img border=0 src="/biz/loading.gif"></td></tr></table>');

	if (btn == 'showlist') {
		var postBody = 'm=PRODFINDER/ShowList&id='+id+'&btn='+btn;
		jQuery.ajax(prototypePLURL+'/PRODFINDER/ShowList', { dataType:"text",data: postBody,async: 1,success: function(data, textStatus, jqXHR){ jHandleResponse(data);} } ) ;
		}
	else if (btn == 'showcat') {
		var postBody = 'm=PRODFINDER/ShowCat&id='+id+'&btn='+btn;
		jQuery.ajax(prototypePLURL+'/PRODFINDER/ShowCat', { dataType:"text",data: postBody,async: 1,success: function(data, textStatus, jqXHR){ jHandleResponse(data);} } ) ;
		}
	else if (btn == 'showmore') {
		var postBody = 'm=PRODFINDER/ShowMore&id='+id+'&btn='+btn;
		jQuery.ajax(prototypePLURL+'/PRODFINDER/ShowMore', { dataType:"text",data: postBody,async: 1,success: function(data, textStatus, jqXHR){ jHandleResponse(data);} } ) ;
		}
	else {
		// alert('id: '+id+' button:'+btn+' txt:'+txt);
		var postBody = 'm=PRODFINDER/Load&id='+id+'&btn='+btn+'&txt='+encodeURIComponent(txt);
		jQuery.ajax(prototypePLURL+'/PRODFINDER/Load', { dataType:"text",data: postBody,async: 1,success: function(data, textStatus, jqXHR){ jHandleResponse(data);} } ) ;
		}

	}



function showNavcatProducts(safe) {

	if (jQuery('#'+selectorEscapeExpression('show_products_navcat:'+safe)).val() == 1) {
		// products are already displayed, so go hide them.
		jQuery('#'+selectorEscapeExpression('~'+safe)).html('');
		}
	else {
		//
		var postBody = 'm=NAVCAT/ShowProducts&safe='+safe;
		jQuery.ajax(prototypePLURL+'/NAVCAT/ShowProducts', { dataType:"text",data: postBody,async: 1,success: function(data, textStatus, jqXHR){ jHandleResponse(data);} } ) ;
		}
	}

//
//
//
function PFupdown(cb,direction) {
{'fraction_non_alphanumeric': 0.2280654682049906, 'fraction_numerical': 0.006171183257311511, 'mean_word_length': 6.53030303030303, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, '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': '7139558', 'n_tokens_mistral': 2687, 'n_tokens_neox': 2590, 'n_words': 380}