<commit_before>/**
 * Collect any regions with the default component set from the DOM.
 */

module.exports = function collectRegions () {

	$('region[default],region[template],[data-region][default],[data-region][template]').each(function() {
		$e = $(this);

		// Provide backwards compatibility for legacy notation
		// (normalize to `template`)
		var componentId = $e.attr('default') || $e.attr('contents');
		$e.attr('template', componentId);


		//
		// TODO:
		// allow embedded templates to be named this way, e.g. `<region template="Foo"></region>`
		// (should be very easy)
		//


		// Now instantiate the appropriate default component in each
		// region with a specified template/component
		FRAMEWORK.Region.fromElement(this);
	});

};<commit_msg>Made collectRegions easier to read and clarified that it is for TOPLEVEL regions (i.e. in the HTML page), not the regions in client-side HTML templates.<commit_after>/**
 * Collect any regions with the default component set from the DOM.
 */

module.exports = function collectRegions () {


	// Get top-level regions.
	var $regions;

	$regions = $('region[default],region[template],[data-region][default],[data-region][template]');


	$regions.each(function() {

		$el = $(this);

		// Provide backwards compatibility for legacy notation
		// (normalize to `template`)
		var componentId = $el.attr('default') || $el.attr('contents');
		$el.attr('template', componentId);


		//
		// TODO:
		// allow embedded templates to be named this way, e.g. `<region template="Foo"></region>`
		// (should be very easy)
		//


		// Now instantiate the appropriate default component in each
		// region with a specified template/component
		FRAMEWORK.Region.fromElement(this);
	});

};
{'fraction_non_alphanumeric': 0.14953810623556582, 'fraction_numerical': 0.0, 'mean_word_length': 3.840782122905028, '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': '6510523', 'n_tokens_mistral': 543, 'n_tokens_neox': 486, 'n_words': 157}