<commit_before>var CanControl = require("can-control");
var $ = require("jquery");
var DemoFrame = require("./demo_frame");

module.exports = CanControl.extend({
	init: function() {
		this.$element = $(this.element);
		this.replaceIframes();
		this.replaceDemos();
	},
	replaceIframes: function() {
		// @iframe can/test/demo.html 400
		// <div class="iframe_wrapper" data-iframe-src="can/test/demo.html" data-iframe-height="400"></div>
		$('.iframe_wrapper', this.$element).each(function() {
			var wrapper = $(this),
				iframe = $('<iframe src="../' + wrapper.data('iframeSrc') + '">');
			
			if(wrapper.data('iframeHeight')) {
				iframe.height(wrapper.data('iframeHeight'));
			}

			wrapper.append(iframe);
		});
	},
	replaceDemos: function() {
		// @demo can/control/control.html 400
		// <div class="demo_wrapper" data-demo-src="can/control/control.html"></div>
		$('.demo_wrapper', this.$element).each(function() {
			var wrapper = $(this);
			new DemoFrame(wrapper);
			
			if(wrapper.data('demoHeight')) {
				iframe.height(wrapper.data('demoHeight'));
			}
		});
	}
});
<commit_msg>:bug: fix including multible demos<commit_after>var CanControl = require("can-control");
var $ = require("jquery");
var DemoFrame = require("./demo_frame");

module.exports = CanControl.extend({
	init: function() {
		this.$element = $(this.element);
		this.replaceIframes();
		this.replaceDemos();
	},
	replaceIframes: function() {
		// @iframe can/test/demo.html 400
		// <div class="iframe_wrapper" data-iframe-src="can/test/demo.html" data-iframe-height="400"></div>
		$('.iframe_wrapper', this.$element).each(function() {
			var wrapper = $(this),
				iframe = $('<iframe src="../' + wrapper.data('iframeSrc') + '">');
			
			if(wrapper.data('iframeHeight')) {
				iframe.height(wrapper.data('iframeHeight'));
			}

			wrapper.append(iframe);
		});
	},
	replaceDemos: function() {
		// @demo can/control/control.html 400
		// <div class="demo_wrapper" data-demo-src="can/control/control.html"></div>
		$('.demo_wrapper', this.$element).each(function() {
			var wrapper = $(this);
			new DemoFrame(wrapper);
			
		});
	}
});

{'fraction_non_alphanumeric': 0.20913801224682055, 'fraction_numerical': 0.008478568064060292, 'mean_word_length': 4.130434782608695, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '6522056', 'n_tokens_mistral': 810, 'n_tokens_neox': 689, 'n_words': 110}