<commit_before>/*
	ShopDown testing[Alpha 1]- by Danieltamkin:

	Main Plugin in development(Compiler),
	Copiling html to a product object.

*/
$.fn.ShopDown = function($data) {
	$this = $(this);
	datacheck($data);
	/*data*/
	function datacheck(data){
	  $data = datascrub(data);
	}
	function datatemplate(){
	  return data = {
	    content: $this,
	    sanitize: true,
			cull: true,
			images: true
			compile: true
	  }
	}
	function datascrub(data){
	  template = datatemplate();
		if(data == undefined || data.length < 1){
			data = template;
		}
		else{
		  $.each(template,function(key,value){
		    $.each(data,function(bravokey,bravovalue){
		      if(bravokey == key){
		        if(bravovalue.length === -1){
		          value = value;
		        }
		        else{
		          // do nothing, bravovalue is in bravokey
		        }
		      }
		      else{
		        if(!(key in data)){// that key doesnt exist? make it.
		          data[key] = value;
		        }
		      }
		    });
		  });
		}
		return data;
	}
	/*html*/
	function htmlGet(){
		if(window.htmlGot !== true){
			htmlCull();// removes images from the Dom.
			html = $($data.content).html();
			window.html 		= html;
			window.htmlGot  = true;// so not to look for html again.
	  	return html;
		}
		else{
			return window.html;
		}
	}
	function htmlSiftTo(id){
	  data = {
	    h1: 'h1#'+id,
	    h2: 'h2#'+id,
	    h3: 'h3#'+id,
	    h4: 'h4#'+id,
	    h5: 'h5#'+id,
	    h6: 'h6#'+id
	  }
	  var	content		= $($data.content),
	      SiftedTo 	= null;
	  $.each(data,function(key,value){
	    Sift = content.find(value);
	    if(Sift.length < 1){
	      // continue to find the proper value, this one doesnt exist.
	    }
	    else{
	      SiftedTo = value;
	      return false;// break out of loop
	    }
	  });
	  return SiftedTo;
	}
	function htmlFind(id,multipleGet=false){
	  if(id == "productimages"){
			return htmlImages();
		}
		else{
			var	content			= $($data.content),
		      multiple 		= content.find(htmlSiftTo(id)).get();
		  if(multiple.length < 1){
		    console.warn("Error, We're missing the tag "+id+"");
		  }
		  else if(multiple.length > 1 && multipleGet == true){
		    console.info(multipleGet);
		    // work on this in a later date.<commit_msg>Updated source file<commit_after>/*
	ShopDown testing[Alpha 1]- by Danieltamkin:

	Main Plugin in development(Compiler),
	Compiling html to a product object.

*/
$.fn.ShopDown = function($data) {
	$this = $(this);
	datacheck($data);
	/*data*/
	function datacheck(data){
	  $data = datascrub(data);
	}
	function datatemplate(){
	  return data = {
	    content: $this,
	    sanitize: true,
			cull: true,
			images: true
			compile: true
	  }
	}
	function datascrub(data){
	  template = datatemplate();
		if(data == undefined || data.length < 1){
			data = template;
		}
		else{
		  $.each(template,function(key,value){
		    $.each(data,function(bravokey,bravovalue){
		      if(bravokey == key){
		        if(bravovalue.length === -1){
		          value = value;
		        }
		        else{
		          // do nothing, bravovalue is in bravokey
		        }
		      }
		      else{
		        if(!(key in data)){// that key doesnt exist? make it.
		          data[key] = value;
		        }
		      }
		    });
		  });
		}
		return data;
	}
	/*html*/
	function htmlGet(){
		if(window.htmlGot !== true){
			htmlCull();// removes images from the Dom.
			html = $($data.content).html();
			window.html 		= html;
			window.htmlGot  = true;// so not to look for html again.
	  	return html;
		}
		else{
			return window.html;
		}
	}
	function htmlSiftTo(id){
	  data = {
	    h1: 'h1#'+id,
	    h2: 'h2#'+id,
	    h3: 'h3#'+id,
	    h4: 'h4#'+id,
	    h5: 'h5#'+id,
	    h6: 'h6#'+id
	  }
	  var	content		= $($data.content),
	      SiftedTo 	= null;
	  $.each(data,function(key,value){
	    Sift = content.find(value);
	    if(Sift.length < 1){
	      // continue to find the proper value, this one doesn't exist.
	    }
	    else{
	      SiftedTo = value;
	      return false;// break out of loop
	    }
	  });
	  return SiftedTo;
	}
	function htmlFind(id,multipleGet=false){
	  if(id == "productimages"){
			return htmlImages();
		}
		else{
			var	content			= $($data.content),
		      multiple 		= content.find(htmlSiftTo(id)).get();
		  if(multiple.length < 1){
		    console.warn("Error, We're missing the tag "+id+"");
		  }
		  else if(multiple.length > 1 && multipleGet == true){
		    console.info(multipleGet);
		    // work on this in a later date.
{'fraction_non_alphanumeric': 0.15382902938557436, 'fraction_numerical': 0.008014247551202136, 'mean_word_length': 2.211579699785561, 'pattern_counts': {'":': 0, '<': 9, '<?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': '1485170', 'n_tokens_mistral': 1829, 'n_tokens_neox': 1568, 'n_words': 377}