<commit_before>/****
* Created by <NAME> in 2012 
* 
* Released into the public domain, as an act of generosity and / or practicality.
****/

package domtools;

import js.w3c.level3.Core;
import js.w3c.level3.Core.Document;
import CommonJS;
import domtools.Query;

class Widget extends Query
{
	/** Create a new element of type "name", and add it to the collection.  
	When your class extends this, it will automatically work with the domtools API (through using).  
	Therefore your class can have very tight integration between haxe features and the DOM. */
	public function new(name:String)
	{
		super();

		var elm = Query.create(name);
		
		this.add(elm);
	}
}<commit_msg>Changed Widget to take html to parse, not an element name.<commit_after>/****
* Created by <NAME> in 2012 
* 
* Released into the public domain, as an act of generosity and / or practicality.
****/

package domtools;

import js.w3c.level3.Core;
import js.w3c.level3.Core.Document;
import CommonJS;
import domtools.Query;

class Widget extends Query
{
	/** Create a new widget by parsing some "template" html, and use that as our collection.
	When your class extends this, it will automatically work with the domtools API (through using).  
	Therefore your class can have very tight integration between haxe features and the DOM. */
	public function new(template:String)
	{
		super();

		var q = Query.parse(template);
		this.collection = q.collection;
	}
}
{'fraction_non_alphanumeric': 0.09497206703910614, 'fraction_numerical': 0.0111731843575419, 'mean_word_length': 3.9756944444444446, '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': '3063255', 'n_tokens_mistral': 447, 'n_tokens_neox': 422, 'n_words': 179}