<commit_before>$.fn.signalsTransformsTable=function(options){ // plugin main fn

if (typeof(options)==='undefined') options={};

var includedSections=$.fn.signalsTransformsTable.includedSections;
if ('includedSections' in options) {
	includedSections=options.includedSections;
}

var sections=$.fn.signalsTransformsTable.sections;
if ('sections' in options) {
	sections=$.extend(true,{},sections,options.sections);
}

var includedTransforms=$.fn.signalsTransformsTable.includedTransforms;
if ('includedTransforms' in options) {
	includedTransforms=options.includedTransforms;
}

var selectedTransform=$.fn.signalsTransformsTable.selectedTransform;
if ('selectedTransform' in options) {
	selectedTransform=options.selectedTransform;
}
if (includedTransforms.indexOf(selectedTransform)<0) {
	selectedTransform=includedTransforms[0];
}

var transformCommon=$.fn.signalsTransformsTable.transformCommon;
if ('transformCommon' in options) {
	transformCommon=$.extend(true,{},transformCommon,options.transformCommon);
}

var transforms=$.fn.signalsTransformsTable.transforms;
if ('transforms' in options) {
	transforms=$.extend(true,{},transforms,options.transforms);
}

var includedPanels=$.fn.signalsTransformsTable.includedPanels;
if ('includedSections' in options) {
	includedPanels=options.includedPanels;
}

var panels=$.fn.signalsTransformsTable.panels;
if ('panels' in options) {
	panels=$.extend(true,{},panels,options.panels);
}

return this.each(function(){
	// section collapsed/shown status for this table
	var isSectionCollapsed={};
	$.each(sections,function(id,_){
		isSectionCollapsed[id]=false;
	});

	function preventTextSelectionOnDoubleClick(ev){
		ev.preventDefault();
	};

	var containerNode=$(this).empty();
	var tableNode=$("<table class='signals-transforms-table' />").appendTo(containerNode);
	var arrowNode=$("<div class='arrow'>"+
		"<div class='label'></div>"+
		"<div class='arrowhead at-tl' /><div class='arrowhead at-bl' />"+
		"<div class='arrowhead at-tr' /><div class='arrowhead at-br' />"+
	"</div>");

	function writeTransform(transformSpecific){
		function writePanelsDropdown(tdNode){
			var panelDropdownNode=$("<div class='panel-dropdown' role='button' title='add panel'>+</div>").click(function(){
				$(this).toggleClass('is-open');
			}).mousedown(preventTextSelectionOnDoubleClick).appendTo(tdNode);
			var ulNode=$("<ul />").appendTo(panelDropdownNode);
			$.each(panels,function(_,panel){
				$("<li>"+panel.name+"</li>").click(function(){
					var tbodyNode=$("<tbody class='panel' />").insertAfter(tdNode.closest('thead, tbody'));
					$("<tr><th colspan='"+(nDomainCols*2+1)+" class='both'>"+panel.name+"</th></tr>").appendTo(tbodyNode);
					$("<tr>"+
						"<td colspan='"+nDomainCols+"' class='time' />"+
						"<td class='both' />"+
						"<td colspan='"+nDomainCols+"' class='freq' />"+
					"</tr>").appendTo(tbodyNode).find('td.both').append(
						$("<div class='panel-remove' role='button' title='remove panel'>−</div>").click(function(){
							$(this).closest('tbody.panel').remove();
						})
					);
					tbodyNode
						.on('panel:init',panel.init)
						.on('panel:update',panel.update)
						.trigger('panel:init');
				}).appendTo(ulNode);
			});
		}
<commit_msg>close other panel dropdowns when one is opened<commit_after>$.fn.signalsTransformsTable=function(options){ // plugin main fn

if (typeof(options)==='undefined') options={};

var includedSections=$.fn.signalsTransformsTable.includedSections;
if ('includedSections' in options) {
	includedSections=options.includedSections;
}

var sections=$.fn.signalsTransformsTable.sections;
if ('sections' in options) {
	sections=$.extend(true,{},sections,options.sections);
}

var includedTransforms=$.fn.signalsTransformsTable.includedTransforms;
if ('includedTransforms' in options) {
	includedTransforms=options.includedTransforms;
}

var selectedTransform=$.fn.signalsTransformsTable.selectedTransform;
if ('selectedTransform' in options) {
	selectedTransform=options.selectedTransform;
}
if (includedTransforms.indexOf(selectedTransform)<0) {
	selectedTransform=includedTransforms[0];
}

var transformCommon=$.fn.signalsTransformsTable.transformCommon;
if ('transformCommon' in options) {
	transformCommon=$.extend(true,{},transformCommon,options.transformCommon);
}

var transforms=$.fn.signalsTransformsTable.transforms;
if ('transforms' in options) {
	transforms=$.extend(true,{},transforms,options.transforms);
}

var includedPanels=$.fn.signalsTransformsTable.includedPanels;
if ('includedSections' in options) {
	includedPanels=options.includedPanels;
}

var panels=$.fn.signalsTransformsTable.panels;
if ('panels' in options) {
	panels=$.extend(true,{},panels,options.panels);
}

return this.each(function(){
	// section collapsed/shown status for this table
	var isSectionCollapsed={};
	$.each(sections,function(id,_){
		isSectionCollapsed[id]=false;
	});

	function preventTextSelectionOnDoubleClick(ev){
		ev.preventDefault();
	};

	var containerNode=$(this).empty();
	var tableNode=$("<table class='signals-transforms-table' />").appendTo(containerNode);
	var arrowNode=$("<div class='arrow'>"+
		"<div class='label'></div>"+
		"<div class='arrowhead at-tl' /><div class='arrowhead at-bl' />"+
		"<div class='arrowhead at-tr' /><div class='arrowhead at-br' />"+
	"</div>");

	function writeTransform(transformSpecific){
		function writePanelsDropdown(tdNode){
			var panelDropdownNode=$("<div class='panel-dropdown' role='button' title='add panel'>+</div>").click(function(){
				var wasOpen=$(this).hasClass('is-open');
				tableNode.find('.panel-dropdown').removeClass('is-open');
				if (!wasOpen) {
					$(this).addClass('is-open');
				}
			}).mousedown(preventTextSelectionOnDoubleClick).appendTo(tdNode);
			var ulNode=$("<ul />").appendTo(panelDropdownNode);
			$.each(panels,function(_,panel){
				$("<li>"+panel.name+"</li>").click(function(){
					var tbodyNode=$("<tbody class='panel' />").insertAfter(tdNode.closest('thead, tbody'));
					$("<tr><th colspan='"+(nDomainCols*2+1)+" class='both'>"+panel.name+"</th></tr>").appendTo(tbodyNode);
					$("<tr>"+
						"<td colspan='"+nDomainCols+"' class='time' />"+
						"<td class='both' />"+
						"<td colspan='"+nDomainCols+"' class='freq' />"+
					"</tr>").appendTo(tbodyNode).find('td.both').append(
						$("<div class='panel-remove' role='button' title='remove panel'>−</div>").click(function(){
							$(this).closest('tbody.panel').remove();
						})
					);
					tbodyNode
						.on('panel:init',panel.init)
						.on('panel:update',panel.update)
						.trigger('panel:init');
				}).appendTo(ulNode);
			});
		}

{'fraction_non_alphanumeric': 0.18940998487140695, 'fraction_numerical': 0.001210287443267776, 'mean_word_length': 6.147027027027027, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 55, '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': '5120639', 'n_tokens_mistral': 2351, 'n_tokens_neox': 2083, 'n_words': 314}