<commit_before>var omnisidebarOptions = {
	init: function() {
		window.removeEventListener("load", omnisidebarOptions.init, false);
		
		omnisidebarOptions.keysets = [
			Application.prefs.get('extensions.omnisidebar.keysets0'),
			Application.prefs.get('extensions.omnisidebar.keysets1'),
			Application.prefs.get('extensions.omnisidebar.keysets2'),
			Application.prefs.get('extensions.omnisidebar.keysets3'),
			Application.prefs.get('extensions.omnisidebar.keysets4'),
			Application.prefs.get('extensions.omnisidebar.keysets5'),
			Application.prefs.get('extensions.omnisidebar.keysets6')
		];
		
		for(var i=0; i<omnisidebarOptions.keysets.length; i++) {
			if(!omnisidebarOptions.keysets[i].value) {
				document.getElementById('keysetItem'+i).setAttribute('hidden', 'true');
			}
		}
		
		omnisidebarOptions.toggleTwin();
		omnisidebarOptions.toggleTitle();
		omnisidebarOptions.toggleTitleTwin();
		omnisidebarOptions.toggleAbove();
		omnisidebarOptions.toggleGlass();
	},
	
	toggleTwin: function() {
		var twin = document.getElementById('twinCheckbox').checked;
		var nodes = document.getElementsByClassName('toggleTwin');
		for(var i=0; i<nodes.length; i++) {
			if(twin) {
				if(nodes[i].id != 'titleButtonTwinCheckbox' || !document.getElementById('hideTitleTwinCheckbox').checked) {
					nodes[i].removeAttribute('disabled');
				}
			} else {
				nodes[i].setAttribute('disabled', 'true');
			}
		}
		omnisidebarOptions.toggleAboveTwin();
	},
	
	toggleTitle: function() {
		if(document.getElementById('hideTitleCheckbox').checked) {
			document.getElementById('titleButtonCheckbox').setAttribute('disabled', 'true');
		} else {
			document.getElementById('titleButtonCheckbox').removeAttribute('disabled');
		}
	},
	
	toggleTitleTwin: function() {
		if(document.getElementById('hideTitleTwinCheckbox').checked) {
			document.getElementById('titleButtonTwinCheckbox').setAttribute('disabled', 'true');
		} else {
			document.getElementById('titleButtonTwinCheckbox').removeAttribute('disabled');
		}
	},
	
	toggleAbove: function() {
		var checked = document.getElementById('aboveCheckbox').checked;
		var els = document.getElementsByClassName('aboveCheckbox');
		for(var i=0; i<els.length; i++) {
			if(checked) {
				els[i].removeAttribute('disabled');
			} else {
				els[i].setAttribute('disabled', 'true');
			}
		}
	},
	
	toggleAboveTwin: function() {
		var enable = (document.getElementById('twinCheckbox').checked && document.getElementById('aboveTwinCheckbox').checked);
		var els = document.getElementsByClassName('aboveTwinCheckbox');
		for(var i=0; i<els.length; i++) {
			if(enable) {
				els[i].removeAttribute('disabled');
			} else {
				els[i].setAttribute('disabled', 'true');
			}
		}
	},
	
	toggleGlass: function() {
		var checked = document.getElementById('glassCheckbox').checked;
		if(checked) {
			document.getElementById('transparencyCheckbox').removeAttribute('disabled');
		} else {
			document.getElementById('transparencyCheckbox').setAttribute('disabled', true);
		}
	},
	
	onlyNumbers: function(v) {
		return parseInt(v || 0);
	}
}

window.addEventListener("load", omnisidebarOptions.init, false);<commit_msg>small fix in the options dialog<commit_after>var omnisidebarOptions = {
	init: function() {
		window.removeEventListener("load", omnisidebarOptions.init, false);
		
		omnisidebarOptions.keysets = [
			Application.prefs.get('extensions.omnisidebar.keysets0'),
			Application.prefs.get('extensions.omnisidebar.keysets1'),
			Application.prefs.get('extensions.omnisidebar.keysets2'),
			Application.prefs.get('extensions.omnisidebar.keysets3'),
			Application.prefs.get('extensions.omnisidebar.keysets4'),
			Application.prefs.get('extensions.omnisidebar.keysets5'),
			Application.prefs.get('extensions.omnisidebar.keysets6')
		];
		
		for(var i=0; i<omnisidebarOptions.keysets.length; i++) {
			if(!omnisidebarOptions.keysets[i].value) {
				document.getElementById('keysetItem'+i).setAttribute('hidden', 'true');
			}
		}
		
		omnisidebarOptions.toggleTwin();
		omnisidebarOptions.toggleTitle();
		omnisidebarOptions.toggleTitleTwin();
		omnisidebarOptions.toggleAbove();
		omnisidebarOptions.toggleGlass();
	},
	
	toggleTwin: function() {
		var twin = document.getElementById('twinCheckbox').checked;
		var nodes = document.getElementsByClassName('toggleTwin');
		for(var i=0; i<nodes.length; i++) {
			if(twin) {
				if(nodes[i].id != 'titleButtonTwinCheckbox' || !document.getElementById('hideTitleTwinCheckbox').checked) {
					nodes[i].removeAttribute('disabled');
				}
			} else {
				nodes[i].setAttribute('disabled', 'true');
			}
		}
		omnisidebarOptions.toggleAboveTwin();
	},
	
	toggleTitle: function() {
		if(document.getElementById('hideTitleCheckbox').checked) {
			document.getElementById('titleButtonCheckbox').setAttribute('disabled', 'true');
		} else {
			document.getElementById('titleButtonCheckbox').removeAttribute('disabled');
		}
	},
	
	toggleTitleTwin: function() {
		if(document.getElementById('hideTitleTwinCheckbox').checked || !document.getElementById('twinCheckbox').checked) {
			document.getElementById('titleButtonTwinCheckbox').setAttribute('disabled', 'true');
		} else {
			document.getElementById('titleButtonTwinCheckbox').removeAttribute('disabled');
		}
	},
	
	toggleAbove: function() {
		var checked = document.getElementById('aboveCheckbox').checked;
		var els = document.getElementsByClassName('aboveCheckbox');
		for(var i=0; i<els.length; i++) {
			if(checked) {
				els[i].removeAttribute('disabled');
			} else {
				els[i].setAttribute('disabled', 'true');
			}
		}
	},
	
	toggleAboveTwin: function() {
		var enable = (document.getElementById('twinCheckbox').checked && document.getElementById('aboveTwinCheckbox').checked);
		var els = document.getElementsByClassName('aboveTwinCheckbox');
		for(var i=0; i<els.length; i++) {
			if(enable) {
				els[i].removeAttribute('disabled');
			} else {
				els[i].setAttribute('disabled', 'true');
			}
		}
	},
	
	toggleGlass: function() {
		var checked = document.getElementById('glassCheckbox').checked;
		if(checked) {
			document.getElementById('transparencyCheckbox').removeAttribute('disabled');
		} else {
			document.getElementById('transparencyCheckbox').setAttribute('disabled', true);
		}
	},
	
	onlyNumbers: function(v) {
		return parseInt(v || 0);
	}
}

window.addEventListener("load", omnisidebarOptions.init, false);
{'fraction_non_alphanumeric': 0.1573086574654956, 'fraction_numerical': 0.0037641154328732747, 'mean_word_length': 5.493890020366599, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, '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': '2611214', 'n_tokens_mistral': 2238, 'n_tokens_neox': 1971, 'n_words': 235}